Skip to content

Commit 3ca27ee

Browse files
feat: [Support] A new service SupportEventSubscription is added (#9305)
* feat: A new service `SupportEventSubscription` is added docs: A comment for field `query` in message `.google.cloud.support.v2.SearchCasesRequest` is changed PiperOrigin-RevId: 940079932 Source-Link: googleapis/googleapis@2bb679d Source-Link: googleapis/googleapis-gen@520a96a Copy-Tag: eyJwIjoiU3VwcG9ydC8uT3dsQm90LnlhbWwiLCJoIjoiNTIwYTk2YWQ3YjA2MGI0NmM1ODcyOWYwYWE2Nzk5Y2I1NjIwODU3YyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: A new service `SupportEventSubscription` is added docs: A comment for field `query` in message `.google.cloud.support.v2.SearchCasesRequest` is changed PiperOrigin-RevId: 940080026 Source-Link: googleapis/googleapis@03756fd Source-Link: googleapis/googleapis-gen@5721e15 Copy-Tag: eyJwIjoiU3VwcG9ydC8uT3dsQm90LnlhbWwiLCJoIjoiNTcyMWUxNTJkNzljZjIxNjY3YTBjNGEyMDE0MTk0ZGIyMWQ3NjYxYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Brent Shaffer <betterbrent@google.com>
1 parent 090b0ae commit 3ca27ee

50 files changed

Lines changed: 6574 additions & 32 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Support/metadata/V2/SupportEventSubscription.php

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Support/metadata/V2/SupportEventSubscriptionService.php

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Support/metadata/V2Beta/SupportEventSubscription.php

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Support/metadata/V2Beta/SupportEventSubscriptionService.php

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START cloudsupport_v2_generated_SupportEventSubscriptionService_CreateSupportEventSubscription_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Support\V2\Client\SupportEventSubscriptionServiceClient;
28+
use Google\Cloud\Support\V2\CreateSupportEventSubscriptionRequest;
29+
use Google\Cloud\Support\V2\SupportEventSubscription;
30+
31+
/**
32+
* Creates a support event subscription for an organization.
33+
*
34+
* @param string $formattedParent The parent resource name where the support event subscription
35+
* will be created. Format: organizations/{organization_id}
36+
* Please see {@see SupportEventSubscriptionServiceClient::organizationName()} for help formatting this field.
37+
* @param string $supportEventSubscriptionPubSubTopic The name of the Pub/Sub topic to publish notifications to.
38+
* Format: projects/{project}/topics/{topic}
39+
*/
40+
function create_support_event_subscription_sample(
41+
string $formattedParent,
42+
string $supportEventSubscriptionPubSubTopic
43+
): void {
44+
// Create a client.
45+
$supportEventSubscriptionServiceClient = new SupportEventSubscriptionServiceClient();
46+
47+
// Prepare the request message.
48+
$supportEventSubscription = (new SupportEventSubscription())
49+
->setPubSubTopic($supportEventSubscriptionPubSubTopic);
50+
$request = (new CreateSupportEventSubscriptionRequest())
51+
->setParent($formattedParent)
52+
->setSupportEventSubscription($supportEventSubscription);
53+
54+
// Call the API and handle any network failures.
55+
try {
56+
/** @var SupportEventSubscription $response */
57+
$response = $supportEventSubscriptionServiceClient->createSupportEventSubscription($request);
58+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
59+
} catch (ApiException $ex) {
60+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
61+
}
62+
}
63+
64+
/**
65+
* Helper to execute the sample.
66+
*
67+
* This sample has been automatically generated and should be regarded as a code
68+
* template only. It will require modifications to work:
69+
* - It may require correct/in-range values for request initialization.
70+
* - It may require specifying regional endpoints when creating the service client,
71+
* please see the apiEndpoint client configuration option for more details.
72+
*/
73+
function callSample(): void
74+
{
75+
$formattedParent = SupportEventSubscriptionServiceClient::organizationName('[ORGANIZATION]');
76+
$supportEventSubscriptionPubSubTopic = '[PUB_SUB_TOPIC]';
77+
78+
create_support_event_subscription_sample($formattedParent, $supportEventSubscriptionPubSubTopic);
79+
}
80+
// [END cloudsupport_v2_generated_SupportEventSubscriptionService_CreateSupportEventSubscription_sync]

0 commit comments

Comments
 (0)