Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NetworkSecurity/metadata/V1/AuthzPolicy.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion NetworkSecurity/metadata/V1/FirewallActivation.php

Large diffs are not rendered by default.

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions NetworkSecurity/metadata/V1/SseRealm.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
* Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

* **Global locations**: If `name` is empty, the method lists the
the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
**Global locations**: If `name` is empty, the method lists the
public locations available to all projects. * **Project-specific
locations**: If `name` follows the format
`projects/{project}`, the method lists locations visible to that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
* Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided in
the [ListLocationsRequest.name] field:

* **Global locations**: If `name` is empty, the method lists the
the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
**Global locations**: If `name` is empty, the method lists the
public locations available to all projects. * **Project-specific
locations**: If `name` follows the format
`projects/{project}`, the method lists locations visible to that
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
/*
* Copyright 2026 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 networksecurity_v1_generated_FirewallActivation_CreateProjectFirewallEndpoint_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetworkSecurity\V1\Client\FirewallActivationClient;
use Google\Cloud\NetworkSecurity\V1\CreateFirewallEndpointRequest;
use Google\Cloud\NetworkSecurity\V1\FirewallEndpoint;
use Google\Rpc\Status;

/**
* Creates a new FirewallEndpoint in a given project and location.
*
* @param string $formattedParent Value for parent. Please see
* {@see FirewallActivationClient::organizationLocationName()} for help formatting this field.
* @param string $firewallEndpointId Id of the requesting object.
* If auto-generating Id server-side, remove this field and
* firewall_endpoint_id from the method_signature of Create RPC.
*/
function create_project_firewall_endpoint_sample(
string $formattedParent,
string $firewallEndpointId
): void {
// Create a client.
$firewallActivationClient = new FirewallActivationClient();

// Prepare the request message.
$firewallEndpoint = new FirewallEndpoint();
$request = (new CreateFirewallEndpointRequest())
->setParent($formattedParent)
->setFirewallEndpointId($firewallEndpointId)
->setFirewallEndpoint($firewallEndpoint);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $firewallActivationClient->createProjectFirewallEndpoint($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
/** @var FirewallEndpoint $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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
{
$formattedParent = FirewallActivationClient::organizationLocationName(
'[ORGANIZATION]',
'[LOCATION]'
);
$firewallEndpointId = '[FIREWALL_ENDPOINT_ID]';

create_project_firewall_endpoint_sample($formattedParent, $firewallEndpointId);
}
// [END networksecurity_v1_generated_FirewallActivation_CreateProjectFirewallEndpoint_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/*
* Copyright 2026 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 networksecurity_v1_generated_FirewallActivation_DeleteProjectFirewallEndpoint_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\NetworkSecurity\V1\Client\FirewallActivationClient;
use Google\Cloud\NetworkSecurity\V1\DeleteFirewallEndpointRequest;
use Google\Rpc\Status;

/**
* Deletes a single project Endpoint.
*
* @param string $formattedName Name of the resource
* Please see {@see FirewallActivationClient::firewallEndpointName()} for help formatting this field.
*/
function delete_project_firewall_endpoint_sample(string $formattedName): void
{
// Create a client.
$firewallActivationClient = new FirewallActivationClient();

// Prepare the request message.
$request = (new DeleteFirewallEndpointRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $firewallActivationClient->deleteProjectFirewallEndpoint($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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 = FirewallActivationClient::firewallEndpointName(
'[ORGANIZATION]',
'[LOCATION]',
'[FIREWALL_ENDPOINT]'
);

delete_project_firewall_endpoint_sample($formattedName);
}
// [END networksecurity_v1_generated_FirewallActivation_DeleteProjectFirewallEndpoint_sync]
Loading
Loading