Google Cloud Parameter Manager V1 Client - Class ParameterManagerClient (0.1.0)

Reference documentation and code samples for the Google Cloud Parameter Manager V1 Client class ParameterManagerClient.

Service Description: Service describing handlers for resources

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 \ ParameterManager \ 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.

↳ logger false|LoggerInterface

A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag

createParameter

Creates a new Parameter in a given project and location.

The async variant is ParameterManagerClient::createParameterAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\CreateParameterRequest

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\ParameterManager\V1\Parameter
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\CreateParameterRequest;
use Google\Cloud\ParameterManager\V1\Parameter;

/**
 * @param string $formattedParent Value for parent in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see ParameterManagerClient::locationName()} for help formatting this field.
 * @param string $parameterId     Id of the Parameter resource
 */
function create_parameter_sample(string $formattedParent, string $parameterId): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

    // Prepare the request message.
    $parameter = new Parameter();
    $request = (new CreateParameterRequest())
        ->setParent($formattedParent)
        ->setParameterId($parameterId)
        ->setParameter($parameter);

    // Call the API and handle any network failures.
    try {
        /** @var Parameter $response */
        $response = $parameterManagerClient->createParameter($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 = ParameterManagerClient::locationName('[PROJECT]', '[LOCATION]');
    $parameterId = '[PARAMETER_ID]';

    create_parameter_sample($formattedParent, $parameterId);
}

createParameterVersion

Creates a new ParameterVersion in a given project, location, and parameter.

The async variant is ParameterManagerClient::createParameterVersionAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\CreateParameterVersionRequest

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\ParameterManager\V1\ParameterVersion
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\CreateParameterVersionRequest;
use Google\Cloud\ParameterManager\V1\ParameterVersion;
use Google\Cloud\ParameterManager\V1\ParameterVersionPayload;

/**
 * @param string $formattedParent             Value for parent in the format
 *                                            `projects/*/locations/*/parameters/*`. Please see
 *                                            {@see ParameterManagerClient::parameterName()} for help formatting this field.
 * @param string $parameterVersionId          Id of the ParameterVersion resource
 * @param string $parameterVersionPayloadData bytes data for storing payload.
 */
function create_parameter_version_sample(
    string $formattedParent,
    string $parameterVersionId,
    string $parameterVersionPayloadData
): void {
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

    // Prepare the request message.
    $parameterVersionPayload = (new ParameterVersionPayload())
        ->setData($parameterVersionPayloadData);
    $parameterVersion = (new ParameterVersion())
        ->setPayload($parameterVersionPayload);
    $request = (new CreateParameterVersionRequest())
        ->setParent($formattedParent)
        ->setParameterVersionId($parameterVersionId)
        ->setParameterVersion($parameterVersion);

    // Call the API and handle any network failures.
    try {
        /** @var ParameterVersion $response */
        $response = $parameterManagerClient->createParameterVersion($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 = ParameterManagerClient::parameterName('[PROJECT]', '[LOCATION]', '[PARAMETER]');
    $parameterVersionId = '[PARAMETER_VERSION_ID]';
    $parameterVersionPayloadData = '...';

    create_parameter_version_sample(
        $formattedParent,
        $parameterVersionId,
        $parameterVersionPayloadData
    );
}

deleteParameter

Deletes a single Parameter.

The async variant is ParameterManagerClient::deleteParameterAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\DeleteParameterRequest

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\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\DeleteParameterRequest;

/**
 * @param string $formattedName Name of the resource in the format
 *                              `projects/*/locations/*/parameters/*`. Please see
 *                              {@see ParameterManagerClient::parameterName()} for help formatting this field.
 */
function delete_parameter_sample(string $formattedName): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

    // Call the API and handle any network failures.
    try {
        $parameterManagerClient->deleteParameter($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 = ParameterManagerClient::parameterName('[PROJECT]', '[LOCATION]', '[PARAMETER]');

    delete_parameter_sample($formattedName);
}

deleteParameterVersion

Deletes a single ParameterVersion.

The async variant is ParameterManagerClient::deleteParameterVersionAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\DeleteParameterVersionRequest

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\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\DeleteParameterVersionRequest;

/**
 * @param string $formattedName Name of the resource in the format
 *                              `projects/*/locations/*/parameters/*/versions/*`. Please see
 *                              {@see ParameterManagerClient::parameterVersionName()} for help formatting this field.
 */
function delete_parameter_version_sample(string $formattedName): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

    // Call the API and handle any network failures.
    try {
        $parameterManagerClient->deleteParameterVersion($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 = ParameterManagerClient::parameterVersionName(
        '[PROJECT]',
        '[LOCATION]',
        '[PARAMETER]',
        '[PARAMETER_VERSION]'
    );

    delete_parameter_version_sample($formattedName);
}

getParameter

Gets details of a single Parameter.

The async variant is ParameterManagerClient::getParameterAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\GetParameterRequest

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\ParameterManager\V1\Parameter
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\GetParameterRequest;
use Google\Cloud\ParameterManager\V1\Parameter;

/**
 * @param string $formattedName Name of the resource in the format
 *                              `projects/*/locations/*/parameters/*`. Please see
 *                              {@see ParameterManagerClient::parameterName()} for help formatting this field.
 */
function get_parameter_sample(string $formattedName): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var Parameter $response */
        $response = $parameterManagerClient->getParameter($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 = ParameterManagerClient::parameterName('[PROJECT]', '[LOCATION]', '[PARAMETER]');

    get_parameter_sample($formattedName);
}

getParameterVersion

Gets details of a single ParameterVersion.

The async variant is ParameterManagerClient::getParameterVersionAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\GetParameterVersionRequest

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\ParameterManager\V1\ParameterVersion
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\GetParameterVersionRequest;
use Google\Cloud\ParameterManager\V1\ParameterVersion;

/**
 * @param string $formattedName Name of the resource in the format
 *                              `projects/*/locations/*/parameters/*/versions/*`. Please see
 *                              {@see ParameterManagerClient::parameterVersionName()} for help formatting this field.
 */
function get_parameter_version_sample(string $formattedName): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var ParameterVersion $response */
        $response = $parameterManagerClient->getParameterVersion($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 = ParameterManagerClient::parameterVersionName(
        '[PROJECT]',
        '[LOCATION]',
        '[PARAMETER]',
        '[PARAMETER_VERSION]'
    );

    get_parameter_version_sample($formattedName);
}

listParameterVersions

Lists ParameterVersions in a given project, location, and parameter.

The async variant is ParameterManagerClient::listParameterVersionsAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\ListParameterVersionsRequest

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\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\ListParameterVersionsRequest;
use Google\Cloud\ParameterManager\V1\ParameterVersion;

/**
 * @param string $formattedParent Parent value for ListParameterVersionsRequest in the format
 *                                `projects/*/locations/*/parameters/*`. Please see
 *                                {@see ParameterManagerClient::parameterName()} for help formatting this field.
 */
function list_parameter_versions_sample(string $formattedParent): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

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

        /** @var ParameterVersion $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 = ParameterManagerClient::parameterName('[PROJECT]', '[LOCATION]', '[PARAMETER]');

    list_parameter_versions_sample($formattedParent);
}

listParameters

Lists Parameters in a given project and location.

The async variant is ParameterManagerClient::listParametersAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\ListParametersRequest

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\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\ListParametersRequest;
use Google\Cloud\ParameterManager\V1\Parameter;

/**
 * @param string $formattedParent Parent value for ListParametersRequest in the format
 *                                `projects/*/locations/*`. Please see
 *                                {@see ParameterManagerClient::locationName()} for help formatting this field.
 */
function list_parameters_sample(string $formattedParent): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

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

        /** @var Parameter $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 = ParameterManagerClient::locationName('[PROJECT]', '[LOCATION]');

    list_parameters_sample($formattedParent);
}

renderParameterVersion

Gets rendered version of a ParameterVersion.

The async variant is ParameterManagerClient::renderParameterVersionAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\RenderParameterVersionRequest

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\ParameterManager\V1\RenderParameterVersionResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\RenderParameterVersionRequest;
use Google\Cloud\ParameterManager\V1\RenderParameterVersionResponse;

/**
 * @param string $formattedName Name of the resource
 *                              Please see {@see ParameterManagerClient::parameterVersionName()} for help formatting this field.
 */
function render_parameter_version_sample(string $formattedName): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

    // Call the API and handle any network failures.
    try {
        /** @var RenderParameterVersionResponse $response */
        $response = $parameterManagerClient->renderParameterVersion($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 = ParameterManagerClient::parameterVersionName(
        '[PROJECT]',
        '[LOCATION]',
        '[PARAMETER]',
        '[PARAMETER_VERSION]'
    );

    render_parameter_version_sample($formattedName);
}

updateParameter

Updates a single Parameter.

The async variant is ParameterManagerClient::updateParameterAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\UpdateParameterRequest

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\ParameterManager\V1\Parameter
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\Parameter;
use Google\Cloud\ParameterManager\V1\UpdateParameterRequest;

/**
 * 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 update_parameter_sample(): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

    // Prepare the request message.
    $parameter = new Parameter();
    $request = (new UpdateParameterRequest())
        ->setParameter($parameter);

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

updateParameterVersion

Updates a single ParameterVersion.

The async variant is ParameterManagerClient::updateParameterVersionAsync() .

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\UpdateParameterVersionRequest

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\ParameterManager\V1\ParameterVersion
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;
use Google\Cloud\ParameterManager\V1\ParameterVersion;
use Google\Cloud\ParameterManager\V1\ParameterVersionPayload;
use Google\Cloud\ParameterManager\V1\UpdateParameterVersionRequest;

/**
 * @param string $parameterVersionPayloadData bytes data for storing payload.
 */
function update_parameter_version_sample(string $parameterVersionPayloadData): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

    // Prepare the request message.
    $parameterVersionPayload = (new ParameterVersionPayload())
        ->setData($parameterVersionPayloadData);
    $parameterVersion = (new ParameterVersion())
        ->setPayload($parameterVersionPayload);
    $request = (new UpdateParameterVersionRequest())
        ->setParameterVersion($parameterVersion);

    // Call the API and handle any network failures.
    try {
        /** @var ParameterVersion $response */
        $response = $parameterManagerClient->updateParameterVersion($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
{
    $parameterVersionPayloadData = '...';

    update_parameter_version_sample($parameterVersionPayloadData);
}

getLocation

Gets information about a location.

The async variant is ParameterManagerClient::getLocationAsync() .

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest

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\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;

/**
 * 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 get_location_sample(): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

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

listLocations

Lists information about the supported locations for this service.

The async variant is ParameterManagerClient::listLocationsAsync() .

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest

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\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\ParameterManager\V1\Client\ParameterManagerClient;

/**
 * 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_locations_sample(): void
{
    // Create a client.
    $parameterManagerClient = new ParameterManagerClient();

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

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

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

createParameterAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\CreateParameterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\Parameter>

createParameterVersionAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\CreateParameterVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\ParameterVersion>

deleteParameterAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\DeleteParameterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

deleteParameterVersionAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\DeleteParameterVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<void>

getParameterAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\GetParameterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\Parameter>

getParameterVersionAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\GetParameterVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\ParameterVersion>

listParameterVersionsAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\ListParameterVersionsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listParametersAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\ListParametersRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

renderParameterVersionAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\RenderParameterVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\RenderParameterVersionResponse>

updateParameterAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\UpdateParameterRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\Parameter>

updateParameterVersionAsync

Parameters
Name Description
request Google\Cloud\ParameterManager\V1\UpdateParameterVersionRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\ParameterManager\V1\ParameterVersion>

getLocationAsync

Parameters
Name Description
request Google\Cloud\Location\GetLocationRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Location\Location>

listLocationsAsync

Parameters
Name Description
request Google\Cloud\Location\ListLocationsRequest
optionalArgs array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

static::locationName

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

Parameters
Name Description
project string
location string
Returns
Type Description
string The formatted location resource.

static::parameterName

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

Parameters
Name Description
project string
location string
parameter string
Returns
Type Description
string The formatted parameter resource.

static::parameterVersionName

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

Parameters
Name Description
project string
location string
parameter string
parameterVersion string
Returns
Type Description
string The formatted parameter_version 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

  • location: projects/{project}/locations/{location}
  • parameter: projects/{project}/locations/{location}/parameters/{parameter}
  • parameterVersion: projects/{project}/locations/{location}/parameters/{parameter}/versions/{parameter_version}

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.