diff --git a/Support/metadata/V2/SupportEventSubscriptionService.php b/Support/metadata/V2/SupportEventSubscriptionService.php index c361e9bfbf16..bf830fd0b677 100644 --- a/Support/metadata/V2/SupportEventSubscriptionService.php +++ b/Support/metadata/V2/SupportEventSubscriptionService.php @@ -19,9 +19,10 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Support\V2\SupportEventSubscription::initOnce(); + \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\xC3\x18\x0A@google/cloud/support/v2/support_event_subscription_service.proto\x12\x17google.cloud.support.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A8google/cloud/support/v2/support_event_subscription.proto\x1A google/protobuf/field_mask.proto\"\xD1\x01\x0A%CreateSupportEventSubscriptionRequest\x12L\x0A\x06parent\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x124cloudsupport.googleapis.com/SupportEventSubscription\x12Z\x0A\x1Asupport_event_subscription\x18\x02 \x01(\x0B21.google.cloud.support.v2.SupportEventSubscriptionB\x03\xE0A\x02\"p\x0A\"GetSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription\"\xD5\x01\x0A\$ListSupportEventSubscriptionsRequest\x12L\x0A\x06parent\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x124cloudsupport.googleapis.com/SupportEventSubscription\x12\x13\x0A\x06filter\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cshow_deleted\x18\x03 \x01(\x08B\x03\xE0A\x01\x12\x16\x0A\x09page_size\x18\x04 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x98\x01\x0A%ListSupportEventSubscriptionsResponse\x12V\x0A\x1Bsupport_event_subscriptions\x18\x01 \x03(\x0B21.google.cloud.support.v2.SupportEventSubscription\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\xB9\x01\x0A%UpdateSupportEventSubscriptionRequest\x12Z\x0A\x1Asupport_event_subscription\x18\x01 \x01(\x0B21.google.cloud.support.v2.SupportEventSubscriptionB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"s\x0A%DeleteSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription\"u\x0A'UndeleteSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription2\xFB\x0B\x0A\x1FSupportEventSubscriptionService\x12\x87\x02\x0A\x1ECreateSupportEventSubscription\x12>.google.cloud.support.v2.CreateSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"r\xDAA!parent,support_event_subscription\x82\xD3\xE4\x93\x02H\"*/v2/{parent=*/*}/supportEventSubscriptions:\x1Asupport_event_subscription\x12\xC8\x01\x0A\x1BGetSupportEventSubscription\x12;.google.cloud.support.v2.GetSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"9\xDAA\x04name\x82\xD3\xE4\x93\x02,\x12*/v2/{name=*/*/supportEventSubscriptions/*}\x12\xDB\x01\x0A\x1DListSupportEventSubscriptions\x12=.google.cloud.support.v2.ListSupportEventSubscriptionsRequest\x1A>.google.cloud.support.v2.ListSupportEventSubscriptionsResponse\";\xDAA\x06parent\x82\xD3\xE4\x93\x02,\x12*/v2/{parent=*/*}/supportEventSubscriptions\x12\xA8\x02\x0A\x1EUpdateSupportEventSubscription\x12>.google.cloud.support.v2.UpdateSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"\x92\x01\xDAA&support_event_subscription,update_mask\x82\xD3\xE4\x93\x02c2E/v2/{support_event_subscription.name=*/*/supportEventSubscriptions/*}:\x1Asupport_event_subscription\x12\xCE\x01\x0A\x1EDeleteSupportEventSubscription\x12>.google.cloud.support.v2.DeleteSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"9\xDAA\x04name\x82\xD3\xE4\x93\x02,**/v2/{name=*/*/supportEventSubscriptions/*}\x12\xD7\x01\x0A UndeleteSupportEventSubscription\x12@.google.cloud.support.v2.UndeleteSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\">\x82\xD3\xE4\x93\x028\"3/v2/{name=*/*/supportEventSubscriptions/*}:undelete:\x01*\x1AO\xCAA\x1Bcloudsupport.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xCD\x01\x0A\x1Bcom.google.cloud.support.v2B\$SupportEventSubscriptionServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xAA\x02\x17Google.Cloud.Support.V2\xCA\x02\x17Google\\Cloud\\Support\\V2\xEA\x02\x1AGoogle::Cloud::Support::V2b\x06proto3" + "\x0A\xED\x1B\x0A@google/cloud/support/v2/support_event_subscription_service.proto\x12\x17google.cloud.support.v2\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A8google/cloud/support/v2/support_event_subscription.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\"\xD1\x01\x0A%CreateSupportEventSubscriptionRequest\x12L\x0A\x06parent\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x124cloudsupport.googleapis.com/SupportEventSubscription\x12Z\x0A\x1Asupport_event_subscription\x18\x02 \x01(\x0B21.google.cloud.support.v2.SupportEventSubscriptionB\x03\xE0A\x02\"p\x0A\"GetSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription\"\xD5\x01\x0A\$ListSupportEventSubscriptionsRequest\x12L\x0A\x06parent\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x124cloudsupport.googleapis.com/SupportEventSubscription\x12\x13\x0A\x06filter\x18\x02 \x01(\x09B\x03\xE0A\x01\x12\x19\x0A\x0Cshow_deleted\x18\x03 \x01(\x08B\x03\xE0A\x01\x12\x16\x0A\x09page_size\x18\x04 \x01(\x05B\x03\xE0A\x01\x12\x17\x0A\x0Apage_token\x18\x05 \x01(\x09B\x03\xE0A\x01\"\x98\x01\x0A%ListSupportEventSubscriptionsResponse\x12V\x0A\x1Bsupport_event_subscriptions\x18\x01 \x03(\x0B21.google.cloud.support.v2.SupportEventSubscription\x12\x17\x0A\x0Fnext_page_token\x18\x02 \x01(\x09\"\xB9\x01\x0A%UpdateSupportEventSubscriptionRequest\x12Z\x0A\x1Asupport_event_subscription\x18\x01 \x01(\x0B21.google.cloud.support.v2.SupportEventSubscriptionB\x03\xE0A\x02\x124\x0A\x0Bupdate_mask\x18\x02 \x01(\x0B2\x1A.google.protobuf.FieldMaskB\x03\xE0A\x01\"s\x0A%DeleteSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription\"u\x0A'UndeleteSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription\"t\x0A&ExpungeSupportEventSubscriptionRequest\x12J\x0A\x04name\x18\x01 \x01(\x09B<\xE0A\x02\xFAA6\x0A4cloudsupport.googleapis.com/SupportEventSubscription2\x92\x0E\x0A\x1FSupportEventSubscriptionService\x12\x93\x02\x0A\x1ECreateSupportEventSubscription\x12>.google.cloud.support.v2.CreateSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"~\xDAA!parent,support_event_subscription\x82\xD3\xE4\x93\x02T\"6/v2/{parent=organizations/*}/supportEventSubscriptions:\x1Asupport_event_subscription\x12\xD4\x01\x0A\x1BGetSupportEventSubscription\x12;.google.cloud.support.v2.GetSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"E\xDAA\x04name\x82\xD3\xE4\x93\x028\x126/v2/{name=organizations/*/supportEventSubscriptions/*}\x12\xE7\x01\x0A\x1DListSupportEventSubscriptions\x12=.google.cloud.support.v2.ListSupportEventSubscriptionsRequest\x1A>.google.cloud.support.v2.ListSupportEventSubscriptionsResponse\"G\xDAA\x06parent\x82\xD3\xE4\x93\x028\x126/v2/{parent=organizations/*}/supportEventSubscriptions\x12\xB4\x02\x0A\x1EUpdateSupportEventSubscription\x12>.google.cloud.support.v2.UpdateSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"\x9E\x01\xDAA&support_event_subscription,update_mask\x82\xD3\xE4\x93\x02o2Q/v2/{support_event_subscription.name=organizations/*/supportEventSubscriptions/*}:\x1Asupport_event_subscription\x12\xDA\x01\x0A\x1EDeleteSupportEventSubscription\x12>.google.cloud.support.v2.DeleteSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"E\xDAA\x04name\x82\xD3\xE4\x93\x028*6/v2/{name=organizations/*/supportEventSubscriptions/*}\x12\xE3\x01\x0A UndeleteSupportEventSubscription\x12@.google.cloud.support.v2.UndeleteSupportEventSubscriptionRequest\x1A1.google.cloud.support.v2.SupportEventSubscription\"J\x82\xD3\xE4\x93\x02D\"?/v2/{name=organizations/*/supportEventSubscriptions/*}:undelete:\x01*\x12\xCC\x01\x0A\x1FExpungeSupportEventSubscription\x12?.google.cloud.support.v2.ExpungeSupportEventSubscriptionRequest\x1A\x16.google.protobuf.Empty\"P\xDAA\x04name\x82\xD3\xE4\x93\x02C\">/v2/{name=organizations/*/supportEventSubscriptions/*}:expunge:\x01*\x1AO\xCAA\x1Bcloudsupport.googleapis.com\xD2A.https://www.googleapis.com/auth/cloud-platformB\xCD\x01\x0A\x1Bcom.google.cloud.support.v2B\$SupportEventSubscriptionServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xAA\x02\x17Google.Cloud.Support.V2\xCA\x02\x17Google\\Cloud\\Support\\V2\xEA\x02\x1AGoogle::Cloud::Support::V2b\x06proto3" , true); static::$is_initialized = true; diff --git a/Support/metadata/V2Beta/SupportEventSubscriptionService.php b/Support/metadata/V2Beta/SupportEventSubscriptionService.php index a679ac8e4f9f..5759072393f7 100644 --- a/Support/metadata/V2Beta/SupportEventSubscriptionService.php +++ b/Support/metadata/V2Beta/SupportEventSubscriptionService.php @@ -19,9 +19,10 @@ public static function initOnce() { \GPBMetadata\Google\Api\FieldBehavior::initOnce(); \GPBMetadata\Google\Api\Resource::initOnce(); \GPBMetadata\Google\Cloud\Support\V2Beta\SupportEventSubscription::initOnce(); + \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\xB7\x19\x0ADgoogle/cloud/support/v2beta/support_event_subscription_service.proto\x12\x1Bgoogle.cloud.support.v2beta\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1AsetName($formattedName); + + // Call the API and handle any network failures. + try { + $supportEventSubscriptionServiceClient->expungeSupportEventSubscription($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SupportEventSubscriptionServiceClient::supportEventSubscriptionName( + '[ORGANIZATION]', + '[SUPPORT_EVENT_SUBSCRIPTION]' + ); + + expunge_support_event_subscription_sample($formattedName); +} +// [END cloudsupport_v2_generated_SupportEventSubscriptionService_ExpungeSupportEventSubscription_sync] diff --git a/Support/samples/V2/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php b/Support/samples/V2/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php index 78fab41cb693..828bdacb0a68 100644 --- a/Support/samples/V2/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php +++ b/Support/samples/V2/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php @@ -30,7 +30,7 @@ use Google\Cloud\Support\V2\SupportEventSubscription; /** - * Lists support event subscriptions. + * Lists support event subscriptions for an organization. * * @param string $formattedParent The fully qualified name of the Cloud resource to list support * event subscriptions under. Format: organizations/{organization_id} diff --git a/Support/samples/V2beta/SupportEventSubscriptionServiceClient/expunge_support_event_subscription.php b/Support/samples/V2beta/SupportEventSubscriptionServiceClient/expunge_support_event_subscription.php new file mode 100644 index 000000000000..5c6233b33634 --- /dev/null +++ b/Support/samples/V2beta/SupportEventSubscriptionServiceClient/expunge_support_event_subscription.php @@ -0,0 +1,104 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + $supportEventSubscriptionServiceClient->expungeSupportEventSubscription($request); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = SupportEventSubscriptionServiceClient::supportEventSubscriptionName( + '[ORGANIZATION]', + '[SUPPORT_EVENT_SUBSCRIPTION]' + ); + + expunge_support_event_subscription_sample($formattedName); +} +// [END cloudsupport_v2beta_generated_SupportEventSubscriptionService_ExpungeSupportEventSubscription_sync] diff --git a/Support/samples/V2beta/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php b/Support/samples/V2beta/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php index e1ec9e763534..1c367aca9d11 100644 --- a/Support/samples/V2beta/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php +++ b/Support/samples/V2beta/SupportEventSubscriptionServiceClient/list_support_event_subscriptions.php @@ -30,7 +30,7 @@ use Google\Cloud\Support\V2beta\SupportEventSubscription; /** - * Lists support event subscriptions. + * Lists support event subscriptions for an organization. * * @param string $formattedParent The fully qualified name of the Cloud resource to list support * event subscriptions under. Format: organizations/{organization_id} diff --git a/Support/src/V2/Client/SupportEventSubscriptionServiceClient.php b/Support/src/V2/Client/SupportEventSubscriptionServiceClient.php index 593734414d5b..a9e2a7ac9b3c 100644 --- a/Support/src/V2/Client/SupportEventSubscriptionServiceClient.php +++ b/Support/src/V2/Client/SupportEventSubscriptionServiceClient.php @@ -36,6 +36,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Support\V2\CreateSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\DeleteSupportEventSubscriptionRequest; +use Google\Cloud\Support\V2\ExpungeSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\GetSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\ListSupportEventSubscriptionsRequest; use Google\Cloud\Support\V2\SupportEventSubscription; @@ -57,6 +58,7 @@ * * @method PromiseInterface createSupportEventSubscriptionAsync(CreateSupportEventSubscriptionRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteSupportEventSubscriptionAsync(DeleteSupportEventSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface expungeSupportEventSubscriptionAsync(ExpungeSupportEventSubscriptionRequest $request, array $optionalArgs = []) * @method PromiseInterface getSupportEventSubscriptionAsync(GetSupportEventSubscriptionRequest $request, array $optionalArgs = []) * @method PromiseInterface listSupportEventSubscriptionsAsync(ListSupportEventSubscriptionsRequest $request, array $optionalArgs = []) * @method PromiseInterface undeleteSupportEventSubscriptionAsync(UndeleteSupportEventSubscriptionRequest $request, array $optionalArgs = []) @@ -312,6 +314,64 @@ public function deleteSupportEventSubscription( return $this->startApiCall('DeleteSupportEventSubscription', $request, $callOptions)->wait(); } + /** + * Expunges a support event subscription. + * + * EXAMPLES: + * + * cURL: + * + * ```shell + * support_event_subscription="organizations/123456789/supportEventSubscriptions/abcdef123456" + * curl \ + * --request POST \ + * --header "Authorization: Bearer $(gcloud auth print-access-token)" \ + * "https://cloudsupport.googleapis.com/v2/$support_event_subscription:expunge" + * ``` + * + * Python: + * + * ```python + * import googleapiclient.discovery + * + * api_version = "v2" + * supportApiService = googleapiclient.discovery.build( + * serviceName="cloudsupport", + * version=api_version, + * discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", + * ) + * + * request = supportApiService.supportEventSubscriptions().expunge( + * name="organizations/123456789/supportEventSubscriptions/abcdef123456" + * ) + * print(request.execute()) + * ``` + * + * The async variant is + * {@see SupportEventSubscriptionServiceClient::expungeSupportEventSubscriptionAsync()} + * . + * + * @example samples/V2/SupportEventSubscriptionServiceClient/expunge_support_event_subscription.php + * + * @param ExpungeSupportEventSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + */ + public function expungeSupportEventSubscription( + ExpungeSupportEventSubscriptionRequest $request, + array $callOptions = [] + ): void { + $this->startApiCall('ExpungeSupportEventSubscription', $request, $callOptions)->wait(); + } + /** * Gets a support event subscription. * @@ -343,7 +403,7 @@ public function getSupportEventSubscription( } /** - * Lists support event subscriptions. + * Lists support event subscriptions for an organization. * * The async variant is * {@see SupportEventSubscriptionServiceClient::listSupportEventSubscriptionsAsync()} diff --git a/Support/src/V2/ExpungeSupportEventSubscriptionRequest.php b/Support/src/V2/ExpungeSupportEventSubscriptionRequest.php new file mode 100644 index 000000000000..d7899204f5f3 --- /dev/null +++ b/Support/src/V2/ExpungeSupportEventSubscriptionRequest.php @@ -0,0 +1,91 @@ +google.cloud.support.v2.ExpungeSupportEventSubscriptionRequest + */ +class ExpungeSupportEventSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * Please see {@see SupportEventSubscriptionServiceClient::supportEventSubscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\Support\V2\ExpungeSupportEventSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Support\V2\SupportEventSubscriptionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Support/src/V2/gapic_metadata.json b/Support/src/V2/gapic_metadata.json index 8ffc19ff8ec6..a1a0b226e030 100644 --- a/Support/src/V2/gapic_metadata.json +++ b/Support/src/V2/gapic_metadata.json @@ -112,6 +112,11 @@ "deleteSupportEventSubscription" ] }, + "ExpungeSupportEventSubscription": { + "methods": [ + "expungeSupportEventSubscription" + ] + }, "GetSupportEventSubscription": { "methods": [ "getSupportEventSubscription" diff --git a/Support/src/V2/resources/support_event_subscription_service_client_config.json b/Support/src/V2/resources/support_event_subscription_service_client_config.json index 14684cd59877..207f6e81330a 100644 --- a/Support/src/V2/resources/support_event_subscription_service_client_config.json +++ b/Support/src/V2/resources/support_event_subscription_service_client_config.json @@ -26,6 +26,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "ExpungeSupportEventSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetSupportEventSubscription": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/Support/src/V2/resources/support_event_subscription_service_descriptor_config.php b/Support/src/V2/resources/support_event_subscription_service_descriptor_config.php index b959ac9833dc..8524c72bce3c 100644 --- a/Support/src/V2/resources/support_event_subscription_service_descriptor_config.php +++ b/Support/src/V2/resources/support_event_subscription_service_descriptor_config.php @@ -47,6 +47,18 @@ ], ], ], + 'ExpungeSupportEventSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetSupportEventSubscription' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Support\V2\SupportEventSubscription', diff --git a/Support/src/V2/resources/support_event_subscription_service_rest_client_config.php b/Support/src/V2/resources/support_event_subscription_service_rest_client_config.php index f15b8c82e902..d47c677179a1 100644 --- a/Support/src/V2/resources/support_event_subscription_service_rest_client_config.php +++ b/Support/src/V2/resources/support_event_subscription_service_rest_client_config.php @@ -25,7 +25,7 @@ 'google.cloud.support.v2.SupportEventSubscriptionService' => [ 'CreateSupportEventSubscription' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{parent=*/*}/supportEventSubscriptions', + 'uriTemplate' => '/v2/{parent=organizations/*}/supportEventSubscriptions', 'body' => 'support_event_subscription', 'placeholders' => [ 'parent' => [ @@ -37,7 +37,19 @@ ], 'DeleteSupportEventSubscription' => [ 'method' => 'delete', - 'uriTemplate' => '/v2/{name=*/*/supportEventSubscriptions/*}', + 'uriTemplate' => '/v2/{name=organizations/*/supportEventSubscriptions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExpungeSupportEventSubscription' => [ + 'method' => 'post', + 'uriTemplate' => '/v2/{name=organizations/*/supportEventSubscriptions/*}:expunge', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -48,7 +60,7 @@ ], 'GetSupportEventSubscription' => [ 'method' => 'get', - 'uriTemplate' => '/v2/{name=*/*/supportEventSubscriptions/*}', + 'uriTemplate' => '/v2/{name=organizations/*/supportEventSubscriptions/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -59,7 +71,7 @@ ], 'ListSupportEventSubscriptions' => [ 'method' => 'get', - 'uriTemplate' => '/v2/{parent=*/*}/supportEventSubscriptions', + 'uriTemplate' => '/v2/{parent=organizations/*}/supportEventSubscriptions', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -70,7 +82,7 @@ ], 'UndeleteSupportEventSubscription' => [ 'method' => 'post', - 'uriTemplate' => '/v2/{name=*/*/supportEventSubscriptions/*}:undelete', + 'uriTemplate' => '/v2/{name=organizations/*/supportEventSubscriptions/*}:undelete', 'body' => '*', 'placeholders' => [ 'name' => [ @@ -82,7 +94,7 @@ ], 'UpdateSupportEventSubscription' => [ 'method' => 'patch', - 'uriTemplate' => '/v2/{support_event_subscription.name=*/*/supportEventSubscriptions/*}', + 'uriTemplate' => '/v2/{support_event_subscription.name=organizations/*/supportEventSubscriptions/*}', 'body' => 'support_event_subscription', 'placeholders' => [ 'support_event_subscription.name' => [ diff --git a/Support/src/V2beta/Client/SupportEventSubscriptionServiceClient.php b/Support/src/V2beta/Client/SupportEventSubscriptionServiceClient.php index d535fef5237b..b192e6e7b005 100644 --- a/Support/src/V2beta/Client/SupportEventSubscriptionServiceClient.php +++ b/Support/src/V2beta/Client/SupportEventSubscriptionServiceClient.php @@ -38,6 +38,7 @@ use Google\Auth\FetchAuthTokenInterface; use Google\Cloud\Support\V2beta\CreateSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\DeleteSupportEventSubscriptionRequest; +use Google\Cloud\Support\V2beta\ExpungeSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\GetSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\ListSupportEventSubscriptionsRequest; use Google\Cloud\Support\V2beta\SupportEventSubscription; @@ -61,6 +62,7 @@ * * @method PromiseInterface createSupportEventSubscriptionAsync(CreateSupportEventSubscriptionRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteSupportEventSubscriptionAsync(DeleteSupportEventSubscriptionRequest $request, array $optionalArgs = []) + * @method PromiseInterface expungeSupportEventSubscriptionAsync(ExpungeSupportEventSubscriptionRequest $request, array $optionalArgs = []) * @method PromiseInterface getSupportEventSubscriptionAsync(GetSupportEventSubscriptionRequest $request, array $optionalArgs = []) * @method PromiseInterface listSupportEventSubscriptionsAsync(ListSupportEventSubscriptionsRequest $request, array $optionalArgs = []) * @method PromiseInterface undeleteSupportEventSubscriptionAsync(UndeleteSupportEventSubscriptionRequest $request, array $optionalArgs = []) @@ -328,6 +330,66 @@ public function deleteSupportEventSubscription( return $this->startApiCall('DeleteSupportEventSubscription', $request, $callOptions)->wait(); } + /** + * Expunges a support event subscription. + * + * EXAMPLES: + * + * cURL: + * + * ```shell + * support_event_subscription="organizations/123456789/supportEventSubscriptions/abcdef123456" + * curl \ + * --request POST \ + * --header "Authorization: Bearer $(gcloud auth print-access-token)" \ + * "https://cloudsupport.googleapis.com/v2beta/$support_event_subscription:expunge" + * ``` + * + * Python: + * + * ```python + * import googleapiclient.discovery + * + * api_version = "v2beta" + * supportApiService = googleapiclient.discovery.build( + * serviceName="cloudsupport", + * version=api_version, + * discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", + * ) + * + * request = supportApiService.supportEventSubscriptions().expunge( + * name="organizations/123456789/supportEventSubscriptions/abcdef123456" + * ) + * print(request.execute()) + * ``` + * + * The async variant is + * {@see SupportEventSubscriptionServiceClient::expungeSupportEventSubscriptionAsync()} + * . + * + * @example samples/V2beta/SupportEventSubscriptionServiceClient/expunge_support_event_subscription.php + * + * @param ExpungeSupportEventSubscriptionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException Thrown if the API call fails. + * + * @experimental + */ + public function expungeSupportEventSubscription( + ExpungeSupportEventSubscriptionRequest $request, + array $callOptions = [] + ): void { + $this->startApiCall('ExpungeSupportEventSubscription', $request, $callOptions)->wait(); + } + /** * Gets a support event subscription. * @@ -361,7 +423,7 @@ public function getSupportEventSubscription( } /** - * Lists support event subscriptions. + * Lists support event subscriptions for an organization. * * The async variant is * {@see SupportEventSubscriptionServiceClient::listSupportEventSubscriptionsAsync()} diff --git a/Support/src/V2beta/ExpungeSupportEventSubscriptionRequest.php b/Support/src/V2beta/ExpungeSupportEventSubscriptionRequest.php new file mode 100644 index 000000000000..4ba91172a944 --- /dev/null +++ b/Support/src/V2beta/ExpungeSupportEventSubscriptionRequest.php @@ -0,0 +1,91 @@ +google.cloud.support.v2beta.ExpungeSupportEventSubscriptionRequest + */ +class ExpungeSupportEventSubscriptionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * Please see {@see SupportEventSubscriptionServiceClient::supportEventSubscriptionName()} for help formatting this field. + * + * @return \Google\Cloud\Support\V2beta\ExpungeSupportEventSubscriptionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Support\V2Beta\SupportEventSubscriptionService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the support event subscription to expunge. + * Format: + * organizations/{organization_id}/supportEventSubscriptions/{subscription_id} + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/Support/src/V2beta/gapic_metadata.json b/Support/src/V2beta/gapic_metadata.json index f91cf79c6b4d..5390be3dd93c 100644 --- a/Support/src/V2beta/gapic_metadata.json +++ b/Support/src/V2beta/gapic_metadata.json @@ -126,6 +126,11 @@ "deleteSupportEventSubscription" ] }, + "ExpungeSupportEventSubscription": { + "methods": [ + "expungeSupportEventSubscription" + ] + }, "GetSupportEventSubscription": { "methods": [ "getSupportEventSubscription" diff --git a/Support/src/V2beta/resources/support_event_subscription_service_client_config.json b/Support/src/V2beta/resources/support_event_subscription_service_client_config.json index b40a371728ef..619d72fecb7f 100644 --- a/Support/src/V2beta/resources/support_event_subscription_service_client_config.json +++ b/Support/src/V2beta/resources/support_event_subscription_service_client_config.json @@ -26,6 +26,11 @@ "retry_codes_name": "no_retry_codes", "retry_params_name": "no_retry_params" }, + "ExpungeSupportEventSubscription": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "GetSupportEventSubscription": { "timeout_millis": 60000, "retry_codes_name": "no_retry_codes", diff --git a/Support/src/V2beta/resources/support_event_subscription_service_descriptor_config.php b/Support/src/V2beta/resources/support_event_subscription_service_descriptor_config.php index 824f8c5dabe9..bd1cf86bccc1 100644 --- a/Support/src/V2beta/resources/support_event_subscription_service_descriptor_config.php +++ b/Support/src/V2beta/resources/support_event_subscription_service_descriptor_config.php @@ -47,6 +47,18 @@ ], ], ], + 'ExpungeSupportEventSubscription' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Protobuf\GPBEmpty', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetSupportEventSubscription' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Support\V2beta\SupportEventSubscription', diff --git a/Support/src/V2beta/resources/support_event_subscription_service_rest_client_config.php b/Support/src/V2beta/resources/support_event_subscription_service_rest_client_config.php index 78d090501dce..23433e486f8e 100644 --- a/Support/src/V2beta/resources/support_event_subscription_service_rest_client_config.php +++ b/Support/src/V2beta/resources/support_event_subscription_service_rest_client_config.php @@ -25,7 +25,7 @@ 'google.cloud.support.v2beta.SupportEventSubscriptionService' => [ 'CreateSupportEventSubscription' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta/{parent=*/*}/supportEventSubscriptions', + 'uriTemplate' => '/v2beta/{parent=organizations/*}/supportEventSubscriptions', 'body' => 'support_event_subscription', 'placeholders' => [ 'parent' => [ @@ -37,7 +37,19 @@ ], 'DeleteSupportEventSubscription' => [ 'method' => 'delete', - 'uriTemplate' => '/v2beta/{name=*/*/supportEventSubscriptions/*}', + 'uriTemplate' => '/v2beta/{name=organizations/*/supportEventSubscriptions/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ExpungeSupportEventSubscription' => [ + 'method' => 'post', + 'uriTemplate' => '/v2beta/{name=organizations/*/supportEventSubscriptions/*}:expunge', + 'body' => '*', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -48,7 +60,7 @@ ], 'GetSupportEventSubscription' => [ 'method' => 'get', - 'uriTemplate' => '/v2beta/{name=*/*/supportEventSubscriptions/*}', + 'uriTemplate' => '/v2beta/{name=organizations/*/supportEventSubscriptions/*}', 'placeholders' => [ 'name' => [ 'getters' => [ @@ -59,7 +71,7 @@ ], 'ListSupportEventSubscriptions' => [ 'method' => 'get', - 'uriTemplate' => '/v2beta/{parent=*/*}/supportEventSubscriptions', + 'uriTemplate' => '/v2beta/{parent=organizations/*}/supportEventSubscriptions', 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -70,7 +82,7 @@ ], 'UndeleteSupportEventSubscription' => [ 'method' => 'post', - 'uriTemplate' => '/v2beta/{name=*/*/supportEventSubscriptions/*}:undelete', + 'uriTemplate' => '/v2beta/{name=organizations/*/supportEventSubscriptions/*}:undelete', 'body' => '*', 'placeholders' => [ 'name' => [ @@ -82,7 +94,7 @@ ], 'UpdateSupportEventSubscription' => [ 'method' => 'patch', - 'uriTemplate' => '/v2beta/{support_event_subscription.name=*/*/supportEventSubscriptions/*}', + 'uriTemplate' => '/v2beta/{support_event_subscription.name=organizations/*/supportEventSubscriptions/*}', 'body' => 'support_event_subscription', 'placeholders' => [ 'support_event_subscription.name' => [ diff --git a/Support/tests/Unit/V2/Client/SupportEventSubscriptionServiceClientTest.php b/Support/tests/Unit/V2/Client/SupportEventSubscriptionServiceClientTest.php index fb6dd7a07617..3cdc771f7e4f 100644 --- a/Support/tests/Unit/V2/Client/SupportEventSubscriptionServiceClientTest.php +++ b/Support/tests/Unit/V2/Client/SupportEventSubscriptionServiceClientTest.php @@ -29,12 +29,14 @@ use Google\Cloud\Support\V2\Client\SupportEventSubscriptionServiceClient; use Google\Cloud\Support\V2\CreateSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\DeleteSupportEventSubscriptionRequest; +use Google\Cloud\Support\V2\ExpungeSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\GetSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\ListSupportEventSubscriptionsRequest; use Google\Cloud\Support\V2\ListSupportEventSubscriptionsResponse; use Google\Cloud\Support\V2\SupportEventSubscription; use Google\Cloud\Support\V2\UndeleteSupportEventSubscriptionRequest; use Google\Cloud\Support\V2\UpdateSupportEventSubscriptionRequest; +use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -220,6 +222,71 @@ public function deleteSupportEventSubscriptionExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function expungeSupportEventSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->supportEventSubscriptionName('[ORGANIZATION]', '[SUPPORT_EVENT_SUBSCRIPTION]'); + $request = (new ExpungeSupportEventSubscriptionRequest())->setName($formattedName); + $gapicClient->expungeSupportEventSubscription($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.support.v2.SupportEventSubscriptionService/ExpungeSupportEventSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function expungeSupportEventSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->supportEventSubscriptionName('[ORGANIZATION]', '[SUPPORT_EVENT_SUBSCRIPTION]'); + $request = (new ExpungeSupportEventSubscriptionRequest())->setName($formattedName); + try { + $gapicClient->expungeSupportEventSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getSupportEventSubscriptionTest() { diff --git a/Support/tests/Unit/V2beta/Client/SupportEventSubscriptionServiceClientTest.php b/Support/tests/Unit/V2beta/Client/SupportEventSubscriptionServiceClientTest.php index 88bc2a9b4503..323557d556ae 100644 --- a/Support/tests/Unit/V2beta/Client/SupportEventSubscriptionServiceClientTest.php +++ b/Support/tests/Unit/V2beta/Client/SupportEventSubscriptionServiceClientTest.php @@ -29,12 +29,14 @@ use Google\Cloud\Support\V2beta\Client\SupportEventSubscriptionServiceClient; use Google\Cloud\Support\V2beta\CreateSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\DeleteSupportEventSubscriptionRequest; +use Google\Cloud\Support\V2beta\ExpungeSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\GetSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\ListSupportEventSubscriptionsRequest; use Google\Cloud\Support\V2beta\ListSupportEventSubscriptionsResponse; use Google\Cloud\Support\V2beta\SupportEventSubscription; use Google\Cloud\Support\V2beta\UndeleteSupportEventSubscriptionRequest; use Google\Cloud\Support\V2beta\UpdateSupportEventSubscriptionRequest; +use Google\Protobuf\GPBEmpty; use Google\Rpc\Code; use stdClass; @@ -220,6 +222,71 @@ public function deleteSupportEventSubscriptionExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function expungeSupportEventSubscriptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->supportEventSubscriptionName('[ORGANIZATION]', '[SUPPORT_EVENT_SUBSCRIPTION]'); + $request = (new ExpungeSupportEventSubscriptionRequest())->setName($formattedName); + $gapicClient->expungeSupportEventSubscription($request); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame( + '/google.cloud.support.v2beta.SupportEventSubscriptionService/ExpungeSupportEventSubscription', + $actualFuncCall + ); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function expungeSupportEventSubscriptionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->supportEventSubscriptionName('[ORGANIZATION]', '[SUPPORT_EVENT_SUBSCRIPTION]'); + $request = (new ExpungeSupportEventSubscriptionRequest())->setName($formattedName); + try { + $gapicClient->expungeSupportEventSubscription($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getSupportEventSubscriptionTest() {