Skip to content

Commit 8925a0d

Browse files
feat: [StorageControl] add support for GCS Storage Control Intelligence Finding APIs (#9217)
* feat: add support for GCS Storage Control Intelligence Finding APIs Stages public GAPIC client libraries in Java, Go, Python, Node.js, and Ruby for the GCS Storage Control Intelligence Finding service. This includes the addition of the following RPC methods for retrieving and summarizing telemetry findings (such as security, performance, or cost-related insights) at the project, organization, or folder level: - `GetIntelligenceFinding` - `ListIntelligenceFindings` - `SummarizeIntelligenceFindings` - `GetIntelligenceFindingRevision` - `ListIntelligenceFindingRevisions` PiperOrigin-RevId: 922200845 Source-Link: googleapis/googleapis@6d5b853 Source-Link: googleapis/googleapis-gen@94bb285 Copy-Tag: eyJwIjoiU3RvcmFnZUNvbnRyb2wvLk93bEJvdC55YW1sIiwiaCI6Ijk0YmIyODVlOTk5ZDAyYTg5NDY5NTRmMzU1OWUyMGQ4ZmViYWFkNGMifQ== * 🦉 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>
1 parent f4098d9 commit 8925a0d

43 files changed

Lines changed: 6023 additions & 1 deletion

File tree

Some content is hidden

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

StorageControl/metadata/V2/StorageControl.php

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 storage_v2_generated_StorageControl_GetIntelligenceFinding_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
28+
use Google\Cloud\Storage\Control\V2\GetIntelligenceFindingRequest;
29+
use Google\Cloud\Storage\Control\V2\IntelligenceFinding;
30+
31+
/**
32+
* Gets the `IntelligenceFinding` for a project.
33+
*
34+
* @param string $formattedName The name of the `IntelligenceFinding` resource.
35+
*
36+
* Format:
37+
* `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
38+
* Please see {@see StorageControlClient::intelligenceFindingName()} for help formatting this field.
39+
*/
40+
function get_intelligence_finding_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$storageControlClient = new StorageControlClient();
44+
45+
// Prepare the request message.
46+
$request = (new GetIntelligenceFindingRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var IntelligenceFinding $response */
52+
$response = $storageControlClient->getIntelligenceFinding($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedName = StorageControlClient::intelligenceFindingName(
71+
'[PROJECT]',
72+
'[LOCATION]',
73+
'[INTELLIGENCE_FINDING]'
74+
);
75+
76+
get_intelligence_finding_sample($formattedName);
77+
}
78+
// [END storage_v2_generated_StorageControl_GetIntelligenceFinding_sync]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 storage_v2_generated_StorageControl_GetIntelligenceFindingRevision_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
28+
use Google\Cloud\Storage\Control\V2\GetIntelligenceFindingRevisionRequest;
29+
use Google\Cloud\Storage\Control\V2\IntelligenceFindingRevision;
30+
31+
/**
32+
* Gets the `IntelligenceFindingRevision` resource.
33+
*
34+
* @param string $formattedName The name of the `IntelligenceFindingRevision` resource.
35+
* ## Format:
36+
*
37+
* `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
38+
* Please see {@see StorageControlClient::intelligenceFindingRevisionName()} for help formatting this field.
39+
*/
40+
function get_intelligence_finding_revision_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$storageControlClient = new StorageControlClient();
44+
45+
// Prepare the request message.
46+
$request = (new GetIntelligenceFindingRevisionRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var IntelligenceFindingRevision $response */
52+
$response = $storageControlClient->getIntelligenceFindingRevision($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedName = StorageControlClient::intelligenceFindingRevisionName(
71+
'[PROJECT]',
72+
'[LOCATION]',
73+
'[INTELLIGENCE_FINDING]',
74+
'[REVISION]'
75+
);
76+
77+
get_intelligence_finding_revision_sample($formattedName);
78+
}
79+
// [END storage_v2_generated_StorageControl_GetIntelligenceFindingRevision_sync]
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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 storage_v2_generated_StorageControl_ListIntelligenceFindingRevisions_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
29+
use Google\Cloud\Storage\Control\V2\IntelligenceFindingRevision;
30+
use Google\Cloud\Storage\Control\V2\ListIntelligenceFindingRevisionsRequest;
31+
32+
/**
33+
* Lists all the revisions of an `IntelligenceFinding` resource.
34+
*
35+
* @param string $formattedParent The parent of the `IntelligenceFindingRevision` resource.
36+
* ## Format:
37+
*
38+
* `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
39+
* Please see {@see StorageControlClient::intelligenceFindingName()} for help formatting this field.
40+
*/
41+
function list_intelligence_finding_revisions_sample(string $formattedParent): void
42+
{
43+
// Create a client.
44+
$storageControlClient = new StorageControlClient();
45+
46+
// Prepare the request message.
47+
$request = (new ListIntelligenceFindingRevisionsRequest())
48+
->setParent($formattedParent);
49+
50+
// Call the API and handle any network failures.
51+
try {
52+
/** @var PagedListResponse $response */
53+
$response = $storageControlClient->listIntelligenceFindingRevisions($request);
54+
55+
/** @var IntelligenceFindingRevision $element */
56+
foreach ($response as $element) {
57+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
58+
}
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 = StorageControlClient::intelligenceFindingName(
76+
'[PROJECT]',
77+
'[LOCATION]',
78+
'[INTELLIGENCE_FINDING]'
79+
);
80+
81+
list_intelligence_finding_revisions_sample($formattedParent);
82+
}
83+
// [END storage_v2_generated_StorageControl_ListIntelligenceFindingRevisions_sync]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 storage_v2_generated_StorageControl_ListIntelligenceFindings_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
29+
use Google\Cloud\Storage\Control\V2\IntelligenceFinding;
30+
use Google\Cloud\Storage\Control\V2\ListIntelligenceFindingsRequest;
31+
32+
/**
33+
* Lists the `IntelligenceFinding` resources for the specified project.
34+
*
35+
* @param string $formattedParent The parent of the `IntelligenceFinding` resource.
36+
*
37+
* Format: `projects/{project}/locations/{location}`
38+
* Please see {@see StorageControlClient::locationName()} for help formatting this field.
39+
*/
40+
function list_intelligence_findings_sample(string $formattedParent): void
41+
{
42+
// Create a client.
43+
$storageControlClient = new StorageControlClient();
44+
45+
// Prepare the request message.
46+
$request = (new ListIntelligenceFindingsRequest())
47+
->setParent($formattedParent);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var PagedListResponse $response */
52+
$response = $storageControlClient->listIntelligenceFindings($request);
53+
54+
/** @var IntelligenceFinding $element */
55+
foreach ($response as $element) {
56+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
57+
}
58+
} catch (ApiException $ex) {
59+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
60+
}
61+
}
62+
63+
/**
64+
* Helper to execute the sample.
65+
*
66+
* This sample has been automatically generated and should be regarded as a code
67+
* template only. It will require modifications to work:
68+
* - It may require correct/in-range values for request initialization.
69+
* - It may require specifying regional endpoints when creating the service client,
70+
* please see the apiEndpoint client configuration option for more details.
71+
*/
72+
function callSample(): void
73+
{
74+
$formattedParent = StorageControlClient::locationName('[PROJECT]', '[LOCATION]');
75+
76+
list_intelligence_findings_sample($formattedParent);
77+
}
78+
// [END storage_v2_generated_StorageControl_ListIntelligenceFindings_sync]

0 commit comments

Comments
 (0)