-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding support for new Security Center Management Apis (#7331)
docs: update comment formatting throughout API PiperOrigin-RevId: 636222407 Source-Link: googleapis/googleapis@060fd8d Source-Link: googleapis/googleapis-gen@939618f Copy-Tag: eyJwIjoiU2VjdXJpdHlDZW50ZXJNYW5hZ2VtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI5Mzk2MThmZmE0NmFhMDNjYzEyZDRmNjI1YmQzODQzMjIxZTY3NmJhIn0=
- Loading branch information
1 parent
70dd5f3
commit 7e98d79
Showing
50 changed files
with
2,338 additions
and
401 deletions.
There are no files selected for viewing
Binary file modified
BIN
+3.26 KB
(110%)
SecurityCenterManagement/metadata/V1/SecurityCenterManagement.php
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...enterManagement/samples/V1/SecurityCenterManagementClient/get_security_center_service.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\SecurityCenterManagement\V1\Client\SecurityCenterManagementClient; | ||
use Google\Cloud\SecurityCenterManagement\V1\GetSecurityCenterServiceRequest; | ||
use Google\Cloud\SecurityCenterManagement\V1\SecurityCenterService; | ||
|
||
/** | ||
* Gets service settings for the specified Security Command Center service. | ||
* | ||
* @param string $formattedName The Security Command Center service to retrieve. | ||
* | ||
* Formats: | ||
* | ||
* * organizations/{organization}/locations/{location}/securityCenterServices/{service} | ||
* * folders/{folder}/locations/{location}/securityCenterServices/{service} | ||
* * projects/{project}/locations/{location}/securityCenterServices/{service} | ||
* | ||
* The possible values for id {service} are: | ||
* | ||
* * container-threat-detection | ||
* * event-threat-detection | ||
* * security-health-analytics | ||
* * vm-threat-detection | ||
* * web-security-scanner | ||
* Please see {@see SecurityCenterManagementClient::securityCenterServiceName()} for help formatting this field. | ||
*/ | ||
function get_security_center_service_sample(string $formattedName): void | ||
{ | ||
// Create a client. | ||
$securityCenterManagementClient = new SecurityCenterManagementClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new GetSecurityCenterServiceRequest()) | ||
->setName($formattedName); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var SecurityCenterService $response */ | ||
$response = $securityCenterManagementClient->getSecurityCenterService($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 = SecurityCenterManagementClient::securityCenterServiceName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[SERVICE]' | ||
); | ||
|
||
get_security_center_service_sample($formattedName); | ||
} | ||
// [END securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityCenterService_sync] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.