Skip to content

Commit 99c5546

Browse files
authored
Merge branch 'main' into docs-resolve-nested-array-types
2 parents 489b48b + 291f912 commit 99c5546

17 files changed

Lines changed: 776 additions & 19 deletions

Support/metadata/V2/AttachmentService.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Support/metadata/V2/CommentService.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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_CaseAttachmentService_GetAttachment_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Support\V2\Attachment;
28+
use Google\Cloud\Support\V2\Client\CaseAttachmentServiceClient;
29+
use Google\Cloud\Support\V2\GetAttachmentRequest;
30+
31+
/**
32+
* Retrieve an attachment associated with a support case.
33+
*
34+
* EXAMPLES:
35+
*
36+
* cURL:
37+
*
38+
* ```shell
39+
* attachment="projects/some-project/cases/23598314/attachments/0684M00000P3h1fQAB"
40+
* curl \
41+
* --header "Authorization: Bearer $(gcloud auth print-access-token)" \
42+
* "https://cloudsupport.googleapis.com/v2/$attachment"
43+
* ```
44+
*
45+
* Python:
46+
*
47+
* ```python
48+
* import googleapiclient.discovery
49+
*
50+
* api_version = "v2"
51+
* supportApiService = googleapiclient.discovery.build(
52+
* serviceName="cloudsupport",
53+
* version=api_version,
54+
* discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
55+
* )
56+
* request = (
57+
* supportApiService.cases()
58+
* .attachments()
59+
* .get(name="projects/some-project/cases/43595344/attachments/0684M00000P3h1fQAB")
60+
* )
61+
* print(request.execute())
62+
* ```
63+
*
64+
* @param string $formattedName The name of the attachment to get. Please see
65+
* {@see CaseAttachmentServiceClient::attachmentName()} for help formatting this field.
66+
*/
67+
function get_attachment_sample(string $formattedName): void
68+
{
69+
// Create a client.
70+
$caseAttachmentServiceClient = new CaseAttachmentServiceClient();
71+
72+
// Prepare the request message.
73+
$request = (new GetAttachmentRequest())
74+
->setName($formattedName);
75+
76+
// Call the API and handle any network failures.
77+
try {
78+
/** @var Attachment $response */
79+
$response = $caseAttachmentServiceClient->getAttachment($request);
80+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
81+
} catch (ApiException $ex) {
82+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
83+
}
84+
}
85+
86+
/**
87+
* Helper to execute the sample.
88+
*
89+
* This sample has been automatically generated and should be regarded as a code
90+
* template only. It will require modifications to work:
91+
* - It may require correct/in-range values for request initialization.
92+
* - It may require specifying regional endpoints when creating the service client,
93+
* please see the apiEndpoint client configuration option for more details.
94+
*/
95+
function callSample(): void
96+
{
97+
$formattedName = CaseAttachmentServiceClient::attachmentName(
98+
'[ORGANIZATION]',
99+
'[CASE]',
100+
'[ATTACHMENT_ID]'
101+
);
102+
103+
get_attachment_sample($formattedName);
104+
}
105+
// [END cloudsupport_v2_generated_CaseAttachmentService_GetAttachment_sync]
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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_CommentService_GetComment_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Support\V2\Client\CommentServiceClient;
28+
use Google\Cloud\Support\V2\Comment;
29+
use Google\Cloud\Support\V2\GetCommentRequest;
30+
31+
/**
32+
* Retrieve a comment.
33+
*
34+
* EXAMPLES:
35+
*
36+
* cURL:
37+
*
38+
* ```shell
39+
* comment="projects/some-project/cases/43595344/comments/234567890"
40+
* curl \
41+
* --header "Authorization: Bearer $(gcloud auth print-access-token)" \
42+
* "https://cloudsupport.googleapis.com/v2/$comment"
43+
* ```
44+
*
45+
* Python:
46+
*
47+
* ```python
48+
* import googleapiclient.discovery
49+
*
50+
* api_version = "v2"
51+
* supportApiService = googleapiclient.discovery.build(
52+
* serviceName="cloudsupport",
53+
* version=api_version,
54+
* discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
55+
* )
56+
*
57+
* request = supportApiService.cases().comments().get(
58+
* name="projects/some-project/cases/43595344/comments/234567890",
59+
* )
60+
* print(request.execute())
61+
* ```
62+
*
63+
* @param string $formattedName The name of the comment to retrieve. Please see
64+
* {@see CommentServiceClient::commentName()} for help formatting this field.
65+
*/
66+
function get_comment_sample(string $formattedName): void
67+
{
68+
// Create a client.
69+
$commentServiceClient = new CommentServiceClient();
70+
71+
// Prepare the request message.
72+
$request = (new GetCommentRequest())
73+
->setName($formattedName);
74+
75+
// Call the API and handle any network failures.
76+
try {
77+
/** @var Comment $response */
78+
$response = $commentServiceClient->getComment($request);
79+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
80+
} catch (ApiException $ex) {
81+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
82+
}
83+
}
84+
85+
/**
86+
* Helper to execute the sample.
87+
*
88+
* This sample has been automatically generated and should be regarded as a code
89+
* template only. It will require modifications to work:
90+
* - It may require correct/in-range values for request initialization.
91+
* - It may require specifying regional endpoints when creating the service client,
92+
* please see the apiEndpoint client configuration option for more details.
93+
*/
94+
function callSample(): void
95+
{
96+
$formattedName = CommentServiceClient::commentName('[ORGANIZATION]', '[CASE]', '[COMMENT]');
97+
98+
get_comment_sample($formattedName);
99+
}
100+
// [END cloudsupport_v2_generated_CommentService_GetComment_sync]

0 commit comments

Comments
 (0)