Skip to content

Commit

Permalink
feat: A new method CreateCustomer is added to service `CloudControl…
Browse files Browse the repository at this point in the history
…sPartnerCore` (#8036)

feat: A new method `UpdateCustomer` is added to service `CloudControlsPartnerCore`
feat: A new method `DeleteCustomer` is added to service `CloudControlsPartnerCore`
feat: A new field `organization_domain` is added to message `.google.cloud.cloudcontrolspartner.v1beta.Customer`
feat: A new message `CreateCustomerRequest` is added
feat: A new message `UpdateCustomerRequest` is added
feat: A new message `DeleteCustomerRequest` is added
docs: A comment for field `requested_cancellation` in message `.google.cloud.cloudcontrolspartner.v1beta.OperationMetadata` is changed
docs: A comment for enum value `VIRTRU` in enum `EkmSolution` is changed
PiperOrigin-RevId: 719291894
Source-Link: googleapis/googleapis@4d82148
Source-Link: googleapis/googleapis-gen@41b559f
Copy-Tag: eyJwIjoiQ29udHJvbHNQYXJ0bmVyLy5Pd2xCb3QueWFtbCIsImgiOiI0MWI1NTlmZDhlODc5OWZlY2I5N2QyZjAwNTYwYTQwOGU5NzdjMzMyIn0=
  • Loading branch information
gcf-owl-bot[bot] authored Jan 24, 2025
1 parent f2b7249 commit 89c812c
Show file tree
Hide file tree
Showing 18 changed files with 1,156 additions and 19 deletions.
12 changes: 8 additions & 4 deletions ControlsPartner/metadata/V1Beta/Core.php

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

Binary file modified ControlsPartner/metadata/V1Beta/Customers.php
Binary file not shown.
Binary file modified ControlsPartner/metadata/V1Beta/Partners.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php
/*
* Copyright 2025 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 cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_CreateCustomer_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\CloudControlsPartner\V1beta\Client\CloudControlsPartnerCoreClient;
use Google\Cloud\CloudControlsPartner\V1beta\CreateCustomerRequest;
use Google\Cloud\CloudControlsPartner\V1beta\Customer;

/**
* Creates a new customer.
*
* @param string $formattedParent Parent resource
* Format: `organizations/{organization}/locations/{location}`
* Please see {@see CloudControlsPartnerCoreClient::organizationLocationName()} for help formatting this field.
* @param string $customerDisplayName Display name for the customer
* @param string $customerId The customer id to use for the customer, which will become the
* final component of the customer's resource name. The specified value must
* be a valid Google cloud organization id.
*/
function create_customer_sample(
string $formattedParent,
string $customerDisplayName,
string $customerId
): void {
// Create a client.
$cloudControlsPartnerCoreClient = new CloudControlsPartnerCoreClient();

// Prepare the request message.
$customer = (new Customer())
->setDisplayName($customerDisplayName);
$request = (new CreateCustomerRequest())
->setParent($formattedParent)
->setCustomer($customer)
->setCustomerId($customerId);

// Call the API and handle any network failures.
try {
/** @var Customer $response */
$response = $cloudControlsPartnerCoreClient->createCustomer($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
{
$formattedParent = CloudControlsPartnerCoreClient::organizationLocationName(
'[ORGANIZATION]',
'[LOCATION]'
);
$customerDisplayName = '[DISPLAY_NAME]';
$customerId = '[CUSTOMER_ID]';

create_customer_sample($formattedParent, $customerDisplayName, $customerId);
}
// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_CreateCustomer_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/*
* Copyright 2025 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 cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_DeleteCustomer_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\CloudControlsPartner\V1beta\Client\CloudControlsPartnerCoreClient;
use Google\Cloud\CloudControlsPartner\V1beta\DeleteCustomerRequest;

/**
* Delete details of a single customer
*
* @param string $formattedName name of the resource to be deleted
* format: name=organizations/&#42;/locations/&#42;/customers/*
* Please see {@see CloudControlsPartnerCoreClient::customerName()} for help formatting this field.
*/
function delete_customer_sample(string $formattedName): void
{
// Create a client.
$cloudControlsPartnerCoreClient = new CloudControlsPartnerCoreClient();

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

// Call the API and handle any network failures.
try {
$cloudControlsPartnerCoreClient->deleteCustomer($request);
printf('Call completed successfully.' . PHP_EOL);
} 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 = CloudControlsPartnerCoreClient::customerName(
'[ORGANIZATION]',
'[LOCATION]',
'[CUSTOMER]'
);

delete_customer_sample($formattedName);
}
// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_DeleteCustomer_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
/*
* Copyright 2025 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 cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_UpdateCustomer_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\CloudControlsPartner\V1beta\Client\CloudControlsPartnerCoreClient;
use Google\Cloud\CloudControlsPartner\V1beta\Customer;
use Google\Cloud\CloudControlsPartner\V1beta\UpdateCustomerRequest;

/**
* Update details of a single customer
*
* @param string $customerDisplayName Display name for the customer
*/
function update_customer_sample(string $customerDisplayName): void
{
// Create a client.
$cloudControlsPartnerCoreClient = new CloudControlsPartnerCoreClient();

// Prepare the request message.
$customer = (new Customer())
->setDisplayName($customerDisplayName);
$request = (new UpdateCustomerRequest())
->setCustomer($customer);

// Call the API and handle any network failures.
try {
/** @var Customer $response */
$response = $cloudControlsPartnerCoreClient->updateCustomer($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
{
$customerDisplayName = '[DISPLAY_NAME]';

update_customer_sample($customerDisplayName);
}
// [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_UpdateCustomer_sync]
Loading

0 comments on commit 89c812c

Please sign in to comment.