Recommender V1 Client - Class RecommenderClient (2.1.2)

Reference documentation and code samples for the Recommender V1 Client class RecommenderClient.

Service Description: Provides insights and recommendations for cloud customers for variouscategories like performance optimization, cost savings, reliability, featurediscovery, etc. Insights and recommendations are generated automaticallybased on analysis of user resources, configuration and monitoring metrics.

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

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

Namespace

Google \ Cloud \ Recommender \ V1 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
optionsarray|Google\ApiCore\Options\ClientOptions

Optional. Options for configuring the service API wrapper.

↳ apiEndpointstring

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

↳ credentialsFetchAuthTokenInterface|CredentialsWrapper

This option should only be used with a pre-constructedGoogle\Auth\FetchAuthTokenInterface orGoogle\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.Important: If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitlyuse Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\Recommender\V1\RecommenderClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new RecommenderClient(['credentials' => $creds]);https://cloud.google.com/docs/authentication/external/externally-sourced-credentials

↳ credentialsConfigarray

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

↳ disableRetriesbool

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

↳ clientConfigstring|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.

↳ transportstring|TransportInterface

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

↳ transportConfigarray

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 theGoogle\ApiCore\Transport\GrpcTransport::build() andGoogle\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSourcecallable

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.

↳ loggerfalse|LoggerInterface

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

↳ universeDomainstring

The service domain for the client. Defaults to 'googleapis.com'.

getInsight

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetInsightRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Insight
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\GetInsightRequest;use Google\Cloud\Recommender\V1\Insight;/** * @param string $formattedName Name of the insight. Please see *                              {@see RecommenderClient::insightName()} for help formatting this field. */function get_insight_sample(string $formattedName): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new GetInsightRequest())        ->setName($formattedName);    // Call the API and handle any network failures.    try {        /** @var Insight $response */        $response = $recommenderClient->getInsight($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::insightName(        '[PROJECT]',        '[LOCATION]',        '[INSIGHT_TYPE]',        '[INSIGHT]'    );    get_insight_sample($formattedName);}

getInsightTypeConfig

Gets the requested InsightTypeConfig. There is only one instance of theconfig for each InsightType.

The async variant isRecommenderClient::getInsightTypeConfigAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetInsightTypeConfigRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\InsightTypeConfig
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\GetInsightTypeConfigRequest;use Google\Cloud\Recommender\V1\InsightTypeConfig;/** * @param string $formattedName Name of the InsightTypeConfig to get. * *                              Acceptable formats: * *                              * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` * *                              * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` * *                              * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` * *                              * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/config` *                              Please see {@see RecommenderClient::insightTypeConfigName()} for help formatting this field. */function get_insight_type_config_sample(string $formattedName): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new GetInsightTypeConfigRequest())        ->setName($formattedName);    // Call the API and handle any network failures.    try {        /** @var InsightTypeConfig $response */        $response = $recommenderClient->getInsightTypeConfig($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::insightTypeConfigName(        '[PROJECT]',        '[LOCATION]',        '[INSIGHT_TYPE]'    );    get_insight_type_config_sample($formattedName);}

getRecommendation

Gets the requested recommendation. Requires the recommender.*.getIAM permission for the specified recommender.

The async variant isRecommenderClient::getRecommendationAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetRecommendationRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Recommendation
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\GetRecommendationRequest;use Google\Cloud\Recommender\V1\Recommendation;/** * @param string $formattedName Name of the recommendation. Please see *                              {@see RecommenderClient::recommendationName()} for help formatting this field. */function get_recommendation_sample(string $formattedName): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new GetRecommendationRequest())        ->setName($formattedName);    // Call the API and handle any network failures.    try {        /** @var Recommendation $response */        $response = $recommenderClient->getRecommendation($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::recommendationName(        '[PROJECT]',        '[LOCATION]',        '[RECOMMENDER]',        '[RECOMMENDATION]'    );    get_recommendation_sample($formattedName);}

getRecommenderConfig

Gets the requested Recommender Config. There is only one instance of theconfig for each Recommender.

The async variant isRecommenderClient::getRecommenderConfigAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetRecommenderConfigRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\RecommenderConfig
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\GetRecommenderConfigRequest;use Google\Cloud\Recommender\V1\RecommenderConfig;/** * @param string $formattedName Name of the Recommendation Config to get. * *                              Acceptable formats: * *                              * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` * *                              * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` * *                              * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` * *                              * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config` *                              Please see {@see RecommenderClient::recommenderConfigName()} for help formatting this field. */function get_recommender_config_sample(string $formattedName): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new GetRecommenderConfigRequest())        ->setName($formattedName);    // Call the API and handle any network failures.    try {        /** @var RecommenderConfig $response */        $response = $recommenderClient->getRecommenderConfig($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::recommenderConfigName(        '[PROJECT]',        '[LOCATION]',        '[RECOMMENDER]'    );    get_recommender_config_sample($formattedName);}

listInsights

Lists insights for the specified Cloud Resource. Requires therecommender.*.list IAM permission for the specified insight type.

The async variant isRecommenderClient::listInsightsAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\ListInsightsRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;use Google\ApiCore\PagedListResponse;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\Insight;use Google\Cloud\Recommender\V1\ListInsightsRequest;/** * @param string $formattedParent The container resource on which to execute the request. *                                Acceptable formats: * *                                * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` * *                                * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` * *                                * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` * *                                * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` * *                                * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]` * *                                LOCATION here refers to GCP Locations: *                                https://cloud.google.com/about/locations/ *                                INSIGHT_TYPE_ID refers to supported insight types: *                                https://cloud.google.com/recommender/docs/insights/insight-types. Please see *                                {@see RecommenderClient::insightTypeName()} for help formatting this field. */function list_insights_sample(string $formattedParent): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new ListInsightsRequest())        ->setParent($formattedParent);    // Call the API and handle any network failures.    try {        /** @var PagedListResponse $response */        $response = $recommenderClient->listInsights($request);        /** @var Insight $element */        foreach ($response as $element) {            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());        }    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedParent = RecommenderClient::insightTypeName('[PROJECT]', '[LOCATION]', '[INSIGHT_TYPE]');    list_insights_sample($formattedParent);}

listRecommendations

Lists recommendations for the specified Cloud Resource. Requires therecommender.*.list IAM permission for the specified recommender.

The async variant isRecommenderClient::listRecommendationsAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\ListRecommendationsRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\ApiCore\PagedListResponse
Example
use Google\ApiCore\ApiException;use Google\ApiCore\PagedListResponse;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\ListRecommendationsRequest;use Google\Cloud\Recommender\V1\Recommendation;/** * @param string $formattedParent The container resource on which to execute the request. *                                Acceptable formats: * *                                * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` * *                                * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` * *                                * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` * *                                * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` * *                                * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]` * *                                LOCATION here refers to GCP Locations: *                                https://cloud.google.com/about/locations/ *                                RECOMMENDER_ID refers to supported recommenders: *                                https://cloud.google.com/recommender/docs/recommenders. Please see *                                {@see RecommenderClient::recommenderName()} for help formatting this field. */function list_recommendations_sample(string $formattedParent): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new ListRecommendationsRequest())        ->setParent($formattedParent);    // Call the API and handle any network failures.    try {        /** @var PagedListResponse $response */        $response = $recommenderClient->listRecommendations($request);        /** @var Recommendation $element */        foreach ($response as $element) {            printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());        }    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedParent = RecommenderClient::recommenderName('[PROJECT]', '[LOCATION]', '[RECOMMENDER]');    list_recommendations_sample($formattedParent);}

markInsightAccepted

Marks the Insight State as Accepted. Users can use this method toindicate to the Recommender API that they have applied some action basedon the insight. This stops the insight content from being updated.

MarkInsightAccepted can be applied to insights in ACTIVE state. Requiresthe recommender.*.update IAM permission for the specified insight.

The async variant isRecommenderClient::markInsightAcceptedAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkInsightAcceptedRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Insight
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\Insight;use Google\Cloud\Recommender\V1\MarkInsightAcceptedRequest;/** * @param string $formattedName Name of the insight. Please see *                              {@see RecommenderClient::insightName()} for help formatting this field. * @param string $etag          Fingerprint of the Insight. Provides optimistic locking. */function mark_insight_accepted_sample(string $formattedName, string $etag): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new MarkInsightAcceptedRequest())        ->setName($formattedName)        ->setEtag($etag);    // Call the API and handle any network failures.    try {        /** @var Insight $response */        $response = $recommenderClient->markInsightAccepted($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::insightName(        '[PROJECT]',        '[LOCATION]',        '[INSIGHT_TYPE]',        '[INSIGHT]'    );    $etag = '[ETAG]';    mark_insight_accepted_sample($formattedName, $etag);}

markRecommendationClaimed

Marks the Recommendation State as Claimed. Users can use this method toindicate to the Recommender API that they are starting to apply therecommendation themselves. This stops the recommendation content from beingupdated. Associated insights are frozen and placed in the ACCEPTED state.

MarkRecommendationClaimed can be applied to recommendations in CLAIMED,SUCCEEDED, FAILED, or ACTIVE state.

Requires the recommender.*.update IAM permission for the specifiedrecommender.

The async variant isRecommenderClient::markRecommendationClaimedAsync().

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationClaimedRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Recommendation
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\MarkRecommendationClaimedRequest;use Google\Cloud\Recommender\V1\Recommendation;/** * @param string $formattedName Name of the recommendation. Please see *                              {@see RecommenderClient::recommendationName()} for help formatting this field. * @param string $etag          Fingerprint of the Recommendation. Provides optimistic locking. */function mark_recommendation_claimed_sample(string $formattedName, string $etag): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new MarkRecommendationClaimedRequest())        ->setName($formattedName)        ->setEtag($etag);    // Call the API and handle any network failures.    try {        /** @var Recommendation $response */        $response = $recommenderClient->markRecommendationClaimed($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::recommendationName(        '[PROJECT]',        '[LOCATION]',        '[RECOMMENDER]',        '[RECOMMENDATION]'    );    $etag = '[ETAG]';    mark_recommendation_claimed_sample($formattedName, $etag);}

markRecommendationDismissed

Mark the Recommendation State as Dismissed. Users can use this method toindicate to the Recommender API that an ACTIVE recommendation has tobe marked back as DISMISSED.

MarkRecommendationDismissed can be applied to recommendations in ACTIVEstate.

Requires the recommender.*.update IAM permission for the specifiedrecommender.

The async variant isRecommenderClient::markRecommendationDismissedAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationDismissedRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Recommendation
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\MarkRecommendationDismissedRequest;use Google\Cloud\Recommender\V1\Recommendation;/** * @param string $formattedName Name of the recommendation. Please see *                              {@see RecommenderClient::recommendationName()} for help formatting this field. */function mark_recommendation_dismissed_sample(string $formattedName): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new MarkRecommendationDismissedRequest())        ->setName($formattedName);    // Call the API and handle any network failures.    try {        /** @var Recommendation $response */        $response = $recommenderClient->markRecommendationDismissed($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::recommendationName(        '[PROJECT]',        '[LOCATION]',        '[RECOMMENDER]',        '[RECOMMENDATION]'    );    mark_recommendation_dismissed_sample($formattedName);}

markRecommendationFailed

Marks the Recommendation State as Failed. Users can use this method toindicate to the Recommender API that they have applied the recommendationthemselves, and the operation failed. This stops the recommendation contentfrom being updated. Associated insights are frozen and placed in theACCEPTED state.

MarkRecommendationFailed can be applied to recommendations in ACTIVE,CLAIMED, SUCCEEDED, or FAILED state.

Requires the recommender.*.update IAM permission for the specifiedrecommender.

The async variant isRecommenderClient::markRecommendationFailedAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationFailedRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Recommendation
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\MarkRecommendationFailedRequest;use Google\Cloud\Recommender\V1\Recommendation;/** * @param string $formattedName Name of the recommendation. Please see *                              {@see RecommenderClient::recommendationName()} for help formatting this field. * @param string $etag          Fingerprint of the Recommendation. Provides optimistic locking. */function mark_recommendation_failed_sample(string $formattedName, string $etag): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new MarkRecommendationFailedRequest())        ->setName($formattedName)        ->setEtag($etag);    // Call the API and handle any network failures.    try {        /** @var Recommendation $response */        $response = $recommenderClient->markRecommendationFailed($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::recommendationName(        '[PROJECT]',        '[LOCATION]',        '[RECOMMENDER]',        '[RECOMMENDATION]'    );    $etag = '[ETAG]';    mark_recommendation_failed_sample($formattedName, $etag);}

markRecommendationSucceeded

Marks the Recommendation State as Succeeded. Users can use this method toindicate to the Recommender API that they have applied the recommendationthemselves, and the operation was successful. This stops the recommendationcontent from being updated. Associated insights are frozen and placed inthe ACCEPTED state.

MarkRecommendationSucceeded can be applied to recommendations in ACTIVE,CLAIMED, SUCCEEDED, or FAILED state.

Requires the recommender.*.update IAM permission for the specifiedrecommender.

The async variant isRecommenderClient::markRecommendationSucceededAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationSucceededRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\Recommendation
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\MarkRecommendationSucceededRequest;use Google\Cloud\Recommender\V1\Recommendation;/** * @param string $formattedName Name of the recommendation. Please see *                              {@see RecommenderClient::recommendationName()} for help formatting this field. * @param string $etag          Fingerprint of the Recommendation. Provides optimistic locking. */function mark_recommendation_succeeded_sample(string $formattedName, string $etag): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $request = (new MarkRecommendationSucceededRequest())        ->setName($formattedName)        ->setEtag($etag);    // Call the API and handle any network failures.    try {        /** @var Recommendation $response */        $response = $recommenderClient->markRecommendationSucceeded($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}/** * Helper to execute the sample. * * This sample has been automatically generated and should be regarded as a code * template only. It will require modifications to work: *  - It may require correct/in-range values for request initialization. *  - It may require specifying regional endpoints when creating the service client, *    please see the apiEndpoint client configuration option for more details. */function callSample(): void{    $formattedName = RecommenderClient::recommendationName(        '[PROJECT]',        '[LOCATION]',        '[RECOMMENDER]',        '[RECOMMENDATION]'    );    $etag = '[ETAG]';    mark_recommendation_succeeded_sample($formattedName, $etag);}

updateInsightTypeConfig

Updates an InsightTypeConfig change. This will create a new revision of theconfig.

The async variant isRecommenderClient::updateInsightTypeConfigAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\InsightTypeConfig
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\InsightTypeConfig;use Google\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest;/** * 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_insight_type_config_sample(): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $insightTypeConfig = new InsightTypeConfig();    $request = (new UpdateInsightTypeConfigRequest())        ->setInsightTypeConfig($insightTypeConfig);    // Call the API and handle any network failures.    try {        /** @var InsightTypeConfig $response */        $response = $recommenderClient->updateInsightTypeConfig($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}

updateRecommenderConfig

Updates a Recommender Config. This will create a new revision of theconfig.

The async variant isRecommenderClient::updateRecommenderConfigAsync() .

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\UpdateRecommenderConfigRequest

A request to house fields associated with the call.

callOptionsarray

Optional.

↳ retrySettingsRetrySettings|array

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

Returns
TypeDescription
Google\Cloud\Recommender\V1\RecommenderConfig
Example
use Google\ApiCore\ApiException;use Google\Cloud\Recommender\V1\Client\RecommenderClient;use Google\Cloud\Recommender\V1\RecommenderConfig;use Google\Cloud\Recommender\V1\UpdateRecommenderConfigRequest;/** * 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_recommender_config_sample(): void{    // Create a client.    $recommenderClient = new RecommenderClient();    // Prepare the request message.    $recommenderConfig = new RecommenderConfig();    $request = (new UpdateRecommenderConfigRequest())        ->setRecommenderConfig($recommenderConfig);    // Call the API and handle any network failures.    try {        /** @var RecommenderConfig $response */        $response = $recommenderClient->updateRecommenderConfig($request);        printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());    } catch (ApiException $ex) {        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());    }}

getInsightAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetInsightRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Insight>

getInsightTypeConfigAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetInsightTypeConfigRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\InsightTypeConfig>

getRecommendationAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetRecommendationRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Recommendation>

getRecommenderConfigAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\GetRecommenderConfigRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\RecommenderConfig>

listInsightsAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\ListInsightsRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

listRecommendationsAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\ListRecommendationsRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse>

markInsightAcceptedAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkInsightAcceptedRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Insight>

markRecommendationClaimedAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationClaimedRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Recommendation>

markRecommendationDismissedAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationDismissedRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Recommendation>

markRecommendationFailedAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationFailedRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Recommendation>

markRecommendationSucceededAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\MarkRecommendationSucceededRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\Recommendation>

updateInsightTypeConfigAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\UpdateInsightTypeConfigRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\InsightTypeConfig>

updateRecommenderConfigAsync

Parameters
NameDescription
requestGoogle\Cloud\Recommender\V1\UpdateRecommenderConfigRequest
optionalArgsarray
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Recommender\V1\RecommenderConfig>

static::billingAccountLocationInsightTypeName

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

Parameters
NameDescription
billingAccountstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted billing_account_location_insight_type resource.

static::billingAccountLocationInsightTypeConfigName

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

Parameters
NameDescription
billingAccountstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted billing_account_location_insight_type_config resource.

static::billingAccountLocationInsightTypeInsightName

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

Parameters
NameDescription
billingAccountstring
locationstring
insightTypestring
insightstring
Returns
TypeDescription
stringThe formatted billing_account_location_insight_type_insight resource.

static::billingAccountLocationRecommenderName

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

Parameters
NameDescription
billingAccountstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted billing_account_location_recommender resource.

static::billingAccountLocationRecommenderConfigName

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

Parameters
NameDescription
billingAccountstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted billing_account_location_recommender_config resource.

static::billingAccountLocationRecommenderRecommendationName

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

Parameters
NameDescription
billingAccountstring
locationstring
recommenderstring
recommendationstring
Returns
TypeDescription
stringThe formatted billing_account_location_recommender_recommendation resource.

static::folderLocationInsightTypeName

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

Parameters
NameDescription
folderstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted folder_location_insight_type resource.

static::folderLocationInsightTypeInsightName

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

Parameters
NameDescription
folderstring
locationstring
insightTypestring
insightstring
Returns
TypeDescription
stringThe formatted folder_location_insight_type_insight resource.

static::folderLocationRecommenderName

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

Parameters
NameDescription
folderstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted folder_location_recommender resource.

static::folderLocationRecommenderRecommendationName

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

Parameters
NameDescription
folderstring
locationstring
recommenderstring
recommendationstring
Returns
TypeDescription
stringThe formatted folder_location_recommender_recommendation resource.

static::insightName

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

Parameters
NameDescription
projectstring
locationstring
insightTypestring
insightstring
Returns
TypeDescription
stringThe formatted insight resource.

static::insightTypeName

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

Parameters
NameDescription
projectstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted insight_type resource.

static::insightTypeConfigName

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

Parameters
NameDescription
projectstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted insight_type_config resource.

static::organizationLocationInsightTypeName

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

Parameters
NameDescription
organizationstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted organization_location_insight_type resource.

static::organizationLocationInsightTypeConfigName

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

Parameters
NameDescription
organizationstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted organization_location_insight_type_config resource.

static::organizationLocationInsightTypeInsightName

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

Parameters
NameDescription
organizationstring
locationstring
insightTypestring
insightstring
Returns
TypeDescription
stringThe formatted organization_location_insight_type_insight resource.

static::organizationLocationRecommenderName

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

Parameters
NameDescription
organizationstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted organization_location_recommender resource.

static::organizationLocationRecommenderConfigName

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

Parameters
NameDescription
organizationstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted organization_location_recommender_config resource.

static::organizationLocationRecommenderRecommendationName

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

Parameters
NameDescription
organizationstring
locationstring
recommenderstring
recommendationstring
Returns
TypeDescription
stringThe formatted organization_location_recommender_recommendation resource.

static::projectLocationInsightTypeName

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

Parameters
NameDescription
projectstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted project_location_insight_type resource.

static::projectLocationInsightTypeConfigName

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

Parameters
NameDescription
projectstring
locationstring
insightTypestring
Returns
TypeDescription
stringThe formatted project_location_insight_type_config resource.

static::projectLocationInsightTypeInsightName

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

Parameters
NameDescription
projectstring
locationstring
insightTypestring
insightstring
Returns
TypeDescription
stringThe formatted project_location_insight_type_insight resource.

static::projectLocationRecommenderName

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

Parameters
NameDescription
projectstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted project_location_recommender resource.

static::projectLocationRecommenderConfigName

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

Parameters
NameDescription
projectstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted project_location_recommender_config resource.

static::projectLocationRecommenderRecommendationName

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

Parameters
NameDescription
projectstring
locationstring
recommenderstring
recommendationstring
Returns
TypeDescription
stringThe formatted project_location_recommender_recommendation resource.

static::recommendationName

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

Parameters
NameDescription
projectstring
locationstring
recommenderstring
recommendationstring
Returns
TypeDescription
stringThe formatted recommendation resource.

static::recommenderName

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

Parameters
NameDescription
projectstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted recommender resource.

static::recommenderConfigName

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

Parameters
NameDescription
projectstring
locationstring
recommenderstring
Returns
TypeDescription
stringThe formatted recommender_config resource.

static::parseName

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

The following name formats are supported:Template: Pattern

  • billingAccountLocationInsightType: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}
  • billingAccountLocationInsightTypeConfig: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/config
  • billingAccountLocationInsightTypeInsight: billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}
  • billingAccountLocationRecommender: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}
  • billingAccountLocationRecommenderConfig: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/config
  • billingAccountLocationRecommenderRecommendation: billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}
  • folderLocationInsightType: folders/{folder}/locations/{location}/insightTypes/{insight_type}
  • folderLocationInsightTypeInsight: folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}
  • folderLocationRecommender: folders/{folder}/locations/{location}/recommenders/{recommender}
  • folderLocationRecommenderRecommendation: folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}
  • insight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}
  • insightType: projects/{project}/locations/{location}/insightTypes/{insight_type}
  • insightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config
  • organizationLocationInsightType: organizations/{organization}/locations/{location}/insightTypes/{insight_type}
  • organizationLocationInsightTypeConfig: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config
  • organizationLocationInsightTypeInsight: organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}
  • organizationLocationRecommender: organizations/{organization}/locations/{location}/recommenders/{recommender}
  • organizationLocationRecommenderConfig: organizations/{organization}/locations/{location}/recommenders/{recommender}/config
  • organizationLocationRecommenderRecommendation: organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}
  • projectLocationInsightType: projects/{project}/locations/{location}/insightTypes/{insight_type}
  • projectLocationInsightTypeConfig: projects/{project}/locations/{location}/insightTypes/{insight_type}/config
  • projectLocationInsightTypeInsight: projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}
  • projectLocationRecommender: projects/{project}/locations/{location}/recommenders/{recommender}
  • projectLocationRecommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config
  • projectLocationRecommenderRecommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}
  • recommendation: projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}
  • recommender: projects/{project}/locations/{location}/recommenders/{recommender}
  • recommenderConfig: projects/{project}/locations/{location}/recommenders/{recommender}/config

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 isprovided, or if the $template argument does not match one of the templateslisted, then parseName will check each of the supported templates, and returnthe first match.

Parameters
NameDescription
formattedNamestring

The formatted name string

template?string

Optional name of template to match

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-09 UTC.