Class v1.CloudChannelServiceClient

CloudChannelService lets Google cloud resellers and distributors manage their customers, channel partners, entitlements, and reports.

Using this service: 1. Resellers and distributors can manage a customer entity. 2. Distributors can register an authorized reseller in their channel and provide them with delegated admin access. 3. Resellers and distributors can manage customer entitlements.

CloudChannelService exposes the following resources: - s: An entity—usually an enterprise—managed by a reseller or distributor.

  • s: An entity that provides a customer with the means to use a service. Entitlements are created or updated as a result of a successful fulfillment.

  • s: An entity that identifies links between distributors and their indirect resellers in a channel. v1

Package

@google-cloud/channel

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of CloudChannelServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

cloudChannelServiceStub

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

descriptors

descriptors: Descriptors;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

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

activateEntitlement(request, options)

activateEntitlement(request?: protos.google.cloud.channel.v1.IActivateEntitlementRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Activates a previously suspended entitlement. Entitlements suspended for pending ToS acceptance can't be activated using this method.

An entitlement activation is a long-running operation and it updates the state of the customer entitlement.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * SUSPENSION_NOT_RESELLER_INITIATED: Can only activate reseller-initiated suspensions and entitlements that have accepted the TOS. * NOT_SUSPENDED: Can only activate suspended entitlements not in an ACTIVE state. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IActivateEntitlementRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to activate.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.activateEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callActivateEntitlement();

activateEntitlement(request, options, callback)

activateEntitlement(request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IActivateEntitlementRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

activateEntitlement(request, callback)

activateEntitlement(request: protos.google.cloud.channel.v1.IActivateEntitlementRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IActivateEntitlementRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelEntitlement(request, options)

cancelEntitlement(request?: protos.google.cloud.channel.v1.ICancelEntitlementRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Cancels a previously fulfilled entitlement.

An entitlement cancellation is a long-running operation.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * FAILED_PRECONDITION: There are Google Cloud projects linked to the Google Cloud entitlement's Cloud Billing subaccount. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * DELETION_TYPE_NOT_ALLOWED: Cancel is only allowed for Google Workspace add-ons, or entitlements for Google Cloud's development platform. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The response will contain google.protobuf.Empty on success. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.ICancelEntitlementRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to cancel.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.cancelEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCancelEntitlement();

cancelEntitlement(request, options, callback)

cancelEntitlement(request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICancelEntitlementRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelEntitlement(request, callback)

cancelEntitlement(request: protos.google.cloud.channel.v1.ICancelEntitlementRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICancelEntitlementRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

changeOffer(request, options)

changeOffer(request?: protos.google.cloud.channel.v1.IChangeOfferRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the Offer for an existing customer entitlement.

An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Offer or Entitlement resource not found. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeOfferRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to update.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Required. New Offer.
   *  Format: accounts/{account_id}/offers/{offer_id}.
   */
  // const offer = 'abc123'
  /**
   *  Optional. Parameters needed to purchase the Offer. To view the available Parameters
   *  refer to the Offer.parameter_definitions google.cloud.channel.v1.Offer.parameter_definitions  from the desired offer.
   */
  // const parameters = 1234
  /**
   *  Optional. Purchase order id provided by the reseller.
   */
  // const purchaseOrderId = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.changeOffer(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callChangeOffer();

changeOffer(request, options, callback)

changeOffer(request: protos.google.cloud.channel.v1.IChangeOfferRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeOfferRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

changeOffer(request, callback)

changeOffer(request: protos.google.cloud.channel.v1.IChangeOfferRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeOfferRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

changeParameters(request, options)

changeParameters(request?: protos.google.cloud.channel.v1.IChangeParametersRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Change parameters of the entitlement.

An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. For example, the number of seats being changed is greater than the allowed number of max seats, or decreasing seats for a commitment based plan. * NOT_FOUND: Entitlement resource not found. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeParametersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the entitlement to update.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Required. Entitlement parameters to update. You can only change editable parameters.
   *  To view the available Parameters for a request, refer to the
   *  Offer.parameter_definitions google.cloud.channel.v1.Offer.parameter_definitions  from the desired offer.
   */
  // const parameters = 1234
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. Purchase order ID provided by the reseller.
   */
  // const purchaseOrderId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.changeParameters(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callChangeParameters();

changeParameters(request, options, callback)

changeParameters(request: protos.google.cloud.channel.v1.IChangeParametersRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeParametersRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

changeParameters(request, callback)

changeParameters(request: protos.google.cloud.channel.v1.IChangeParametersRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeParametersRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

changeRenewalSettings(request, options)

changeRenewalSettings(request?: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the renewal settings for an existing customer entitlement.

An entitlement update is a long-running operation and it updates the entitlement as a result of fulfillment.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * NOT_COMMITMENT_PLAN: Renewal Settings are only applicable for a commitment plan. Can't enable or disable renewals for non-commitment plans. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the entitlement to update.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Required. New renewal settings.
   */
  // const renewalSettings = {}
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.changeRenewalSettings(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callChangeRenewalSettings();

changeRenewalSettings(request, options, callback)

changeRenewalSettings(request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

changeRenewalSettings(request, callback)

changeRenewalSettings(request: protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IChangeRenewalSettingsRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

channelPartnerLinkPath(account, channelPartnerLink)

channelPartnerLinkPath(account: string, channelPartnerLink: string): string;

Return a fully-qualified channelPartnerLink resource name string.

Parameters
NameDescription
account string
channelPartnerLink string
Returns
TypeDescription
string

{string} Resource name string.

checkActivateEntitlementProgress(name)

checkActivateEntitlementProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by activateEntitlement().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to activate.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.activateEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callActivateEntitlement();

checkCancelEntitlementProgress(name)

checkCancelEntitlementProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by cancelEntitlement().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to cancel.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.cancelEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCancelEntitlement();

checkChangeOfferProgress(name)

checkChangeOfferProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by changeOffer().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to update.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Required. New Offer.
   *  Format: accounts/{account_id}/offers/{offer_id}.
   */
  // const offer = 'abc123'
  /**
   *  Optional. Parameters needed to purchase the Offer. To view the available Parameters
   *  refer to the Offer.parameter_definitions google.cloud.channel.v1.Offer.parameter_definitions  from the desired offer.
   */
  // const parameters = 1234
  /**
   *  Optional. Purchase order id provided by the reseller.
   */
  // const purchaseOrderId = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.changeOffer(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callChangeOffer();

checkChangeParametersProgress(name)

checkChangeParametersProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by changeParameters().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the entitlement to update.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Required. Entitlement parameters to update. You can only change editable parameters.
   *  To view the available Parameters for a request, refer to the
   *  Offer.parameter_definitions google.cloud.channel.v1.Offer.parameter_definitions  from the desired offer.
   */
  // const parameters = 1234
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'
  /**
   *  Optional. Purchase order ID provided by the reseller.
   */
  // const purchaseOrderId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.changeParameters(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callChangeParameters();

checkChangeRenewalSettingsProgress(name)

checkChangeRenewalSettingsProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by changeRenewalSettings().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the entitlement to update.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Required. New renewal settings.
   */
  // const renewalSettings = {}
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.changeRenewalSettings(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callChangeRenewalSettings();

checkCloudIdentityAccountsExist(request, options)

checkCloudIdentityAccountsExist(request?: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse,
        (protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest | undefined),
        {} | undefined
    ]>;

Confirms the existence of Cloud Identity accounts based on the domain and if the Cloud Identity accounts are owned by the reseller.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INVALID_VALUE: Invalid domain value in the request.

Return value: A list of resources for the domain (may be empty)

Note: in the v1alpha1 version of the API, a NOT_FOUND error returns if no resources match the domain.

Parameters
NameDescription
request protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, (protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest | undefined), {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The reseller account's resource name.
   *  Parent uses the format: accounts/{account_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. Domain to fetch for Cloud Identity account customer.
   */
  // const domain = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callCheckCloudIdentityAccountsExist() {
    // Construct request
    const request = {
      parent,
      domain,
    };

    // Run request
    const response = await channelClient.checkCloudIdentityAccountsExist(request);
    console.log(response);
  }

  callCheckCloudIdentityAccountsExist();

checkCloudIdentityAccountsExist(request, options, callback)

checkCloudIdentityAccountsExist(request: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

checkCloudIdentityAccountsExist(request, callback)

checkCloudIdentityAccountsExist(request: protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest, callback: Callback<protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest
callback Callback<protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

checkCreateEntitlementProgress(name)

checkCreateEntitlementProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by createEntitlement().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account in which to create the
   *  entitlement.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The entitlement to create.
   */
  // const entitlement = {}
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callCreateEntitlement() {
    // Construct request
    const request = {
      parent,
      entitlement,
    };

    // Run request
    const [operation] = await channelClient.createEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateEntitlement();

checkProvisionCloudIdentityProgress(name)

checkProvisionCloudIdentityProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Customer, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by provisionCloudIdentity().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Customer, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the customer.
   *  Format: accounts/{account_id}/customers/{customer_id}
   */
  // const customer = 'abc123'
  /**
   *  CloudIdentity-specific customer information.
   */
  // const cloudIdentityInfo = {}
  /**
   *  Admin user information.
   */
  // const user = {}
  /**
   *  Validate the request and preview the review, but do not post it.
   */
  // const validateOnly = true

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callProvisionCloudIdentity() {
    // Construct request
    const request = {
      customer,
    };

    // Run request
    const [operation] = await channelClient.provisionCloudIdentity(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callProvisionCloudIdentity();

checkStartPaidServiceProgress(name)

checkStartPaidServiceProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by startPaidService().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the entitlement to start a paid service for.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.startPaidService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callStartPaidService();

checkSuspendEntitlementProgress(name)

checkSuspendEntitlementProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by suspendEntitlement().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.Entitlement, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to suspend.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.suspendEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callSuspendEntitlement();

checkTransferEntitlementsProgress(name)

checkTransferEntitlementsProgress(name: string): Promise<LROperation<protos.google.cloud.channel.v1.TransferEntitlementsResponse, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by transferEntitlements().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.channel.v1.TransferEntitlementsResponse, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account that will receive
   *  transferred entitlements.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The new entitlements to create or transfer.
   */
  // const entitlements = 1234
  /**
   *  The super admin of the resold customer generates this token to
   *  authorize a reseller to access their Cloud Identity and purchase
   *  entitlements on their behalf. You can omit this token after authorization.
   *  See https://support.google.com/a/answer/7643790 for more details.
   */
  // const authToken = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callTransferEntitlements() {
    // Construct request
    const request = {
      parent,
      entitlements,
    };

    // Run request
    const [operation] = await channelClient.transferEntitlements(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTransferEntitlements();

checkTransferEntitlementsToGoogleProgress(name)

checkTransferEntitlementsToGoogleProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.channel.v1.OperationMetadata>>;

Check the status of the long running operation returned by transferEntitlementsToGoogle().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.channel.v1.OperationMetadata>>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account where the entitlements
   *  transfer from.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The entitlements to transfer to Google.
   */
  // const entitlements = 1234
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callTransferEntitlementsToGoogle() {
    // Construct request
    const request = {
      parent,
      entitlements,
    };

    // Run request
    const [operation] = await channelClient.transferEntitlementsToGoogle(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTransferEntitlementsToGoogle();

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.

createChannelPartnerLink(request?: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IChannelPartnerLink,
        (protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest | undefined),
        {} | undefined
    ]>;

Initiates a channel partner link between a distributor and a reseller, or between resellers in an n-tier reseller channel. Invited partners need to follow the invite_link_uri provided in the response to accept. After accepting the invitation, a link is set up between the two parties. You must be a distributor to call this method.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * ALREADY_EXISTS: The ChannelPartnerLink sent in the request already exists. * NOT_FOUND: No Cloud Identity customer exists for provided domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The new resource.

Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IChannelPartnerLink, (protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest | undefined), {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Create a channel partner link for the provided reseller account's
   *  resource name.
   *  Parent uses the format: accounts/{account_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The channel partner link to create.
   *  Either channel_partner_link.reseller_cloud_identity_id or domain can be
   *  used to create a link.
   */
  // const channelPartnerLink = {}

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callCreateChannelPartnerLink() {
    // Construct request
    const request = {
      parent,
      channelPartnerLink,
    };

    // Run request
    const response = await channelClient.createChannelPartnerLink(request);
    console.log(response);
  }

  callCreateChannelPartnerLink();

createChannelPartnerLink(request: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void
createChannelPartnerLink(request: protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest, callback: Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest
callback Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createCustomer(request, options)

createCustomer(request?: protos.google.cloud.channel.v1.ICreateCustomerRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ICustomer,
        protos.google.cloud.channel.v1.ICreateCustomerRequest | undefined,
        {} | undefined
    ]>;

Creates a new resource under the reseller or distributor account.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * Domain field value doesn't match the primary email domain.

Return value: The newly created resource.

Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateCustomerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.ICreateCustomerRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of reseller account in which to create the customer.
   *  Parent uses the format: accounts/{account_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The customer to create.
   */
  // const customer = {}

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callCreateCustomer() {
    // Construct request
    const request = {
      parent,
      customer,
    };

    // Run request
    const response = await channelClient.createCustomer(request);
    console.log(response);
  }

  callCreateCustomer();

createCustomer(request, options, callback)

createCustomer(request: protos.google.cloud.channel.v1.ICreateCustomerRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateCustomerRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createCustomer(request, callback)

createCustomer(request: protos.google.cloud.channel.v1.ICreateCustomerRequest, callback: Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateCustomerRequest
callback Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.ICreateCustomerRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createEntitlement(request, options)

createEntitlement(request?: protos.google.cloud.channel.v1.ICreateEntitlementRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates an entitlement for a customer.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: * Required request parameters are missing or invalid. * There is already a customer entitlement for a SKU from the same product family. * INVALID_VALUE: Make sure the OfferId is valid. If it is, contact Google Channel support for further troubleshooting. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: * The SKU was already purchased for the customer. * The customer's primary email already exists. Retry after changing the customer's primary contact email. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The domain required for purchasing a SKU has not been verified. * A pre-requisite SKU required to purchase an Add-On SKU is missing. For example, Google Workspace Business Starter is required to purchase Vault or Drive. * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateEntitlementRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account in which to create the
   *  entitlement.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The entitlement to create.
   */
  // const entitlement = {}
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callCreateEntitlement() {
    // Construct request
    const request = {
      parent,
      entitlement,
    };

    // Run request
    const [operation] = await channelClient.createEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateEntitlement();

createEntitlement(request, options, callback)

createEntitlement(request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateEntitlementRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createEntitlement(request, callback)

createEntitlement(request: protos.google.cloud.channel.v1.ICreateEntitlementRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ICreateEntitlementRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

customerPath(account, customer)

customerPath(account: string, customer: string): string;

Return a fully-qualified customer resource name string.

Parameters
NameDescription
account string
customer string
Returns
TypeDescription
string

{string} Resource name string.

deleteCustomer(request, options)

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

Deletes the given permanently.

Possible error codes:

* PERMISSION_DENIED: The account making the request does not own this customer. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * FAILED_PRECONDITION: The customer has existing entitlements. * NOT_FOUND: No resource found for the name in the request.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IDeleteCustomerRequest

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.channel.v1.IDeleteCustomerRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the customer to delete.
   */
  // const name = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const response = await channelClient.deleteCustomer(request);
    console.log(response);
  }

  callDeleteCustomer();

deleteCustomer(request, options, callback)

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

deleteCustomer(request, callback)

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

entitlementPath(account, customer, entitlement)

entitlementPath(account: string, customer: string, entitlement: string): string;

Return a fully-qualified entitlement resource name string.

Parameters
NameDescription
account string
customer string
entitlement string
Returns
TypeDescription
string

{string} Resource name string.

getChannelPartnerLink(request?: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IChannelPartnerLink,
        protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | undefined,
        {} | undefined
    ]>;

Returns the requested resource. You must be a distributor to call this method.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: ChannelPartnerLink resource not found because of an invalid channel partner link name.

Return value: The resource.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the channel partner link to retrieve.
   *  Name uses the format: accounts/{account_id}/channelPartnerLinks/{id}
   *  where {id} is the Cloud Identity ID of the partner.
   */
  // const name = 'abc123'
  /**
   *  Optional. The level of granularity the ChannelPartnerLink will display.
   */
  // const view = {}

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const response = await channelClient.getChannelPartnerLink(request);
    console.log(response);
  }

  callGetChannelPartnerLink();

getChannelPartnerLink(request: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void
getChannelPartnerLink(request: protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest, callback: Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest
callback Callback<protos.google.cloud.channel.v1.IChannelPartnerLink, protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getCustomer(request, options)

getCustomer(request?: protos.google.cloud.channel.v1.IGetCustomerRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ICustomer,
        protos.google.cloud.channel.v1.IGetCustomerRequest | undefined,
        {} | undefined
    ]>;

Returns the requested resource.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer resource doesn't exist. Usually the result of an invalid name parameter.

Return value: The resource.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetCustomerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IGetCustomerRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the customer to retrieve.
   *  Name uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const name = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const response = await channelClient.getCustomer(request);
    console.log(response);
  }

  callGetCustomer();

getCustomer(request, options, callback)

getCustomer(request: protos.google.cloud.channel.v1.IGetCustomerRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetCustomerRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getCustomer(request, callback)

getCustomer(request: protos.google.cloud.channel.v1.IGetCustomerRequest, callback: Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetCustomerRequest
callback Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getEntitlement(request, options)

getEntitlement(request?: protos.google.cloud.channel.v1.IGetEntitlementRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IEntitlement,
        protos.google.cloud.channel.v1.IGetEntitlementRequest | undefined,
        {} | undefined
    ]>;

Returns the requested resource.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer entitlement was not found.

Return value: The requested resource.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetEntitlementRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IGetEntitlementRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to retrieve.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const response = await channelClient.getEntitlement(request);
    console.log(response);
  }

  callGetEntitlement();

getEntitlement(request, options, callback)

getEntitlement(request: protos.google.cloud.channel.v1.IGetEntitlementRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IGetEntitlementRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetEntitlementRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IGetEntitlementRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getEntitlement(request, callback)

getEntitlement(request: protos.google.cloud.channel.v1.IGetEntitlementRequest, callback: Callback<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IGetEntitlementRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IGetEntitlementRequest
callback Callback<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IGetEntitlementRequest | 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

importCustomer(request, options)

importCustomer(request?: protos.google.cloud.channel.v1.IImportCustomerRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ICustomer,
        protos.google.cloud.channel.v1.IImportCustomerRequest | undefined,
        {} | undefined
    ]>;

Imports a from the Cloud Identity associated with the provided Cloud Identity ID or domain before a TransferEntitlements call. If a linked Customer already exists and overwrite_if_exists is true, it will update that Customer's data.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * NOT_FOUND: Cloud Identity doesn't exist or was deleted. * INVALID_ARGUMENT: Required parameters are missing, or the auth_token is expired or invalid. * ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite.

Return value: The .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IImportCustomerRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IImportCustomerRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Customer domain.
   */
  // const domain = 'abc123'
  /**
   *  Required. Customer's Cloud Identity ID
   */
  // const cloudIdentityId = 'abc123'
  /**
   *  Required. The resource name of the reseller's account.
   *  Parent takes the format: accounts/{account_id} or
   *  accounts/{account_id}/channelPartnerLinks/{channel_partner_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. The super admin of the resold customer generates this token to
   *  authorize a reseller to access their Cloud Identity and purchase
   *  entitlements on their behalf. You can omit this token after authorization.
   *  See https://support.google.com/a/answer/7643790 for more details.
   */
  // const authToken = 'abc123'
  /**
   *  Required. Choose to overwrite an existing customer if found.
   *  This must be set to true if there is an existing customer with a
   *  conflicting region code or domain.
   */
  // const overwriteIfExists = true
  /**
   *  Optional. Cloud Identity ID of a channel partner who will be the direct reseller for
   *  the customer's order. This field is required for 2-tier transfer scenarios
   *  and can be provided via the request Parent binding as well.
   */
  // const channelPartnerId = 'abc123'
  /**
   *  Optional. Specifies the customer that will receive imported Cloud Identity
   *  information.
   *  Format: accounts/{account_id}/customers/{customer_id}
   */
  // const customer = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callImportCustomer() {
    // Construct request
    const request = {
      domain,
      cloudIdentityId,
      parent,
      overwriteIfExists,
    };

    // Run request
    const response = await channelClient.importCustomer(request);
    console.log(response);
  }

  callImportCustomer();

importCustomer(request, options, callback)

importCustomer(request: protos.google.cloud.channel.v1.IImportCustomerRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IImportCustomerRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IImportCustomerRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IImportCustomerRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importCustomer(request, callback)

importCustomer(request: protos.google.cloud.channel.v1.IImportCustomerRequest, callback: Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IImportCustomerRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IImportCustomerRequest
callback Callback<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IImportCustomerRequest | 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.

listChannelPartnerLinks(request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IChannelPartnerLink[],
        protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest | null,
        protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse
    ]>;

List s belonging to a distributor. You must be a distributor to call this method.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: The list of the distributor account's resources.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IChannelPartnerLink[], protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest | null, protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse ]>

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

listChannelPartnerLinks(request: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse | null | undefined, protos.google.cloud.channel.v1.IChannelPartnerLink>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse | null | undefined, protos.google.cloud.channel.v1.IChannelPartnerLink>
Returns
TypeDescription
void
listChannelPartnerLinks(request: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse | null | undefined, protos.google.cloud.channel.v1.IChannelPartnerLink>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse | null | undefined, protos.google.cloud.channel.v1.IChannelPartnerLink>
Returns
TypeDescription
void

listChannelPartnerLinksAsync(request, options)

listChannelPartnerLinksAsync(request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.IChannelPartnerLink>;

Equivalent to listChannelPartnerLinks, 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.channel.v1.IListChannelPartnerLinksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.IChannelPartnerLink>

{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 [ChannelPartnerLink]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller account for listing channel partner
   *  links.
   *  Parent uses the format: accounts/{account_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, server will pick a default size (25).
   *  The maximum value is 200; the server will coerce values above 200.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   *  Obtained using
   *  ListChannelPartnerLinksResponse.next_page_token google.cloud.channel.v1.ListChannelPartnerLinksResponse.next_page_token  of the previous
   *  CloudChannelService.ListChannelPartnerLinks google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The level of granularity the ChannelPartnerLink will display.
   */
  // const view = {}

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListChannelPartnerLinks() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await channelClient.listChannelPartnerLinksAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListChannelPartnerLinks();

listChannelPartnerLinksStream(request, options)

listChannelPartnerLinksStream(request?: protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest

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 [ChannelPartnerLink] 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 listChannelPartnerLinksAsync() 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.

listCustomers(request, options)

listCustomers(request?: protos.google.cloud.channel.v1.IListCustomersRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ICustomer[],
        protos.google.cloud.channel.v1.IListCustomersRequest | null,
        protos.google.cloud.channel.v1.IListCustomersResponse
    ]>;

List s.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request is different from the reseller account in the API request. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: List of s, or an empty list if there are no customers.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListCustomersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ICustomer[], protos.google.cloud.channel.v1.IListCustomersRequest | null, protos.google.cloud.channel.v1.IListCustomersResponse ]>

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

listCustomers(request, options, callback)

listCustomers(request: protos.google.cloud.channel.v1.IListCustomersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListCustomersRequest, protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, protos.google.cloud.channel.v1.ICustomer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListCustomersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListCustomersRequest, protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, protos.google.cloud.channel.v1.ICustomer>
Returns
TypeDescription
void

listCustomers(request, callback)

listCustomers(request: protos.google.cloud.channel.v1.IListCustomersRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListCustomersRequest, protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, protos.google.cloud.channel.v1.ICustomer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListCustomersRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListCustomersRequest, protos.google.cloud.channel.v1.IListCustomersResponse | null | undefined, protos.google.cloud.channel.v1.ICustomer>
Returns
TypeDescription
void

listCustomersAsync(request, options)

listCustomersAsync(request?: protos.google.cloud.channel.v1.IListCustomersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.ICustomer>;

Equivalent to listCustomers, 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.channel.v1.IListCustomersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.ICustomer>

{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 [Customer]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller account to list customers from.
   *  Parent uses the format: accounts/{account_id}.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of customers to return. The service may return fewer
   *  than this value. If unspecified, returns at most 10 customers. The
   *  maximum value is 50.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token identifying a page of results other than the first page.
   *  Obtained through
   *  ListCustomersResponse.next_page_token google.cloud.channel.v1.ListCustomersResponse.next_page_token  of the previous
   *  CloudChannelService.ListCustomers google.cloud.channel.v1.CloudChannelService.ListCustomers  call.
   */
  // const pageToken = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListCustomers() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await channelClient.listCustomersAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListCustomers();

listCustomersStream(request, options)

listCustomersStream(request?: protos.google.cloud.channel.v1.IListCustomersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListCustomersRequest

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 [Customer] 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 listCustomersAsync() 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.

listEntitlements(request, options)

listEntitlements(request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IEntitlement[],
        protos.google.cloud.channel.v1.IListEntitlementsRequest | null,
        protos.google.cloud.channel.v1.IListEntitlementsResponse
    ]>;

Lists s belonging to a customer.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: A list of the customer's s.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListEntitlementsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IEntitlement[], protos.google.cloud.channel.v1.IListEntitlementsRequest | null, protos.google.cloud.channel.v1.IListEntitlementsResponse ]>

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

listEntitlements(request, options, callback)

listEntitlements(request: protos.google.cloud.channel.v1.IListEntitlementsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListEntitlementsRequest, protos.google.cloud.channel.v1.IListEntitlementsResponse | null | undefined, protos.google.cloud.channel.v1.IEntitlement>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListEntitlementsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListEntitlementsRequest, protos.google.cloud.channel.v1.IListEntitlementsResponse | null | undefined, protos.google.cloud.channel.v1.IEntitlement>
Returns
TypeDescription
void

listEntitlements(request, callback)

listEntitlements(request: protos.google.cloud.channel.v1.IListEntitlementsRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListEntitlementsRequest, protos.google.cloud.channel.v1.IListEntitlementsResponse | null | undefined, protos.google.cloud.channel.v1.IEntitlement>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListEntitlementsRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListEntitlementsRequest, protos.google.cloud.channel.v1.IListEntitlementsResponse | null | undefined, protos.google.cloud.channel.v1.IEntitlement>
Returns
TypeDescription
void

listEntitlementsAsync(request, options)

listEntitlementsAsync(request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.IEntitlement>;

Equivalent to listEntitlements, 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.channel.v1.IListEntitlementsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.IEntitlement>

{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 [Entitlement]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account to list
   *  entitlements for.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, return at most 50 entitlements.
   *  The maximum value is 100; the server will coerce values above 100.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   *  Obtained using
   *  ListEntitlementsResponse.next_page_token google.cloud.channel.v1.ListEntitlementsResponse.next_page_token  of the previous
   *  CloudChannelService.ListEntitlements google.cloud.channel.v1.CloudChannelService.ListEntitlements  call.
   */
  // const pageToken = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListEntitlements() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await channelClient.listEntitlementsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListEntitlements();

listEntitlementsStream(request, options)

listEntitlementsStream(request?: protos.google.cloud.channel.v1.IListEntitlementsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListEntitlementsRequest

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 [Entitlement] 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 listEntitlementsAsync() 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.

listOffers(request, options)

listOffers(request?: protos.google.cloud.channel.v1.IListOffersRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IOffer[],
        protos.google.cloud.channel.v1.IListOffersRequest | null,
        protos.google.cloud.channel.v1.IListOffersResponse
    ]>;

Lists the Offers the reseller can sell.

Possible error codes:

* INVALID_ARGUMENT: Required request parameters are missing or invalid.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListOffersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IOffer[], protos.google.cloud.channel.v1.IListOffersRequest | null, protos.google.cloud.channel.v1.IListOffersResponse ]>

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

listOffers(request, options, callback)

listOffers(request: protos.google.cloud.channel.v1.IListOffersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListOffersRequest, protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, protos.google.cloud.channel.v1.IOffer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListOffersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListOffersRequest, protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, protos.google.cloud.channel.v1.IOffer>
Returns
TypeDescription
void

listOffers(request, callback)

listOffers(request: protos.google.cloud.channel.v1.IListOffersRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListOffersRequest, protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, protos.google.cloud.channel.v1.IOffer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListOffersRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListOffersRequest, protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, protos.google.cloud.channel.v1.IOffer>
Returns
TypeDescription
void

listOffersAsync(request, options)

listOffersAsync(request?: protos.google.cloud.channel.v1.IListOffersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.IOffer>;

Equivalent to listOffers, 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.channel.v1.IListOffersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.IOffer>

{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 [Offer]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller account from which to list Offers.
   *  Parent uses the format: accounts/{account_id}.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 500 Offers.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The expression to filter results by name (name of
   *  the Offer), sku.name (name of the SKU), or sku.product.name (name of the
   *  Product).
   *  Example 1: sku.product.name=products/p1 AND sku.name!=products/p1/skus/s1
   *  Example 2: name=accounts/a1/offers/o1
   */
  // const filter = 'abc123'
  /**
   *  Optional. The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListOffers() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await channelClient.listOffersAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListOffers();

listOffersStream(request, options)

listOffersStream(request?: protos.google.cloud.channel.v1.IListOffersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListOffersRequest

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 [Offer] 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 listOffersAsync() 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.

listProducts(request, options)

listProducts(request?: protos.google.cloud.channel.v1.IListProductsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IProduct[],
        protos.google.cloud.channel.v1.IListProductsRequest | null,
        protos.google.cloud.channel.v1.IListProductsResponse
    ]>;

Lists the Products the reseller is authorized to sell.

Possible error codes:

* INVALID_ARGUMENT: Required request parameters are missing or invalid.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListProductsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IProduct[], protos.google.cloud.channel.v1.IListProductsRequest | null, protos.google.cloud.channel.v1.IListProductsResponse ]>

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

listProducts(request, options, callback)

listProducts(request: protos.google.cloud.channel.v1.IListProductsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListProductsRequest, protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, protos.google.cloud.channel.v1.IProduct>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListProductsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListProductsRequest, protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, protos.google.cloud.channel.v1.IProduct>
Returns
TypeDescription
void

listProducts(request, callback)

listProducts(request: protos.google.cloud.channel.v1.IListProductsRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListProductsRequest, protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, protos.google.cloud.channel.v1.IProduct>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListProductsRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListProductsRequest, protos.google.cloud.channel.v1.IListProductsResponse | null | undefined, protos.google.cloud.channel.v1.IProduct>
Returns
TypeDescription
void

listProductsAsync(request, options)

listProductsAsync(request?: protos.google.cloud.channel.v1.IListProductsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.IProduct>;

Equivalent to listProducts, 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.channel.v1.IListProductsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.IProduct>

{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 [Product]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller account.
   *  Format: accounts/{account_id}.
   */
  // const account = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 100 Products.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListProducts() {
    // Construct request
    const request = {
      account,
    };

    // Run request
    const iterable = await channelClient.listProductsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListProducts();

listProductsStream(request, options)

listProductsStream(request?: protos.google.cloud.channel.v1.IListProductsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListProductsRequest

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 [Product] 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 listProductsAsync() 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.

listPurchasableOffers(request, options)

listPurchasableOffers(request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IPurchasableOffer[],
        protos.google.cloud.channel.v1.IListPurchasableOffersRequest | null,
        protos.google.cloud.channel.v1.IListPurchasableOffersResponse
    ]>;

Lists the following:

* Offers that you can purchase for a customer. * Offers that you can change for an entitlement.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableOffersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IPurchasableOffer[], protos.google.cloud.channel.v1.IListPurchasableOffersRequest | null, protos.google.cloud.channel.v1.IListPurchasableOffersResponse ]>

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

listPurchasableOffers(request, options, callback)

listPurchasableOffers(request: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableOffersRequest, protos.google.cloud.channel.v1.IListPurchasableOffersResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableOffer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableOffersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableOffersRequest, protos.google.cloud.channel.v1.IListPurchasableOffersResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableOffer>
Returns
TypeDescription
void

listPurchasableOffers(request, callback)

listPurchasableOffers(request: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableOffersRequest, protos.google.cloud.channel.v1.IListPurchasableOffersResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableOffer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableOffersRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableOffersRequest, protos.google.cloud.channel.v1.IListPurchasableOffersResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableOffer>
Returns
TypeDescription
void

listPurchasableOffersAsync(request, options)

listPurchasableOffersAsync(request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.IPurchasableOffer>;

Equivalent to listPurchasableOffers, 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.channel.v1.IListPurchasableOffersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.IPurchasableOffer>

{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 [PurchasableOffer]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  List Offers for CreateEntitlement purchase.
   */
  // const createEntitlementPurchase = {}
  /**
   *  List Offers for ChangeOffer purchase.
   */
  // const changeOfferPurchase = {}
  /**
   *  Required. The resource name of the customer to list Offers for.
   *  Format: accounts/{account_id}/customers/{customer_id}.
   */
  // const customer = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 100 Offers.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListPurchasableOffers() {
    // Construct request
    const request = {
      customer,
    };

    // Run request
    const iterable = await channelClient.listPurchasableOffersAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListPurchasableOffers();

listPurchasableOffersStream(request, options)

listPurchasableOffersStream(request?: protos.google.cloud.channel.v1.IListPurchasableOffersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableOffersRequest

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 [PurchasableOffer] 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 listPurchasableOffersAsync() 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.

listPurchasableSkus(request, options)

listPurchasableSkus(request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IPurchasableSku[],
        protos.google.cloud.channel.v1.IListPurchasableSkusRequest | null,
        protos.google.cloud.channel.v1.IListPurchasableSkusResponse
    ]>;

Lists the following:

* SKUs that you can purchase for a customer * SKUs that you can upgrade or downgrade for an entitlement.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableSkusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IPurchasableSku[], protos.google.cloud.channel.v1.IListPurchasableSkusRequest | null, protos.google.cloud.channel.v1.IListPurchasableSkusResponse ]>

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

listPurchasableSkus(request, options, callback)

listPurchasableSkus(request: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableSkusRequest, protos.google.cloud.channel.v1.IListPurchasableSkusResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableSku>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableSkusRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableSkusRequest, protos.google.cloud.channel.v1.IListPurchasableSkusResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableSku>
Returns
TypeDescription
void

listPurchasableSkus(request, callback)

listPurchasableSkus(request: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableSkusRequest, protos.google.cloud.channel.v1.IListPurchasableSkusResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableSku>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableSkusRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListPurchasableSkusRequest, protos.google.cloud.channel.v1.IListPurchasableSkusResponse | null | undefined, protos.google.cloud.channel.v1.IPurchasableSku>
Returns
TypeDescription
void

listPurchasableSkusAsync(request, options)

listPurchasableSkusAsync(request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.IPurchasableSku>;

Equivalent to listPurchasableSkus, 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.channel.v1.IListPurchasableSkusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.IPurchasableSku>

{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 [PurchasableSku]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  List SKUs for CreateEntitlement purchase.
   */
  // const createEntitlementPurchase = {}
  /**
   *  List SKUs for ChangeOffer purchase with a new SKU.
   */
  // const changeOfferPurchase = {}
  /**
   *  Required. The resource name of the customer to list SKUs for.
   *  Format: accounts/{account_id}/customers/{customer_id}.
   */
  // const customer = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 100 SKUs.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListPurchasableSkus() {
    // Construct request
    const request = {
      customer,
    };

    // Run request
    const iterable = await channelClient.listPurchasableSkusAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListPurchasableSkus();

listPurchasableSkusStream(request, options)

listPurchasableSkusStream(request?: protos.google.cloud.channel.v1.IListPurchasableSkusRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListPurchasableSkusRequest

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 [PurchasableSku] 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 listPurchasableSkusAsync() 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.

listSkus(request, options)

listSkus(request?: protos.google.cloud.channel.v1.IListSkusRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ISku[],
        protos.google.cloud.channel.v1.IListSkusRequest | null,
        protos.google.cloud.channel.v1.IListSkusResponse
    ]>;

Lists the SKUs for a product the reseller is authorized to sell.

Possible error codes:

* INVALID_ARGUMENT: Required request parameters are missing or invalid.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSkusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ISku[], protos.google.cloud.channel.v1.IListSkusRequest | null, protos.google.cloud.channel.v1.IListSkusResponse ]>

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

listSkus(request, options, callback)

listSkus(request: protos.google.cloud.channel.v1.IListSkusRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListSkusRequest, protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, protos.google.cloud.channel.v1.ISku>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSkusRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListSkusRequest, protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, protos.google.cloud.channel.v1.ISku>
Returns
TypeDescription
void

listSkus(request, callback)

listSkus(request: protos.google.cloud.channel.v1.IListSkusRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListSkusRequest, protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, protos.google.cloud.channel.v1.ISku>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSkusRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListSkusRequest, protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, protos.google.cloud.channel.v1.ISku>
Returns
TypeDescription
void

listSkusAsync(request, options)

listSkusAsync(request?: protos.google.cloud.channel.v1.IListSkusRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.ISku>;

Equivalent to listSkus, 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.channel.v1.IListSkusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.ISku>

{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 [Sku]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the Product to list SKUs for.
   *  Parent uses the format: products/{product_id}.
   *  Supports products/- to retrieve SKUs for all products.
   */
  // const parent = 'abc123'
  /**
   *  Required. Resource name of the reseller.
   *  Format: accounts/{account_id}.
   */
  // const account = 'abc123'
  /**
   *  Optional. Requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 100 SKUs.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A token for a page of results other than the first page.
   *  Optional.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListSkus() {
    // Construct request
    const request = {
      parent,
      account,
    };

    // Run request
    const iterable = await channelClient.listSkusAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListSkus();

listSkusStream(request, options)

listSkusStream(request?: protos.google.cloud.channel.v1.IListSkusRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSkusRequest

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 [Sku] 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 listSkusAsync() 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.

listSubscribers(request, options)

listSubscribers(request?: protos.google.cloud.channel.v1.IListSubscribersRequest, options?: CallOptions): Promise<[
        string[],
        protos.google.cloud.channel.v1.IListSubscribersRequest | null,
        protos.google.cloud.channel.v1.IListSubscribersResponse
    ]>;

Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account.

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The topic resource doesn't exist. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: A list of service email addresses.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSubscribersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ string[], protos.google.cloud.channel.v1.IListSubscribersRequest | null, protos.google.cloud.channel.v1.IListSubscribersResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of string. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listSubscribersAsync() 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.

listSubscribers(request, options, callback)

listSubscribers(request: protos.google.cloud.channel.v1.IListSubscribersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListSubscribersRequest, protos.google.cloud.channel.v1.IListSubscribersResponse | null | undefined, string>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSubscribersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListSubscribersRequest, protos.google.cloud.channel.v1.IListSubscribersResponse | null | undefined, string>
Returns
TypeDescription
void

listSubscribers(request, callback)

listSubscribers(request: protos.google.cloud.channel.v1.IListSubscribersRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListSubscribersRequest, protos.google.cloud.channel.v1.IListSubscribersResponse | null | undefined, string>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSubscribersRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListSubscribersRequest, protos.google.cloud.channel.v1.IListSubscribersResponse | null | undefined, string>
Returns
TypeDescription
void

listSubscribersAsync(request, options)

listSubscribersAsync(request?: protos.google.cloud.channel.v1.IListSubscribersRequest, options?: CallOptions): AsyncIterable<string>;

Equivalent to listSubscribers, 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.channel.v1.IListSubscribersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<string>

{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 string. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the account.
   */
  // const account = 'abc123'
  /**
   *  Optional. The maximum number of service accounts to return. The service may return
   *  fewer than this value.
   *  If unspecified, returns at most 100 service accounts.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous `ListSubscribers` call.
   *  Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `ListSubscribers` must
   *  match the call that provided the page token.
   */
  // const pageToken = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListSubscribers() {
    // Construct request
    const request = {
      account,
    };

    // Run request
    const iterable = await channelClient.listSubscribersAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListSubscribers();

listSubscribersStream(request, options)

listSubscribersStream(request?: protos.google.cloud.channel.v1.IListSubscribersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListSubscribersRequest

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 string on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSubscribersAsync() 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.

listTransferableOffers(request, options)

listTransferableOffers(request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ITransferableOffer[],
        protos.google.cloud.channel.v1.IListTransferableOffersRequest | null,
        protos.google.cloud.channel.v1.IListTransferableOffersResponse
    ]>;

List s of a customer based on Cloud Identity ID or Customer Name in the request.

Use this method when a reseller gets the entitlement information of an unowned customer. The reseller should provide the customer's Cloud Identity ID or Customer Name.

Possible error codes:

* PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The supplied auth token is invalid. * The reseller account making the request is different from the reseller account in the query. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: List of for the given customer and SKU.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableOffersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ITransferableOffer[], protos.google.cloud.channel.v1.IListTransferableOffersRequest | null, protos.google.cloud.channel.v1.IListTransferableOffersResponse ]>

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

listTransferableOffers(request, options, callback)

listTransferableOffers(request: protos.google.cloud.channel.v1.IListTransferableOffersRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListTransferableOffersRequest, protos.google.cloud.channel.v1.IListTransferableOffersResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableOffer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableOffersRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListTransferableOffersRequest, protos.google.cloud.channel.v1.IListTransferableOffersResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableOffer>
Returns
TypeDescription
void

listTransferableOffers(request, callback)

listTransferableOffers(request: protos.google.cloud.channel.v1.IListTransferableOffersRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListTransferableOffersRequest, protos.google.cloud.channel.v1.IListTransferableOffersResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableOffer>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableOffersRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListTransferableOffersRequest, protos.google.cloud.channel.v1.IListTransferableOffersResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableOffer>
Returns
TypeDescription
void

listTransferableOffersAsync(request, options)

listTransferableOffersAsync(request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.ITransferableOffer>;

Equivalent to listTransferableOffers, 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.channel.v1.IListTransferableOffersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.ITransferableOffer>

{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 [TransferableOffer]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Customer's Cloud Identity ID
   */
  // const cloudIdentityId = 'abc123'
  /**
   *  A reseller should create a customer and use the resource name of
   *  that customer here.
   */
  // const customerName = 'abc123'
  /**
   *  Required. The resource name of the reseller's account.
   */
  // const parent = 'abc123'
  /**
   *  Requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 100 offers.
   *  The maximum value is 1000; the server will coerce values above 1000.
   */
  // const pageSize = 1234
  /**
   *  A token for a page of results other than the first page.
   *  Obtained using
   *  ListTransferableOffersResponse.next_page_token google.cloud.channel.v1.ListTransferableOffersResponse.next_page_token  of the previous
   *  CloudChannelService.ListTransferableOffers google.cloud.channel.v1.CloudChannelService.ListTransferableOffers  call.
   */
  // const pageToken = 'abc123'
  /**
   *  Required. The SKU to look up Offers for.
   */
  // const sku = 'abc123'
  /**
   *  The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListTransferableOffers() {
    // Construct request
    const request = {
      parent,
      sku,
    };

    // Run request
    const iterable = await channelClient.listTransferableOffersAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListTransferableOffers();

listTransferableOffersStream(request, options)

listTransferableOffersStream(request?: protos.google.cloud.channel.v1.IListTransferableOffersRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableOffersRequest

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 [TransferableOffer] 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 listTransferableOffersAsync() 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.

listTransferableSkus(request, options)

listTransferableSkus(request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.ITransferableSku[],
        protos.google.cloud.channel.v1.IListTransferableSkusRequest | null,
        protos.google.cloud.channel.v1.IListTransferableSkusResponse
    ]>;

List s of a customer based on the Cloud Identity ID or Customer Name in the request.

Use this method to list the entitlements information of an unowned customer. You should provide the customer's Cloud Identity ID or Customer Name.

Possible error codes:

* PERMISSION_DENIED: * The customer doesn't belong to the reseller and has no auth token. * The supplied auth token is invalid. * The reseller account making the request is different from the reseller account in the query. * INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: A list of the customer's .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableSkusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.ITransferableSku[], protos.google.cloud.channel.v1.IListTransferableSkusRequest | null, protos.google.cloud.channel.v1.IListTransferableSkusResponse ]>

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

listTransferableSkus(request, options, callback)

listTransferableSkus(request: protos.google.cloud.channel.v1.IListTransferableSkusRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.channel.v1.IListTransferableSkusRequest, protos.google.cloud.channel.v1.IListTransferableSkusResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableSku>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableSkusRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.channel.v1.IListTransferableSkusRequest, protos.google.cloud.channel.v1.IListTransferableSkusResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableSku>
Returns
TypeDescription
void

listTransferableSkus(request, callback)

listTransferableSkus(request: protos.google.cloud.channel.v1.IListTransferableSkusRequest, callback: PaginationCallback<protos.google.cloud.channel.v1.IListTransferableSkusRequest, protos.google.cloud.channel.v1.IListTransferableSkusResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableSku>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableSkusRequest
callback PaginationCallback<protos.google.cloud.channel.v1.IListTransferableSkusRequest, protos.google.cloud.channel.v1.IListTransferableSkusResponse | null | undefined, protos.google.cloud.channel.v1.ITransferableSku>
Returns
TypeDescription
void

listTransferableSkusAsync(request, options)

listTransferableSkusAsync(request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.channel.v1.ITransferableSku>;

Equivalent to listTransferableSkus, 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.channel.v1.IListTransferableSkusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.channel.v1.ITransferableSku>

{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 [TransferableSku]. 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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Customer's Cloud Identity ID
   */
  // const cloudIdentityId = 'abc123'
  /**
   *  A reseller is required to create a customer and use the resource name of
   *  the created customer here.
   *  Customer_name uses the format:
   *  accounts/{account_id}/customers/{customer_id}
   */
  // const customerName = 'abc123'
  /**
   *  Required. The reseller account's resource name.
   *  Parent uses the format: accounts/{account_id}
   */
  // const parent = 'abc123'
  /**
   *  The requested page size. Server might return fewer results than requested.
   *  If unspecified, returns at most 100 SKUs.
   *  The maximum value is 1000; the server will coerce values above 1000.
   *  Optional.
   */
  // const pageSize = 1234
  /**
   *  A token for a page of results other than the first page.
   *  Obtained using
   *  ListTransferableSkusResponse.next_page_token google.cloud.channel.v1.ListTransferableSkusResponse.next_page_token  of the previous
   *  CloudChannelService.ListTransferableSkus google.cloud.channel.v1.CloudChannelService.ListTransferableSkus  call.
   *  Optional.
   */
  // const pageToken = 'abc123'
  /**
   *  The super admin of the resold customer generates this token to
   *  authorize a reseller to access their Cloud Identity and purchase
   *  entitlements on their behalf. You can omit this token after authorization.
   *  See https://support.google.com/a/answer/7643790 for more details.
   */
  // const authToken = 'abc123'
  /**
   *  The BCP-47 language code. For example, "en-US". The
   *  response will localize in the corresponding language code, if specified.
   *  The default value is "en-US".
   *  Optional.
   */
  // const languageCode = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callListTransferableSkus() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await channelClient.listTransferableSkusAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListTransferableSkus();

listTransferableSkusStream(request, options)

listTransferableSkusStream(request?: protos.google.cloud.channel.v1.IListTransferableSkusRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.channel.v1.IListTransferableSkusRequest

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 [TransferableSku] 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 listTransferableSkusAsync() 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.

lookupOffer(request, options)

lookupOffer(request?: protos.google.cloud.channel.v1.ILookupOfferRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IOffer,
        protos.google.cloud.channel.v1.ILookupOfferRequest | undefined,
        {} | undefined
    ]>;

Returns the requested resource.

Possible error codes:

* PERMISSION_DENIED: The entitlement doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement or offer was not found.

Return value: The resource.

Parameters
NameDescription
request protos.google.cloud.channel.v1.ILookupOfferRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IOffer, protos.google.cloud.channel.v1.ILookupOfferRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to retrieve the Offer.
   *  Entitlement uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const entitlement = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callLookupOffer() {
    // Construct request
    const request = {
      entitlement,
    };

    // Run request
    const response = await channelClient.lookupOffer(request);
    console.log(response);
  }

  callLookupOffer();

lookupOffer(request, options, callback)

lookupOffer(request: protos.google.cloud.channel.v1.ILookupOfferRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.IOffer, protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ILookupOfferRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.IOffer, protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

lookupOffer(request, callback)

lookupOffer(request: protos.google.cloud.channel.v1.ILookupOfferRequest, callback: Callback<protos.google.cloud.channel.v1.IOffer, protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ILookupOfferRequest
callback Callback<protos.google.cloud.channel.v1.IOffer, protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

matchAccountFromChannelPartnerLinkName(channelPartnerLinkName)

matchAccountFromChannelPartnerLinkName(channelPartnerLinkName: string): string | number;

Parse the account from ChannelPartnerLink resource.

Parameter
NameDescription
channelPartnerLinkName string

A fully-qualified path representing ChannelPartnerLink resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchAccountFromCustomerName(customerName)

matchAccountFromCustomerName(customerName: string): string | number;

Parse the account from Customer resource.

Parameter
NameDescription
customerName string

A fully-qualified path representing Customer resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchAccountFromEntitlementName(entitlementName)

matchAccountFromEntitlementName(entitlementName: string): string | number;

Parse the account from Entitlement resource.

Parameter
NameDescription
entitlementName string

A fully-qualified path representing Entitlement resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchAccountFromOfferName(offerName)

matchAccountFromOfferName(offerName: string): string | number;

Parse the account from Offer resource.

Parameter
NameDescription
offerName string

A fully-qualified path representing Offer resource.

Returns
TypeDescription
string | number

{string} A string representing the account.

matchChannelPartnerLinkFromChannelPartnerLinkName(channelPartnerLinkName)

matchChannelPartnerLinkFromChannelPartnerLinkName(channelPartnerLinkName: string): string | number;

Parse the channel_partner_link from ChannelPartnerLink resource.

Parameter
NameDescription
channelPartnerLinkName string

A fully-qualified path representing ChannelPartnerLink resource.

Returns
TypeDescription
string | number

{string} A string representing the channel_partner_link.

matchCustomerFromCustomerName(customerName)

matchCustomerFromCustomerName(customerName: string): string | number;

Parse the customer from Customer resource.

Parameter
NameDescription
customerName string

A fully-qualified path representing Customer resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchCustomerFromEntitlementName(entitlementName)

matchCustomerFromEntitlementName(entitlementName: string): string | number;

Parse the customer from Entitlement resource.

Parameter
NameDescription
entitlementName string

A fully-qualified path representing Entitlement resource.

Returns
TypeDescription
string | number

{string} A string representing the customer.

matchEntitlementFromEntitlementName(entitlementName)

matchEntitlementFromEntitlementName(entitlementName: string): string | number;

Parse the entitlement from Entitlement resource.

Parameter
NameDescription
entitlementName string

A fully-qualified path representing Entitlement resource.

Returns
TypeDescription
string | number

{string} A string representing the entitlement.

matchOfferFromOfferName(offerName)

matchOfferFromOfferName(offerName: string): string | number;

Parse the offer from Offer resource.

Parameter
NameDescription
offerName string

A fully-qualified path representing Offer resource.

Returns
TypeDescription
string | number

{string} A string representing the offer.

matchProductFromProductName(productName)

matchProductFromProductName(productName: string): string | number;

Parse the product from Product resource.

Parameter
NameDescription
productName string

A fully-qualified path representing Product resource.

Returns
TypeDescription
string | number

{string} A string representing the product.

matchProductFromSkuName(skuName)

matchProductFromSkuName(skuName: string): string | number;

Parse the product from Sku resource.

Parameter
NameDescription
skuName string

A fully-qualified path representing Sku resource.

Returns
TypeDescription
string | number

{string} A string representing the product.

matchSkuFromSkuName(skuName)

matchSkuFromSkuName(skuName: string): string | number;

Parse the sku from Sku resource.

Parameter
NameDescription
skuName string

A fully-qualified path representing Sku resource.

Returns
TypeDescription
string | number

{string} A string representing the sku.

offerPath(account, offer)

offerPath(account: string, offer: string): string;

Return a fully-qualified offer resource name string.

Parameters
NameDescription
account string
offer string
Returns
TypeDescription
string

{string} Resource name string.

productPath(product)

productPath(product: string): string;

Return a fully-qualified product resource name string.

Parameter
NameDescription
product string
Returns
TypeDescription
string

{string} Resource name string.

provisionCloudIdentity(request, options)

provisionCloudIdentity(request?: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a Cloud Identity for the given customer using the customer's information, or the information provided here.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer was not found. * ALREADY_EXISTS: The customer's primary email already exists. Retry after changing the customer's primary contact email. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata contains an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the customer.
   *  Format: accounts/{account_id}/customers/{customer_id}
   */
  // const customer = 'abc123'
  /**
   *  CloudIdentity-specific customer information.
   */
  // const cloudIdentityInfo = {}
  /**
   *  Admin user information.
   */
  // const user = {}
  /**
   *  Validate the request and preview the review, but do not post it.
   */
  // const validateOnly = true

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callProvisionCloudIdentity() {
    // Construct request
    const request = {
      customer,
    };

    // Run request
    const [operation] = await channelClient.provisionCloudIdentity(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callProvisionCloudIdentity();

provisionCloudIdentity(request, options, callback)

provisionCloudIdentity(request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

provisionCloudIdentity(request, callback)

provisionCloudIdentity(request: protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IProvisionCloudIdentityRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.ICustomer, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

registerSubscriber(request, options)

registerSubscriber(request?: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, options?: CallOptions): Promise<[
        protos.google.cloud.channel.v1.IRegisterSubscriberResponse,
        protos.google.cloud.channel.v1.IRegisterSubscriberRequest | undefined,
        {} | undefined
    ]>;

Registers a service account with subscriber privileges on the Cloud Pub/Sub topic for this Channel Services account. After you create a subscriber, you get the events through

Possible error codes:

* PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The topic name with the registered service email address.

Parameters
NameDescription
request protos.google.cloud.channel.v1.IRegisterSubscriberRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.channel.v1.IRegisterSubscriberResponse, protos.google.cloud.channel.v1.IRegisterSubscriberRequest | undefined, {} | undefined ]>

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

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the account.
   */
  // const account = 'abc123'
  /**
   *  Required. Service account that provides subscriber access to the registered topic.
   */
  // const serviceAccount = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callRegisterSubscriber() {
    // Construct request
    const request = {
      account,
      serviceAccount,
    };

    // Run request
    const response = await channelClient.registerSubscriber(request);
    console.log(response);
  }

  callRegisterSubscriber();

registerSubscriber(request, options, callback)

registerSubscriber(request: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, options: CallOptions, callback: Callback<protos.google.cloud.channel.v1.IRegisterSubscriberResponse, protos.google.cloud.channel.v1.IRegisterSubscriberRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IRegisterSubscriberRequest
options CallOptions
callback Callback<protos.google.cloud.channel.v1.IRegisterSubscriberResponse, protos.google.cloud.channel.v1.IRegisterSubscriberRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

registerSubscriber(request, callback)

registerSubscriber(request: protos.google.cloud.channel.v1.IRegisterSubscriberRequest, callback: Callback<protos.google.cloud.channel.v1.IRegisterSubscriberResponse, protos.google.cloud.channel.v1.IRegisterSubscriberRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IRegisterSubscriberRequest
callback Callback<protos.google.cloud.channel.v1.IRegisterSubscriberResponse, protos.google.cloud.channel.v1.IRegisterSubscriberRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

skuPath(product, sku)

skuPath(product: string, sku: string): string;

Return a fully-qualified sku resource name string.

Parameters
NameDescription
product string
sku string
Returns
TypeDescription
string

{string} Resource name string.

startPaidService(request, options)

startPaidService(request?: protos.google.cloud.channel.v1.IStartPaidServiceRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Starts paid service for a trial entitlement.

Starts paid service for a trial entitlement immediately. This method is only applicable if a plan is set up for a trial entitlement but has some trial days remaining.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * FAILED_PRECONDITION/NOT_IN_TRIAL: This method only works for entitlement on trial plans. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.IStartPaidServiceRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the entitlement to start a paid service for.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.startPaidService(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callStartPaidService();

startPaidService(request, options, callback)

startPaidService(request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IStartPaidServiceRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

startPaidService(request, callback)

startPaidService(request: protos.google.cloud.channel.v1.IStartPaidServiceRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.IStartPaidServiceRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

suspendEntitlement(request, options)

suspendEntitlement(request?: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Suspends a previously fulfilled entitlement.

An entitlement suspension is a long-running operation.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: Entitlement resource not found. * NOT_ACTIVE: Entitlement is not active. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.ISuspendEntitlementRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the entitlement to suspend.
   *  Name uses the format:
   *  accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

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

    // Run request
    const [operation] = await channelClient.suspendEntitlement(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callSuspendEntitlement();

suspendEntitlement(request, options, callback)

suspendEntitlement(request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ISuspendEntitlementRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

suspendEntitlement(request, callback)

suspendEntitlement(request: protos.google.cloud.channel.v1.ISuspendEntitlementRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ISuspendEntitlementRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.IEntitlement, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

transferEntitlements(request, options)

transferEntitlements(request?: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.channel.v1.ITransferEntitlementsResponse, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Transfers customer entitlements to new reseller.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * Specify all transferring entitlements. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.ITransferEntitlementsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.channel.v1.ITransferEntitlementsResponse, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account that will receive
   *  transferred entitlements.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The new entitlements to create or transfer.
   */
  // const entitlements = 1234
  /**
   *  The super admin of the resold customer generates this token to
   *  authorize a reseller to access their Cloud Identity and purchase
   *  entitlements on their behalf. You can omit this token after authorization.
   *  See https://support.google.com/a/answer/7643790 for more details.
   */
  // const authToken = 'abc123'
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callTransferEntitlements() {
    // Construct request
    const request = {
      parent,
      entitlements,
    };

    // Run request
    const [operation] = await channelClient.transferEntitlements(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTransferEntitlements();

transferEntitlements(request, options, callback)

transferEntitlements(request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.channel.v1.ITransferEntitlementsResponse, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ITransferEntitlementsRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.channel.v1.ITransferEntitlementsResponse, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

transferEntitlements(request, callback)

transferEntitlements(request: protos.google.cloud.channel.v1.ITransferEntitlementsRequest, callback: Callback<LROperation<protos.google.cloud.channel.v1.ITransferEntitlementsResponse, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ITransferEntitlementsRequest
callback Callback<LROperation<protos.google.cloud.channel.v1.ITransferEntitlementsResponse, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

transferEntitlementsToGoogle(request, options)

transferEntitlementsToGoogle(request?: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Transfers customer entitlements from their current reseller to Google.

Possible error codes:

* PERMISSION_DENIED: The customer doesn't belong to the reseller. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * NOT_FOUND: The customer or offer resource was not found. * ALREADY_EXISTS: The SKU was already transferred for the customer. * CONDITION_NOT_MET or FAILED_PRECONDITION: * The SKU requires domain verification to transfer, but the domain is not verified. * An Add-On SKU (example, Vault or Drive) is missing the pre-requisite SKU (example, G Suite Basic). * (Developer accounts only) Reseller and resold domain must meet the following naming requirements: * Domain names must start with goog-test. * Domain names must include the reseller domain. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support.

Return value: The ID of a long-running operation.

To get the results of the operation, call the GetOperation method of CloudChannelOperationsService. The response will contain google.protobuf.Empty on success. The Operation metadata will contain an instance of .

Parameters
NameDescription
request protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{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

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the reseller's customer account where the entitlements
   *  transfer from.
   *  Parent uses the format: accounts/{account_id}/customers/{customer_id}
   */
  // const parent = 'abc123'
  /**
   *  Required. The entitlements to transfer to Google.
   */
  // const entitlements = 1234
  /**
   *  Optional. You can specify an optional unique request ID, and if you need to retry
   *  your request, the server will know to ignore the request if it's complete.
   *  For example, 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
   *  it received the original operation with the same request ID. If it did, it
   *  will ignore the second request.
   *  The request ID must be a valid UUID (https://tools.ietf.org/html/rfc4122)
   *  with the exception that zero UUID is not supported
   *  (`00000000-0000-0000-0000-000000000000`).
   */
  // const requestId = 'abc123'

  // Imports the Channel library
  const {CloudChannelServiceClient} = require('@google-cloud/channel').v1;

  // Instantiates a client
  const channelClient = new CloudChannelServiceClient();

  async function callTransferEntitlementsToGoogle() {
    // Construct request
    const request = {
      parent,
      entitlements,
    };

    // Run request
    const [operation] = await channelClient.transferEntitlementsToGoogle(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callTransferEntitlementsToGoogle();

transferEntitlementsToGoogle(request, options, callback)

transferEntitlementsToGoogle(request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

transferEntitlementsToGoogle(request, callback)

transferEntitlementsToGoogle(request: protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.channel.v1.ITransferEntitlementsToGoogleRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.channel.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription