Google Cloud Apigee Registry V1 Client - Class RegistryClient (0.2.7)

Reference documentation and code samples for the Google Cloud Apigee Registry V1 Client class RegistryClient.

Service Description: The Registry service allows teams to manage descriptions of APIs.

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

$registryClient = new RegistryClient();
try {
    $formattedParent = $registryClient->locationName('[PROJECT]', '[LOCATION]');
    $api = new Api();
    $apiId = 'api_id';
    $response = $registryClient->createApi($formattedParent, $api, $apiId);
} finally {
    $registryClient->close();
}

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

Methods

apiName

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

Parameters
NameDescription
project string
location string
api string
Returns
TypeDescription
stringThe formatted api resource.

apiDeploymentName

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

Parameters
NameDescription
project string
location string
api string
deployment string
Returns
TypeDescription
stringThe formatted api_deployment resource.

apiSpecName

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

Parameters
NameDescription
project string
location string
api string
version string
spec string
Returns
TypeDescription
stringThe formatted api_spec resource.

apiVersionName

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

Parameters
NameDescription
project string
location string
api string
version string
Returns
TypeDescription
stringThe formatted api_version resource.

artifactName

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

Parameters
NameDescription
project string
location string
artifact string
Returns
TypeDescription
stringThe formatted artifact resource.

locationName

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

Parameters
NameDescription
project string
location string
Returns
TypeDescription
stringThe formatted location resource.

projectLocationApiArtifactName

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

Parameters
NameDescription
project string
location string
api string
artifact string
Returns
TypeDescription
stringThe formatted project_location_api_artifact resource.

projectLocationApiDeploymentArtifactName

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

Parameters
NameDescription
project string
location string
api string
deployment string
artifact string
Returns
TypeDescription
stringThe formatted project_location_api_deployment_artifact resource.

projectLocationApiVersionArtifactName

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

Parameters
NameDescription
project string
location string
api string
version string
artifact string
Returns
TypeDescription
stringThe formatted project_location_api_version_artifact resource.

projectLocationApiVersionSpecArtifactName

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

Parameters
NameDescription
project string
location string
api string
version string
spec string
artifact string
Returns
TypeDescription
stringThe formatted project_location_api_version_spec_artifact resource.

projectLocationArtifactName

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

Parameters
NameDescription
project string
location string
artifact string
Returns
TypeDescription
stringThe formatted project_location_artifact resource.

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

  • api: projects/{project}/locations/{location}/apis/{api}
  • apiDeployment: projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}
  • apiSpec: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}
  • apiVersion: projects/{project}/locations/{location}/apis/{api}/versions/{version}
  • artifact: projects/{project}/locations/{location}/artifacts/{artifact}
  • location: projects/{project}/locations/{location}
  • projectLocationApiArtifact: projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}
  • projectLocationApiDeploymentArtifact: projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}
  • projectLocationApiVersionArtifact: projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}
  • projectLocationApiVersionSpecArtifact: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}
  • projectLocationArtifact: projects/{project}/locations/{location}/artifacts/{artifact}

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

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

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

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

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

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

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

↳ credentialsConfig array

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

↳ disableRetries bool

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

↳ clientConfig string|array

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

↳ transport string|TransportInterface

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

↳ transportConfig array

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

↳ clientCertSource callable

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

createApi

Creates a specified API.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of APIs. Format: projects/*/locations/*

api Google\Cloud\ApigeeRegistry\V1\Api

Required. The API to create.

apiId string

Required. The ID to use for the API, which will become the final component of the API's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.

Following AIP-162, IDs must not have the form of a UUID.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\Api
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of APIs.
 *                                Format: `projects/*/locations/*`
 *                                Please see {@see RegistryClient::locationName()} for help formatting this field.
 * @param string $apiId           The ID to use for the API, which will become the final component of
 *                                the API's resource name.
 *
 *                                This value should be 4-63 characters, and valid characters
 *                                are /[a-z][0-9]-/.
 *
 *                                Following AIP-162, IDs must not have the form of a UUID.
 */
function create_api_sample(string $formattedParent, string $apiId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');
    $apiId = '[API_ID]';

    create_api_sample($formattedParent, $apiId);
}

createApiDeployment

Creates a specified deployment.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of deployments. Format: projects/*/locations/*/apis/*

apiDeployment Google\Cloud\ApigeeRegistry\V1\ApiDeployment

Required. The deployment to create.

apiDeploymentId string

Required. The ID to use for the deployment, which will become the final component of the deployment's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.

Following AIP-162, IDs must not have the form of a UUID.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of deployments.
 *                                Format: `projects/*/locations/*/apis/*`
 *                                Please see {@see RegistryClient::apiName()} for help formatting this field.
 * @param string $apiDeploymentId The ID to use for the deployment, which will become the final component of
 *                                the deployment's resource name.
 *
 *                                This value should be 4-63 characters, and valid characters
 *                                are /[a-z][0-9]-/.
 *
 *                                Following AIP-162, IDs must not have the form of a UUID.
 */
function create_api_deployment_sample(string $formattedParent, string $apiDeploymentId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
    $apiDeploymentId = '[API_DEPLOYMENT_ID]';

    create_api_deployment_sample($formattedParent, $apiDeploymentId);
}

createApiSpec

Creates a specified spec.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of specs. Format: projects/*/locations/*/apis/*/versions/*

apiSpec Google\Cloud\ApigeeRegistry\V1\ApiSpec

Required. The spec to create.

apiSpecId string

Required. The ID to use for the spec, which will become the final component of the spec's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.

Following AIP-162, IDs must not have the form of a UUID.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of specs.
 *                                Format: `projects/*/locations/*/apis/*/versions/*`
 *                                Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
 * @param string $apiSpecId       The ID to use for the spec, which will become the final component of
 *                                the spec's resource name.
 *
 *                                This value should be 4-63 characters, and valid characters
 *                                are /[a-z][0-9]-/.
 *
 *                                Following AIP-162, IDs must not have the form of a UUID.
 */
function create_api_spec_sample(string $formattedParent, string $apiSpecId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');
    $apiSpecId = '[API_SPEC_ID]';

    create_api_spec_sample($formattedParent, $apiSpecId);
}

createApiVersion

Creates a specified version.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of versions. Format: projects/*/locations/*/apis/*

apiVersion Google\Cloud\ApigeeRegistry\V1\ApiVersion

Required. The version to create.

apiVersionId string

Required. The ID to use for the version, which will become the final component of the version's resource name.

This value should be 1-63 characters, and valid characters are /[a-z][0-9]-/.

Following AIP-162, IDs must not have the form of a UUID.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiVersion
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of versions.
 *                                Format: `projects/*/locations/*/apis/*`
 *                                Please see {@see RegistryClient::apiName()} for help formatting this field.
 * @param string $apiVersionId    The ID to use for the version, which will become the final component of
 *                                the version's resource name.
 *
 *                                This value should be 1-63 characters, and valid characters
 *                                are /[a-z][0-9]-/.
 *
 *                                Following AIP-162, IDs must not have the form of a UUID.
 */
function create_api_version_sample(string $formattedParent, string $apiVersionId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');
    $apiVersionId = '[API_VERSION_ID]';

    create_api_version_sample($formattedParent, $apiVersionId);
}

createArtifact

Creates a specified artifact.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of artifacts. Format: {parent}

artifact Google\Cloud\ApigeeRegistry\V1\Artifact

Required. The artifact to create.

artifactId string

Required. The ID to use for the artifact, which will become the final component of the artifact's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.

Following AIP-162, IDs must not have the form of a UUID.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\Artifact
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of artifacts.
 *                                Format: `{parent}`
 *                                Please see {@see RegistryClient::locationName()} for help formatting this field.
 * @param string $artifactId      The ID to use for the artifact, which will become the final component of
 *                                the artifact's resource name.
 *
 *                                This value should be 4-63 characters, and valid characters
 *                                are /[a-z][0-9]-/.
 *
 *                                Following AIP-162, IDs must not have the form of a UUID.
 */
function create_artifact_sample(string $formattedParent, string $artifactId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');
    $artifactId = '[ARTIFACT_ID]';

    create_artifact_sample($formattedParent, $artifactId);
}

deleteApi

Removes a specified API and all of the resources that it owns.

Parameters
NameDescription
name string

Required. The name of the API to delete. Format: projects/*/locations/*/apis/*

optionalArgs array

Optional.

↳ force bool

If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)

↳ 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\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the API to delete.
 *                              Format: `projects/*/locations/*/apis/*`
 *                              Please see {@see RegistryClient::apiName()} for help formatting this field.
 */
function delete_api_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');

    delete_api_sample($formattedName);
}

deleteApiDeployment

Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).

Parameters
NameDescription
name string

Required. The name of the deployment to delete. Format: projects/*/locations/*/apis/*/deployments/*

optionalArgs array

Optional.

↳ force bool

If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)

↳ 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\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the deployment to delete.
 *                              Format: `projects/*/locations/*/apis/*/deployments/*`
 *                              Please see {@see RegistryClient::apiDeploymentName()} for help formatting this field.
 */
function delete_api_deployment_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiDeploymentName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[DEPLOYMENT]'
    );

    delete_api_deployment_sample($formattedName);
}

deleteApiDeploymentRevision

Deletes a revision of a deployment.

Parameters
NameDescription
name string

Required. The name of the deployment revision to be deleted, with a revision ID explicitly included.

Example: projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the deployment revision to be deleted,
 *                              with a revision ID explicitly included.
 *
 *                              Example:
 *                              `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8`
 *                              Please see {@see RegistryClient::apiDeploymentName()} for help formatting this field.
 */
function delete_api_deployment_revision_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiDeploymentName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[DEPLOYMENT]'
    );

    delete_api_deployment_revision_sample($formattedName);
}

deleteApiSpec

Removes a specified spec, all revisions, and all child resources (e.g., artifacts).

Parameters
NameDescription
name string

Required. The name of the spec to delete. Format: projects/*/locations/*/apis/*/versions/*/specs/*

optionalArgs array

Optional.

↳ force bool

If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)

↳ 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\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the spec to delete.
 *                              Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
 *                              Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
 */
function delete_api_spec_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );

    delete_api_spec_sample($formattedName);
}

deleteApiSpecRevision

Deletes a revision of a spec.

Parameters
NameDescription
name string

Required. The name of the spec revision to be deleted, with a revision ID explicitly included.

Example: projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the spec revision to be deleted,
 *                              with a revision ID explicitly included.
 *
 *                              Example:
 *                              `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8`
 *                              Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
 */
function delete_api_spec_revision_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );

    delete_api_spec_revision_sample($formattedName);
}

deleteApiVersion

Removes a specified version and all of the resources that it owns.

Parameters
NameDescription
name string

Required. The name of the version to delete. Format: projects/*/locations/*/apis/*/versions/*

optionalArgs array

Optional.

↳ force bool

If set to true, any child resources will also be deleted. (Otherwise, the request will only work if there are no child resources.)

↳ 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\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the version to delete.
 *                              Format: `projects/*/locations/*/apis/*/versions/*`
 *                              Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
 */
function delete_api_version_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');

    delete_api_version_sample($formattedName);
}

deleteArtifact

Removes a specified artifact.

Parameters
NameDescription
name string

Required. The name of the artifact to delete. Format: {parent}/artifacts/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the artifact to delete.
 *                              Format: `{parent}/artifacts/*`
 *                              Please see {@see RegistryClient::artifactName()} for help formatting this field.
 */
function delete_artifact_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::artifactName('[PROJECT]', '[LOCATION]', '[ARTIFACT]');

    delete_artifact_sample($formattedName);
}

getApi

Returns a specified API.

Parameters
NameDescription
name string

Required. The name of the API to retrieve. Format: projects/*/locations/*/apis/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\Api
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the API to retrieve.
 *                              Format: `projects/*/locations/*/apis/*`
 *                              Please see {@see RegistryClient::apiName()} for help formatting this field.
 */
function get_api_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');

    get_api_sample($formattedName);
}

getApiDeployment

Returns a specified deployment.

Parameters
NameDescription
name string

Required. The name of the deployment to retrieve. Format: projects/*/locations/*/apis/*/deployments/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the deployment to retrieve.
 *                              Format: `projects/*/locations/*/apis/*/deployments/*`
 *                              Please see {@see RegistryClient::apiDeploymentName()} for help formatting this field.
 */
function get_api_deployment_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiDeploymentName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[DEPLOYMENT]'
    );

    get_api_deployment_sample($formattedName);
}

getApiSpec

Returns a specified spec.

Parameters
NameDescription
name string

Required. The name of the spec to retrieve. Format: projects/*/locations/*/apis/*/versions/*/specs/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the spec to retrieve.
 *                              Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
 *                              Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
 */
function get_api_spec_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );

    get_api_spec_sample($formattedName);
}

getApiSpecContents

Returns the contents of a specified spec.

If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).

Parameters
NameDescription
name string

Required. The name of the spec whose contents should be retrieved. Format: projects/*/locations/*/apis/*/versions/*/specs/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Api\HttpBody
Example
use Google\ApiCore\ApiException;
use Google\Api\HttpBody;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the spec whose contents should be retrieved.
 *                              Format: `projects/*/locations/*/apis/*/versions/*/specs/*`
 *                              Please see {@see RegistryClient::apiSpecName()} for help formatting this field.
 */
function get_api_spec_contents_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );

    get_api_spec_contents_sample($formattedName);
}

getApiVersion

Returns a specified version.

Parameters
NameDescription
name string

Required. The name of the version to retrieve. Format: projects/*/locations/*/apis/*/versions/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiVersion
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the version to retrieve.
 *                              Format: `projects/*/locations/*/apis/*/versions/*`
 *                              Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
 */
function get_api_version_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');

    get_api_version_sample($formattedName);
}

getArtifact

Returns a specified artifact.

Parameters
NameDescription
name string

Required. The name of the artifact to retrieve. Format: {parent}/artifacts/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\Artifact
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the artifact to retrieve.
 *                              Format: `{parent}/artifacts/*`
 *                              Please see {@see RegistryClient::artifactName()} for help formatting this field.
 */
function get_artifact_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::artifactName('[PROJECT]', '[LOCATION]', '[ARTIFACT]');

    get_artifact_sample($formattedName);
}

getArtifactContents

Returns the contents of a specified artifact.

If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).

Parameters
NameDescription
name string

Required. The name of the artifact whose contents should be retrieved. Format: {parent}/artifacts/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Api\HttpBody
Example
use Google\ApiCore\ApiException;
use Google\Api\HttpBody;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the artifact whose contents should be retrieved.
 *                              Format: `{parent}/artifacts/*`
 *                              Please see {@see RegistryClient::artifactName()} for help formatting this field.
 */
function get_artifact_contents_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::artifactName('[PROJECT]', '[LOCATION]', '[ARTIFACT]');

    get_artifact_contents_sample($formattedName);
}

listApiDeploymentRevisions

Lists all revisions of a deployment.

Revisions are returned in descending order of revision creation time.

Parameters
NameDescription
name string

Required. The name of the deployment to list revisions for.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the deployment to list revisions for. Please see
 *                              {@see RegistryClient::apiDeploymentName()} for help formatting this field.
 */
function list_api_deployment_revisions_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiDeploymentName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[DEPLOYMENT]'
    );

    list_api_deployment_revisions_sample($formattedName);
}

listApiDeployments

Returns matching deployments.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of deployments. Format: projects/*/locations/*/apis/*

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ filter string

An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of deployments.
 *                                Format: `projects/*/locations/*/apis/*`
 *                                Please see {@see RegistryClient::apiName()} for help formatting this field.
 */
function list_api_deployments_sample(string $formattedParent): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');

    list_api_deployments_sample($formattedParent);
}

listApiSpecRevisions

Lists all revisions of a spec.

Revisions are returned in descending order of revision creation time.

Parameters
NameDescription
name string

Required. The name of the spec to list revisions for.

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the spec to list revisions for. Please see
 *                              {@see RegistryClient::apiSpecName()} for help formatting this field.
 */
function list_api_spec_revisions_sample(string $formattedName): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );

    list_api_spec_revisions_sample($formattedName);
}

listApiSpecs

Returns matching specs.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of specs. Format: projects/*/locations/*/apis/*/versions/*

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ filter string

An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields except contents.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of specs.
 *                                Format: `projects/*/locations/*/apis/*/versions/*`
 *                                Please see {@see RegistryClient::apiVersionName()} for help formatting this field.
 */
function list_api_specs_sample(string $formattedParent): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiVersionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');

    list_api_specs_sample($formattedParent);
}

listApiVersions

Returns matching versions.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of versions. Format: projects/*/locations/*/apis/*

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ filter string

An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of versions.
 *                                Format: `projects/*/locations/*/apis/*`
 *                                Please see {@see RegistryClient::apiName()} for help formatting this field.
 */
function list_api_versions_sample(string $formattedParent): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::apiName('[PROJECT]', '[LOCATION]', '[API]');

    list_api_versions_sample($formattedParent);
}

listApis

Returns matching APIs.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of APIs. Format: projects/*/locations/*

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ filter string

An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of APIs.
 *                                Format: `projects/*/locations/*`
 *                                Please see {@see RegistryClient::locationName()} for help formatting this field.
 */
function list_apis_sample(string $formattedParent): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');

    list_apis_sample($formattedParent);
}

listArtifacts

Returns matching artifacts.

Parameters
NameDescription
parent string

Required. The parent, which owns this collection of artifacts. Format: {parent}

optionalArgs array

Optional.

↳ pageSize int

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

↳ pageToken string

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

↳ filter string

An expression that can be used to filter the list. Filters use the Common Expression Language and can refer to all message fields except contents.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedParent The parent, which owns this collection of artifacts.
 *                                Format: `{parent}`
 *                                Please see {@see RegistryClient::locationName()} for help formatting this field.
 */
function list_artifacts_sample(string $formattedParent): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

/**
 * 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 = RegistryClient::locationName('[PROJECT]', '[LOCATION]');

    list_artifacts_sample($formattedParent);
}

replaceArtifact

Used to replace a specified artifact.

Parameters
NameDescription
artifact Google\Cloud\ApigeeRegistry\V1\Artifact

Required. The artifact to replace.

The name field is used to identify the artifact to replace. Format: {parent}/artifacts/*

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\Artifact
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Artifact;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * 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 replace_artifact_sample(): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

rollbackApiDeployment

Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.

Parameters
NameDescription
name string

Required. The deployment being rolled back.

revisionId string

Required. The revision ID to roll back to. It must be a revision of the same deployment.

Example: c7cfa2a8

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The deployment being rolled back. Please see
 *                              {@see RegistryClient::apiDeploymentName()} for help formatting this field.
 * @param string $revisionId    The revision ID to roll back to.
 *                              It must be a revision of the same deployment.
 *
 *                              Example: `c7cfa2a8`
 */
function rollback_api_deployment_sample(string $formattedName, string $revisionId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiDeploymentName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[DEPLOYMENT]'
    );
    $revisionId = '[REVISION_ID]';

    rollback_api_deployment_sample($formattedName, $revisionId);
}

rollbackApiSpec

Sets the current revision to a specified prior revision.

Note that this creates a new revision with a new revision ID.

Parameters
NameDescription
name string

Required. The spec being rolled back.

revisionId string

Required. The revision ID to roll back to. It must be a revision of the same spec.

Example: c7cfa2a8

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The spec being rolled back. Please see
 *                              {@see RegistryClient::apiSpecName()} for help formatting this field.
 * @param string $revisionId    The revision ID to roll back to.
 *                              It must be a revision of the same spec.
 *
 *                              Example: `c7cfa2a8`
 */
function rollback_api_spec_sample(string $formattedName, string $revisionId): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );
    $revisionId = '[REVISION_ID]';

    rollback_api_spec_sample($formattedName, $revisionId);
}

tagApiDeploymentRevision

Adds a tag to a specified revision of a deployment.

Parameters
NameDescription
name string

Required. The name of the deployment to be tagged, including the revision ID.

tag string

Required. The tag to apply. The tag should be at most 40 characters, and match [a-z][a-z0-9-]{3,39}.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the deployment to be tagged, including the revision ID. Please see
 *                              {@see RegistryClient::apiDeploymentName()} for help formatting this field.
 * @param string $tag           The tag to apply.
 *                              The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`.
 */
function tag_api_deployment_revision_sample(string $formattedName, string $tag): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiDeploymentName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[DEPLOYMENT]'
    );
    $tag = '[TAG]';

    tag_api_deployment_revision_sample($formattedName, $tag);
}

tagApiSpecRevision

Adds a tag to a specified revision of a spec.

Parameters
NameDescription
name string

Required. The name of the spec to be tagged, including the revision ID.

tag string

Required. The tag to apply. The tag should be at most 40 characters, and match [a-z][a-z0-9-]{3,39}.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * @param string $formattedName The name of the spec to be tagged, including the revision ID. Please see
 *                              {@see RegistryClient::apiSpecName()} for help formatting this field.
 * @param string $tag           The tag to apply.
 *                              The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`.
 */
function tag_api_spec_revision_sample(string $formattedName, string $tag): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

/**
 * 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 = RegistryClient::apiSpecName(
        '[PROJECT]',
        '[LOCATION]',
        '[API]',
        '[VERSION]',
        '[SPEC]'
    );
    $tag = '[TAG]';

    tag_api_spec_revision_sample($formattedName, $tag);
}

updateApi

Used to modify a specified API.

Parameters
NameDescription
api Google\Cloud\ApigeeRegistry\V1\Api

Required. The API to update.

The name field is used to identify the API to update. Format: projects/*/locations/*/apis/*

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.

↳ allowMissing bool

If set to true, and the API is not found, a new API will be created. In this situation, update_mask is ignored.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\Api
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Api;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * 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_api_sample(): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

updateApiDeployment

Used to modify a specified deployment.

Parameters
NameDescription
apiDeployment Google\Cloud\ApigeeRegistry\V1\ApiDeployment

Required. The deployment to update.

The name field is used to identify the deployment to update. Format: projects/*/locations/*/apis/*/deployments/*

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.

↳ allowMissing bool

If set to true, and the deployment is not found, a new deployment will be created. In this situation, update_mask is ignored.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiDeployment
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiDeployment;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * 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_api_deployment_sample(): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

updateApiSpec

Used to modify a specified spec.

Parameters
NameDescription
apiSpec Google\Cloud\ApigeeRegistry\V1\ApiSpec

Required. The spec to update.

The name field is used to identify the spec to update. Format: projects/*/locations/*/apis/*/versions/*/specs/*

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.

↳ allowMissing bool

If set to true, and the spec is not found, a new spec will be created. In this situation, update_mask is ignored.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiSpec
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiSpec;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * 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_api_spec_sample(): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

updateApiVersion

Used to modify a specified version.

Parameters
NameDescription
apiVersion Google\Cloud\ApigeeRegistry\V1\ApiVersion

Required. The version to update.

The name field is used to identify the version to update. Format: projects/*/locations/*/apis/*/versions/*

optionalArgs array

Optional.

↳ updateMask FieldMask

The list of fields to be updated. If omitted, all fields are updated that are set in the request message (fields set to default values are ignored). If an asterisk "*" is specified, all fields are updated, including fields that are unspecified/default in the request.

↳ allowMissing bool

If set to true, and the version is not found, a new version will be created. In this situation, update_mask is ignored.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\ApigeeRegistry\V1\ApiVersion
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\ApiVersion;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;

/**
 * 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_api_version_sample(): void
{
    // Create a client.
    $registryClient = new RegistryClient();

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

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

getLocation

Gets information about a location.

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

Resource name for the location.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Location\Location
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;
use Google\Cloud\Location\Location;

/**
 * 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.
    $registryClient = new RegistryClient();

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

Parameters
NameDescription
optionalArgs array

Optional.

↳ name string

The resource that owns the locations collection, if applicable.

↳ filter string

The standard list filter.

↳ pageSize int

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

↳ pageToken string

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

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;
use Google\Cloud\Location\Location;

/**
 * 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.
    $registryClient = new RegistryClient();

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

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

getIamPolicy

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

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

optionalArgs array

Optional.

↳ options GetPolicyOptions

OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;
use Google\Cloud\Iam\V1\Policy;

/**
 * @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.
    $registryClient = new RegistryClient();

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

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

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy Google\Cloud\Iam\V1\Policy

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

optionalArgs array

Optional.

↳ updateMask FieldMask

OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: paths: "bindings, etag"

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Iam\V1\Policy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;
use Google\Cloud\Iam\V1\Policy;

/**
 * @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.
    $registryClient = new RegistryClient();

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

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

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

Parameters
NameDescription
resource string

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions string[]

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.

optionalArgs array

Optional.

↳ retrySettings RetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Iam\V1\TestIamPermissionsResponse
Example
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\RegistryClient;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;

/**
 * @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.
    $registryClient = new RegistryClient();

    // Prepare any non-scalar elements to be passed along with the request.
    $permissions = [$permissionsElement,];

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

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

Constants

SERVICE_NAME

Value: 'google.cloud.apigeeregistry.v1.Registry'

The name of the service.

SERVICE_ADDRESS

Value: 'apigeeregistry.googleapis.com'

The default address of the service.

DEFAULT_SERVICE_PORT

Value: 443

The default port of the service.

CODEGEN_NAME

Value: 'gapic'

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