Skip to content

Commit 7e24854

Browse files
feat: [DeveloperConnect] add DCI insights config proto (#8400)
* feat: add DCI insights config proto feat: a new message `google.cloud.developerconnect.v1.AccountConnector` is added feat: a new message `google.cloud.developerconnect.v1.User` is added feat: a new enum `google.cloud.developerconnect.v1.SystemProvider` is added feat: a new message `google.cloud.developerconnect.v1.GitProxyConfig` is added feat: a new field `bitbucket_data_center_config` is added to message `google.cloud.developerconnect.v1.Connection` feat: a new field `bitbucket_cloud_config` is added to message `google.cloud.developerconnect.v1.Connection` feat: a new field `provider_oauth_config` is added to message `google.cloud.developerconnect.v1.AccountConnector` feat: a new field `oauth_start_uri` is added to message `google.cloud.developerconnect.v1.AccountConnector` docs: A comment for field `uid` in message `.google.cloud.developerconnect.v1.Connection` is changed docs: A comment for field `uid` in message `.google.cloud.developerconnect.v1.GitRepositoryLink` is changed PiperOrigin-RevId: 774881785 Source-Link: googleapis/googleapis@3a48320 Source-Link: googleapis/googleapis-gen@cfd7440 Copy-Tag: eyJwIjoiRGV2ZWxvcGVyQ29ubmVjdC8uT3dsQm90LnlhbWwiLCJoIjoiY2ZkNzQ0MGU2NmVkNDk5NGI2ZTc2MDM4MGMxYTVjOTk5MThjZmQxOSJ9 * 🦉 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 6addf47 commit 7e24854

68 files changed

Lines changed: 11422 additions & 102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
6.96 KB
Binary file not shown.
6.09 KB
Binary file not shown.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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 developerconnect_v1_generated_DeveloperConnect_CreateAccountConnector_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\DeveloperConnect\V1\AccountConnector;
29+
use Google\Cloud\DeveloperConnect\V1\Client\DeveloperConnectClient;
30+
use Google\Cloud\DeveloperConnect\V1\CreateAccountConnectorRequest;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Creates a new AccountConnector in a given project and location.
35+
*
36+
* @param string $formattedParent Location resource name as the account_connector’s parent. Please see
37+
* {@see DeveloperConnectClient::locationName()} for help formatting this field.
38+
* @param string $accountConnectorId The ID to use for the AccountConnector, which will become the
39+
* final component of the AccountConnector's resource name. Its format should
40+
* adhere to https://google.aip.dev/122#resource-id-segments Names must be
41+
* unique per-project per-location.
42+
*/
43+
function create_account_connector_sample(
44+
string $formattedParent,
45+
string $accountConnectorId
46+
): void {
47+
// Create a client.
48+
$developerConnectClient = new DeveloperConnectClient();
49+
50+
// Prepare the request message.
51+
$accountConnector = new AccountConnector();
52+
$request = (new CreateAccountConnectorRequest())
53+
->setParent($formattedParent)
54+
->setAccountConnectorId($accountConnectorId)
55+
->setAccountConnector($accountConnector);
56+
57+
// Call the API and handle any network failures.
58+
try {
59+
/** @var OperationResponse $response */
60+
$response = $developerConnectClient->createAccountConnector($request);
61+
$response->pollUntilComplete();
62+
63+
if ($response->operationSucceeded()) {
64+
/** @var AccountConnector $result */
65+
$result = $response->getResult();
66+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
67+
} else {
68+
/** @var Status $error */
69+
$error = $response->getError();
70+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
71+
}
72+
} catch (ApiException $ex) {
73+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
74+
}
75+
}
76+
77+
/**
78+
* Helper to execute the sample.
79+
*
80+
* This sample has been automatically generated and should be regarded as a code
81+
* template only. It will require modifications to work:
82+
* - It may require correct/in-range values for request initialization.
83+
* - It may require specifying regional endpoints when creating the service client,
84+
* please see the apiEndpoint client configuration option for more details.
85+
*/
86+
function callSample(): void
87+
{
88+
$formattedParent = DeveloperConnectClient::locationName('[PROJECT]', '[LOCATION]');
89+
$accountConnectorId = '[ACCOUNT_CONNECTOR_ID]';
90+
91+
create_account_connector_sample($formattedParent, $accountConnectorId);
92+
}
93+
// [END developerconnect_v1_generated_DeveloperConnect_CreateAccountConnector_sync]
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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 developerconnect_v1_generated_DeveloperConnect_DeleteAccountConnector_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\DeveloperConnect\V1\Client\DeveloperConnectClient;
29+
use Google\Cloud\DeveloperConnect\V1\DeleteAccountConnectorRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes a single AccountConnector.
34+
*
35+
* @param string $formattedName Name of the resource
36+
* Please see {@see DeveloperConnectClient::accountConnectorName()} for help formatting this field.
37+
*/
38+
function delete_account_connector_sample(string $formattedName): void
39+
{
40+
// Create a client.
41+
$developerConnectClient = new DeveloperConnectClient();
42+
43+
// Prepare the request message.
44+
$request = (new DeleteAccountConnectorRequest())
45+
->setName($formattedName);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var OperationResponse $response */
50+
$response = $developerConnectClient->deleteAccountConnector($request);
51+
$response->pollUntilComplete();
52+
53+
if ($response->operationSucceeded()) {
54+
printf('Operation completed successfully.' . PHP_EOL);
55+
} else {
56+
/** @var Status $error */
57+
$error = $response->getError();
58+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
59+
}
60+
} catch (ApiException $ex) {
61+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
62+
}
63+
}
64+
65+
/**
66+
* Helper to execute the sample.
67+
*
68+
* This sample has been automatically generated and should be regarded as a code
69+
* template only. It will require modifications to work:
70+
* - It may require correct/in-range values for request initialization.
71+
* - It may require specifying regional endpoints when creating the service client,
72+
* please see the apiEndpoint client configuration option for more details.
73+
*/
74+
function callSample(): void
75+
{
76+
$formattedName = DeveloperConnectClient::accountConnectorName(
77+
'[PROJECT]',
78+
'[LOCATION]',
79+
'[ACCOUNT_CONNECTOR]'
80+
);
81+
82+
delete_account_connector_sample($formattedName);
83+
}
84+
// [END developerconnect_v1_generated_DeveloperConnect_DeleteAccountConnector_sync]
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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 developerconnect_v1_generated_DeveloperConnect_DeleteSelf_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\DeveloperConnect\V1\Client\DeveloperConnectClient;
29+
use Google\Cloud\DeveloperConnect\V1\DeleteSelfRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Delete the User based on the user credentials.
34+
*
35+
* @param string $formattedName Name of the AccountConnector resource
36+
* Please see {@see DeveloperConnectClient::accountConnectorName()} for help formatting this field.
37+
*/
38+
function delete_self_sample(string $formattedName): void
39+
{
40+
// Create a client.
41+
$developerConnectClient = new DeveloperConnectClient();
42+
43+
// Prepare the request message.
44+
$request = (new DeleteSelfRequest())
45+
->setName($formattedName);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var OperationResponse $response */
50+
$response = $developerConnectClient->deleteSelf($request);
51+
$response->pollUntilComplete();
52+
53+
if ($response->operationSucceeded()) {
54+
printf('Operation completed successfully.' . PHP_EOL);
55+
} else {
56+
/** @var Status $error */
57+
$error = $response->getError();
58+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
59+
}
60+
} catch (ApiException $ex) {
61+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
62+
}
63+
}
64+
65+
/**
66+
* Helper to execute the sample.
67+
*
68+
* This sample has been automatically generated and should be regarded as a code
69+
* template only. It will require modifications to work:
70+
* - It may require correct/in-range values for request initialization.
71+
* - It may require specifying regional endpoints when creating the service client,
72+
* please see the apiEndpoint client configuration option for more details.
73+
*/
74+
function callSample(): void
75+
{
76+
$formattedName = DeveloperConnectClient::accountConnectorName(
77+
'[PROJECT]',
78+
'[LOCATION]',
79+
'[ACCOUNT_CONNECTOR]'
80+
);
81+
82+
delete_self_sample($formattedName);
83+
}
84+
// [END developerconnect_v1_generated_DeveloperConnect_DeleteSelf_sync]
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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 developerconnect_v1_generated_DeveloperConnect_DeleteUser_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\DeveloperConnect\V1\Client\DeveloperConnectClient;
29+
use Google\Cloud\DeveloperConnect\V1\DeleteUserRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes a single User.
34+
*
35+
* @param string $formattedName Name of the resource
36+
* Please see {@see DeveloperConnectClient::userName()} for help formatting this field.
37+
*/
38+
function delete_user_sample(string $formattedName): void
39+
{
40+
// Create a client.
41+
$developerConnectClient = new DeveloperConnectClient();
42+
43+
// Prepare the request message.
44+
$request = (new DeleteUserRequest())
45+
->setName($formattedName);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var OperationResponse $response */
50+
$response = $developerConnectClient->deleteUser($request);
51+
$response->pollUntilComplete();
52+
53+
if ($response->operationSucceeded()) {
54+
printf('Operation completed successfully.' . PHP_EOL);
55+
} else {
56+
/** @var Status $error */
57+
$error = $response->getError();
58+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
59+
}
60+
} catch (ApiException $ex) {
61+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
62+
}
63+
}
64+
65+
/**
66+
* Helper to execute the sample.
67+
*
68+
* This sample has been automatically generated and should be regarded as a code
69+
* template only. It will require modifications to work:
70+
* - It may require correct/in-range values for request initialization.
71+
* - It may require specifying regional endpoints when creating the service client,
72+
* please see the apiEndpoint client configuration option for more details.
73+
*/
74+
function callSample(): void
75+
{
76+
$formattedName = DeveloperConnectClient::userName(
77+
'[PROJECT]',
78+
'[LOCATION]',
79+
'[ACCOUNT_CONNECTOR]',
80+
'[USER]'
81+
);
82+
83+
delete_user_sample($formattedName);
84+
}
85+
// [END developerconnect_v1_generated_DeveloperConnect_DeleteUser_sync]

0 commit comments

Comments
 (0)