# Google Cloud Service Management V1 Client - Class ServiceManagerClient (2.2.0)

2.2.0 (latest) 2.1.2 2.0.5 1.3.5 1.2.2 1.1.1 1.0.6 Reference documentation and code samples for the Google Cloud Service Management V1 Client class ServiceManagerClient.

Service Description: [Google Service Management
API](https://cloud.google.com/service-infrastructure/docs/overview)

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.

## Namespace

Google \\ Cloud \\ ServiceManagement \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` 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` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\ServiceManagement\V1\ServiceManagerClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new ServiceManagerClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ 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()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_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|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` 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](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) 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()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_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. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### createService

Creates a new managed service.

A managed service is immutable, and is subject to mandatory 30-day
data retention. You cannot move a service or recreate it within 30 days
after deletion.

One producer project can own no more than 500 services. For security and
reliability purposes, a production service should be hosted in a
dedicated producer project.

Operation\<response: ManagedService\>

The async variant is [ServiceManagerClient::createServiceAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__createServiceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.CreateServiceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ManagedService>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\CreateServiceRequest;
    use Google\Cloud\ServiceManagement\V1\ManagedService;
    use Google\Rpc\Status;

    /**
     * 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 create_service_sample(): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $service = new ManagedService();
        $request = (new CreateServiceRequest())
            ->setService($service);

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

            if ($response->operationSucceeded()) {
                /** @var ManagedService $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());
        }
    }

### createServiceConfig

Creates a new service configuration (version) for a managed service.

This method only stores the service configuration. To roll out the service
configuration to backend systems please call
[CreateServiceRollout](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__createServiceRollout__).

Only the 100 most recent service configurations and ones referenced by
existing rollouts are kept for each service. The rest will be deleted
eventually.

The async variant is [ServiceManagerClient::createServiceConfigAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__createServiceConfigAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.CreateServiceConfigRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Service.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Api\Service;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\CreateServiceConfigRequest;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     */
    function create_service_config_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $serviceConfig = new Service();
        $request = (new CreateServiceConfigRequest())
            ->setServiceName($serviceName)
            ->setServiceConfig($serviceConfig);

        // Call the API and handle any network failures.
        try {
            /** @var Service $response */
            $response = $serviceManagerClient->createServiceConfig($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
    {
        $serviceName = '[SERVICE_NAME]';

        create_service_config_sample($serviceName);
    }

### createServiceRollout

Creates a new service configuration rollout. Based on rollout, the
Google Service Management will roll out the service configurations to
different backend services. For example, the logging configuration will be
pushed to Google Cloud Logging.

Please note that any previous pending and running Rollouts and associated
Operations will be automatically cancelled so that the latest Rollout will
not be blocked by previous Rollouts.

Only the 100 most recent (in any state) and the last 10 successful (if not
already part of the set of 100 most recent) rollouts are kept for each
service. The rest will be deleted eventually.

Operation\<response: Rollout\>

The async variant is [ServiceManagerClient::createServiceRolloutAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__createServiceRolloutAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.CreateServiceRolloutRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Rollout>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\CreateServiceRolloutRequest;
    use Google\Cloud\ServiceManagement\V1\Rollout;
    use Google\Rpc\Status;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     */
    function create_service_rollout_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $rollout = new Rollout();
        $request = (new CreateServiceRolloutRequest())
            ->setServiceName($serviceName)
            ->setRollout($rollout);

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

            if ($response->operationSucceeded()) {
                /** @var Rollout $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
    {
        $serviceName = '[SERVICE_NAME]';

        create_service_rollout_sample($serviceName);
    }

### deleteService

Deletes a managed service. This method will change the service to the
`Soft-Delete` state for 30 days. Within this period, service producers may
call
[UndeleteService](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__undeleteService__)
to restore the service. After 30 days, the service will be permanently
deleted.

Operation\<response: google.protobuf.Empty\>

The async variant is [ServiceManagerClient::deleteServiceAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__deleteServiceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.DeleteServiceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<null>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\DeleteServiceRequest;
    use Google\Rpc\Status;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     */
    function delete_service_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new DeleteServiceRequest())
            ->setServiceName($serviceName);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $serviceManagerClient->deleteService($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
    {
        $serviceName = '[SERVICE_NAME]';

        delete_service_sample($serviceName);
    }

### generateConfigReport

Generates and returns a report (errors, warnings and changes from
existing configurations) associated with
GenerateConfigReportRequest.new_value

If GenerateConfigReportRequest.old_value is specified,
GenerateConfigReportRequest will contain a single ChangeReport based on the
comparison between GenerateConfigReportRequest.new_value and
GenerateConfigReportRequest.old_value.
If GenerateConfigReportRequest.old_value is not specified, this method
will compare GenerateConfigReportRequest.new_value with the last pushed
service configuration.

The async variant is [ServiceManagerClient::generateConfigReportAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__generateConfigReportAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GenerateConfigReportRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GenerateConfigReportResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\GenerateConfigReportRequest;
    use Google\Cloud\ServiceManagement\V1\GenerateConfigReportResponse;
    use Google\Protobuf\Any;

    /**
     * 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 generate_config_report_sample(): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $newConfig = new Any();
        $request = (new GenerateConfigReportRequest())
            ->setNewConfig($newConfig);

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

### getService

Gets a managed service. Authentication is required unless the service is
public.

The async variant is [ServiceManagerClient::getServiceAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__getServiceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GetServiceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ManagedService` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\GetServiceRequest;
    use Google\Cloud\ServiceManagement\V1\ManagedService;

    /**
     * @param string $serviceName The name of the service.  See the `ServiceManager` overview for
     *                            naming requirements.  For example: `example.googleapis.com`.
     */
    function get_service_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new GetServiceRequest())
            ->setServiceName($serviceName);

        // Call the API and handle any network failures.
        try {
            /** @var ManagedService $response */
            $response = $serviceManagerClient->getService($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
    {
        $serviceName = '[SERVICE_NAME]';

        get_service_sample($serviceName);
    }

### getServiceConfig

Gets a service configuration (version) for a managed service.

The async variant is [ServiceManagerClient::getServiceConfigAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__getServiceConfigAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GetServiceConfigRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Service.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Api\Service;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\GetServiceConfigRequest;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     * @param string $configId    The id of the service configuration resource.
     *
     *                            This field must be specified for the server to return all fields, including
     *                            `SourceInfo`.
     */
    function get_service_config_sample(string $serviceName, string $configId): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new GetServiceConfigRequest())
            ->setServiceName($serviceName)
            ->setConfigId($configId);

        // Call the API and handle any network failures.
        try {
            /** @var Service $response */
            $response = $serviceManagerClient->getServiceConfig($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
    {
        $serviceName = '[SERVICE_NAME]';
        $configId = '[CONFIG_ID]';

        get_service_config_sample($serviceName, $configId);
    }

### getServiceRollout

Gets a service configuration
[rollout](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Rollout).

The async variant is [ServiceManagerClient::getServiceRolloutAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__getServiceRolloutAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GetServiceRolloutRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Rollout` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\GetServiceRolloutRequest;
    use Google\Cloud\ServiceManagement\V1\Rollout;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     * @param string $rolloutId   The id of the rollout resource.
     */
    function get_service_rollout_sample(string $serviceName, string $rolloutId): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new GetServiceRolloutRequest())
            ->setServiceName($serviceName)
            ->setRolloutId($rolloutId);

        // Call the API and handle any network failures.
        try {
            /** @var Rollout $response */
            $response = $serviceManagerClient->getServiceRollout($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
    {
        $serviceName = '[SERVICE_NAME]';
        $rolloutId = '[ROLLOUT_ID]';

        get_service_rollout_sample($serviceName, $rolloutId);
    }

### listServiceConfigs

Lists the history of the service configuration for a managed service,
from the newest to the oldest.

The async variant is [ServiceManagerClient::listServiceConfigsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__listServiceConfigsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ListServiceConfigsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Api\Service;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\ListServiceConfigsRequest;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     */
    function list_service_configs_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new ListServiceConfigsRequest())
            ->setServiceName($serviceName);

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

            /** @var Service $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
    {
        $serviceName = '[SERVICE_NAME]';

        list_service_configs_sample($serviceName);
    }

### listServiceRollouts

Lists the history of the service configuration rollouts for a managed
service, from the newest to the oldest.

The async variant is [ServiceManagerClient::listServiceRolloutsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__listServiceRolloutsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ListServiceRolloutsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\ListServiceRolloutsRequest;
    use Google\Cloud\ServiceManagement\V1\Rollout;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     * @param string $filter      Use `filter` to return subset of rollouts.
     *                            The following filters are supported:
     *
     *                            -- By [status]
     *                            [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example,
     *                            `filter='status=SUCCESS'`
     *
     *                            -- By [strategy]
     *                            [google.api.servicemanagement.v1.Rollout.strategy]. For example,
     *                            `filter='strategy=TrafficPercentStrategy'`
     */
    function list_service_rollouts_sample(string $serviceName, string $filter): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new ListServiceRolloutsRequest())
            ->setServiceName($serviceName)
            ->setFilter($filter);

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

            /** @var Rollout $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
    {
        $serviceName = '[SERVICE_NAME]';
        $filter = '[FILTER]';

        list_service_rollouts_sample($serviceName, $filter);
    }

### listServices

Lists managed services.

Returns all public services. For authenticated users, also returns all
services the calling user has "servicemanagement.services.get" permission
for.

The async variant is [ServiceManagerClient::listServicesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__listServicesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ListServicesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\ListServicesRequest;
    use Google\Cloud\ServiceManagement\V1\ManagedService;

    /**
     * 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 list_services_sample(): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = new ListServicesRequest();

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

            /** @var ManagedService $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());
        }
    }

### submitConfigSource

Creates a new service configuration (version) for a managed service based
on
user-supplied configuration source files (for example: OpenAPI
Specification). This method stores the source configurations as well as the
generated service configuration. To rollout the service configuration to
other services,
please call
[CreateServiceRollout](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__createServiceRollout__).

Only the 100 most recent configuration sources and ones referenced by
existing service configurtions are kept for each service. The rest will be
deleted eventually.

Operation\<response: SubmitConfigSourceResponse\>

The async variant is [ServiceManagerClient::submitConfigSourceAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__submitConfigSourceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.SubmitConfigSourceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.SubmitConfigSourceResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\ConfigSource;
    use Google\Cloud\ServiceManagement\V1\SubmitConfigSourceRequest;
    use Google\Cloud\ServiceManagement\V1\SubmitConfigSourceResponse;
    use Google\Rpc\Status;

    /**
     * @param string $serviceName The name of the service.  See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements.  For example: `example.googleapis.com`.
     */
    function submit_config_source_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $configSource = new ConfigSource();
        $request = (new SubmitConfigSourceRequest())
            ->setServiceName($serviceName)
            ->setConfigSource($configSource);

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

            if ($response->operationSucceeded()) {
                /** @var SubmitConfigSourceResponse $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
    {
        $serviceName = '[SERVICE_NAME]';

        submit_config_source_sample($serviceName);
    }

### undeleteService

Revives a previously deleted managed service. The method restores the
service using the configuration at the time the service was deleted.

The target service must exist and must have been deleted within the
last 30 days.

Operation\<response: UndeleteServiceResponse\>

The async variant is [ServiceManagerClient::undeleteServiceAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__undeleteServiceAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.UndeleteServiceRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.UndeleteServiceResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;
    use Google\Cloud\ServiceManagement\V1\UndeleteServiceRequest;
    use Google\Cloud\ServiceManagement\V1\UndeleteServiceResponse;
    use Google\Rpc\Status;

    /**
     * @param string $serviceName The name of the service. See the
     *                            [overview](https://cloud.google.com/service-management/overview) for naming
     *                            requirements. For example: `example.googleapis.com`.
     */
    function undelete_service_sample(string $serviceName): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new UndeleteServiceRequest())
            ->setServiceName($serviceName);

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

            if ($response->operationSucceeded()) {
                /** @var UndeleteServiceResponse $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
    {
        $serviceName = '[SERVICE_NAME]';

        undelete_service_sample($serviceName);
    }

### getIamPolicy

Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.

The async variant is [ServiceManagerClient::getIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__getIamPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.GetIamPolicyRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Iam\V1\GetIamPolicyRequest;
    use Google\Cloud\Iam\V1\Policy;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;

    /**
     * @param string $resource REQUIRED: The resource for which the policy is being requested.
     *                         See the operation documentation for the appropriate value for this field.
     */
    function get_iam_policy_sample(string $resource): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $request = (new GetIamPolicyRequest())
            ->setResource($resource);

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $serviceManagerClient->getIamPolicy($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
    {
        $resource = '[RESOURCE]';

        get_iam_policy_sample($resource);
    }

### setIamPolicy

Sets the access control policy on the specified resource. Replaces
any existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
errors.

The async variant is [ServiceManagerClient::setIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__setIamPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.SetIamPolicyRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Iam\V1\Policy;
    use Google\Cloud\Iam\V1\SetIamPolicyRequest;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;

    /**
     * @param string $resource REQUIRED: The resource for which the policy is being specified.
     *                         See the operation documentation for the appropriate value for this field.
     */
    function set_iam_policy_sample(string $resource): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $policy = new Policy();
        $request = (new SetIamPolicyRequest())
            ->setResource($resource)
            ->setPolicy($policy);

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $serviceManagerClient->setIamPolicy($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
    {
        $resource = '[RESOURCE]';

        set_iam_policy_sample($resource);
    }

### testIamPermissions

Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.

The async variant is [ServiceManagerClient::testIamPermissionsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Client.ServiceManagerClient#_Google_Cloud_ServiceManagement_V1_Client_ServiceManagerClient__testIamPermissionsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
    use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
    use Google\Cloud\ServiceManagement\V1\Client\ServiceManagerClient;

    /**
     * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
     *                                   See the operation documentation for the appropriate value for this field.
     * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
     *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
     *                                   information see
     *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
     */
    function test_iam_permissions_sample(string $resource, string $permissionsElement): void
    {
        // Create a client.
        $serviceManagerClient = new ServiceManagerClient();

        // Prepare the request message.
        $permissions = [$permissionsElement,];
        $request = (new TestIamPermissionsRequest())
            ->setResource($resource)
            ->setPermissions($permissions);

        // Call the API and handle any network failures.
        try {
            /** @var TestIamPermissionsResponse $response */
            $response = $serviceManagerClient->testIamPermissions($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
    {
        $resource = '[RESOURCE]';
        $permissionsElement = '[PERMISSIONS]';

        test_iam_permissions_sample($resource, $permissionsElement);
    }

### createServiceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.CreateServiceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### createServiceConfigAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.CreateServiceConfigRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Service.html>` |   |

### createServiceRolloutAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.CreateServiceRolloutRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### deleteServiceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.DeleteServiceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### generateConfigReportAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GenerateConfigReportRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GenerateConfigReportResponse>` |   |

### getServiceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GetServiceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ManagedService>` |   |

### getServiceConfigAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GetServiceConfigRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Service.html>` |   |

### getServiceRolloutAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.GetServiceRolloutRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.Rollout>` |   |

### listServiceConfigsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ListServiceConfigsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listServiceRolloutsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ListServiceRolloutsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listServicesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.ListServicesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### submitConfigSourceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.SubmitConfigSourceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### undeleteServiceAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-management/latest/V1.UndeleteServiceRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### getIamPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.GetIamPolicyRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html>` |   |

### setIamPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.SetIamPolicyRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html>` |   |

### testIamPermissionsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsResponse.html>` |   |

### 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** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |