Class v1.RegistrationServiceClient (4.0.6)

Service Directory API for registering services. It defines the following resource model:

  • The API has a collection of resources, named projects/* /locations/* /namespaces/*.

  • Each Namespace has a collection of resources, named projects/* /locations/* /namespaces/* /services/*.

  • Each Service has a collection of resources, named projects/* /locations/* /namespaces/* /services/* /endpoints/*. v1

Package

@google-cloud/service-directory

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of RegistrationServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.fallback

: 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 RegistrationServiceClient({fallback: 'rest'}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

registrationServiceStub

registrationServiceStub?: Promise<{
        [name: string]: Function;
    }>;

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createEndpoint(request, options)

createEndpoint(request?: protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IEndpoint,
        (protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest | undefined),
        {} | undefined
    ]>;

Creates a endpoint, and returns the new Endpoint.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IEndpoint, (protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the service that this endpoint provides.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Resource ID must be 1-63 characters long, and comply with
   *  RFC1035.
   *  Specifically, the name must be 1-63 characters long and match the regular
   *  expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
   *  character must be a lowercase letter, and all following characters must
   *  be a dash, lowercase letter, or digit, except the last character, which
   *  cannot be a dash.
   */
  // const endpointId = 'abc123'
  /**
   *  Required. A endpoint with initial fields set.
   */
  // const endpoint = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callCreateEndpoint() {
    // Construct request
    const request = {
      parent,
      endpointId,
      endpoint,
    };

    // Run request
    const response = await servicedirectoryClient.createEndpoint(request);
    console.log(response);
  }

  callCreateEndpoint();

createEndpoint(request, options, callback)

createEndpoint(request: protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createEndpoint(request, callback)

createEndpoint(request: protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.ICreateEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createNamespace(request, options)

createNamespace(request?: protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.INamespace,
        (protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest | undefined),
        {} | undefined
    ]>;

Creates a namespace, and returns the new Namespace.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.INamespace, (protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the project and location the namespace
   *  will be created in.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Resource ID must be 1-63 characters long, and comply with
   *  RFC1035.
   *  Specifically, the name must be 1-63 characters long and match the regular
   *  expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
   *  character must be a lowercase letter, and all following characters must
   *  be a dash, lowercase letter, or digit, except the last character, which
   *  cannot be a dash.
   */
  // const namespaceId = 'abc123'
  /**
   *  Required. A namespace with initial fields set.
   */
  // const namespace = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callCreateNamespace() {
    // Construct request
    const request = {
      parent,
      namespaceId,
      namespace,
    };

    // Run request
    const response = await servicedirectoryClient.createNamespace(request);
    console.log(response);
  }

  callCreateNamespace();

createNamespace(request, options, callback)

createNamespace(request: protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createNamespace(request, callback)

createNamespace(request: protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.ICreateNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createService(request, options)

createService(request?: protos.google.cloud.servicedirectory.v1.ICreateServiceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IService,
        protos.google.cloud.servicedirectory.v1.ICreateServiceRequest | undefined,
        {} | undefined
    ]>;

Creates a service, and returns the new Service.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.ICreateServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the namespace this service will belong to.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Resource ID must be 1-63 characters long, and comply with
   *  RFC1035.
   *  Specifically, the name must be 1-63 characters long and match the regular
   *  expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first
   *  character must be a lowercase letter, and all following characters must
   *  be a dash, lowercase letter, or digit, except the last character, which
   *  cannot be a dash.
   */
  // const serviceId = 'abc123'
  /**
   *  Required. A service  with initial fields set.
   */
  // const service = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callCreateService() {
    // Construct request
    const request = {
      parent,
      serviceId,
      service,
    };

    // Run request
    const response = await servicedirectoryClient.createService(request);
    console.log(response);
  }

  callCreateService();

createService(request, options, callback)

createService(request: protos.google.cloud.servicedirectory.v1.ICreateServiceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.ICreateServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateServiceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.ICreateServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createService(request, callback)

createService(request: protos.google.cloud.servicedirectory.v1.ICreateServiceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.ICreateServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.ICreateServiceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.ICreateServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteEndpoint(request, options)

deleteEndpoint(request?: protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest | undefined),
        {} | undefined
    ]>;

Deletes a endpoint.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the endpoint to delete.
   */
  // const name = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callDeleteEndpoint() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await servicedirectoryClient.deleteEndpoint(request);
    console.log(response);
  }

  callDeleteEndpoint();

deleteEndpoint(request, options, callback)

deleteEndpoint(request: protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteEndpoint(request, callback)

deleteEndpoint(request: protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteNamespace(request, options)

deleteNamespace(request?: protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest | undefined),
        {} | undefined
    ]>;

Deletes a namespace. This also deletes all services and endpoints in the namespace.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the namespace to delete.
   */
  // const name = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callDeleteNamespace() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await servicedirectoryClient.deleteNamespace(request);
    console.log(response);
  }

  callDeleteNamespace();

deleteNamespace(request, options, callback)

deleteNamespace(request: protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteNamespace(request, callback)

deleteNamespace(request: protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteService(request, options)

deleteService(request?: protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest | undefined,
        {} | undefined
    ]>;

Deletes a service. This also deletes all endpoints associated with the service.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the service to delete.
   */
  // const name = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callDeleteService() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await servicedirectoryClient.deleteService(request);
    console.log(response);
  }

  callDeleteService();

deleteService(request, options, callback)

deleteService(request: protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteService(request, callback)

deleteService(request: protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.servicedirectory.v1.IDeleteServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

endpointPath(project, location, namespace, service, endpoint)

endpointPath(project: string, location: string, namespace: string, service: string, endpoint: string): string;

Return a fully-qualified endpoint resource name string.

Parameters
NameDescription
project string
location string
namespace string
service string
endpoint string
Returns
TypeDescription
string

{string} Resource name string.

getEndpoint(request, options)

getEndpoint(request?: protos.google.cloud.servicedirectory.v1.IGetEndpointRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IEndpoint,
        protos.google.cloud.servicedirectory.v1.IGetEndpointRequest | undefined,
        {} | undefined
    ]>;

Gets a endpoint.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetEndpointRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IGetEndpointRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the endpoint to get.
   */
  // const name = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callGetEndpoint() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await servicedirectoryClient.getEndpoint(request);
    console.log(response);
  }

  callGetEndpoint();

getEndpoint(request, options, callback)

getEndpoint(request: protos.google.cloud.servicedirectory.v1.IGetEndpointRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IGetEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetEndpointRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IGetEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getEndpoint(request, callback)

getEndpoint(request: protos.google.cloud.servicedirectory.v1.IGetEndpointRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IGetEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetEndpointRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IGetEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options)

getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.IGetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Gets the IAM Policy for a resource (namespace or service only).

Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  OPTIONAL: A `GetPolicyOptions` object for specifying options to
   *  `GetIamPolicy`.
   */
  // const options = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callGetIamPolicy() {
    // Construct request
    const request = {
      resource,
    };

    // Run request
    const response = await servicedirectoryClient.getIamPolicy(request);
    console.log(response);
  }

  callGetIamPolicy();

getIamPolicy(request, options, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getNamespace(request, options)

getNamespace(request?: protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.INamespace,
        protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest | undefined,
        {} | undefined
    ]>;

Gets a namespace.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the namespace to retrieve.
   */
  // const name = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callGetNamespace() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await servicedirectoryClient.getNamespace(request);
    console.log(response);
  }

  callGetNamespace();

getNamespace(request, options, callback)

getNamespace(request: protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getNamespace(request, callback)

getNamespace(request: protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IGetNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

getService(request, options)

getService(request?: protos.google.cloud.servicedirectory.v1.IGetServiceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IService,
        protos.google.cloud.servicedirectory.v1.IGetServiceRequest | undefined,
        {} | undefined
    ]>;

Gets a service.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IGetServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the service to get.
   */
  // const name = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callGetService() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await servicedirectoryClient.getService(request);
    console.log(response);
  }

  callGetService();

getService(request, options, callback)

getService(request: protos.google.cloud.servicedirectory.v1.IGetServiceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IGetServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetServiceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getService(request, callback)

getService(request: protos.google.cloud.servicedirectory.v1.IGetServiceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IGetServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IGetServiceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IGetServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

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
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listEndpoints(request, options)

listEndpoints(request?: protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IEndpoint[],
        protos.google.cloud.servicedirectory.v1.IListEndpointsRequest | null,
        protos.google.cloud.servicedirectory.v1.IListEndpointsResponse
    ]>;

Lists all endpoints.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListEndpointsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IEndpoint[], protos.google.cloud.servicedirectory.v1.IListEndpointsRequest | null, protos.google.cloud.servicedirectory.v1.IListEndpointsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listEndpointsAsync() 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.

listEndpoints(request, options, callback)

listEndpoints(request: protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, protos.google.cloud.servicedirectory.v1.IListEndpointsResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IEndpoint>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListEndpointsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, protos.google.cloud.servicedirectory.v1.IListEndpointsResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IEndpoint>
Returns
TypeDescription
void

listEndpoints(request, callback)

listEndpoints(request: protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, callback: PaginationCallback<protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, protos.google.cloud.servicedirectory.v1.IListEndpointsResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IEndpoint>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListEndpointsRequest
callback PaginationCallback<protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, protos.google.cloud.servicedirectory.v1.IListEndpointsResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IEndpoint>
Returns
TypeDescription
void

listEndpointsAsync(request, options)

listEndpointsAsync(request?: protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.servicedirectory.v1.IEndpoint>;

Equivalent to listEndpoints, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListEndpointsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.servicedirectory.v1.IEndpoint>

{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 . 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

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the service whose endpoints we'd like to
   *  list.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. The next_page_token value returned from a previous List request,
   *  if any.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The filter to list result by.
   *  General filter string syntax:
   *  

listEndpointsStream(request, options)

listEndpointsStream(request?: protos.google.cloud.servicedirectory.v1.IListEndpointsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListEndpointsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing 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 listEndpointsAsync() 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.

listNamespaces(request, options)

listNamespaces(request?: protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.INamespace[],
        protos.google.cloud.servicedirectory.v1.IListNamespacesRequest | null,
        protos.google.cloud.servicedirectory.v1.IListNamespacesResponse
    ]>;

Lists all namespaces.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListNamespacesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.INamespace[], protos.google.cloud.servicedirectory.v1.IListNamespacesRequest | null, protos.google.cloud.servicedirectory.v1.IListNamespacesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listNamespacesAsync() 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.

listNamespaces(request, options, callback)

listNamespaces(request: protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, protos.google.cloud.servicedirectory.v1.IListNamespacesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.INamespace>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListNamespacesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, protos.google.cloud.servicedirectory.v1.IListNamespacesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.INamespace>
Returns
TypeDescription
void

listNamespaces(request, callback)

listNamespaces(request: protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, callback: PaginationCallback<protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, protos.google.cloud.servicedirectory.v1.IListNamespacesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.INamespace>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListNamespacesRequest
callback PaginationCallback<protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, protos.google.cloud.servicedirectory.v1.IListNamespacesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.INamespace>
Returns
TypeDescription
void

listNamespacesAsync(request, options)

listNamespacesAsync(request?: protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.servicedirectory.v1.INamespace>;

Equivalent to listNamespaces, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListNamespacesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.servicedirectory.v1.INamespace>

{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 . 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

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the project and location whose namespaces
   *  we'd like to list.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. The next_page_token value returned from a previous List request,
   *  if any.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The filter to list result by.
   *  General filter string syntax:
   *  

listNamespacesStream(request, options)

listNamespacesStream(request?: protos.google.cloud.servicedirectory.v1.IListNamespacesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListNamespacesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing 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 listNamespacesAsync() 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.

listServices(request, options)

listServices(request?: protos.google.cloud.servicedirectory.v1.IListServicesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IService[],
        protos.google.cloud.servicedirectory.v1.IListServicesRequest | null,
        protos.google.cloud.servicedirectory.v1.IListServicesResponse
    ]>;

Lists all services belonging to a namespace.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IService[], protos.google.cloud.servicedirectory.v1.IListServicesRequest | null, protos.google.cloud.servicedirectory.v1.IListServicesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listServicesAsync() 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.

listServices(request, options, callback)

listServices(request: protos.google.cloud.servicedirectory.v1.IListServicesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.servicedirectory.v1.IListServicesRequest, protos.google.cloud.servicedirectory.v1.IListServicesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IService>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListServicesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.servicedirectory.v1.IListServicesRequest, protos.google.cloud.servicedirectory.v1.IListServicesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IService>
Returns
TypeDescription
void

listServices(request, callback)

listServices(request: protos.google.cloud.servicedirectory.v1.IListServicesRequest, callback: PaginationCallback<protos.google.cloud.servicedirectory.v1.IListServicesRequest, protos.google.cloud.servicedirectory.v1.IListServicesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IService>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListServicesRequest
callback PaginationCallback<protos.google.cloud.servicedirectory.v1.IListServicesRequest, protos.google.cloud.servicedirectory.v1.IListServicesResponse | null | undefined, protos.google.cloud.servicedirectory.v1.IService>
Returns
TypeDescription
void

listServicesAsync(request, options)

listServicesAsync(request?: protos.google.cloud.servicedirectory.v1.IListServicesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.servicedirectory.v1.IService>;

Equivalent to listServices, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.servicedirectory.v1.IService>

{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 . 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

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the namespace whose services we'd
   *  like to list.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. The next_page_token value returned from a previous List request,
   *  if any.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The filter to list result by.
   *  General filter string syntax:
   *  

listServicesStream(request, options)

listServicesStream(request?: protos.google.cloud.servicedirectory.v1.IListServicesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IListServicesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing 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 listServicesAsync() 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.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchEndpointFromEndpointName(endpointName)

matchEndpointFromEndpointName(endpointName: string): string | number;

Parse the endpoint from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the endpoint.

matchLocationFromEndpointName(endpointName)

matchLocationFromEndpointName(endpointName: string): string | number;

Parse the location from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromNamespaceName(namespaceName)

matchLocationFromNamespaceName(namespaceName: string): string | number;

Parse the location from Namespace resource.

Parameter
NameDescription
namespaceName string

A fully-qualified path representing Namespace resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromServiceName(serviceName)

matchLocationFromServiceName(serviceName: string): string | number;

Parse the location from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchNamespaceFromEndpointName(endpointName)

matchNamespaceFromEndpointName(endpointName: string): string | number;

Parse the namespace from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchNamespaceFromNamespaceName(namespaceName)

matchNamespaceFromNamespaceName(namespaceName: string): string | number;

Parse the namespace from Namespace resource.

Parameter
NameDescription
namespaceName string

A fully-qualified path representing Namespace resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchNamespaceFromServiceName(serviceName)

matchNamespaceFromServiceName(serviceName: string): string | number;

Parse the namespace from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchProjectFromEndpointName(endpointName)

matchProjectFromEndpointName(endpointName: string): string | number;

Parse the project from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromNamespaceName(namespaceName)

matchProjectFromNamespaceName(namespaceName: string): string | number;

Parse the project from Namespace resource.

Parameter
NameDescription
namespaceName string

A fully-qualified path representing Namespace resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromServiceName(serviceName)

matchProjectFromServiceName(serviceName: string): string | number;

Parse the project from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchServiceFromEndpointName(endpointName)

matchServiceFromEndpointName(endpointName: string): string | number;

Parse the service from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchServiceFromServiceName(serviceName)

matchServiceFromServiceName(serviceName: string): string | number;

Parse the service from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

namespacePath(project, location, namespace)

namespacePath(project: string, location: string, namespace: string): string;

Return a fully-qualified namespace resource name string.

Parameters
NameDescription
project string
location string
namespace string
Returns
TypeDescription
string

{string} Resource name string.

servicePath(project, location, namespace, service)

servicePath(project: string, location: string, namespace: string, service: string): string;

Return a fully-qualified service resource name string.

Parameters
NameDescription
project string
location string
namespace string
service string
Returns
TypeDescription
string

{string} Resource name string.

setIamPolicy(request, options)

setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.ISetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Sets the IAM Policy for a resource (namespace or service only).

Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy is being specified.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  REQUIRED: The complete policy to be applied to the `resource`. The size of
   *  the policy is limited to a few 10s of KB. An empty policy is a
   *  valid policy but certain Cloud Platform services (such as Projects)
   *  might reject them.
   */
  // const policy = {}
  /**
   *  OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
   *  the fields in the mask will be modified. If no mask is provided, the
   *  following default mask is used:
   *  `paths: "bindings, etag"`
   */
  // const updateMask = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callSetIamPolicy() {
    // Construct request
    const request = {
      resource,
      policy,
    };

    // Run request
    const response = await servicedirectoryClient.setIamPolicy(request);
    console.log(response);
  }

  callSetIamPolicy();

setIamPolicy(request, options, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options)

testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.ITestIamPermissionsResponse,
        protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
        {} | undefined
    ]>;

Tests IAM permissions for a resource (namespace or service only).

Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource for which the policy detail is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  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).
   */
  // const permissions = 'abc123'

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callTestIamPermissions() {
    // Construct request
    const request = {
      resource,
      permissions,
    };

    // Run request
    const response = await servicedirectoryClient.testIamPermissions(request);
    console.log(response);
  }

  callTestIamPermissions();

testIamPermissions(request, options, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
options CallOptions
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateEndpoint(request, options)

updateEndpoint(request?: protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IEndpoint,
        (protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest | undefined),
        {} | undefined
    ]>;

Updates a endpoint.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IEndpoint, (protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The updated endpoint.
   */
  // const endpoint = {}
  /**
   *  Required. List of fields to be updated in this request.
   */
  // const updateMask = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callUpdateEndpoint() {
    // Construct request
    const request = {
      endpoint,
      updateMask,
    };

    // Run request
    const response = await servicedirectoryClient.updateEndpoint(request);
    console.log(response);
  }

  callUpdateEndpoint();

updateEndpoint(request, options, callback)

updateEndpoint(request: protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateEndpoint(request, callback)

updateEndpoint(request: protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IEndpoint, protos.google.cloud.servicedirectory.v1.IUpdateEndpointRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateNamespace(request, options)

updateNamespace(request?: protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.INamespace,
        (protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest | undefined),
        {} | undefined
    ]>;

Updates a namespace.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.INamespace, (protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The updated namespace.
   */
  // const namespace = {}
  /**
   *  Required. List of fields to be updated in this request.
   */
  // const updateMask = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callUpdateNamespace() {
    // Construct request
    const request = {
      namespace,
      updateMask,
    };

    // Run request
    const response = await servicedirectoryClient.updateNamespace(request);
    console.log(response);
  }

  callUpdateNamespace();

updateNamespace(request, options, callback)

updateNamespace(request: protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateNamespace(request, callback)

updateNamespace(request: protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.INamespace, protos.google.cloud.servicedirectory.v1.IUpdateNamespaceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateService(request, options)

updateService(request?: protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest, options?: CallOptions): Promise<[
        protos.google.cloud.servicedirectory.v1.IService,
        protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest | undefined,
        {} | undefined
    ]>;

Updates a service.

Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The updated service.
   */
  // const service = {}
  /**
   *  Required. List of fields to be updated in this request.
   */
  // const updateMask = {}

  // Imports the Servicedirectory library
  const {RegistrationServiceClient} = require('@google-cloud/service-directory').v1;

  // Instantiates a client
  const servicedirectoryClient = new RegistrationServiceClient();

  async function callUpdateService() {
    // Construct request
    const request = {
      service,
      updateMask,
    };

    // Run request
    const response = await servicedirectoryClient.updateService(request);
    console.log(response);
  }

  callUpdateService();

updateService(request, options, callback)

updateService(request: protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateService(request, callback)

updateService(request: protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IService, protos.google.cloud.servicedirectory.v1.IUpdateServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void