Google Cloud Channel V1 Client - Class CloudChannelServiceClient (2.0.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.

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.

Namespace

Google \ Cloud \ Channel \ V1 \ Client

Methods

__construct

Constructor.

Parameters
Name Description
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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::activateEntitlementAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ActivateEntitlementRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\ActivateEntitlementRequest;
use Google\Cloud\Channel\V1\Client\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();

    // Prepare the request message.
    $request = (new ActivateEntitlementRequest())
        ->setName($name);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->activateEntitlement($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::cancelEntitlementAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CancelEntitlementRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\CancelEntitlementRequest;
use Google\Cloud\Channel\V1\Client\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();

    // Prepare the request message.
    $request = (new CancelEntitlementRequest())
        ->setName($name);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->cancelEntitlement($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::changeOfferAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ChangeOfferRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\ChangeOfferRequest;
use Google\Cloud\Channel\V1\Client\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();

    // Prepare the request message.
    $request = (new ChangeOfferRequest())
        ->setName($name)
        ->setOffer($formattedOffer);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->changeOffer($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::changeParametersAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ChangeParametersRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\ChangeParametersRequest;
use Google\Cloud\Channel\V1\Client\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 the request message.
    $parameters = [new Parameter()];
    $request = (new ChangeParametersRequest())
        ->setName($name)
        ->setParameters($parameters);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->changeParameters($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::changeRenewalSettingsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ChangeRenewalSettingsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\ChangeRenewalSettingsRequest;
use Google\Cloud\Channel\V1\Client\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 the request message.
    $renewalSettings = new RenewalSettings();
    $request = (new ChangeRenewalSettingsRequest())
        ->setName($name)
        ->setRenewalSettings($renewalSettings);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->changeRenewalSettings($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::checkCloudIdentityAccountsExistAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistRequest;
use Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistResponse;
use Google\Cloud\Channel\V1\Client\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();

    // Prepare the request message.
    $request = (new CheckCloudIdentityAccountsExistRequest())
        ->setParent($parent)
        ->setDomain($domain);

    // Call the API and handle any network failures.
    try {
        /** @var CheckCloudIdentityAccountsExistResponse $response */
        $response = $cloudChannelServiceClient->checkCloudIdentityAccountsExist($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::createChannelPartnerLinkAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateChannelPartnerLinkRequest

A request to house fields associated with the call.

callOptions 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
Type Description
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\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CreateChannelPartnerLinkRequest;

/**
 * @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 the request message.
    $channelPartnerLink = (new ChannelPartnerLink())
        ->setResellerCloudIdentityId($channelPartnerLinkResellerCloudIdentityId)
        ->setLinkState($channelPartnerLinkLinkState);
    $request = (new CreateChannelPartnerLinkRequest())
        ->setParent($parent)
        ->setChannelPartnerLink($channelPartnerLink);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerLink $response */
        $response = $cloudChannelServiceClient->createChannelPartnerLink($request);
        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.

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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::createChannelPartnerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateChannelPartnerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CreateChannelPartnerRepricingConfigRequest;
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 the request message.
    $channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $channelPartnerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $channelPartnerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($channelPartnerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($channelPartnerRepricingConfigRepricingConfigRebillingBasis);
    $channelPartnerRepricingConfig = (new ChannelPartnerRepricingConfig())
        ->setRepricingConfig($channelPartnerRepricingConfigRepricingConfig);
    $request = (new CreateChannelPartnerRepricingConfigRequest())
        ->setParent($formattedParent)
        ->setChannelPartnerRepricingConfig($channelPartnerRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerRepricingConfig $response */
        $response = $cloudChannelServiceClient->createChannelPartnerRepricingConfig($request);
        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.
  • You are not authorized to create a customer. See https://support.google.com/channelservices/answer/9759265
  • 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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::createCustomerAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateCustomerRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CreateCustomerRequest;
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 the request message.
    $customerOrgPostalAddress = new PostalAddress();
    $customer = (new Customer())
        ->setOrgDisplayName($customerOrgDisplayName)
        ->setOrgPostalAddress($customerOrgPostalAddress)
        ->setDomain($customerDomain);
    $request = (new CreateCustomerRequest())
        ->setParent($parent)
        ->setCustomer($customer);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->createCustomer($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::createCustomerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateCustomerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\CustomerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CreateCustomerRepricingConfigRequest;
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 the request message.
    $customerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $customerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $customerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($customerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($customerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($customerRepricingConfigRepricingConfigRebillingBasis);
    $customerRepricingConfig = (new CustomerRepricingConfig())
        ->setRepricingConfig($customerRepricingConfigRepricingConfig);
    $request = (new CreateCustomerRepricingConfigRequest())
        ->setParent($formattedParent)
        ->setCustomerRepricingConfig($customerRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var CustomerRepricingConfig $response */
        $response = $cloudChannelServiceClient->createCustomerRepricingConfig($request);
        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.
  • The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265
  • 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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::createEntitlementAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateEntitlementRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CreateEntitlementRequest;
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 the request message.
    $entitlement = (new Entitlement())
        ->setOffer($formattedEntitlementOffer);
    $request = (new CreateEntitlementRequest())
        ->setParent($formattedParent)
        ->setEntitlement($entitlement);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->createEntitlement($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::deleteChannelPartnerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\DeleteChannelPartnerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\DeleteChannelPartnerRepricingConfigRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new DeleteChannelPartnerRepricingConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $cloudChannelServiceClient->deleteChannelPartnerRepricingConfig($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::deleteCustomerAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\DeleteCustomerRequest

A request to house fields associated with the call.

callOptions 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\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\DeleteCustomerRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new DeleteCustomerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $cloudChannelServiceClient->deleteCustomer($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::deleteCustomerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\DeleteCustomerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\DeleteCustomerRepricingConfigRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new DeleteCustomerRepricingConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        $cloudChannelServiceClient->deleteCustomerRepricingConfig($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::getChannelPartnerLinkAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\GetChannelPartnerLinkRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\ChannelPartnerLink
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerLink;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\GetChannelPartnerLinkRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new GetChannelPartnerLinkRequest())
        ->setName($name);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerLink $response */
        $response = $cloudChannelServiceClient->getChannelPartnerLink($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::getChannelPartnerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\GetChannelPartnerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\GetChannelPartnerRepricingConfigRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new GetChannelPartnerRepricingConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerRepricingConfig $response */
        $response = $cloudChannelServiceClient->getChannelPartnerRepricingConfig($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::getCustomerAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\GetCustomerRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Cloud\Channel\V1\GetCustomerRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new GetCustomerRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->getCustomer($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::getCustomerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\GetCustomerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\CustomerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CustomerRepricingConfig;
use Google\Cloud\Channel\V1\GetCustomerRepricingConfigRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new GetCustomerRepricingConfigRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var CustomerRepricingConfig $response */
        $response = $cloudChannelServiceClient->getCustomerRepricingConfig($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::getEntitlementAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\GetEntitlementRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\Entitlement
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\GetEntitlementRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new GetEntitlementRequest())
        ->setName($formattedName);

    // Call the API and handle any network failures.
    try {
        /** @var Entitlement $response */
        $response = $cloudChannelServiceClient->getEntitlement($request);
        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.
  • You are not authorized to import the customer. See https://support.google.com/channelservices/answer/9759265
  • 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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::importCustomerAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ImportCustomerRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Cloud\Channel\V1\ImportCustomerRequest;

/**
 * @param string $domain            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 $domain, string $parent, bool $overwriteIfExists): void
{
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare the request message.
    $request = (new ImportCustomerRequest())
        ->setDomain($domain)
        ->setParent($parent)
        ->setOverwriteIfExists($overwriteIfExists);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->importCustomer($request);
        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
{
    $domain = '[DOMAIN]';
    $parent = '[PARENT]';
    $overwriteIfExists = false;

    import_customer_sample($domain, $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listChannelPartnerLinksAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListChannelPartnerLinksRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\ChannelPartnerLink;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListChannelPartnerLinksRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListChannelPartnerLinksRequest())
        ->setParent($parent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listChannelPartnerRepricingConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListChannelPartnerRepricingConfigsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListChannelPartnerRepricingConfigsRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListChannelPartnerRepricingConfigsRequest())
        ->setParent($formattedParent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listCustomerRepricingConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListCustomerRepricingConfigsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\CustomerRepricingConfig;
use Google\Cloud\Channel\V1\ListCustomerRepricingConfigsRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListCustomerRepricingConfigsRequest())
        ->setParent($formattedParent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listCustomersAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListCustomersRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Cloud\Channel\V1\ListCustomersRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListCustomersRequest())
        ->setParent($parent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listEntitlementChangesAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListEntitlementChangesRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\EntitlementChange;
use Google\Cloud\Channel\V1\ListEntitlementChangesRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListEntitlementChangesRequest())
        ->setParent($formattedParent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listEntitlementsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListEntitlementsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\ListEntitlementsRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListEntitlementsRequest())
        ->setParent($formattedParent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listOffersAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListOffersRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListOffersRequest;
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();

    // Prepare the request message.
    $request = (new ListOffersRequest())
        ->setParent($parent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listProductsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListProductsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListProductsRequest;
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();

    // Prepare the request message.
    $request = (new ListProductsRequest())
        ->setAccount($account);

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

        /** @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:

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listPurchasableOffersAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListPurchasableOffersRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListPurchasableOffersRequest;
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();

    // Prepare the request message.
    $request = (new ListPurchasableOffersRequest())
        ->setCustomer($formattedCustomer);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listPurchasableSkusAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListPurchasableSkusRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListPurchasableSkusRequest;
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();

    // Prepare the request message.
    $request = (new ListPurchasableSkusRequest())
        ->setCustomer($formattedCustomer);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listSkuGroupBillableSkusAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSkuGroupBillableSkusRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\BillableSku;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListSkuGroupBillableSkusRequest;

/**
 * @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();

    // Prepare the request message.
    $request = (new ListSkuGroupBillableSkusRequest())
        ->setParent($formattedParent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listSkuGroupsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSkuGroupsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListSkuGroupsRequest;
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();

    // Prepare the request message.
    $request = (new ListSkuGroupsRequest())
        ->setParent($parent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listSkusAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSkusRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListSkusRequest;
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();

    // Prepare the request message.
    $request = (new ListSkusRequest())
        ->setParent($formattedParent)
        ->setAccount($account);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listSubscribersAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSubscribersRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListSubscribersRequest;

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

    // Prepare the request message.
    $request = (new ListSubscribersRequest())
        ->setAccount($account);

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

        /** @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.
  • The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265
  • INVALID_ARGUMENT: Required request parameters are missing or invalid.

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

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listTransferableOffersAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListTransferableOffersRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListTransferableOffersRequest;
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();

    // Prepare the request message.
    $request = (new ListTransferableOffersRequest())
        ->setParent($parent)
        ->setSku($sku);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::listTransferableSkusAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ListTransferableSkusRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\ListTransferableSkusRequest;
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();

    // Prepare the request message.
    $request = (new ListTransferableSkusRequest())
        ->setParent($parent);

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

        /** @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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::lookupOfferAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\LookupOfferRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\Offer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\LookupOfferRequest;
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();

    // Prepare the request message.
    $request = (new LookupOfferRequest())
        ->setEntitlement($formattedEntitlement);

    // Call the API and handle any network failures.
    try {
        /** @var Offer $response */
        $response = $cloudChannelServiceClient->lookupOffer($request);
        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.
  • You are not authorized to provision cloud identity id. See https://support.google.com/channelservices/answer/9759265
  • 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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::provisionCloudIdentityAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\ProvisionCloudIdentityRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Cloud\Channel\V1\ProvisionCloudIdentityRequest;
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();

    // Prepare the request message.
    $request = (new ProvisionCloudIdentityRequest())
        ->setCustomer($formattedCustomer);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->provisionCloudIdentity($request);
        $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);
}

queryEligibleBillingAccounts

Lists the billing accounts that are eligible to purchase particular SKUs for a given 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: Based on the provided list of SKUs, returns a list of SKU groups that must be purchased using the same billing account and the billing accounts eligible to purchase each SKU group.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::queryEligibleBillingAccountsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\QueryEligibleBillingAccountsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\QueryEligibleBillingAccountsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\QueryEligibleBillingAccountsRequest;
use Google\Cloud\Channel\V1\QueryEligibleBillingAccountsResponse;

/**
 * @param string $formattedCustomer The resource name of the customer to list eligible billing
 *                                  accounts for. Format: accounts/{account_id}/customers/{customer_id}. Please see
 *                                  {@see CloudChannelServiceClient::customerName()} for help formatting this field.
 * @param string $skusElement       List of SKUs to list eligible billing accounts for. At least one
 *                                  SKU is required. Format: products/{product_id}/skus/{sku_id}.
 */
function query_eligible_billing_accounts_sample(
    string $formattedCustomer,
    string $skusElement
): void {
    // Create a client.
    $cloudChannelServiceClient = new CloudChannelServiceClient();

    // Prepare the request message.
    $skus = [$skusElement,];
    $request = (new QueryEligibleBillingAccountsRequest())
        ->setCustomer($formattedCustomer)
        ->setSkus($skus);

    // Call the API and handle any network failures.
    try {
        /** @var QueryEligibleBillingAccountsResponse $response */
        $response = $cloudChannelServiceClient->queryEligibleBillingAccounts($request);
        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
{
    $formattedCustomer = CloudChannelServiceClient::customerName('[ACCOUNT]', '[CUSTOMER]');
    $skusElement = '[SKUS]';

    query_eligible_billing_accounts_sample($formattedCustomer, $skusElement);
}

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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::registerSubscriberAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\RegisterSubscriberRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\RegisterSubscriberResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\RegisterSubscriberRequest;
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();

    // Prepare the request message.
    $request = (new RegisterSubscriberRequest())
        ->setAccount($account)
        ->setServiceAccount($serviceAccount);

    // Call the API and handle any network failures.
    try {
        /** @var RegisterSubscriberResponse $response */
        $response = $cloudChannelServiceClient->registerSubscriber($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::startPaidServiceAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\StartPaidServiceRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\StartPaidServiceRequest;
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();

    // Prepare the request message.
    $request = (new StartPaidServiceRequest())
        ->setName($name);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->startPaidService($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::suspendEntitlementAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\SuspendEntitlementRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\SuspendEntitlementRequest;
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();

    // Prepare the request message.
    $request = (new SuspendEntitlementRequest())
        ->setName($name);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->suspendEntitlement($request);
        $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.
  • The reseller is not authorized to transact on this Product. See https://support.google.com/channelservices/answer/9759265
  • 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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::transferEntitlementsAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\TransferEntitlementsRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\TransferEntitlementsRequest;
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 the request message.
    $entitlement = (new Entitlement())
        ->setOffer($formattedEntitlementsOffer);
    $entitlements = [$entitlement,];
    $request = (new TransferEntitlementsRequest())
        ->setParent($parent)
        ->setEntitlements($entitlements);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->transferEntitlements($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::transferEntitlementsToGoogleAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\TransferEntitlementsToGoogleRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\ApiCore\OperationResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Entitlement;
use Google\Cloud\Channel\V1\TransferEntitlementsToGoogleRequest;
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 the request message.
    $entitlement = (new Entitlement())
        ->setOffer($formattedEntitlementsOffer);
    $entitlements = [$entitlement,];
    $request = (new TransferEntitlementsToGoogleRequest())
        ->setParent($parent)
        ->setEntitlements($entitlements);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $cloudChannelServiceClient->transferEntitlementsToGoogle($request);
        $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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::unregisterSubscriberAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\UnregisterSubscriberRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\UnregisterSubscriberResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\UnregisterSubscriberRequest;
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();

    // Prepare the request message.
    $request = (new UnregisterSubscriberRequest())
        ->setAccount($account)
        ->setServiceAccount($serviceAccount);

    // Call the API and handle any network failures.
    try {
        /** @var UnregisterSubscriberResponse $response */
        $response = $cloudChannelServiceClient->unregisterSubscriber($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::updateChannelPartnerLinkAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateChannelPartnerLinkRequest

A request to house fields associated with the call.

callOptions 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
Type Description
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\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\UpdateChannelPartnerLinkRequest;
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 the request message.
    $channelPartnerLink = (new ChannelPartnerLink())
        ->setResellerCloudIdentityId($channelPartnerLinkResellerCloudIdentityId)
        ->setLinkState($channelPartnerLinkLinkState);
    $updateMask = new FieldMask();
    $request = (new UpdateChannelPartnerLinkRequest())
        ->setName($name)
        ->setChannelPartnerLink($channelPartnerLink)
        ->setUpdateMask($updateMask);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerLink $response */
        $response = $cloudChannelServiceClient->updateChannelPartnerLink($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::updateChannelPartnerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateChannelPartnerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\ChannelPartnerRepricingConfig;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\RebillingBasis;
use Google\Cloud\Channel\V1\RepricingAdjustment;
use Google\Cloud\Channel\V1\RepricingConfig;
use Google\Cloud\Channel\V1\UpdateChannelPartnerRepricingConfigRequest;
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 the request message.
    $channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $channelPartnerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $channelPartnerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($channelPartnerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($channelPartnerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($channelPartnerRepricingConfigRepricingConfigRebillingBasis);
    $channelPartnerRepricingConfig = (new ChannelPartnerRepricingConfig())
        ->setRepricingConfig($channelPartnerRepricingConfigRepricingConfig);
    $request = (new UpdateChannelPartnerRepricingConfigRequest())
        ->setChannelPartnerRepricingConfig($channelPartnerRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var ChannelPartnerRepricingConfig $response */
        $response = $cloudChannelServiceClient->updateChannelPartnerRepricingConfig($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::updateCustomerAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateCustomerRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\Customer
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\CloudChannelServiceClient;
use Google\Cloud\Channel\V1\Customer;
use Google\Cloud\Channel\V1\UpdateCustomerRequest;
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 the request message.
    $customerOrgPostalAddress = new PostalAddress();
    $customer = (new Customer())
        ->setOrgDisplayName($customerOrgDisplayName)
        ->setOrgPostalAddress($customerOrgPostalAddress)
        ->setDomain($customerDomain);
    $request = (new UpdateCustomerRequest())
        ->setCustomer($customer);

    // Call the API and handle any network failures.
    try {
        /** @var Customer $response */
        $response = $cloudChannelServiceClient->updateCustomer($request);
        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.

The async variant is Google\Cloud\Channel\V1\Client\CloudChannelServiceClient::updateCustomerRepricingConfigAsync() .

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateCustomerRepricingConfigRequest

A request to house fields associated with the call.

callOptions 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
Type Description
Google\Cloud\Channel\V1\CustomerRepricingConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Channel\V1\Client\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\Cloud\Channel\V1\UpdateCustomerRepricingConfigRequest;
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 the request message.
    $customerRepricingConfigRepricingConfigEffectiveInvoiceMonth = new Date();
    $customerRepricingConfigRepricingConfigAdjustment = new RepricingAdjustment();
    $customerRepricingConfigRepricingConfig = (new RepricingConfig())
        ->setEffectiveInvoiceMonth($customerRepricingConfigRepricingConfigEffectiveInvoiceMonth)
        ->setAdjustment($customerRepricingConfigRepricingConfigAdjustment)
        ->setRebillingBasis($customerRepricingConfigRepricingConfigRebillingBasis);
    $customerRepricingConfig = (new CustomerRepricingConfig())
        ->setRepricingConfig($customerRepricingConfigRepricingConfig);
    $request = (new UpdateCustomerRepricingConfigRequest())
        ->setCustomerRepricingConfig($customerRepricingConfig);

    // Call the API and handle any network failures.
    try {
        /** @var CustomerRepricingConfig $response */
        $response = $cloudChannelServiceClient->updateCustomerRepricingConfig($request);
        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);
}

activateEntitlementAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ActivateEntitlementRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

cancelEntitlementAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CancelEntitlementRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

changeOfferAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ChangeOfferRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

changeParametersAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ChangeParametersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

changeRenewalSettingsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ChangeRenewalSettingsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

checkCloudIdentityAccountsExistAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CheckCloudIdentityAccountsExistRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createChannelPartnerLinkAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateChannelPartnerLinkRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createChannelPartnerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateChannelPartnerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createCustomerAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateCustomerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createCustomerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateCustomerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createEntitlementAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\CreateEntitlementRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteChannelPartnerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\DeleteChannelPartnerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCustomerAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\DeleteCustomerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteCustomerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\DeleteCustomerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getChannelPartnerLinkAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\GetChannelPartnerLinkRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getChannelPartnerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\GetChannelPartnerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCustomerAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\GetCustomerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getCustomerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\GetCustomerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getEntitlementAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\GetEntitlementRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

importCustomerAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ImportCustomerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listChannelPartnerLinksAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListChannelPartnerLinksRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listChannelPartnerRepricingConfigsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListChannelPartnerRepricingConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCustomerRepricingConfigsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListCustomerRepricingConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listCustomersAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListCustomersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listEntitlementChangesAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListEntitlementChangesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listEntitlementsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListEntitlementsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listOffersAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListOffersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listProductsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListProductsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listPurchasableOffersAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListPurchasableOffersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listPurchasableSkusAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListPurchasableSkusRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listSkuGroupBillableSkusAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSkuGroupBillableSkusRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listSkuGroupsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSkuGroupsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listSkusAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSkusRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listSubscribersAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListSubscribersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listTransferableOffersAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListTransferableOffersRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listTransferableSkusAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ListTransferableSkusRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

lookupOfferAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\LookupOfferRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

provisionCloudIdentityAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\ProvisionCloudIdentityRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

queryEligibleBillingAccountsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\QueryEligibleBillingAccountsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

registerSubscriberAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\RegisterSubscriberRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

startPaidServiceAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\StartPaidServiceRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

suspendEntitlementAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\SuspendEntitlementRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

transferEntitlementsAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\TransferEntitlementsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

transferEntitlementsToGoogleAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\TransferEntitlementsToGoogleRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

unregisterSubscriberAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\UnregisterSubscriberRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateChannelPartnerLinkAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateChannelPartnerLinkRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateChannelPartnerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateChannelPartnerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateCustomerAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateCustomerRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateCustomerRepricingConfigAsync

Parameters
Name Description
request Google\Cloud\Channel\V1\UpdateCustomerRepricingConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

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

Returns
Type Description
Google\LongRunning\Client\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
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::channelPartnerLinkName

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

Parameters
Name Description
account string
channelPartnerLink string
Returns
Type Description
string The formatted channel_partner_link resource.

static::channelPartnerRepricingConfigName

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

Parameters
Name Description
account string
channelPartner string
channelPartnerRepricingConfig string
Returns
Type Description
string The formatted channel_partner_repricing_config resource.

static::customerName

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

Parameters
Name Description
account string
customer string
Returns
Type Description
string The formatted customer resource.

static::customerRepricingConfigName

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

Parameters
Name Description
account string
customer string
customerRepricingConfig string
Returns
Type Description
string The formatted customer_repricing_config resource.

static::entitlementName

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

Parameters
Name Description
account string
customer string
entitlement string
Returns
Type Description
string The formatted entitlement resource.

static::offerName

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

Parameters
Name Description
account string
offer string
Returns
Type Description
string The formatted offer resource.

static::productName

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

Parameter
Name Description
product string
Returns
Type Description
string The formatted product resource.

static::skuGroupName

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

Parameters
Name Description
account string
skuGroup string
Returns
Type Description
string The 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
Name Description
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
Type Description
array An associative array from name component IDs to component values.