text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

/* global window */
import type * as gax from 'google-gax';
import type {
  Callback,
  CallOptions,
  Descriptors,
  ClientOptions,
  GrpcClientOptions,
  LROperation,
  PaginationCallback,
  GaxCall,
  IamClient,
  IamProtos,
  LocationsClient,
  LocationProtos,
} from 'google-gax';
import {Transform} from 'stream';
import * as protos from '../../protos/protos';
import jsonProtos = require('../../protos/protos.json');
/**
 * Client JSON configuration object, loaded from
 * `src/v1/certificate_authority_service_client_config.json`.
 * This file defines retry strategy and timeouts for all API methods in this library.
 */
import * as gapicConfig from './certificate_authority_service_client_config.json';
const version = require('../../../package.json').version;

/**
 *  {@link google.cloud.security.privateca.v1.CertificateAuthorityService|Certificate Authority Service} manages private
 *  certificate authorities and issued certificates.
 * @class
 * @memberof v1
 */
export class CertificateAuthorityServiceClient {
  private _terminated = false;
  private _opts: ClientOptions;
  private _providedCustomServicePath: boolean;
  private _gaxModule: typeof gax | typeof gax.fallback;
  private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient;
  private _protos: {};
  private _defaults: {[method: string]: gax.CallSettings};
  auth: gax.GoogleAuth;
  descriptors: Descriptors = {
    page: {},
    stream: {},
    longrunning: {},
    batching: {},
  };
  warn: (code: string, message: string, warnType?: string) => void;
  innerApiCalls: {[name: string]: Function};
  iamClient: IamClient;
  locationsClient: LocationsClient;
  pathTemplates: {[name: string]: gax.PathTemplate};
  operationsClient: gax.OperationsClient;
  certificateAuthorityServiceStub?: Promise<{[name: string]: Function}>;

  /**
   * Construct an instance of CertificateAuthorityServiceClient.
   *
   * @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 | "rest"} [options.fallback] - Use HTTP fallback mode.
   *     Pass "rest" to use HTTP/1.1 REST API instead of gRPC.
   *     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 CertificateAuthorityServiceClient({fallback: 'rest'}, gax);
   *     ```
   */
  constructor(
    opts?: ClientOptions,
    gaxInstance?: typeof gax | typeof gax.fallback
  ) {
    // Ensure that options include all the required fields.
    const staticMembers = this
      .constructor as typeof CertificateAuthorityServiceClient;
    const servicePath =
      opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath;
    this._providedCustomServicePath = !!(
      opts?.servicePath || opts?.apiEndpoint
    );
    const port = opts?.port || staticMembers.port;
    const clientConfig = opts?.clientConfig ?? {};
    const fallback =
      opts?.fallback ??
      (typeof window !== 'undefined' && typeof window?.fetch === 'function');
    opts = Object.assign({servicePath, port, clientConfig, fallback}, opts);

    // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
    if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) {
      opts['scopes'] = staticMembers.scopes;
    }

    // Load google-gax module synchronously if needed
    if (!gaxInstance) {
      gaxInstance = require('google-gax') as typeof gax;
    }

    // Choose either gRPC or proto-over-HTTP implementation of google-gax.
    this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance;

    // Create a `gaxGrpc` object, with any grpc-specific options sent to the client.
    this._gaxGrpc = new this._gaxModule.GrpcClient(opts);

    // Save options to use in initialize() method.
    this._opts = opts;

    // Save the auth object to the client, for use by other methods.
    this.auth = this._gaxGrpc.auth as gax.GoogleAuth;

    // Set useJWTAccessWithScope on the auth object.
    this.auth.useJWTAccessWithScope = true;

    // Set defaultServicePath on the auth object.
    this.auth.defaultServicePath = staticMembers.servicePath;

    // Set the default scopes in auth client if needed.
    if (servicePath === staticMembers.servicePath) {
      this.auth.defaultScopes = staticMembers.scopes;
    }
    this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts);

    this.locationsClient = new this._gaxModule.LocationsClient(
      this._gaxGrpc,
      opts
    );

    // Determine the client header string.
    const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
    if (typeof process !== 'undefined' && '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 if (opts.fallback === 'rest') {
      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 = {
      caPoolPathTemplate: new this._gaxModule.PathTemplate(
        'projects/{project}/locations/{location}/caPools/{ca_pool}'
      ),
      certificatePathTemplate: new this._gaxModule.PathTemplate(
        'projects/{project}/locations/{location}/caPools/{ca_pool}/certificates/{certificate}'
      ),
      certificateAuthorityPathTemplate: new this._gaxModule.PathTemplate(
        'projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}'
      ),
      certificateRevocationListPathTemplate: new this._gaxModule.PathTemplate(
        'projects/{project}/locations/{location}/caPools/{ca_pool}/certificateAuthorities/{certificate_authority}/certificateRevocationLists/{certificate_revocation_list}'
      ),
      certificateTemplatePathTemplate: new this._gaxModule.PathTemplate(
        'projects/{project}/locations/{location}/certificateTemplates/{certificate_template}'
      ),
      locationPathTemplate: new this._gaxModule.PathTemplate(
        'projects/{project}/locations/{location}'
      ),
    };

    // 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 = {
      listCertificates: new this._gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'certificates'
      ),
      listCertificateAuthorities: new this._gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'certificateAuthorities'
      ),
      listCaPools: new this._gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'caPools'
      ),
      listCertificateRevocationLists: new this._gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'certificateRevocationLists'
      ),
      listCertificateTemplates: new this._gaxModule.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'certificateTemplates'
      ),
    };

    const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos);
    // This API contains "long-running operations", which return a
    // an Operation object that allows for tracking of the operation,
    // rather than holding a request open.
    const lroOptions: GrpcClientOptions = {
      auth: this.auth,
      grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined,
    };
    if (opts.fallback === 'rest') {
      lroOptions.protoJson = protoFilesRoot;
      lroOptions.httpRules = [
        {
          selector: 'google.cloud.location.Locations.GetLocation',
          get: '/v1/{name=projects/*/locations/*}',
        },
        {
          selector: 'google.cloud.location.Locations.ListLocations',
          get: '/v1/{name=projects/*}/locations',
        },
        {
          selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',
          get: '/v1/{resource=projects/*/locations/*/caPools/*}:getIamPolicy',
          additional_bindings: [
            {
              get: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:getIamPolicy',
            },
            {
              get: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:getIamPolicy',
            },
          ],
        },
        {
          selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',
          post: '/v1/{resource=projects/*/locations/*/caPools/*}:setIamPolicy',
          body: '*',
          additional_bindings: [
            {
              post: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:setIamPolicy',
              body: '*',
            },
            {
              post: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:setIamPolicy',
              body: '*',
            },
          ],
        },
        {
          selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',
          post: '/v1/{resource=projects/*/locations/*/caPools/*}:testIamPermissions',
          body: '*',
          additional_bindings: [
            {
              post: '/v1/{resource=projects/*/locations/*/certificateTemplates/*}:testIamPermissions',
              body: '*',
            },
            {
              post: '/v1/{resource=projects/*/locations/*/caPools/*/certificateAuthorities/*/certificateRevocationLists/*}:testIamPermissions',
              body: '*',
            },
          ],
        },
        {
          selector: 'google.longrunning.Operations.CancelOperation',
          post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',
          body: '*',
        },
        {
          selector: 'google.longrunning.Operations.DeleteOperation',
          delete: '/v1/{name=projects/*/locations/*/operations/*}',
        },
        {
          selector: 'google.longrunning.Operations.GetOperation',
          get: '/v1/{name=projects/*/locations/*/operations/*}',
        },
        {
          selector: 'google.longrunning.Operations.ListOperations',
          get: '/v1/{name=projects/*/locations/*}/operations',
        },
      ];
    }
    this.operationsClient = this._gaxModule
      .lro(lroOptions)
      .operationsClient(opts);
    const activateCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const activateCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const createCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const createCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const disableCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const disableCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const enableCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const enableCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const undeleteCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const undeleteCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const deleteCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const deleteCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const updateCertificateAuthorityResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateAuthority'
    ) as gax.protobuf.Type;
    const updateCertificateAuthorityMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const createCaPoolResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CaPool'
    ) as gax.protobuf.Type;
    const createCaPoolMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const updateCaPoolResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CaPool'
    ) as gax.protobuf.Type;
    const updateCaPoolMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const deleteCaPoolResponse = protoFilesRoot.lookup(
      '.google.protobuf.Empty'
    ) as gax.protobuf.Type;
    const deleteCaPoolMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const updateCertificateRevocationListResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateRevocationList'
    ) as gax.protobuf.Type;
    const updateCertificateRevocationListMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const createCertificateTemplateResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateTemplate'
    ) as gax.protobuf.Type;
    const createCertificateTemplateMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const deleteCertificateTemplateResponse = protoFilesRoot.lookup(
      '.google.protobuf.Empty'
    ) as gax.protobuf.Type;
    const deleteCertificateTemplateMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;
    const updateCertificateTemplateResponse = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.CertificateTemplate'
    ) as gax.protobuf.Type;
    const updateCertificateTemplateMetadata = protoFilesRoot.lookup(
      '.google.cloud.security.privateca.v1.OperationMetadata'
    ) as gax.protobuf.Type;

    this.descriptors.longrunning = {
      activateCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        activateCertificateAuthorityResponse.decode.bind(
          activateCertificateAuthorityResponse
        ),
        activateCertificateAuthorityMetadata.decode.bind(
          activateCertificateAuthorityMetadata
        )
      ),
      createCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        createCertificateAuthorityResponse.decode.bind(
          createCertificateAuthorityResponse
        ),
        createCertificateAuthorityMetadata.decode.bind(
          createCertificateAuthorityMetadata
        )
      ),
      disableCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        disableCertificateAuthorityResponse.decode.bind(
          disableCertificateAuthorityResponse
        ),
        disableCertificateAuthorityMetadata.decode.bind(
          disableCertificateAuthorityMetadata
        )
      ),
      enableCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        enableCertificateAuthorityResponse.decode.bind(
          enableCertificateAuthorityResponse
        ),
        enableCertificateAuthorityMetadata.decode.bind(
          enableCertificateAuthorityMetadata
        )
      ),
      undeleteCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        undeleteCertificateAuthorityResponse.decode.bind(
          undeleteCertificateAuthorityResponse
        ),
        undeleteCertificateAuthorityMetadata.decode.bind(
          undeleteCertificateAuthorityMetadata
        )
      ),
      deleteCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        deleteCertificateAuthorityResponse.decode.bind(
          deleteCertificateAuthorityResponse
        ),
        deleteCertificateAuthorityMetadata.decode.bind(
          deleteCertificateAuthorityMetadata
        )
      ),
      updateCertificateAuthority: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        updateCertificateAuthorityResponse.decode.bind(
          updateCertificateAuthorityResponse
        ),
        updateCertificateAuthorityMetadata.decode.bind(
          updateCertificateAuthorityMetadata
        )
      ),
      createCaPool: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        createCaPoolResponse.decode.bind(createCaPoolResponse),
        createCaPoolMetadata.decode.bind(createCaPoolMetadata)
      ),
      updateCaPool: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        updateCaPoolResponse.decode.bind(updateCaPoolResponse),
        updateCaPoolMetadata.decode.bind(updateCaPoolMetadata)
      ),
      deleteCaPool: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        deleteCaPoolResponse.decode.bind(deleteCaPoolResponse),
        deleteCaPoolMetadata.decode.bind(deleteCaPoolMetadata)
      ),
      updateCertificateRevocationList:
        new this._gaxModule.LongrunningDescriptor(
          this.operationsClient,
          updateCertificateRevocationListResponse.decode.bind(
            updateCertificateRevocationListResponse
          ),
          updateCertificateRevocationListMetadata.decode.bind(
            updateCertificateRevocationListMetadata
          )
        ),
      createCertificateTemplate: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        createCertificateTemplateResponse.decode.bind(
          createCertificateTemplateResponse
        ),
        createCertificateTemplateMetadata.decode.bind(
          createCertificateTemplateMetadata
        )
      ),
      deleteCertificateTemplate: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        deleteCertificateTemplateResponse.decode.bind(
          deleteCertificateTemplateResponse
        ),
        deleteCertificateTemplateMetadata.decode.bind(
          deleteCertificateTemplateMetadata
        )
      ),
      updateCertificateTemplate: new this._gaxModule.LongrunningDescriptor(
        this.operationsClient,
        updateCertificateTemplateResponse.decode.bind(
          updateCertificateTemplateResponse
        ),
        updateCertificateTemplateMetadata.decode.bind(
          updateCertificateTemplateMetadata
        )
      ),
    };

    // Put together the default options sent with requests.
    this._defaults = this._gaxGrpc.constructSettings(
      'google.cloud.security.privateca.v1.CertificateAuthorityService',
      gapicConfig as gax.ClientConfig,
      opts.clientConfig || {},
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
    // merely providing the destination and request information.
    this.innerApiCalls = {};

    // Add a warn function to the client constructor so it can be easily tested.
    this.warn = this._gaxModule.warn;
  }

  /**
   * Initialize the client.
   * Performs asynchronous operations (such as authentication) and prepares the client.
   * This function will be called automatically when any class method is called for the
   * first time, but if you need to initialize it before calling an actual method,
   * feel free to call initialize() directly.
   *
   * You can await on this method if you want to make sure the client is initialized.
   *
   * @returns {Promise} A promise that resolves to an authenticated service stub.
   */
  initialize() {
    // If the client stub promise is already initialized, return immediately.
    if (this.certificateAuthorityServiceStub) {
      return this.certificateAuthorityServiceStub;
    }

    // Put together the "service stub" for
    // google.cloud.security.privateca.v1.CertificateAuthorityService.
    this.certificateAuthorityServiceStub = this._gaxGrpc.createStub(
      this._opts.fallback
        ? (this._protos as protobuf.Root).lookupService(
            'google.cloud.security.privateca.v1.CertificateAuthorityService'
          )
        : // eslint-disable-next-line @typescript-eslint/no-explicit-any
          (this._protos as any).google.cloud.security.privateca.v1
            .CertificateAuthorityService,
      this._opts,
      this._providedCustomServicePath
    ) as Promise<{[method: string]: Function}>;

    // Iterate over each of the methods that the service provides
    // and create an API call method for each.
    const certificateAuthorityServiceStubMethods = [
      'createCertificate',
      'getCertificate',
      'listCertificates',
      'revokeCertificate',
      'updateCertificate',
      'activateCertificateAuthority',
      'createCertificateAuthority',
      'disableCertificateAuthority',
      'enableCertificateAuthority',
      'fetchCertificateAuthorityCsr',
      'getCertificateAuthority',
      'listCertificateAuthorities',
      'undeleteCertificateAuthority',
      'deleteCertificateAuthority',
      'updateCertificateAuthority',
      'createCaPool',
      'updateCaPool',
      'getCaPool',
      'listCaPools',
      'deleteCaPool',
      'fetchCaCerts',
      'getCertificateRevocationList',
      'listCertificateRevocationLists',
      'updateCertificateRevocationList',
      'createCertificateTemplate',
      'deleteCertificateTemplate',
      'getCertificateTemplate',
      'listCertificateTemplates',
      'updateCertificateTemplate',
    ];
    for (const methodName of certificateAuthorityServiceStubMethods) {
      const callPromise = this.certificateAuthorityServiceStub.then(
        stub =>
          (...args: Array<{}>) => {
            if (this._terminated) {
              return Promise.reject('The client has already been closed.');
            }
            const func = stub[methodName];
            return func.apply(stub, args);
          },
        (err: Error | null | undefined) => () => {
          throw err;
        }
      );

      const descriptor =
        this.descriptors.page[methodName] ||
        this.descriptors.longrunning[methodName] ||
        undefined;
      const apiCall = this._gaxModule.createApiCall(
        callPromise,
        this._defaults[methodName],
        descriptor,
        this._opts.fallback
      );

      this.innerApiCalls[methodName] = apiCall;
    }

    return this.certificateAuthorityServiceStub;
  }

  /**
   * The DNS address for this API service.
   * @returns {string} The DNS address for this service.
   */
  static get servicePath() {
    return 'privateca.googleapis.com';
  }

  /**
   * The DNS address for this API service - same as servicePath(),
   * exists for compatibility reasons.
   * @returns {string} The DNS address for this service.
   */
  static get apiEndpoint() {
    return 'privateca.googleapis.com';
  }

  /**
   * 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'];
  }

  getProjectId(): Promise<string>;
  getProjectId(callback: Callback<string, undefined, undefined>): void;
  /**
   * Return the project ID used by this class.
   * @returns {Promise} A promise that resolves to string containing the project ID.
   */
  getProjectId(
    callback?: Callback<string, undefined, undefined>
  ): Promise<string> | void {
    if (callback) {
      this.auth.getProjectId(callback);
      return;
    }
    return this.auth.getProjectId();
  }

  // -------------------
  // -- Service calls --
  // -------------------
  /**
   * Create a new {@link google.cloud.security.privateca.v1.Certificate|Certificate} in a given Project, Location from a particular
   * {@link google.cloud.security.privateca.v1.CaPool|CaPool}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the {@link google.cloud.security.privateca.v1.CaPool|CaPool} associated with the {@link google.cloud.security.privateca.v1.Certificate|Certificate},
   *   in the format `projects/* /locations/* /caPools/*`.
   * @param {string} [request.certificateId]
   *   Optional. It must be unique within a location and match the regular
   *   expression `[a-zA-Z0-9_-]{1,63}`. This field is required when using a
   *   {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the Enterprise {@link |CertificateAuthority.Tier},
   *   but is optional and its value is ignored otherwise.
   * @param {google.cloud.security.privateca.v1.Certificate} request.certificate
   *   Required. A {@link google.cloud.security.privateca.v1.Certificate|Certificate} with initial field values.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and the
   *   request times out. If you make the request again with the same request ID,
   *   the server can check if original operation with the same request ID was
   *   received, and if so, will ignore the second request. This prevents clients
   *   from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {boolean} [request.validateOnly]
   *   Optional. If this is true, no {@link google.cloud.security.privateca.v1.Certificate|Certificate} resource will be persisted regardless
   *   of the {@link google.cloud.security.privateca.v1.CaPool|CaPool}'s {@link google.cloud.security.privateca.v1.CaPool.tier|tier}, and the returned {@link google.cloud.security.privateca.v1.Certificate|Certificate}
   *   will not contain the {@link google.cloud.security.privateca.v1.Certificate.pem_certificate|pem_certificate} field.
   * @param {string} [request.issuingCertificateAuthorityId]
   *   Optional. The resource ID of the {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} that should issue the
   *   certificate.  This optional field will ignore the load-balancing scheme of
   *   the Pool and directly issue the certificate from the CA with the specified
   *   ID, contained in the same {@link google.cloud.security.privateca.v1.CaPool|CaPool} referenced by `parent`. Per-CA quota
   *   rules apply. If left empty, a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} will be chosen from
   *   the {@link google.cloud.security.privateca.v1.CaPool|CaPool} by the service. For example, to issue a {@link google.cloud.security.privateca.v1.Certificate|Certificate} from
   *   a Certificate Authority with resource name
   *   "projects/my-project/locations/us-central1/caPools/my-pool/certificateAuthorities/my-ca",
   *   you can set the {@link google.cloud.security.privateca.v1.CreateCertificateRequest.parent|parent} to
   *   "projects/my-project/locations/us-central1/caPools/my-pool" and the
   *   {@link google.cloud.security.privateca.v1.CreateCertificateRequest.issuing_certificate_authority_id|issuing_certificate_authority_id} to "my-ca".
   * @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 [Certificate]{@link google.cloud.security.privateca.v1.Certificate}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_certificate.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificate_async
   */
  createCertificate(
    request?: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  createCertificate(
    request: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  createCertificate(
    request: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  createCertificate(
    request?: protos.google.cloud.security.privateca.v1.ICreateCertificateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificate,
          | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.ICreateCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.createCertificate(request, options, callback);
  }
  /**
   * Returns a {@link google.cloud.security.privateca.v1.Certificate|Certificate}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The {@link google.cloud.security.privateca.v1.Certificate.name|name} of the {@link google.cloud.security.privateca.v1.Certificate|Certificate} to get.
   * @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 [Certificate]{@link google.cloud.security.privateca.v1.Certificate}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.get_certificate.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificate_async
   */
  getCertificate(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  getCertificate(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IGetCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificate(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IGetCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificate(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificate,
          | protos.google.cloud.security.privateca.v1.IGetCertificateRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IGetCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.getCertificate(request, options, callback);
  }
  /**
   * Revoke a {@link google.cloud.security.privateca.v1.Certificate|Certificate}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.Certificate|Certificate} in the
   *   format
   *   `projects/* /locations/* /caPools/* /certificates/*`.
   * @param {google.cloud.security.privateca.v1.RevocationReason} request.reason
   *   Required. The {@link google.cloud.security.privateca.v1.RevocationReason|RevocationReason} for revoking this certificate.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @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 [Certificate]{@link google.cloud.security.privateca.v1.Certificate}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.revoke_certificate.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_async
   */
  revokeCertificate(
    request?: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  revokeCertificate(
    request: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  revokeCertificate(
    request: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  revokeCertificate(
    request?: protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificate,
          | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.IRevokeCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.revokeCertificate(request, options, callback);
  }
  /**
   * Update a {@link google.cloud.security.privateca.v1.Certificate|Certificate}. Currently, the only field you can update is the
   * {@link google.cloud.security.privateca.v1.Certificate.labels|labels} field.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {google.cloud.security.privateca.v1.Certificate} request.certificate
   *   Required. {@link google.cloud.security.privateca.v1.Certificate|Certificate} with updated values.
   * @param {google.protobuf.FieldMask} request.updateMask
   *   Required. A list of fields to be updated in this request.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @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 [Certificate]{@link google.cloud.security.privateca.v1.Certificate}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_async
   */
  updateCertificate(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  updateCertificate(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificate(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificate(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificate,
          | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificate,
      | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate,
      (
        | protos.google.cloud.security.privateca.v1.IUpdateCertificateRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        'certificate.name': request.certificate!.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.updateCertificate(request, options, callback);
  }
  /**
   * Fetch a certificate signing request (CSR) from a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}
   * that is in state
   * {@link google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION|AWAITING_USER_ACTIVATION}
   * and is of type {@link google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. The
   * CSR must then be signed by the desired parent Certificate Authority, which
   * could be another {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} resource, or could be an on-prem
   * certificate authority. See also {@link google.cloud.security.privateca.v1.CertificateAuthorityService.ActivateCertificateAuthority|ActivateCertificateAuthority}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the
   *   format `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @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 [FetchCertificateAuthorityCsrResponse]{@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.fetch_certificate_authority_csr.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_async
   */
  fetchCertificateAuthorityCsr(
    request?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse,
      (
        | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  fetchCertificateAuthorityCsr(
    request: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse,
      | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  fetchCertificateAuthorityCsr(
    request: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse,
      | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  fetchCertificateAuthorityCsr(
    request?: protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse,
          | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse,
      | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrResponse,
      (
        | protos.google.cloud.security.privateca.v1.IFetchCertificateAuthorityCsrRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.fetchCertificateAuthorityCsr(
      request,
      options,
      callback
    );
  }
  /**
   * Returns a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The {@link google.cloud.security.privateca.v1.CertificateAuthority.name|name} of the {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} to
   *   get.
   * @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 [CertificateAuthority]{@link google.cloud.security.privateca.v1.CertificateAuthority}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.get_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_async
   */
  getCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateAuthority,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  getCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateAuthority,
      | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateAuthority,
      | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificateAuthority,
          | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateAuthority,
      | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateAuthority,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateAuthorityRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.getCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Returns a {@link google.cloud.security.privateca.v1.CaPool|CaPool}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The {@link google.cloud.security.privateca.v1.CaPool.name|name} of the {@link google.cloud.security.privateca.v1.CaPool|CaPool} to get.
   * @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 [CaPool]{@link google.cloud.security.privateca.v1.CaPool}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.get_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCaPool_async
   */
  getCaPool(
    request?: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICaPool,
      protos.google.cloud.security.privateca.v1.IGetCaPoolRequest | undefined,
      {} | undefined
    ]
  >;
  getCaPool(
    request: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICaPool,
      | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCaPool(
    request: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICaPool,
      | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCaPool(
    request?: protos.google.cloud.security.privateca.v1.IGetCaPoolRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICaPool,
          | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICaPool,
      | protos.google.cloud.security.privateca.v1.IGetCaPoolRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICaPool,
      protos.google.cloud.security.privateca.v1.IGetCaPoolRequest | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.getCaPool(request, options, callback);
  }
  /**
   * FetchCaCerts returns the current trust anchor for the {@link google.cloud.security.privateca.v1.CaPool|CaPool}. This will
   * include CA certificate chains for all ACTIVE {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}
   * resources in the {@link google.cloud.security.privateca.v1.CaPool|CaPool}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.caPool
   *   Required. The resource name for the {@link google.cloud.security.privateca.v1.CaPool|CaPool} in the
   *   format `projects/* /locations/* /caPools/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @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 [FetchCaCertsResponse]{@link google.cloud.security.privateca.v1.FetchCaCertsResponse}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.fetch_ca_certs.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_async
   */
  fetchCaCerts(
    request?: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse,
      (
        | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  fetchCaCerts(
    request: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse,
      | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  fetchCaCerts(
    request: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse,
      | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  fetchCaCerts(
    request?: protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse,
          | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse,
      | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.IFetchCaCertsResponse,
      (
        | protos.google.cloud.security.privateca.v1.IFetchCaCertsRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        ca_pool: request.caPool ?? '',
      });
    this.initialize();
    return this.innerApiCalls.fetchCaCerts(request, options, callback);
  }
  /**
   * Returns a {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The {@link google.cloud.security.privateca.v1.CertificateRevocationList.name|name} of the
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} to get.
   * @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 [CertificateRevocationList]{@link google.cloud.security.privateca.v1.CertificateRevocationList}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.get_certificate_revocation_list.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_async
   */
  getCertificateRevocationList(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  getCertificateRevocationList(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
      | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificateRevocationList(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
      | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificateRevocationList(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
          | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
      | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateRevocationListRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.getCertificateRevocationList(
      request,
      options,
      callback
    );
  }
  /**
   * Returns a {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The {@link google.cloud.security.privateca.v1.CertificateTemplate.name|name} of the {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} to
   *   get.
   * @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 [CertificateTemplate]{@link google.cloud.security.privateca.v1.CertificateTemplate}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.get_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_async
   */
  getCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateTemplate,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest
        | undefined
      ),
      {} | undefined
    ]
  >;
  getCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest,
    options: CallOptions,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateTemplate,
      | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest,
    callback: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateTemplate,
      | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): void;
  getCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          protos.google.cloud.security.privateca.v1.ICertificateTemplate,
          | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      protos.google.cloud.security.privateca.v1.ICertificateTemplate,
      | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateTemplate,
      (
        | protos.google.cloud.security.privateca.v1.IGetCertificateTemplateRequest
        | undefined
      ),
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.getCertificateTemplate(
      request,
      options,
      callback
    );
  }

  /**
   * Activate a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} that is in state
   * {@link google.cloud.security.privateca.v1.CertificateAuthority.State.AWAITING_USER_ACTIVATION|AWAITING_USER_ACTIVATION}
   * and is of type {@link google.cloud.security.privateca.v1.CertificateAuthority.Type.SUBORDINATE|SUBORDINATE}. After
   * the parent Certificate Authority signs a certificate signing request from
   * {@link google.cloud.security.privateca.v1.CertificateAuthorityService.FetchCertificateAuthorityCsr|FetchCertificateAuthorityCsr}, this method can complete the activation
   * process.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the
   *   format `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {string} request.pemCaCertificate
   *   Required. The signed CA certificate issued from
   *   {@link google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse.pem_csr|FetchCertificateAuthorityCsrResponse.pem_csr}.
   * @param {google.cloud.security.privateca.v1.SubordinateConfig} request.subordinateConfig
   *   Required. Must include information about the issuer of 'pem_ca_certificate', and any
   *   further issuers until the self-signed CA.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.activate_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async
   */
  activateCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  activateCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  activateCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  activateCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IActivateCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.activateCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `activateCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.activate_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_async
   */
  async checkActivateCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.activateCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Create a new {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in a given Project and Location.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the {@link google.cloud.security.privateca.v1.CaPool|CaPool} associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {string} request.certificateAuthorityId
   *   Required. It must be unique within a location and match the regular
   *   expression `[a-zA-Z0-9_-]{1,63}`
   * @param {google.cloud.security.privateca.v1.CertificateAuthority} request.certificateAuthority
   *   Required. A {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} with initial field values.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async
   */
  createCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  createCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  createCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  createCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.ICreateCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.createCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `createCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_async
   */
  async checkCreateCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.createCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Disable a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the
   *   format `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.disable_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async
   */
  disableCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  disableCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  disableCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  disableCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IDisableCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.disableCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `disableCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.disable_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_async
   */
  async checkDisableCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.disableCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Enable a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the
   *   format `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.enable_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async
   */
  enableCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  enableCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  enableCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  enableCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IEnableCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.enableCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `enableCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.enable_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_async
   */
  async checkEnableCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.enableCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Undelete a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} that has been deleted.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the
   *   format `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async
   */
  undeleteCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  undeleteCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  undeleteCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  undeleteCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IUndeleteCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.undeleteCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `undeleteCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.undelete_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_async
   */
  async checkUndeleteCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.undeleteCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Delete a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} in the
   *   format `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {boolean} [request.ignoreActiveCertificates]
   *   Optional. This field allows the CA to be deleted even if the CA has
   *   active certs. Active certs include both unrevoked and unexpired certs.
   * @param {boolean} [request.skipGracePeriod]
   *   Optional. If this flag is set, the Certificate Authority will be deleted as soon as
   *   possible without a 30-day grace period where undeletion would have been
   *   allowed. If you proceed, there will be no way to recover this CA.
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.delete_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async
   */
  deleteCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  deleteCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  deleteCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  deleteCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.deleteCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `deleteCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.delete_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_async
   */
  async checkDeleteCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.deleteCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Update a {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {google.cloud.security.privateca.v1.CertificateAuthority} request.certificateAuthority
   *   Required. {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthority} with updated values.
   * @param {google.protobuf.FieldMask} request.updateMask
   *   Required. A list of fields to be updated in this request.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async
   */
  updateCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  updateCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificateAuthority(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificateAuthority(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateAuthorityRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateAuthority,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateAuthority,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        'certificate_authority.name': request.certificateAuthority!.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.updateCertificateAuthority(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `updateCertificateAuthority()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate_authority.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_async
   */
  async checkUpdateCertificateAuthorityProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.updateCertificateAuthority,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateAuthority,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Create a {@link google.cloud.security.privateca.v1.CaPool|CaPool}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CaPool|CaPool}, in the format `projects/* /locations/*`.
   * @param {string} request.caPoolId
   *   Required. It must be unique within a location and match the regular
   *   expression `[a-zA-Z0-9_-]{1,63}`
   * @param {google.cloud.security.privateca.v1.CaPool} request.caPool
   *   Required. A {@link google.cloud.security.privateca.v1.CaPool|CaPool} with initial field values.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async
   */
  createCaPool(
    request?: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  createCaPool(
    request: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  createCaPool(
    request: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  createCaPool(
    request?: protos.google.cloud.security.privateca.v1.ICreateCaPoolRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICaPool,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.createCaPool(request, options, callback);
  }
  /**
   * Check the status of the long running operation returned by `createCaPool()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCaPool_async
   */
  async checkCreateCaPoolProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CaPool,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.createCaPool,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CaPool,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Update a {@link google.cloud.security.privateca.v1.CaPool|CaPool}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {google.cloud.security.privateca.v1.CaPool} request.caPool
   *   Required. {@link google.cloud.security.privateca.v1.CaPool|CaPool} with updated values.
   * @param {google.protobuf.FieldMask} request.updateMask
   *   Required. A list of fields to be updated in this request.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async
   */
  updateCaPool(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  updateCaPool(
    request: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCaPool(
    request: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCaPool(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCaPoolRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICaPool,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICaPool,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        'ca_pool.name': request.caPool!.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.updateCaPool(request, options, callback);
  }
  /**
   * Check the status of the long running operation returned by `updateCaPool()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_async
   */
  async checkUpdateCaPoolProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CaPool,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.updateCaPool,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CaPool,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Delete a {@link google.cloud.security.privateca.v1.CaPool|CaPool}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CaPool|CaPool} in the
   *   format `projects/* /locations/* /caPools/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.delete_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async
   */
  deleteCaPool(
    request?: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  deleteCaPool(
    request: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  deleteCaPool(
    request: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest,
    callback: Callback<
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  deleteCaPool(
    request?: protos.google.cloud.security.privateca.v1.IDeleteCaPoolRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.protobuf.IEmpty,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.deleteCaPool(request, options, callback);
  }
  /**
   * Check the status of the long running operation returned by `deleteCaPool()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.delete_ca_pool.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_async
   */
  async checkDeleteCaPoolProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.protobuf.Empty,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.deleteCaPool,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.protobuf.Empty,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Update a {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {google.cloud.security.privateca.v1.CertificateRevocationList} request.certificateRevocationList
   *   Required. {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationList} with updated values.
   * @param {google.protobuf.FieldMask} request.updateMask
   *   Required. A list of fields to be updated in this request.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async
   */
  updateCertificateRevocationList(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  updateCertificateRevocationList(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificateRevocationList(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificateRevocationList(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateRevocationListRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateRevocationList,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        'certificate_revocation_list.name':
          request.certificateRevocationList!.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.updateCertificateRevocationList(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `updateCertificateRevocationList()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate_revocation_list.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_async
   */
  async checkUpdateCertificateRevocationListProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateRevocationList,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.updateCertificateRevocationList,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateRevocationList,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Create a new {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} in a given Project and Location.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}, in the format
   *   `projects/* /locations/*`.
   * @param {string} request.certificateTemplateId
   *   Required. It must be unique within a location and match the regular
   *   expression `[a-zA-Z0-9_-]{1,63}`
   * @param {google.cloud.security.privateca.v1.CertificateTemplate} request.certificateTemplate
   *   Required. A {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} with initial field values.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async
   */
  createCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  createCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  createCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  createCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.ICreateCertificateTemplateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateTemplate,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.createCertificateTemplate(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `createCertificateTemplate()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.create_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_async
   */
  async checkCreateCertificateTemplateProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateTemplate,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.createCertificateTemplate,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateTemplate,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * DeleteCertificateTemplate deletes a {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Required. The resource name for this {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} in the format
   *   `projects/* /locations/* /certificateTemplates/*`.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.delete_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async
   */
  deleteCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  deleteCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  deleteCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest,
    callback: Callback<
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  deleteCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.IDeleteCertificateTemplateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.protobuf.IEmpty,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.protobuf.IEmpty,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        name: request.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.deleteCertificateTemplate(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `deleteCertificateTemplate()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.delete_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_async
   */
  async checkDeleteCertificateTemplateProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.protobuf.Empty,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.deleteCertificateTemplate,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.protobuf.Empty,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Update a {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {google.cloud.security.privateca.v1.CertificateTemplate} request.certificateTemplate
   *   Required. {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplate} with updated values.
   * @param {google.protobuf.FieldMask} request.updateMask
   *   Required. A list of fields to be updated in this request.
   * @param {string} [request.requestId]
   *   Optional. An ID to identify requests. Specify a unique request ID so that if you must
   *   retry your request, the server will know to ignore the request if it has
   *   already been completed. The server will guarantee that for at least 60
   *   minutes since the first request.
   *
   *   For example, consider a situation where you make an initial request and t
   *   he request times out. If you make the request again with the same request
   *   ID, the server can check if original operation with the same request ID
   *   was received, and if so, will ignore the second request. This prevents
   *   clients from accidentally creating duplicate commitments.
   *
   *   The request ID must be a valid UUID with the exception that zero UUID is
   *   not supported (00000000-0000-0000-0000-000000000000).
   * @param {object} [options]
   *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing
   *   a long running operation. Its `promise()` method returns a promise
   *   you can `await` for.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async
   */
  updateCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest,
    options?: CallOptions
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  >;
  updateCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest,
    options: CallOptions,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificateTemplate(
    request: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest,
    callback: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): void;
  updateCertificateTemplate(
    request?: protos.google.cloud.security.privateca.v1.IUpdateCertificateTemplateRequest,
    optionsOrCallback?:
      | CallOptions
      | Callback<
          LROperation<
            protos.google.cloud.security.privateca.v1.ICertificateTemplate,
            protos.google.cloud.security.privateca.v1.IOperationMetadata
          >,
          protos.google.longrunning.IOperation | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | null | undefined,
      {} | null | undefined
    >
  ): Promise<
    [
      LROperation<
        protos.google.cloud.security.privateca.v1.ICertificateTemplate,
        protos.google.cloud.security.privateca.v1.IOperationMetadata
      >,
      protos.google.longrunning.IOperation | undefined,
      {} | undefined
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        'certificate_template.name': request.certificateTemplate!.name ?? '',
      });
    this.initialize();
    return this.innerApiCalls.updateCertificateTemplate(
      request,
      options,
      callback
    );
  }
  /**
   * Check the status of the long running operation returned by `updateCertificateTemplate()`.
   * @param {String} name
   *   The operation name that will be passed.
   * @returns {Promise} - The promise which resolves to an object.
   *   The decoded operation object has result and metadata field to get information from.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.update_certificate_template.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_async
   */
  async checkUpdateCertificateTemplateProgress(
    name: string
  ): Promise<
    LROperation<
      protos.google.cloud.security.privateca.v1.CertificateTemplate,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >
  > {
    const request =
      new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest(
        {name}
      );
    const [operation] = await this.operationsClient.getOperation(request);
    const decodeOperation = new this._gaxModule.Operation(
      operation,
      this.descriptors.longrunning.updateCertificateTemplate,
      this._gaxModule.createDefaultBackoffSettings()
    );
    return decodeOperation as LROperation<
      protos.google.cloud.security.privateca.v1.CertificateTemplate,
      protos.google.cloud.security.privateca.v1.OperationMetadata
    >;
  }
  /**
   * Lists {@link google.cloud.security.privateca.v1.Certificate|Certificates}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.Certificate|Certificates}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.Certificate|Certificates} to include in the
   *   response. Further {@link google.cloud.security.privateca.v1.Certificate|Certificates} can subsequently be obtained
   *   by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response. For details
   *   on supported filters and syntax, see [Certificates Filtering
   *   documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted. For details on supported fields
   *   and syntax, see [Certificates Sorting
   *   documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
   * @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 [Certificate]{@link google.cloud.security.privateca.v1.Certificate}.
   *   The client library will perform auto-pagination by default: it will call the API as many
   *   times as needed and will merge results from all the pages into this array.
   *   Note that it can affect your quota.
   *   We recommend using `listCertificatesAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificates(
    request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate[],
      protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificatesResponse
    ]
  >;
  listCertificates(
    request: protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
    options: CallOptions,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificatesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificate
    >
  ): void;
  listCertificates(
    request: protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificatesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificate
    >
  ): void;
  listCertificates(
    request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
    optionsOrCallback?:
      | CallOptions
      | PaginationCallback<
          protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
          | protos.google.cloud.security.privateca.v1.IListCertificatesResponse
          | null
          | undefined,
          protos.google.cloud.security.privateca.v1.ICertificate
        >,
    callback?: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificatesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificate
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificate[],
      protos.google.cloud.security.privateca.v1.IListCertificatesRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificatesResponse
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.listCertificates(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 resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.Certificate|Certificates}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.Certificate|Certificates} to include in the
   *   response. Further {@link google.cloud.security.privateca.v1.Certificate|Certificates} can subsequently be obtained
   *   by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response. For details
   *   on supported filters and syntax, see [Certificates Filtering
   *   documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted. For details on supported fields
   *   and syntax, see [Certificates Sorting
   *   documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
   * @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 [Certificate]{@link google.cloud.security.privateca.v1.Certificate} 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 `listCertificatesAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificatesStream(
    request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
    options?: CallOptions
  ): Transform {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCertificates'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificates.createStream(
      this.innerApiCalls.listCertificates as GaxCall,
      request,
      callSettings
    );
  }

  /**
   * Equivalent to `listCertificates`, but returns an iterable object.
   *
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.Certificate|Certificates}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.Certificate|Certificates} to include in the
   *   response. Further {@link google.cloud.security.privateca.v1.Certificate|Certificates} can subsequently be obtained
   *   by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificatesResponse.next_page_token|ListCertificatesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response. For details
   *   on supported filters and syntax, see [Certificates Filtering
   *   documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#filtering_support).
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted. For details on supported fields
   *   and syntax, see [Certificates Sorting
   *   documentation](https://cloud.google.com/certificate-authority-service/docs/sorting-filtering-certificates#sorting_support).
   * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
   *   When you iterate the returned iterable, each element will be an object representing
   *   [Certificate]{@link google.cloud.security.privateca.v1.Certificate}. 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
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.list_certificates.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificates_async
   */
  listCertificatesAsync(
    request?: protos.google.cloud.security.privateca.v1.IListCertificatesRequest,
    options?: CallOptions
  ): AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificate> {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCertificates'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificates.asyncIterate(
      this.innerApiCalls['listCertificates'] as GaxCall,
      request as {},
      callSettings
    ) as AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificate>;
  }
  /**
   * Lists {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the {@link google.cloud.security.privateca.v1.CaPool|CaPool} associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} to
   *   include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CertificateAuthority]{@link google.cloud.security.privateca.v1.CertificateAuthority}.
   *   The client library will perform auto-pagination by default: it will call the API as many
   *   times as needed and will merge results from all the pages into this array.
   *   Note that it can affect your quota.
   *   We recommend using `listCertificateAuthoritiesAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificateAuthorities(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateAuthority[],
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse
    ]
  >;
  listCertificateAuthorities(
    request: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
    options: CallOptions,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateAuthority
    >
  ): void;
  listCertificateAuthorities(
    request: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateAuthority
    >
  ): void;
  listCertificateAuthorities(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
    optionsOrCallback?:
      | CallOptions
      | PaginationCallback<
          protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
          | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse
          | null
          | undefined,
          protos.google.cloud.security.privateca.v1.ICertificateAuthority
        >,
    callback?: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateAuthority
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateAuthority[],
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesResponse
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.listCertificateAuthorities(
      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 resource name of the {@link google.cloud.security.privateca.v1.CaPool|CaPool} associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} to
   *   include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CertificateAuthority]{@link google.cloud.security.privateca.v1.CertificateAuthority} 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 `listCertificateAuthoritiesAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificateAuthoritiesStream(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
    options?: CallOptions
  ): Transform {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCertificateAuthorities'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificateAuthorities.createStream(
      this.innerApiCalls.listCertificateAuthorities as GaxCall,
      request,
      callSettings
    );
  }

  /**
   * Equivalent to `listCertificateAuthorities`, but returns an iterable object.
   *
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the {@link google.cloud.security.privateca.v1.CaPool|CaPool} associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities}, in the format
   *   `projects/* /locations/* /caPools/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} to
   *   include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CertificateAuthority|CertificateAuthorities} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateAuthoritiesResponse.next_page_token|ListCertificateAuthoritiesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
   *   When you iterate the returned iterable, each element will be an object representing
   *   [CertificateAuthority]{@link google.cloud.security.privateca.v1.CertificateAuthority}. 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
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.list_certificate_authorities.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_async
   */
  listCertificateAuthoritiesAsync(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateAuthoritiesRequest,
    options?: CallOptions
  ): AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificateAuthority> {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCertificateAuthorities'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificateAuthorities.asyncIterate(
      this.innerApiCalls['listCertificateAuthorities'] as GaxCall,
      request as {},
      callSettings
    ) as AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificateAuthority>;
  }
  /**
   * Lists {@link google.cloud.security.privateca.v1.CaPool|CaPools}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CaPool|CaPools}, in the format
   *   `projects/* /locations/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of {@link google.cloud.security.privateca.v1.CaPool|CaPools} to
   *   include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CaPool|CaPools} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CaPool]{@link google.cloud.security.privateca.v1.CaPool}.
   *   The client library will perform auto-pagination by default: it will call the API as many
   *   times as needed and will merge results from all the pages into this array.
   *   Note that it can affect your quota.
   *   We recommend using `listCaPoolsAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCaPools(
    request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICaPool[],
      protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null,
      protos.google.cloud.security.privateca.v1.IListCaPoolsResponse
    ]
  >;
  listCaPools(
    request: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
    options: CallOptions,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
      | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICaPool
    >
  ): void;
  listCaPools(
    request: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
      | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICaPool
    >
  ): void;
  listCaPools(
    request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
    optionsOrCallback?:
      | CallOptions
      | PaginationCallback<
          protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
          | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse
          | null
          | undefined,
          protos.google.cloud.security.privateca.v1.ICaPool
        >,
    callback?: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
      | protos.google.cloud.security.privateca.v1.IListCaPoolsResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICaPool
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICaPool[],
      protos.google.cloud.security.privateca.v1.IListCaPoolsRequest | null,
      protos.google.cloud.security.privateca.v1.IListCaPoolsResponse
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.listCaPools(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 resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CaPool|CaPools}, in the format
   *   `projects/* /locations/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of {@link google.cloud.security.privateca.v1.CaPool|CaPools} to
   *   include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CaPool|CaPools} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CaPool]{@link google.cloud.security.privateca.v1.CaPool} 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 `listCaPoolsAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCaPoolsStream(
    request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
    options?: CallOptions
  ): Transform {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCaPools'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCaPools.createStream(
      this.innerApiCalls.listCaPools as GaxCall,
      request,
      callSettings
    );
  }

  /**
   * Equivalent to `listCaPools`, but returns an iterable object.
   *
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CaPool|CaPools}, in the format
   *   `projects/* /locations/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of {@link google.cloud.security.privateca.v1.CaPool|CaPools} to
   *   include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CaPool|CaPools} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCaPoolsResponse.next_page_token|ListCaPoolsResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
   *   When you iterate the returned iterable, each element will be an object representing
   *   [CaPool]{@link google.cloud.security.privateca.v1.CaPool}. 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
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.list_ca_pools.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCaPools_async
   */
  listCaPoolsAsync(
    request?: protos.google.cloud.security.privateca.v1.IListCaPoolsRequest,
    options?: CallOptions
  ): AsyncIterable<protos.google.cloud.security.privateca.v1.ICaPool> {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCaPools'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCaPools.asyncIterate(
      this.innerApiCalls['listCaPools'] as GaxCall,
      request as {},
      callSettings
    ) as AsyncIterable<protos.google.cloud.security.privateca.v1.ICaPool>;
  }
  /**
   * Lists {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, in the format
   *   `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} to include in the
   *   response. Further {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}
   *   can subsequently be obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CertificateRevocationList]{@link google.cloud.security.privateca.v1.CertificateRevocationList}.
   *   The client library will perform auto-pagination by default: it will call the API as many
   *   times as needed and will merge results from all the pages into this array.
   *   Note that it can affect your quota.
   *   We recommend using `listCertificateRevocationListsAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificateRevocationLists(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList[],
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse
    ]
  >;
  listCertificateRevocationLists(
    request: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
    options: CallOptions,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList
    >
  ): void;
  listCertificateRevocationLists(
    request: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList
    >
  ): void;
  listCertificateRevocationLists(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
    optionsOrCallback?:
      | CallOptions
      | PaginationCallback<
          protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
          | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse
          | null
          | undefined,
          protos.google.cloud.security.privateca.v1.ICertificateRevocationList
        >,
    callback?: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateRevocationList[],
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsResponse
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.listCertificateRevocationLists(
      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 resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, in the format
   *   `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} to include in the
   *   response. Further {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}
   *   can subsequently be obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CertificateRevocationList]{@link google.cloud.security.privateca.v1.CertificateRevocationList} 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 `listCertificateRevocationListsAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificateRevocationListsStream(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
    options?: CallOptions
  ): Transform {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings =
      this._defaults['listCertificateRevocationLists'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificateRevocationLists.createStream(
      this.innerApiCalls.listCertificateRevocationLists as GaxCall,
      request,
      callSettings
    );
  }

  /**
   * Equivalent to `listCertificateRevocationLists`, but returns an iterable object.
   *
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}, in the format
   *   `projects/* /locations/* /caPools/* /certificateAuthorities/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists} to include in the
   *   response. Further {@link google.cloud.security.privateca.v1.CertificateRevocationList|CertificateRevocationLists}
   *   can subsequently be obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateRevocationListsResponse.next_page_token|ListCertificateRevocationListsResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
   *   When you iterate the returned iterable, each element will be an object representing
   *   [CertificateRevocationList]{@link google.cloud.security.privateca.v1.CertificateRevocationList}. 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
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.list_certificate_revocation_lists.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_async
   */
  listCertificateRevocationListsAsync(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateRevocationListsRequest,
    options?: CallOptions
  ): AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificateRevocationList> {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings =
      this._defaults['listCertificateRevocationLists'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificateRevocationLists.asyncIterate(
      this.innerApiCalls['listCertificateRevocationLists'] as GaxCall,
      request as {},
      callSettings
    ) as AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificateRevocationList>;
  }
  /**
   * Lists {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, in the format
   *   `projects/* /locations/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} to include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CertificateTemplate]{@link google.cloud.security.privateca.v1.CertificateTemplate}.
   *   The client library will perform auto-pagination by default: it will call the API as many
   *   times as needed and will merge results from all the pages into this array.
   *   Note that it can affect your quota.
   *   We recommend using `listCertificateTemplatesAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificateTemplates(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
    options?: CallOptions
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateTemplate[],
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse
    ]
  >;
  listCertificateTemplates(
    request: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
    options: CallOptions,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateTemplate
    >
  ): void;
  listCertificateTemplates(
    request: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
    callback: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateTemplate
    >
  ): void;
  listCertificateTemplates(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
    optionsOrCallback?:
      | CallOptions
      | PaginationCallback<
          protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
          | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse
          | null
          | undefined,
          protos.google.cloud.security.privateca.v1.ICertificateTemplate
        >,
    callback?: PaginationCallback<
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
      | protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse
      | null
      | undefined,
      protos.google.cloud.security.privateca.v1.ICertificateTemplate
    >
  ): Promise<
    [
      protos.google.cloud.security.privateca.v1.ICertificateTemplate[],
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest | null,
      protos.google.cloud.security.privateca.v1.IListCertificateTemplatesResponse
    ]
  > | void {
    request = request || {};
    let options: CallOptions;
    if (typeof optionsOrCallback === 'function' && callback === undefined) {
      callback = optionsOrCallback;
      options = {};
    } else {
      options = optionsOrCallback as CallOptions;
    }
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    this.initialize();
    return this.innerApiCalls.listCertificateTemplates(
      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 resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, in the format
   *   `projects/* /locations/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} to include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [CertificateTemplate]{@link google.cloud.security.privateca.v1.CertificateTemplate} 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 `listCertificateTemplatesAsync()`
   *   method described below for async iteration which you can stop as needed.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   */
  listCertificateTemplatesStream(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
    options?: CallOptions
  ): Transform {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCertificateTemplates'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificateTemplates.createStream(
      this.innerApiCalls.listCertificateTemplates as GaxCall,
      request,
      callSettings
    );
  }

  /**
   * Equivalent to `listCertificateTemplates`, but returns an iterable object.
   *
   * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.parent
   *   Required. The resource name of the location associated with the
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates}, in the format
   *   `projects/* /locations/*`.
   * @param {number} [request.pageSize]
   *   Optional. Limit on the number of
   *   {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} to include in the response.
   *   Further {@link google.cloud.security.privateca.v1.CertificateTemplate|CertificateTemplates} can subsequently be
   *   obtained by including the
   *   {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token} in a subsequent
   *   request. If unspecified, the server will pick an appropriate default.
   * @param {string} [request.pageToken]
   *   Optional. Pagination token, returned earlier via
   *   {@link google.cloud.security.privateca.v1.ListCertificateTemplatesResponse.next_page_token|ListCertificateTemplatesResponse.next_page_token}.
   * @param {string} [request.filter]
   *   Optional. Only include resources that match the filter in the response.
   * @param {string} [request.orderBy]
   *   Optional. Specify how the results should be sorted.
   * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
   *   When you iterate the returned iterable, each element will be an object representing
   *   [CertificateTemplate]{@link google.cloud.security.privateca.v1.CertificateTemplate}. 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
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   * @example <caption>include:samples/generated/v1/certificate_authority_service.list_certificate_templates.js</caption>
   * region_tag:privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_async
   */
  listCertificateTemplatesAsync(
    request?: protos.google.cloud.security.privateca.v1.IListCertificateTemplatesRequest,
    options?: CallOptions
  ): AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificateTemplate> {
    request = request || {};
    options = options || {};
    options.otherArgs = options.otherArgs || {};
    options.otherArgs.headers = options.otherArgs.headers || {};
    options.otherArgs.headers['x-goog-request-params'] =
      this._gaxModule.routingHeader.fromParams({
        parent: request.parent ?? '',
      });
    const defaultCallSettings = this._defaults['listCertificateTemplates'];
    const callSettings = defaultCallSettings.merge(options);
    this.initialize();
    return this.descriptors.page.listCertificateTemplates.asyncIterate(
      this.innerApiCalls['listCertificateTemplates'] as GaxCall,
      request as {},
      callSettings
    ) as AsyncIterable<protos.google.cloud.security.privateca.v1.ICertificateTemplate>;
  }
  /**
   * Gets the access control policy for a resource. Returns an empty policy
   * if the resource exists and does not have a policy set.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.resource
   *   REQUIRED: The resource for which the policy is being requested.
   *   See the operation documentation for the appropriate value for this field.
   * @param {Object} [request.options]
   *   OPTIONAL: A `GetPolicyOptions` object for specifying options to
   *   `GetIamPolicy`. This field is only used by Cloud IAM.
   *
   *   This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions}
   * @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 [Policy]{@link google.iam.v1.Policy}.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
   *   The promise has a method named "cancel" which cancels the ongoing API call.
   */
  getIamPolicy(
    request: IamProtos.google.iam.v1.GetIamPolicyRequest,
    options?:
      | gax.CallOptions
      | Callback<
          IamProtos.google.iam.v1.Policy,
          IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      IamProtos.google.iam.v1.Policy,
      IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined,
      {} | null | undefined
    >
  ): Promise<IamProtos.google.iam.v1.Policy> {
    return this.iamClient.getIamPolicy(request, options, callback);
  }

  /**
   * Returns permissions that a caller has on the specified resource. If the
   * resource does not exist, this will return an empty set of
   * permissions, not a NOT_FOUND error.
   *
   * Note: This operation is designed to be used for building
   * permission-aware UIs and command-line tools, not for authorization
   * checking. This operation may "fail open" without warning.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.resource
   *   REQUIRED: The resource for which the policy detail is being requested.
   *   See the operation documentation for the appropriate value for this field.
   * @param {string[]} request.permissions
   *   The set of permissions to check for the `resource`. Permissions with
   *   wildcards (such as '*' or 'storage.*') are not allowed. For more
   *   information see
   *   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
   * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
   *   The promise has a method named "cancel" which cancels the ongoing API call.
   */
  setIamPolicy(
    request: IamProtos.google.iam.v1.SetIamPolicyRequest,
    options?:
      | gax.CallOptions
      | Callback<
          IamProtos.google.iam.v1.Policy,
          IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      IamProtos.google.iam.v1.Policy,
      IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined,
      {} | null | undefined
    >
  ): Promise<IamProtos.google.iam.v1.Policy> {
    return this.iamClient.setIamPolicy(request, options, callback);
  }

  /**
   * Returns permissions that a caller has on the specified resource. If the
   * resource does not exist, this will return an empty set of
   * permissions, not a NOT_FOUND error.
   *
   * Note: This operation is designed to be used for building
   * permission-aware UIs and command-line tools, not for authorization
   * checking. This operation may "fail open" without warning.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.resource
   *   REQUIRED: The resource for which the policy detail is being requested.
   *   See the operation documentation for the appropriate value for this field.
   * @param {string[]} request.permissions
   *   The set of permissions to check for the `resource`. Permissions with
   *   wildcards (such as '*' or 'storage.*') are not allowed. For more
   *   information see
   *   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
   * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
   * @returns {Promise} - The promise which resolves to an array.
   *   The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
   *   The promise has a method named "cancel" which cancels the ongoing API call.
   *
   */
  testIamPermissions(
    request: IamProtos.google.iam.v1.TestIamPermissionsRequest,
    options?:
      | gax.CallOptions
      | Callback<
          IamProtos.google.iam.v1.TestIamPermissionsResponse,
          IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      IamProtos.google.iam.v1.TestIamPermissionsResponse,
      IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined,
      {} | null | undefined
    >
  ): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse> {
    return this.iamClient.testIamPermissions(request, options, callback);
  }

  /**
   * Gets information about a location.
   *
   * @param {Object} request
   *   The request object that will be sent.
   * @param {string} request.name
   *   Resource name for the location.
   * @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 [Location]{@link google.cloud.location.Location}.
   *   Please see the
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
   *   for more details and examples.
   * @example
   * ```
   * const [response] = await client.getLocation(request);
   * ```
   */
  getLocation(
    request: LocationProtos.google.cloud.location.IGetLocationRequest,
    options?:
      | gax.CallOptions
      | Callback<
          LocationProtos.google.cloud.location.ILocation,
          | LocationProtos.google.cloud.location.IGetLocationRequest
          | null
          | undefined,
          {} | null | undefined
        >,
    callback?: Callback<
      LocationProtos.google.cloud.location.ILocation,
      | LocationProtos.google.cloud.location.IGetLocationRequest
      | null
      | undefined,
      {} | null | undefined
    >
  ): Promise<LocationProtos.google.cloud.location.ILocation> {
    return this.locationsClient.getLocation(request, options, callback);
  }

  /**
   * Lists information about the supported locations for this service. 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.name
   *   The resource that owns the locations collection, if applicable.
   * @param {string} request.filter
   *   The standard list filter.
   * @param {number} request.pageSize
   *   The standard list page size.
   * @param {string} request.pageToken
   *   The standard list page token.
   * @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 [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
   *   When you iterate the returned iterable, each element will be an object representing
   *   [Location]{@link google.cloud.location.Location}. 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
   *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
   *   for more details and examples.
   * @example
   * ```
   * const iterable = client.listLocationsAsync(request);
   * for await (const response of iterable) {
   *   // process response
   * }
   * ```
   */
  listLocationsAsync(
    request: LocationProtos.google.cloud.location.IListLocationsRequest,
    options?: CallOptions
  ): AsyncIterable<LocationProtos.google.cloud.location.ILocation> {
    return this.locationsClient.listLocationsAsync(request, options);
  }

  // --------------------
  // -- Path templates --
  // --------------------

  /**
   * Return a fully-qualified caPool resource name string.
   *
   * @param {string} project
   * @param {string} location
   * @param {string} ca_pool
   * @returns {string} Resource name string.
   */
  caPoolPath(project: string, location: string, caPool: string) {
    return this.pathTemplates.caPoolPathTemplate.render({
      project: project,
      location: location,
      ca_pool: caPool,
    });
  }

  /**
   * Parse the project from CaPool resource.
   *
   * @param {string} caPoolName
   *   A fully-qualified path representing CaPool resource.
   * @returns {string} A string representing the project.
   */
  matchProjectFromCaPoolName(caPoolName: string) {
    return this.pathTemplates.caPoolPathTemplate.match(caPoolName).project;
  }

  /**
   * Parse the location from CaPool resource.
   *
   * @param {string} caPoolName
   *   A fully-qualified path representing CaPool resource.
   * @returns {string} A string representing the location.
   */
  matchLocationFromCaPoolName(caPoolName: string) {
    return this.pathTemplates.caPoolPathTemplate.match(caPoolName).location;
  }

  /**
   * Parse the ca_pool from CaPool resource.
   *
   * @param {string} caPoolName
   *   A fully-qualified path representing CaPool resource.
   * @returns {string} A string representing the ca_pool.
   */
  matchCaPoolFromCaPoolName(caPoolName: string) {
    return this.pathTemplates.caPoolPathTemplate.match(caPoolName).ca_pool;
  }

  /**
   * Return a fully-qualified certificate resource name string.
   *
   * @param {string} project
   * @param {string} location
   * @param {string} ca_pool
   * @param {string} certificate
   * @returns {string} Resource name string.
   */
  certificatePath(
    project: string,
    location: string,
    caPool: string,
    certificate: string
  ) {
    return this.pathTemplates.certificatePathTemplate.render({
      project: project,
      location: location,
      ca_pool: caPool,
      certificate: certificate,
    });
  }

  /**
   * Parse the project from Certificate resource.
   *
   * @param {string} certificateName
   *   A fully-qualified path representing Certificate resource.
   * @returns {string} A string representing the project.
   */
  matchProjectFromCertificateName(certificateName: string) {
    return this.pathTemplates.certificatePathTemplate.match(certificateName)
      .project;
  }

  /**
   * Parse the location from Certificate resource.
   *
   * @param {string} certificateName
   *   A fully-qualified path representing Certificate resource.
   * @returns {string} A string representing the location.
   */
  matchLocationFromCertificateName(certificateName: string) {
    return this.pathTemplates.certificatePathTemplate.match(certificateName)
      .location;
  }

  /**
   * Parse the ca_pool from Certificate resource.
   *
   * @param {string} certificateName
   *   A fully-qualified path representing Certificate resource.
   * @returns {string} A string representing the ca_pool.
   */
  matchCaPoolFromCertificateName(certificateName: string) {
    return this.pathTemplates.certificatePathTemplate.match(certificateName)
      .ca_pool;
  }

  /**
   * Parse the certificate from Certificate resource.
   *
   * @param {string} certificateName
   *   A fully-qualified path representing Certificate resource.
   * @returns {string} A string representing the certificate.
   */
  matchCertificateFromCertificateName(certificateName: string) {
    return this.pathTemplates.certificatePathTemplate.match(certificateName)
      .certificate;
  }

  /**
   * Return a fully-qualified certificateAuthority resource name string.
   *
   * @param {string} project
   * @param {string} location
   * @param {string} ca_pool
   * @param {string} certificate_authority
   * @returns {string} Resource name string.
   */
  certificateAuthorityPath(
    project: string,
    location: string,
    caPool: string,
    certificateAuthority: string
  ) {
    return this.pathTemplates.certificateAuthorityPathTemplate.render({
      project: project,
      location: location,
      ca_pool: caPool,
      certificate_authority: certificateAuthority,
    });
  }

  /**
   * Parse the project from CertificateAuthority resource.
   *
   * @param {string} certificateAuthorityName
   *   A fully-qualified path representing CertificateAuthority resource.
   * @returns {string} A string representing the project.
   */
  matchProjectFromCertificateAuthorityName(certificateAuthorityName: string) {
    return this.pathTemplates.certificateAuthorityPathTemplate.match(
      certificateAuthorityName
    ).project;
  }

  /**
   * Parse the location from CertificateAuthority resource.
   *
   * @param {string} certificateAuthorityName
   *   A fully-qualified path representing CertificateAuthority resource.
   * @returns {string} A string representing the location.
   */
  matchLocationFromCertificateAuthorityName(certificateAuthorityName: string) {
    return this.pathTemplates.certificateAuthorityPathTemplate.match(
      certificateAuthorityName
    ).location;
  }

  /**
   * Parse the ca_pool from CertificateAuthority resource.
   *
   * @param {string} certificateAuthorityName
   *   A fully-qualified path representing CertificateAuthority resource.
   * @returns {string} A string representing the ca_pool.
   */
  matchCaPoolFromCertificateAuthorityName(certificateAuthorityName: string) {
    return this.pathTemplates.certificateAuthorityPathTemplate.match(
      certificateAuthorityName
    ).ca_pool;
  }

  /**
   * Parse the certificate_authority from CertificateAuthority resource.
   *
   * @param {string} certificateAuthorityName
   *   A fully-qualified path representing CertificateAuthority resource.
   * @returns {string} A string representing the certificate_authority.
   */
  matchCertificateAuthorityFromCertificateAuthorityName(
    certificateAuthorityName: string
  ) {
    return this.pathTemplates.certificateAuthorityPathTemplate.match(
      certificateAuthorityName
    ).certificate_authority;
  }

  /**
   * Return a fully-qualified certificateRevocationList resource name string.
   *
   * @param {string} project
   * @param {string} location
   * @param {string} ca_pool
   * @param {string} certificate_authority
   * @param {string} certificate_revocation_list
   * @returns {string} Resource name string.
   */
  certificateRevocationListPath(
    project: string,
    location: string,
    caPool: string,
    certificateAuthority: string,
    certificateRevocationList: string
  ) {
    return this.pathTemplates.certificateRevocationListPathTemplate.render({
      project: project,
      location: location,
      ca_pool: caPool,
      certificate_authority: certificateAuthority,
      certificate_revocation_list: certificateRevocationList,
    });
  }

  /**
   * Parse the project from CertificateRevocationList resource.
   *
   * @param {string} certificateRevocationListName
   *   A fully-qualified path representing CertificateRevocationList resource.
   * @returns {string} A string representing the project.
   */
  matchProjectFromCertificateRevocationListName(
    certificateRevocationListName: string
  ) {
    return this.pathTemplates.certificateRevocationListPathTemplate.match(
      certificateRevocationListName
    ).project;
  }

  /**
   * Parse the location from CertificateRevocationList resource.
   *
   * @param {string} certificateRevocationListName
   *   A fully-qualified path representing CertificateRevocationList resource.
   * @returns {string} A string representing the location.
   */
  matchLocationFromCertificateRevocationListName(
    certificateRevocationListName: string
  ) {
    return this.pathTemplates.certificateRevocationListPathTemplate.match(
      certificateRevocationListName
    ).location;
  }

  /**
   * Parse the ca_pool from CertificateRevocationList resource.
   *
   * @param {string} certificateRevocationListName
   *   A fully-qualified path representing CertificateRevocationList resource.
   * @returns {string} A string representing the ca_pool.
   */
  matchCaPoolFromCertificateRevocationListName(
    certificateRevocationListName: string
  ) {
    return this.pathTemplates.certificateRevocationListPathTemplate.match(
      certificateRevocationListName
    ).ca_pool;
  }

  /**
   * Parse the certificate_authority from CertificateRevocationList resource.
   *
   * @param {string} certificateRevocationListName
   *   A fully-qualified path representing CertificateRevocationList resource.
   * @returns {string} A string representing the certificate_authority.
   */
  matchCertificateAuthorityFromCertificateRevocationListName(
    certificateRevocationListName: string
  ) {
    return this.pathTemplates.certificateRevocationListPathTemplate.match(
      certificateRevocationListName
    ).certificate_authority;
  }

  /**
   * Parse the certificate_revocation_list from CertificateRevocationList resource.
   *
   * @param {string} certificateRevocationListName
   *   A fully-qualified path representing CertificateRevocationList resource.
   * @returns {string} A string representing the certificate_revocation_list.
   */
  matchCertificateRevocationListFromCertificateRevocationListName(
    certificateRevocationListName: string
  ) {
    return this.pathTemplates.certificateRevocationListPathTemplate.match(
      certificateRevocationListName
    ).certificate_revocation_list;
  }

  /**
   * Return a fully-qualified certificateTemplate resource name string.
   *
   * @param {string} project
   * @param {string} location
   * @param {string} certificate_template
   * @returns {string} Resource name string.
   */
  certificateTemplatePath(
    project: string,
    location: string,
    certificateTemplate: string
  ) {
    return this.pathTemplates.certificateTemplatePathTemplate.render({
      project: project,
      location: location,
      certificate_template: certificateTemplate,
    });
  }

  /**
   * Parse the project from CertificateTemplate resource.
   *
   * @param {string} certificateTemplateName
   *   A fully-qualified path representing CertificateTemplate resource.
   * @returns {string} A string representing the project.
   */
  matchProjectFromCertificateTemplateName(certificateTemplateName: string) {
    return this.pathTemplates.certificateTemplatePathTemplate.match(
      certificateTemplateName
    ).project;
  }

  /**
   * Parse the location from CertificateTemplate resource.
   *
   * @param {string} certificateTemplateName
   *   A fully-qualified path representing CertificateTemplate resource.
   * @returns {string} A string representing the location.
   */
  matchLocationFromCertificateTemplateName(certificateTemplateName: string) {
    return this.pathTemplates.certificateTemplatePathTemplate.match(
      certificateTemplateName
    ).location;
  }

  /**
   * Parse the certificate_template from CertificateTemplate resource.
   *
   * @param {string} certificateTemplateName
   *   A fully-qualified path representing CertificateTemplate resource.
   * @returns {string} A string representing the certificate_template.
   */
  matchCertificateTemplateFromCertificateTemplateName(
    certificateTemplateName: string
  ) {
    return this.pathTemplates.certificateTemplatePathTemplate.match(
      certificateTemplateName
    ).certificate_template;
  }

  /**
   * Return a fully-qualified location resource name string.
   *
   * @param {string} project
   * @param {string} location
   * @returns {string} Resource name string.
   */
  locationPath(project: string, location: string) {
    return this.pathTemplates.locationPathTemplate.render({
      project: project,
      location: location,
    });
  }

  /**
   * Parse the project from Location resource.
   *
   * @param {string} locationName
   *   A fully-qualified path representing Location resource.
   * @returns {string} A string representing the project.
   */
  matchProjectFromLocationName(locationName: string) {
    return this.pathTemplates.locationPathTemplate.match(locationName).project;
  }

  /**
   * Parse the location from Location resource.
   *
   * @param {string} locationName
   *   A fully-qualified path representing Location resource.
   * @returns {string} A string representing the location.
   */
  matchLocationFromLocationName(locationName: string) {
    return this.pathTemplates.locationPathTemplate.match(locationName).location;
  }

  /**
   * Terminate the gRPC channel and close the client.
   *
   * The client will no longer be usable and all future behavior is undefined.
   * @returns {Promise} A promise that resolves when the client is closed.
   */
  close(): Promise<void> {
    if (this.certificateAuthorityServiceStub && !this._terminated) {
      return this.certificateAuthorityServiceStub.then(stub => {
        this._terminated = true;
        stub.close();
        this.iamClient.close();
        this.locationsClient.close();
        this.operationsClient.close();
      });
    }
    return Promise.resolve();
  }
}