Google Cloud Channel V1 Client - Class CloudChannelServiceClient (1.7.0)

Reference documentation and code samples for the Google Cloud Channel V1 Client class CloudChannelServiceClient.

Service Description: 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:

  • Customers: An entity-usually an enterprise-managed by a reseller or distributor.

  • Entitlements: 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.

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

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:

$cloudChannelServiceClient = new CloudChannelServiceClient();
try {
    $name = 'name';
    $operationResponse = $cloudChannelServiceClient->activateEntitlement($name);
    $operationResponse->pollUntilComplete();
    if ($operationResponse->operationSucceeded()) {
        $result = $operationResponse->getResult();
        // doSomethingWith($result)
    } else {
        $error = $operationResponse->getError();
        // handleError($error)
    }
    // Alternatively:
    // start the operation, keep the operation name, and resume later
    $operationResponse = $cloudChannelServiceClient->activateEntitlement($name);
    $operationName = $operationResponse->getName();
    // ... do other work
    $newOperationResponse = $cloudChannelServiceClient->resumeOperation($operationName, 'activateEntitlement');
    while (!$newOperationResponse->isDone()) {
        // ... do other work
        $newOperationResponse->reload();
    }
    if ($newOperationResponse->operationSucceeded()) {
        $result = $newOperationResponse->getResult();
        // doSomethingWith($result)
    } else {
        $error = $newOperationResponse->getError();
        // handleError($error)
    }
} finally {
    $cloudChannelServiceClient->close();
}

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

This service has a new (beta) implementation. See Google\Cloud\Channel\V1\Client\CloudChannelServiceClient to use the new surface.

Namespace

Google \ Cloud \ Channel \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

activateEntitlement

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

Parameters
NameDescription
name string

Required. The resource name of the entitlement to activate. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Rpc\Status;

/**
 * @param string $name The resource name of the entitlement to activate.
 *                     Name uses the format:
 *                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 */
function activate_entitlement_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->activateEntitlement($name);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    activate_entitlement_sample($name);
}

cancelEntitlement

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

Parameters
NameDescription
name string

Required. The resource name of the entitlement to cancel. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Rpc\Status;

/**
 * @param string $name The resource name of the entitlement to cancel.
 *                     Name uses the format:
 *                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 */
function cancel_entitlement_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->cancelEntitlement($name);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            printf('Operation completed successfully.' . PHP_EOL);
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    cancel_entitlement_sample($name);
}

changeOffer

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

Parameters
NameDescription
name string

Required. The resource name of the entitlement to update. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

offer string

Required. New Offer. Format: accounts/{account_id}/offers/{offer_id}.

optionalArgs array

Optional.

↳ parameters Parameter[]

Optional. Parameters needed to purchase the Offer. To view the available Parameters refer to the Offer.parameter_definitions from the desired offer.

↳ purchaseOrderId string

Optional. Purchase order id provided by the reseller.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Rpc\Status;

/**
 * @param string $name           The resource name of the entitlement to update.
 *                               Name uses the format:
 *                               accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 * @param string $formattedOffer New Offer.
 *                               Format: accounts/{account_id}/offers/{offer_id}. Please see
 *                               {@see CloudChannelServiceClient::offerName()} for help formatting this field.
 */
function change_offer_sample(string $name, string $formattedOffer): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->changeOffer($name, $formattedOffer);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';
    $formattedOffer = CloudChannelServiceClient::offerName('[ACCOUNT]', '[OFFER]');

    change_offer_sample($name, $formattedOffer);
}

changeParameters

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

Parameters
NameDescription
name string

Required. The name of the entitlement to update. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

parameters array<Google\Cloud\Channel\V1\Parameter>

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 from the desired offer.

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ purchaseOrderId string

Optional. Purchase order ID provided by the reseller.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\Parameter;
use Google\Rpc\Status;

/**
 * @param string $name The name of the entitlement to update.
 *                     Name uses the format:
 *                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 */
function change_parameters_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $parameters = [new Parameter()];

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->changeParameters($name, $parameters);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    change_parameters_sample($name);
}

changeRenewalSettings

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

Parameters
NameDescription
name string

Required. The name of the entitlement to update. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

renewalSettings Google\Cloud\Channel\V1\RenewalSettings

Required. New renewal settings.

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\RenewalSettings;
use Google\Rpc\Status;

/**
 * @param string $name The name of the entitlement to update.
 *                     Name uses the format:
 *                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 */
function change_renewal_settings_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $renewalSettings = new RenewalSettings();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->changeRenewalSettings($name, $renewalSettings);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    change_renewal_settings_sample($name);
}

checkCloudIdentityAccountsExist

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 CloudIdentityCustomerAccount resources for the domain (may be empty)

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

Parameters
NameDescription
parent string

Required. The reseller account's resource name. Parent uses the format: accounts/{account_id}

domain string

Required. Domain to fetch for Cloud Identity account customer.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $parent The reseller account's resource name.
 *                       Parent uses the format: accounts/{account_id}
 * @param string $domain Domain to fetch for Cloud Identity account customer.
 */
function check_cloud_identity_accounts_exist_sample(string $parent, string $domain): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var CheckCloudIdentityAccountsExistResponse $response */
        $response = $cloudChannelServiceClient->checkCloudIdentityAccountsExist($parent, $domain);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';
    $domain = '[DOMAIN]';

    check_cloud_identity_accounts_exist_sample($parent, $domain);
}

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 ChannelPartnerLink resource.

Parameters
NameDescription
parent string

Required. Create a channel partner link for the provided reseller account's resource name. Parent uses the format: accounts/{account_id}

channelPartnerLink Google\Cloud\Channel\V1\ChannelPartnerLink

Required. The channel partner link to create. Either channel_partner_link.reseller_cloud_identity_id or domain can be used to create a link.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\ChannelPartnerLink
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerLink;
use Google\Cloud\Channel\V1\ChannelPartnerLinkState;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $parent                                    Create a channel partner link for the provided reseller account's
 *                                                          resource name.
 *                                                          Parent uses the format: accounts/{account_id}
 * @param string $channelPartnerLinkResellerCloudIdentityId Cloud Identity ID of the linked reseller.
 * @param int    $channelPartnerLinkLinkState               State of the channel partner link.
 */
function create_channel_partner_link_sample(
    string $parent,
    string $channelPartnerLinkResellerCloudIdentityId,
    int $channelPartnerLinkLinkState
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $channelPartnerLink = (new ChannelPartnerLink())
        ->setResellerCloudIdentityId($channelPartnerLinkResellerCloudIdentityId)
        ->setLinkState($channelPartnerLinkLinkState);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerLink $response */
        $response = $cloudChannelServiceClient->createChannelPartnerLink($parent, $channelPartnerLink);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';
    $channelPartnerLinkResellerCloudIdentityId = '[RESELLER_CLOUD_IDENTITY_ID]';
    $channelPartnerLinkLinkState = ChannelPartnerLinkState::CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED;

    create_channel_partner_link_sample(
        $parent,
        $channelPartnerLinkResellerCloudIdentityId,
        $channelPartnerLinkLinkState
    );
}

createChannelPartnerRepricingConfig

Creates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. You can only create configs if the RepricingConfig.effective_invoice_month is a future month. If needed, you can create a config for the current month, with some restrictions.

When creating a config for a future month, make sure there are no existing configs for that RepricingConfig.effective_invoice_month.

The following restrictions are for creating configs in the current month.

  • This functionality is reserved for recovering from an erroneous config, and should not be used for regular business cases.
  • The new config will not modify exports used with other configs. Changes to the config may be immediate, but may take up to 24 hours.
  • There is a limit of ten configs for any ChannelPartner or RepricingConfig.effective_invoice_month.
  • The contained ChannelPartnerRepricingConfig.repricing_config vaule must be different from the value used in the current config for a ChannelPartner.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated ChannelPartnerRepricingConfig resource, otherwise returns an error.

Parameters
NameDescription
parent string

Required. The resource name of the ChannelPartner that will receive the repricing config. Parent uses the format: accounts/{account_id}/channelPartnerLinks/{channel_partner_id}

channelPartnerRepricingConfig Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig

Required. The ChannelPartnerRepricingConfig object to update.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\RebillingBasis;
use Google\Cloud\Channel\V1\RepricingAdjustment;
use Google\Cloud\Channel\V1\RepricingConfig;
use Google\Type\Date;

/**
 * @param string $formattedParent                                            The resource name of the ChannelPartner that will receive the
 *                                                                           repricing config. Parent uses the format:
 *                                                                           accounts/{account_id}/channelPartnerLinks/{channel_partner_id}
 *                                                                           Please see {@see CloudChannelServiceClient::channelPartnerLinkName()} for help formatting this field.
 * @param int    $channelPartnerRepricingConfigRepricingConfigRebillingBasis The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to
 *                                                                           use for this bill. Specifies the relative cost based on repricing costs you
 *                                                                           will apply.
 */
function create_channel_partner_repricing_config_sample(
    string $formattedParent,
    int $channelPartnerRepricingConfigRepricingConfigRebillingBasis
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $channelPartnerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $channelPartnerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($channelPartnerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($channelPartnerRepricingConfigRepricingConfigRebillingBasis);
    $channelPartnerRepricingConfig = (new ChannelPartnerRepricingConfig())
        ->setRepricingConfig($channelPartnerRepricingConfigRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerRepricingConfig $response */
        $response = $cloudChannelServiceClient->createChannelPartnerRepricingConfig(
            $formattedParent,
            $channelPartnerRepricingConfig
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::channelPartnerLinkName(
        '[ACCOUNT]',
        '[CHANNEL_PARTNER_LINK]'
    );
    $channelPartnerRepricingConfigRepricingConfigRebillingBasis = RebillingBasis::REBILLING_BASIS_UNSPECIFIED;

    create_channel_partner_repricing_config_sample(
        $formattedParent,
        $channelPartnerRepricingConfigRepricingConfigRebillingBasis
    );
}

createCustomer

Creates a new Customer 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 Customer resource.

Parameters
NameDescription
parent string

Required. The resource name of reseller account in which to create the customer. Parent uses the format: accounts/{account_id}

customer Google\Cloud\Channel\V1\Customer

Required. The customer to create.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Type\PostalAddress;

/**
 * @param string $parent                 The resource name of reseller account in which to create the
 *                                       customer. Parent uses the format: accounts/{account_id}
 * @param string $customerOrgDisplayName Name of the organization that the customer entity represents.
 * @param string $customerDomain         The customer's primary domain. Must match the primary contact
 *                                       email's domain.
 */
function create_customer_sample(
    string $parent,
    string $customerOrgDisplayName,
    string $customerDomain
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customerOrgPostalAddress = new PostalAddress();
    $customer = (new Customer())
        ->setOrgDisplayName($customerOrgDisplayName)
        ->setOrgPostalAddress($customerOrgPostalAddress)
        ->setDomain($customerDomain);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->createCustomer($parent, $customer);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';
    $customerOrgDisplayName = '[ORG_DISPLAY_NAME]';
    $customerDomain = '[DOMAIN]';

    create_customer_sample($parent, $customerOrgDisplayName, $customerDomain);
}

createCustomerRepricingConfig

Creates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. You can only create configs if the RepricingConfig.effective_invoice_month is a future month. If needed, you can create a config for the current month, with some restrictions.

When creating a config for a future month, make sure there are no existing configs for that RepricingConfig.effective_invoice_month.

The following restrictions are for creating configs in the current month.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The CustomerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated CustomerRepricingConfig resource, otherwise returns an error.

Parameters
NameDescription
parent string

Required. The resource name of the customer that will receive this repricing config. Parent uses the format: accounts/{account_id}/customers/{customer_id}

customerRepricingConfig Google\Cloud\Channel\V1\CustomerRepricingConfig

Required. The CustomerRepricingConfig object to update.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\CustomerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CustomerRepricingConfig;
use Google\Cloud\Channel\V1\RebillingBasis;
use Google\Cloud\Channel\V1\RepricingAdjustment;
use Google\Cloud\Channel\V1\RepricingConfig;
use Google\Type\Date;

/**
 * @param string $formattedParent                                      The resource name of the customer that will receive this
 *                                                                     repricing config. Parent uses the format:
 *                                                                     accounts/{account_id}/customers/{customer_id}
 *                                                                     Please see {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 * @param int    $customerRepricingConfigRepricingConfigRebillingBasis The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to
 *                                                                     use for this bill. Specifies the relative cost based on repricing costs you
 *                                                                     will apply.
 */
function create_customer_repricing_config_sample(
    string $formattedParent,
    int $customerRepricingConfigRepricingConfigRebillingBasis
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $customerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $customerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($customerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($customerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($customerRepricingConfigRepricingConfigRebillingBasis);
    $customerRepricingConfig = (new CustomerRepricingConfig())
        ->setRepricingConfig($customerRepricingConfigRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var CustomerRepricingConfig $response */
        $response = $cloudChannelServiceClient->createCustomerRepricingConfig(
            $formattedParent,
            $customerRepricingConfig
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');
    $customerRepricingConfigRepricingConfigRebillingBasis = RebillingBasis::REBILLING_BASIS_UNSPECIFIED;

    create_customer_repricing_config_sample(
        $formattedParent,
        $customerRepricingConfigRepricingConfigRebillingBasis
    );
}

createEntitlement

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

Parameters
NameDescription
parent string

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}

entitlement Google\Cloud\Channel\V1\Entitlement

Required. The entitlement to create.

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Rpc\Status;

/**
 * @param string $formattedParent           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}
 *                                          Please see {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 * @param string $formattedEntitlementOffer The offer resource name for which the entitlement is to be
 *                                          created. Takes the form: accounts/{account_id}/offers/{offer_id}. Please see
 *                                          {@see CloudChannelServiceClient::offerName()} for help formatting this field.
 */
function create_entitlement_sample(
    string $formattedParent,
    string $formattedEntitlementOffer
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $entitlement = (new Entitlement())
        ->setOffer($formattedEntitlementOffer);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->createEntitlement($formattedParent, $entitlement);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');
    $formattedEntitlementOffer = CloudChannelServiceClient::offerName('[ACCOUNT]', '[OFFER]');

    create_entitlement_sample($formattedParent, $formattedEntitlementOffer);
}

deleteChannelPartnerRepricingConfig

Deletes the given ChannelPartnerRepricingConfig permanently. You can only delete configs if their RepricingConfig.effective_invoice_month is set to a date after the current month.

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 ChannelPartnerRepricingConfig is active or in the past.
  • NOT_FOUND: No ChannelPartnerRepricingConfig found for the name in the request.
Parameters
NameDescription
name string

Required. The resource name of the channel partner repricing config rule to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $formattedName The resource name of the channel partner repricing config rule to
 *                              delete. Please see
 *                              {@see CloudChannelServiceClient::channelPartnerRepricingConfigName()} for help formatting this field.
 */
function delete_channel_partner_repricing_config_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        $cloudChannelServiceClient->deleteChannelPartnerRepricingConfig($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::channelPartnerRepricingConfigName(
        '[ACCOUNT]',
        '[CHANNEL_PARTNER]',
        '[CHANNEL_PARTNER_REPRICING_CONFIG]'
    );

    delete_channel_partner_repricing_config_sample($formattedName);
}

deleteCustomer

Deletes the given Customer 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 Customer resource found for the name in the request.
Parameters
NameDescription
name string

Required. The resource name of the customer to delete.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $formattedName The resource name of the customer to delete. Please see
 *                              {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function delete_customer_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        $cloudChannelServiceClient->deleteCustomer($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    delete_customer_sample($formattedName);
}

deleteCustomerRepricingConfig

Deletes the given CustomerRepricingConfig permanently. You can only delete configs if their RepricingConfig.effective_invoice_month is set to a date after the current month.

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 CustomerRepricingConfig is active or in the past.
  • NOT_FOUND: No CustomerRepricingConfig found for the name in the request.
Parameters
NameDescription
name string

Required. The resource name of the customer repricing config rule to delete. Format: accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $formattedName The resource name of the customer repricing config rule to
 *                              delete. Format:
 *                              accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. Please see
 *                              {@see CloudChannelServiceClient::customerRepricingConfigName()} for help formatting this field.
 */
function delete_customer_repricing_config_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        $cloudChannelServiceClient->deleteCustomerRepricingConfig($formattedName);
        printf('Call completed successfully.' . PHP_EOL);
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::customerRepricingConfigName(
        '[ACCOUNT]',
        '[CUSTOMER]',
        '[CUSTOMER_REPRICING_CONFIG]'
    );

    delete_customer_repricing_config_sample($formattedName);
}

Returns the requested ChannelPartnerLink 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 ChannelPartnerLink resource.

Parameters
NameDescription
name string

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.

optionalArgs array

Optional.

↳ view int

Optional. The level of granularity the ChannelPartnerLink will display. For allowed values, use constants defined on Google\Cloud\Channel\V1\ChannelPartnerLinkView

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\ChannelPartnerLink
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerLink;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $name 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.
 */
function get_channel_partner_link_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerLink $response */
        $response = $cloudChannelServiceClient->getChannelPartnerLink($name);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    get_channel_partner_link_sample($name);
}

getChannelPartnerRepricingConfig

Gets information about how a Distributor modifies their bill before sending it to a ChannelPartner.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The ChannelPartnerRepricingConfig was not found.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the ChannelPartnerRepricingConfig resource, otherwise returns an error.

Parameters
NameDescription
name string

Required. The resource name of the ChannelPartnerRepricingConfig Format: accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $formattedName The resource name of the ChannelPartnerRepricingConfig
 *                              Format:
 *                              accounts/{account_id}/channelPartnerLinks/{channel_partner_id}/channelPartnerRepricingConfigs/{id}. Please see
 *                              {@see CloudChannelServiceClient::channelPartnerRepricingConfigName()} for help formatting this field.
 */
function get_channel_partner_repricing_config_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerRepricingConfig $response */
        $response = $cloudChannelServiceClient->getChannelPartnerRepricingConfig($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::channelPartnerRepricingConfigName(
        '[ACCOUNT]',
        '[CHANNEL_PARTNER]',
        '[CHANNEL_PARTNER_REPRICING_CONFIG]'
    );

    get_channel_partner_repricing_config_sample($formattedName);
}

getCustomer

Returns the requested Customer 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 Customer resource.

Parameters
NameDescription
name string

Required. The resource name of the customer to retrieve. Name uses the format: accounts/{account_id}/customers/{customer_id}

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;

/**
 * @param string $formattedName The resource name of the customer to retrieve.
 *                              Name uses the format: accounts/{account_id}/customers/{customer_id}
 *                              Please see {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function get_customer_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->getCustomer($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    get_customer_sample($formattedName);
}

getCustomerRepricingConfig

Gets information about how a Reseller modifies their bill before sending it to a Customer.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The CustomerRepricingConfig was not found.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the CustomerRepricingConfig resource, otherwise returns an error.

Parameters
NameDescription
name string

Required. The resource name of the CustomerRepricingConfig. Format: accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\CustomerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CustomerRepricingConfig;

/**
 * @param string $formattedName The resource name of the CustomerRepricingConfig.
 *                              Format:
 *                              accounts/{account_id}/customers/{customer_id}/customerRepricingConfigs/{id}. Please see
 *                              {@see CloudChannelServiceClient::customerRepricingConfigName()} for help formatting this field.
 */
function get_customer_repricing_config_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var CustomerRepricingConfig $response */
        $response = $cloudChannelServiceClient->getCustomerRepricingConfig($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::customerRepricingConfigName(
        '[ACCOUNT]',
        '[CUSTOMER]',
        '[CUSTOMER_REPRICING_CONFIG]'
    );

    get_customer_repricing_config_sample($formattedName);
}

getEntitlement

Returns the requested Entitlement 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 Entitlement resource.

Parameters
NameDescription
name string

Required. The resource name of the entitlement to retrieve. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\Entitlement
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;

/**
 * @param string $formattedName The resource name of the entitlement to retrieve.
 *                              Name uses the format:
 *                              accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 *                              Please see {@see CloudChannelServiceClient::entitlementName()} for help formatting this field.
 */
function get_entitlement_sample(string $formattedName): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Entitlement $response */
        $response = $cloudChannelServiceClient->getEntitlement($formattedName);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedName = CloudChannelServiceClient::entitlementName(
        '[ACCOUNT]',
        '[CUSTOMER]',
        '[ENTITLEMENT]'
    );

    get_entitlement_sample($formattedName);
}

importCustomer

Imports a Customer 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 Customer.

Parameters
NameDescription
customerIdentity Google\Cloud\Channel\V1\ImportCustomerRequest\CustomerIdentityOneof

An instance of the wrapper class for the required proto oneof customer_identity.

parent string

Required. The resource name of the reseller's account. Parent takes the format: accounts/{account_id} or accounts/{account_id}/channelPartnerLinks/{channel_partner_id}

overwriteIfExists bool

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.

optionalArgs array

Optional.

↳ authToken string

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.

↳ channelPartnerId string

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.

↳ customer string

Optional. Specifies the customer that will receive imported Cloud Identity information. Format: accounts/{account_id}/customers/{customer_id}

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Cloud\Channel\V1\ImportCustomerRequest\CustomerIdentityOneof;

/**
 * @param string $customerIdentityDomain Customer domain.
 * @param string $parent                 The resource name of the reseller's account.
 *                                       Parent takes the format: accounts/{account_id} or
 *                                       accounts/{account_id}/channelPartnerLinks/{channel_partner_id}
 * @param bool   $overwriteIfExists      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.
 */
function import_customer_sample(
    string $customerIdentityDomain,
    string $parent,
    bool $overwriteIfExists
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customerIdentity = (new CustomerIdentityOneof())
        ->setDomain($customerIdentityDomain);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->importCustomer(
            $customerIdentity,
            $parent,
            $overwriteIfExists
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $customerIdentityDomain = '[DOMAIN]';
    $parent = '[PARENT]';
    $overwriteIfExists = false;

    import_customer_sample($customerIdentityDomain, $parent, $overwriteIfExists);
}

List ChannelPartnerLinks 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 ChannelPartnerLink resources.

Parameters
NameDescription
parent string

Required. The resource name of the reseller account for listing channel partner links. Parent uses the format: accounts/{account_id}

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ view int

Optional. The level of granularity the ChannelPartnerLink will display. For allowed values, use constants defined on Google\Cloud\Channel\V1\ChannelPartnerLinkView

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\ChannelPartnerLink;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $parent The resource name of the reseller account for listing channel
 *                       partner links. Parent uses the format: accounts/{account_id}
 */
function list_channel_partner_links_sample(string $parent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listChannelPartnerLinks($parent);

        /** @var ChannelPartnerLink $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';

    list_channel_partner_links_sample($parent);
}

listChannelPartnerRepricingConfigs

Lists information about how a Reseller modifies their bill before sending it to a ChannelPartner.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the ChannelPartnerRepricingConfig resources. The data for each resource is displayed in the ascending order of:

If unsuccessful, returns an error.

Parameters
NameDescription
parent string

Required. The resource name of the account's ChannelPartnerLink. Parent uses the format: accounts/{account_id}/channelPartnerLinks/{channel_partner_id}. Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs for all channel partners.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. A filter for [CloudChannelService.ListChannelPartnerRepricingConfigs] results (channel_partner_link only). You can use this filter when you support a BatchGet-like query. To use the filter, you must set parent=accounts/{account_id}/channelPartnerLinks/-. Example: channel_partner_link = accounts/account_id/channelPartnerLinks/c1 OR channel_partner_link = accounts/account_id/channelPartnerLinks/c2.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $formattedParent The resource name of the account's
 *                                [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]. Parent
 *                                uses the format:
 *                                accounts/{account_id}/channelPartnerLinks/{channel_partner_id}.
 *                                Supports accounts/{account_id}/channelPartnerLinks/- to retrieve configs
 *                                for all channel partners. Please see
 *                                {@see CloudChannelServiceClient::channelPartnerLinkName()} for help formatting this field.
 */
function list_channel_partner_repricing_configs_sample(string $formattedParent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listChannelPartnerRepricingConfigs($formattedParent);

        /** @var ChannelPartnerRepricingConfig $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::channelPartnerLinkName(
        '[ACCOUNT]',
        '[CHANNEL_PARTNER_LINK]'
    );

    list_channel_partner_repricing_configs_sample($formattedParent);
}

listCustomerRepricingConfigs

Lists information about how a Reseller modifies their bill before sending it to a Customer.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • NOT_FOUND: The CustomerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the CustomerRepricingConfig resources. The data for each resource is displayed in the ascending order of:

If unsuccessful, returns an error.

Parameters
NameDescription
parent string

Required. The resource name of the customer. Parent uses the format: accounts/{account_id}/customers/{customer_id}. Supports accounts/{account_id}/customers/- to retrieve configs for all customers.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs] results (customer only). You can use this filter when you support a BatchGet-like query. To use the filter, you must set parent=accounts/{account_id}/customers/-. Example: customer = accounts/account_id/customers/c1 OR customer = accounts/account_id/customers/c2.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CustomerRepricingConfig;

/**
 * @param string $formattedParent The resource name of the customer.
 *                                Parent uses the format: accounts/{account_id}/customers/{customer_id}.
 *                                Supports accounts/{account_id}/customers/- to retrieve configs for all
 *                                customers. Please see
 *                                {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function list_customer_repricing_configs_sample(string $formattedParent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listCustomerRepricingConfigs($formattedParent);

        /** @var CustomerRepricingConfig $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    list_customer_repricing_configs_sample($formattedParent);
}

listCustomers

List Customers.

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 Customers, or an empty list if there are no customers.

Parameters
NameDescription
parent string

Required. The resource name of the reseller account to list customers from. Parent uses the format: accounts/{account_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filters applied to the [CloudChannelService.ListCustomers] results. See https://cloud.google.com/channel/docs/concepts/google-cloud/filter-customers for more information.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;

/**
 * @param string $parent The resource name of the reseller account to list customers from.
 *                       Parent uses the format: accounts/{account_id}.
 */
function list_customers_sample(string $parent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listCustomers($parent);

        /** @var Customer $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';

    list_customers_sample($parent);
}

listEntitlementChanges

List entitlement history.

Possible error codes:

  • PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different.
  • INVALID_ARGUMENT: Missing or invalid required fields in the request.
  • NOT_FOUND: The parent resource doesn't exist. Usually the result of an invalid name parameter.
  • INTERNAL: Any non-user error related to a technical issue in the backend. In this case, contact CloudChannel support.
  • UNKNOWN: Any non-user error related to a technical issue in the backend. In this case, contact Cloud Channel support.

Return value: List of EntitlementChanges.

Parameters
NameDescription
parent string

Required. The resource name of the entitlement for which to list entitlement changes. The - wildcard may be used to match entitlements across a customer. Formats:

  • accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
  • accounts/{account_id}/customers/{customer_id}/entitlements/-
optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

Optional. Filters applied to the list results.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\EntitlementChange;

/**
 * @param string $formattedParent The resource name of the entitlement for which to list
 *                                entitlement changes. The `-` wildcard may be used to match entitlements
 *                                across a customer. Formats:
 *
 *                                * accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 *                                * accounts/{account_id}/customers/{customer_id}/entitlements/-
 *                                Please see {@see CloudChannelServiceClient::entitlementName()} for help formatting this field.
 */
function list_entitlement_changes_sample(string $formattedParent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listEntitlementChanges($formattedParent);

        /** @var EntitlementChange $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::entitlementName(
        '[ACCOUNT]',
        '[CUSTOMER]',
        '[ENTITLEMENT]'
    );

    list_entitlement_changes_sample($formattedParent);
}

listEntitlements

Lists Entitlements 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 Entitlements.

Parameters
NameDescription
parent string

Required. The resource name of the reseller's customer account to list entitlements for. Parent uses the format: accounts/{account_id}/customers/{customer_id}

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;

/**
 * @param string $formattedParent The resource name of the reseller's customer account to list
 *                                entitlements for.
 *                                Parent uses the format: accounts/{account_id}/customers/{customer_id}
 *                                Please see {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function list_entitlements_sample(string $formattedParent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listEntitlements($formattedParent);

        /** @var Entitlement $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    list_entitlements_sample($formattedParent);
}

listOffers

Lists the Offers the reseller can sell.

Possible error codes:

  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
Parameters
NameDescription
parent string

Required. The resource name of the reseller account from which to list Offers. Parent uses the format: accounts/{account_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ filter string

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

↳ languageCode string

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

↳ showFutureOffers bool

Optional. A boolean flag that determines if a response returns future offers 30 days from now. If the show_future_offers is true, the response will only contain offers that are scheduled to be available 30 days from now.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Offer;

/**
 * @param string $parent The resource name of the reseller account from which to list
 *                       Offers. Parent uses the format: accounts/{account_id}.
 */
function list_offers_sample(string $parent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listOffers($parent);

        /** @var Offer $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';

    list_offers_sample($parent);
}

listProducts

Lists the Products the reseller is authorized to sell.

Possible error codes:

  • INVALID_ARGUMENT: Required request parameters are missing or invalid.
Parameters
NameDescription
account string

Required. The resource name of the reseller account. Format: accounts/{account_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ languageCode string

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

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Product;

/**
 * @param string $account The resource name of the reseller account.
 *                        Format: accounts/{account_id}.
 */
function list_products_sample(string $account): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listProducts($account);

        /** @var Product $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $account = '[ACCOUNT]';

    list_products_sample($account);
}

listPurchasableOffers

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
customer string

Required. The resource name of the customer to list Offers for. Format: accounts/{account_id}/customers/{customer_id}.

optionalArgs array

Optional.

↳ createEntitlementPurchase CreateEntitlementPurchase

List Offers for CreateEntitlement purchase.

↳ changeOfferPurchase ChangeOfferPurchase

List Offers for ChangeOffer purchase.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ languageCode string

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

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\PurchasableOffer;

/**
 * @param string $formattedCustomer The resource name of the customer to list Offers for.
 *                                  Format: accounts/{account_id}/customers/{customer_id}. Please see
 *                                  {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function list_purchasable_offers_sample(string $formattedCustomer): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listPurchasableOffers($formattedCustomer);

        /** @var PurchasableOffer $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedCustomer = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    list_purchasable_offers_sample($formattedCustomer);
}

listPurchasableSkus

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
customer string

Required. The resource name of the customer to list SKUs for. Format: accounts/{account_id}/customers/{customer_id}.

optionalArgs array

Optional.

↳ createEntitlementPurchase Google\Cloud\Channel\V1\ListPurchasableSkusRequest\CreateEntitlementPurchase

List SKUs for CreateEntitlement purchase.

↳ changeOfferPurchase Google\Cloud\Channel\V1\ListPurchasableSkusRequest\ChangeOfferPurchase

List SKUs for ChangeOffer purchase with a new SKU.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ languageCode string

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

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\PurchasableSku;

/**
 * @param string $formattedCustomer The resource name of the customer to list SKUs for.
 *                                  Format: accounts/{account_id}/customers/{customer_id}. Please see
 *                                  {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function list_purchasable_skus_sample(string $formattedCustomer): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listPurchasableSkus($formattedCustomer);

        /** @var PurchasableSku $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedCustomer = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    list_purchasable_skus_sample($formattedCustomer);
}

listSkuGroupBillableSkus

Lists the Billable SKUs in a given SKU group.

Possible error codes: PERMISSION_DENIED: If the account making the request and the account being queried for are different, or the account doesn't exist. INVALID_ARGUMENT: Missing or invalid required parameters in the request. INTERNAL: Any non-user error related to technical issue in the backend. In this case, contact cloud channel support.

Return Value: If successful, the BillableSku resources. The data for each resource is displayed in the ascending order of:

If unsuccessful, returns an error.

Parameters
NameDescription
parent string

Required. Resource name of the SKU group. Format: accounts/{account}/skuGroups/{sku_group}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\BillableSku;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $formattedParent Resource name of the SKU group.
 *                                Format: accounts/{account}/skuGroups/{sku_group}. Please see
 *                                {@see CloudChannelServiceClient::skuGroupName()} for help formatting this field.
 */
function list_sku_group_billable_skus_sample(string $formattedParent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listSkuGroupBillableSkus($formattedParent);

        /** @var BillableSku $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::skuGroupName('[ACCOUNT]', '[SKU_GROUP]');

    list_sku_group_billable_skus_sample($formattedParent);
}

listSkuGroups

Lists the Rebilling supported SKU groups the account is authorized to sell.

Reference: https://cloud.google.com/skus/sku-groups

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different, or the account doesn't exist.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the SkuGroup resources. The data for each resource is displayed in the alphabetical order of SKU group display name. The data for each resource is displayed in the ascending order of SkuGroup.display_name

If unsuccessful, returns an error.

Parameters
NameDescription
parent string

Required. The resource name of the account from which to list SKU groups. Parent uses the format: accounts/{account}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\SkuGroup;

/**
 * @param string $parent The resource name of the account from which to list SKU groups.
 *                       Parent uses the format: accounts/{account}.
 */
function list_sku_groups_sample(string $parent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listSkuGroups($parent);

        /** @var SkuGroup $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';

    list_sku_groups_sample($parent);
}

listSkus

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
parent string

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.

account string

Required. Resource name of the reseller. Format: accounts/{account_id}.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ languageCode string

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

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Sku;

/**
 * @param string $formattedParent 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. Please see
 *                                {@see CloudChannelServiceClient::productName()} for help formatting this field.
 * @param string $account         Resource name of the reseller.
 *                                Format: accounts/{account_id}.
 */
function list_skus_sample(string $formattedParent, string $account): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listSkus($formattedParent, $account);

        /** @var Sku $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = CloudChannelServiceClient::productName('[PRODUCT]');
    $account = '[ACCOUNT]';

    list_skus_sample($formattedParent, $account);
}

listSubscribers

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
account string

Required. Resource name of the account.

optionalArgs array

Optional.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;

/**
 * @param string $account Resource name of the account.
 */
function list_subscribers_sample(string $account): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listSubscribers($account);

        /** @var string $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element);
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $account = '[ACCOUNT]';

    list_subscribers_sample($account);
}

listTransferableOffers

List TransferableOffers 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 customer provided incorrect reseller information when generating auth token.
  • 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 TransferableOffer for the given customer and SKU.

Parameters
NameDescription
parent string

Required. The resource name of the reseller's account.

sku string

Required. The SKU to look up Offers for.

optionalArgs array

Optional.

↳ cloudIdentityId string

Customer's Cloud Identity ID

↳ customerName string

A reseller should create a customer and use the resource name of that customer here.

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ languageCode string

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

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\TransferableOffer;

/**
 * @param string $parent The resource name of the reseller's account.
 * @param string $sku    The SKU to look up Offers for.
 */
function list_transferable_offers_sample(string $parent, string $sku): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listTransferableOffers($parent, $sku);

        /** @var TransferableOffer $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';
    $sku = '[SKU]';

    list_transferable_offers_sample($parent, $sku);
}

listTransferableSkus

List TransferableSkus 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 TransferableSku.

Parameters
NameDescription
parent string

Required. The reseller account's resource name. Parent uses the format: accounts/{account_id}

optionalArgs array

Optional.

↳ cloudIdentityId string

Customer's Cloud Identity ID

↳ customerName string

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}

↳ pageSize int

The maximum number of resources contained in the underlying API response. The API may return fewer values in a page, even if there are additional values to be retrieved.

↳ pageToken string

A page token is used to specify a page of values to be returned. If no page token is specified (the default), the first page of values will be returned. Any page token used here must have been generated by a previous call to the API.

↳ authToken string

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.

↳ languageCode string

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.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\TransferableSku;

/**
 * @param string $parent The reseller account's resource name.
 *                       Parent uses the format: accounts/{account_id}
 */
function list_transferable_skus_sample(string $parent): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var PagedListResponse $response */
        $response = $cloudChannelServiceClient->listTransferableSkus($parent);

        /** @var TransferableSku $element */
        foreach ($response as $element) {
            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';

    list_transferable_skus_sample($parent);
}

lookupOffer

Returns the requested Offer 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 Offer resource.

Parameters
NameDescription
entitlement string

Required. The resource name of the entitlement to retrieve the Offer. Entitlement uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\Offer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Offer;

/**
 * @param string $formattedEntitlement The resource name of the entitlement to retrieve the Offer.
 *                                     Entitlement uses the format:
 *                                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 *                                     Please see {@see CloudChannelServiceClient::entitlementName()} for help formatting this field.
 */
function lookup_offer_sample(string $formattedEntitlement): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var Offer $response */
        $response = $cloudChannelServiceClient->lookupOffer($formattedEntitlement);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedEntitlement = CloudChannelServiceClient::entitlementName(
        '[ACCOUNT]',
        '[CUSTOMER]',
        '[ENTITLEMENT]'
    );

    lookup_offer_sample($formattedEntitlement);
}

provisionCloudIdentity

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

Parameters
NameDescription
customer string

Required. Resource name of the customer. Format: accounts/{account_id}/customers/{customer_id}

optionalArgs array

Optional.

↳ cloudIdentityInfo CloudIdentityInfo

CloudIdentity-specific customer information.

↳ user AdminUser

Admin user information.

↳ validateOnly bool

Validate the request and preview the review, but do not post it.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Rpc\Status;

/**
 * @param string $formattedCustomer Resource name of the customer.
 *                                  Format: accounts/{account_id}/customers/{customer_id}
 *                                  Please see {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 */
function provision_cloud_identity_sample(string $formattedCustomer): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->provisionCloudIdentity($formattedCustomer);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Customer $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedCustomer = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');

    provision_cloud_identity_sample($formattedCustomer);
}

registerSubscriber

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 SubscriberEvent

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
account string

Required. Resource name of the account.

serviceAccount string

Required. Service account that provides subscriber access to the registered topic.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\RegisterSubscriberResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\RegisterSubscriberResponse;

/**
 * @param string $account        Resource name of the account.
 * @param string $serviceAccount Service account that provides subscriber access to the registered
 *                               topic.
 */
function register_subscriber_sample(string $account, string $serviceAccount): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var RegisterSubscriberResponse $response */
        $response = $cloudChannelServiceClient->registerSubscriber($account, $serviceAccount);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $account = '[ACCOUNT]';
    $serviceAccount = '[SERVICE_ACCOUNT]';

    register_subscriber_sample($account, $serviceAccount);
}

startPaidService

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

Parameters
NameDescription
name string

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}

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Rpc\Status;

/**
 * @param string $name The name of the entitlement to start a paid service for.
 *                     Name uses the format:
 *                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 */
function start_paid_service_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->startPaidService($name);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    start_paid_service_sample($name);
}

suspendEntitlement

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

Parameters
NameDescription
name string

Required. The resource name of the entitlement to suspend. Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Rpc\Status;

/**
 * @param string $name The resource name of the entitlement to suspend.
 *                     Name uses the format:
 *                     accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id}
 */
function suspend_entitlement_sample(string $name): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->suspendEntitlement($name);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var Entitlement $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';

    suspend_entitlement_sample($name);
}

transferEntitlements

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

Parameters
NameDescription
parent string

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}

entitlements array<Google\Cloud\Channel\V1\Entitlement>

Required. The new entitlements to create or transfer.

optionalArgs array

Optional.

↳ authToken string

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.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\TransferEntitlementsResponse;
use Google\Rpc\Status;

/**
 * @param string $parent                     The resource name of the reseller's customer account that will
 *                                           receive transferred entitlements. Parent uses the format:
 *                                           accounts/{account_id}/customers/{customer_id}
 * @param string $formattedEntitlementsOffer The offer resource name for which the entitlement is to be
 *                                           created. Takes the form: accounts/{account_id}/offers/{offer_id}. Please see
 *                                           {@see CloudChannelServiceClient::offerName()} for help formatting this field.
 */
function transfer_entitlements_sample(string $parent, string $formattedEntitlementsOffer): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $entitlement = (new Entitlement())
        ->setOffer($formattedEntitlementsOffer);
    $entitlements = [$entitlement,];

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->transferEntitlements($parent, $entitlements);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var TransferEntitlementsResponse $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';
    $formattedEntitlementsOffer = CloudChannelServiceClient::offerName('[ACCOUNT]', '[OFFER]');

    transfer_entitlements_sample($parent, $formattedEntitlementsOffer);
}

transferEntitlementsToGoogle

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

Parameters
NameDescription
parent string

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}

entitlements array<Google\Cloud\Channel\V1\Entitlement>

Required. The entitlements to transfer to Google.

optionalArgs array

Optional.

↳ requestId string

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 with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Rpc\Status;

/**
 * @param string $parent                     The resource name of the reseller's customer account where the
 *                                           entitlements transfer from. Parent uses the format:
 *                                           accounts/{account_id}/customers/{customer_id}
 * @param string $formattedEntitlementsOffer The offer resource name for which the entitlement is to be
 *                                           created. Takes the form: accounts/{account_id}/offers/{offer_id}. Please see
 *                                           {@see CloudChannelServiceClient::offerName()} for help formatting this field.
 */
function transfer_entitlements_to_google_sample(
    string $parent,
    string $formattedEntitlementsOffer
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $entitlement = (new Entitlement())
        ->setOffer($formattedEntitlementsOffer);
    $entitlements = [$entitlement,];

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->transferEntitlementsToGoogle($parent, $entitlements);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            printf('Operation completed successfully.' . PHP_EOL);
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $parent = '[PARENT]';
    $formattedEntitlementsOffer = CloudChannelServiceClient::offerName('[ACCOUNT]', '[OFFER]');

    transfer_entitlements_to_google_sample($parent, $formattedEntitlementsOffer);
}

unregisterSubscriber

Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. If there are no service accounts left with subscriber privileges, this deletes the topic.

You can call ListSubscribers to check for these accounts.

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: The topic name that unregistered the service email address. Returns a success response if the service email address wasn't registered with the topic.

Parameters
NameDescription
account string

Required. Resource name of the account.

serviceAccount string

Required. Service account to unregister from subscriber access to the topic.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\UnregisterSubscriberResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\UnregisterSubscriberResponse;

/**
 * @param string $account        Resource name of the account.
 * @param string $serviceAccount Service account to unregister from subscriber access to the
 *                               topic.
 */
function unregister_subscriber_sample(string $account, string $serviceAccount): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Call the API and handle any network failures.
    try {
        /** @var UnregisterSubscriberResponse $response */
        $response = $cloudChannelServiceClient->unregisterSubscriber($account, $serviceAccount);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $account = '[ACCOUNT]';
    $serviceAccount = '[SERVICE_ACCOUNT]';

    unregister_subscriber_sample($account, $serviceAccount);
}

Updates a channel partner link. Distributors call this method to change a link's status. For example, to suspend a partner link.

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.
  • Link state cannot change from invited to active or suspended.
  • Cannot send reseller_cloud_identity_id, invite_url, or name in update mask.
  • NOT_FOUND: ChannelPartnerLink 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 updated ChannelPartnerLink resource.

Parameters
NameDescription
name string

Required. The resource name of the channel partner link to cancel. Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud Identity ID of the partner.

channelPartnerLink Google\Cloud\Channel\V1\ChannelPartnerLink

Required. The channel partner link to update. Only channel_partner_link.link_state is allowed for updates.

updateMask Google\Protobuf\FieldMask

Required. The update mask that applies to the resource. The only allowable value for an update mask is channel_partner_link.link_state.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\ChannelPartnerLink
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerLink;
use Google\Cloud\Channel\V1\ChannelPartnerLinkState;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Protobuf\FieldMask;

/**
 * @param string $name                                      The resource name of the channel partner link to cancel.
 *                                                          Name uses the format: accounts/{account_id}/channelPartnerLinks/{id}
 *                                                          where {id} is the Cloud Identity ID of the partner.
 * @param string $channelPartnerLinkResellerCloudIdentityId Cloud Identity ID of the linked reseller.
 * @param int    $channelPartnerLinkLinkState               State of the channel partner link.
 */
function update_channel_partner_link_sample(
    string $name,
    string $channelPartnerLinkResellerCloudIdentityId,
    int $channelPartnerLinkLinkState
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $channelPartnerLink = (new ChannelPartnerLink())
        ->setResellerCloudIdentityId($channelPartnerLinkResellerCloudIdentityId)
        ->setLinkState($channelPartnerLinkLinkState);
    $updateMask = new FieldMask();

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerLink $response */
        $response = $cloudChannelServiceClient->updateChannelPartnerLink(
            $name,
            $channelPartnerLink,
            $updateMask
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $name = '[NAME]';
    $channelPartnerLinkResellerCloudIdentityId = '[RESELLER_CLOUD_IDENTITY_ID]';
    $channelPartnerLinkLinkState = ChannelPartnerLinkState::CHANNEL_PARTNER_LINK_STATE_UNSPECIFIED;

    update_channel_partner_link_sample(
        $name,
        $channelPartnerLinkResellerCloudIdentityId,
        $channelPartnerLinkLinkState
    );
}

updateChannelPartnerRepricingConfig

Updates a ChannelPartnerRepricingConfig. Call this method to set modifications for a specific ChannelPartner's bill. This method overwrites the existing CustomerRepricingConfig.

You can only update configs if the RepricingConfig.effective_invoice_month is a future month. To make changes to configs for the current month, use CreateChannelPartnerRepricingConfig, taking note of its restrictions. You cannot update the RepricingConfig.effective_invoice_month.

When updating a config in the future:

  • This config must already exist.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The ChannelPartnerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated ChannelPartnerRepricingConfig resource, otherwise returns an error.

Parameters
NameDescription
channelPartnerRepricingConfig Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig

Required. The ChannelPartnerRepricingConfig object to update.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\RebillingBasis;
use Google\Cloud\Channel\V1\RepricingAdjustment;
use Google\Cloud\Channel\V1\RepricingConfig;
use Google\Type\Date;

/**
 * @param int $channelPartnerRepricingConfigRepricingConfigRebillingBasis The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to
 *                                                                        use for this bill. Specifies the relative cost based on repricing costs you
 *                                                                        will apply.
 */
function update_channel_partner_repricing_config_sample(
    int $channelPartnerRepricingConfigRepricingConfigRebillingBasis
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $channelPartnerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $channelPartnerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($channelPartnerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($channelPartnerRepricingConfigRepricingConfigRebillingBasis);
    $channelPartnerRepricingConfig = (new ChannelPartnerRepricingConfig())
        ->setRepricingConfig($channelPartnerRepricingConfigRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerRepricingConfig $response */
        $response = $cloudChannelServiceClient->updateChannelPartnerRepricingConfig(
            $channelPartnerRepricingConfig
        );
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $channelPartnerRepricingConfigRepricingConfigRebillingBasis = RebillingBasis::REBILLING_BASIS_UNSPECIFIED;

    update_channel_partner_repricing_config_sample(
        $channelPartnerRepricingConfigRepricingConfigRebillingBasis
    );
}

updateCustomer

Updates an existing Customer resource for the reseller or distributor.

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: No Customer resource found for the name in the request.

Return value: The updated Customer resource.

Parameters
NameDescription
customer Google\Cloud\Channel\V1\Customer

Required. New contents of the customer.

optionalArgs array

Optional.

↳ updateMask FieldMask

The update mask that applies to the resource. Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Type\PostalAddress;

/**
 * @param string $customerOrgDisplayName Name of the organization that the customer entity represents.
 * @param string $customerDomain         The customer's primary domain. Must match the primary contact
 *                                       email's domain.
 */
function update_customer_sample(string $customerOrgDisplayName, string $customerDomain): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customerOrgPostalAddress = new PostalAddress();
    $customer = (new Customer())
        ->setOrgDisplayName($customerOrgDisplayName)
        ->setOrgPostalAddress($customerOrgPostalAddress)
        ->setDomain($customerDomain);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->updateCustomer($customer);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $customerOrgDisplayName = '[ORG_DISPLAY_NAME]';
    $customerDomain = '[DOMAIN]';

    update_customer_sample($customerOrgDisplayName, $customerDomain);
}

updateCustomerRepricingConfig

Updates a CustomerRepricingConfig. Call this method to set modifications for a specific customer's bill. This method overwrites the existing CustomerRepricingConfig.

You can only update configs if the RepricingConfig.effective_invoice_month is a future month. To make changes to configs for the current month, use CreateCustomerRepricingConfig, taking note of its restrictions. You cannot update the RepricingConfig.effective_invoice_month.

When updating a config in the future:

  • This config must already exist.

Possible Error Codes:

  • PERMISSION_DENIED: If the account making the request and the account being queried are different.
  • INVALID_ARGUMENT: Missing or invalid required parameters in the request. Also displays if the updated config is for the current month or past months.
  • NOT_FOUND: The CustomerRepricingConfig specified does not exist or is not associated with the given account.
  • INTERNAL: Any non-user error related to technical issues in the backend. In this case, contact Cloud Channel support.

Return Value: If successful, the updated CustomerRepricingConfig resource, otherwise returns an error.

Parameters
NameDescription
customerRepricingConfig Google\Cloud\Channel\V1\CustomerRepricingConfig

Required. The CustomerRepricingConfig object to update.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Channel\V1\CustomerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CustomerRepricingConfig;
use Google\Cloud\Channel\V1\RebillingBasis;
use Google\Cloud\Channel\V1\RepricingAdjustment;
use Google\Cloud\Channel\V1\RepricingConfig;
use Google\Type\Date;

/**
 * @param int $customerRepricingConfigRepricingConfigRebillingBasis The [RebillingBasis][google.cloud.channel.v1.RebillingBasis] to
 *                                                                  use for this bill. Specifies the relative cost based on repricing costs you
 *                                                                  will apply.
 */
function update_customer_repricing_config_sample(
    int $customerRepricingConfigRepricingConfigRebillingBasis
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $customerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $customerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $customerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($customerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($customerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($customerRepricingConfigRepricingConfigRebillingBasis);
    $customerRepricingConfig = (new CustomerRepricingConfig())
        ->setRepricingConfig($customerRepricingConfigRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var CustomerRepricingConfig $response */
        $response = $cloudChannelServiceClient->updateCustomerRepricingConfig($customerRepricingConfig);
        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $customerRepricingConfigRepricingConfigRebillingBasis = RebillingBasis::REBILLING_BASIS_UNSPECIFIED;

    update_customer_repricing_config_sample($customerRepricingConfigRepricingConfigRebillingBasis);
}

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
TypeDescription
Google\ApiCore\LongRunning\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
NameDescription
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
TypeDescription
Google\ApiCore\OperationResponse

static::channelPartnerLinkName

Formats a string containing the fully-qualified path to represent a channel_partner_link resource.

Parameters
NameDescription
account string
channelPartnerLink string
Returns
TypeDescription
stringThe formatted channel_partner_link resource.

static::channelPartnerRepricingConfigName

Formats a string containing the fully-qualified path to represent a channel_partner_repricing_config resource.

Parameters
NameDescription
account string
channelPartner string
channelPartnerRepricingConfig string
Returns
TypeDescription
stringThe formatted channel_partner_repricing_config resource.

static::customerName

Formats a string containing the fully-qualified path to represent a customer resource.

Parameters
NameDescription
account string
customer string
Returns
TypeDescription
stringThe formatted customer resource.

static::customerRepricingConfigName

Formats a string containing the fully-qualified path to represent a customer_repricing_config resource.

Parameters
NameDescription
account string
customer string
customerRepricingConfig string
Returns
TypeDescription
stringThe formatted customer_repricing_config resource.

static::entitlementName

Formats a string containing the fully-qualified path to represent a entitlement resource.

Parameters
NameDescription
account string
customer string
entitlement string
Returns
TypeDescription
stringThe formatted entitlement resource.

static::offerName

Formats a string containing the fully-qualified path to represent a offer resource.

Parameters
NameDescription
account string
offer string
Returns
TypeDescription
stringThe formatted offer resource.

static::productName

Formats a string containing the fully-qualified path to represent a product resource.

Parameter
NameDescription
product string
Returns
TypeDescription
stringThe formatted product resource.

static::skuGroupName

Formats a string containing the fully-qualified path to represent a sku_group resource.

Parameters
NameDescription
account string
skuGroup string
Returns
TypeDescription
stringThe formatted sku_group resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • channelPartnerLink: accounts/{account}/channelPartnerLinks/{channel_partner_link}
  • channelPartnerRepricingConfig: accounts/{account}/channelPartnerLinks/{channel_partner}/channelPartnerRepricingConfigs/{channel_partner_repricing_config}
  • customer: accounts/{account}/customers/{customer}
  • customerRepricingConfig: accounts/{account}/customers/{customer}/customerRepricingConfigs/{customer_repricing_config}
  • entitlement: accounts/{account}/customers/{customer}/entitlements/{entitlement}
  • offer: accounts/{account}/offers/{offer}
  • product: products/{product}
  • skuGroup: accounts/{account}/skuGroups/{sku_group}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.

Constants

SERVICE_NAME

Value: 'google.cloud.channel.v1.CloudChannelService'

The name of the service.

SERVICE_ADDRESS

Value: 'cloudchannel.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

The name of the code generator, to be included in the agent header.