Skip to content
Merged
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
Binary file modified GeminiDataAnalytics/metadata/V1Beta/DataAgentService.php
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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 geminidataanalytics_v1beta_generated_DataAgentService_CreateDataAgentSync_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\GeminiDataAnalytics\V1beta\Client\DataAgentServiceClient;
use Google\Cloud\GeminiDataAnalytics\V1beta\CreateDataAgentRequest;
use Google\Cloud\GeminiDataAnalytics\V1beta\DataAgent;

/**
* Creates a new DataAgent in a given project and location synchronously.
*
* @param string $formattedParent Value for parent. Please see
* {@see DataAgentServiceClient::locationName()} for help formatting this field.
*/
function create_data_agent_sync_sample(string $formattedParent): void
{
// Create a client.
$dataAgentServiceClient = new DataAgentServiceClient();

// Prepare the request message.
$dataAgent = new DataAgent();
$request = (new CreateDataAgentRequest())
->setParent($formattedParent)
->setDataAgent($dataAgent);

// Call the API and handle any network failures.
try {
/** @var DataAgent $response */
$response = $dataAgentServiceClient->createDataAgentSync($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 = DataAgentServiceClient::locationName('[PROJECT]', '[LOCATION]');

create_data_agent_sync_sample($formattedParent);
}
// [END geminidataanalytics_v1beta_generated_DataAgentService_CreateDataAgentSync_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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 geminidataanalytics_v1beta_generated_DataAgentService_DeleteDataAgentSync_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\GeminiDataAnalytics\V1beta\Client\DataAgentServiceClient;
use Google\Cloud\GeminiDataAnalytics\V1beta\DeleteDataAgentRequest;

/**
* Deletes a single DataAgent synchronously.
*
* @param string $formattedName Name of the resource. Please see
* {@see DataAgentServiceClient::dataAgentName()} for help formatting this field.
*/
function delete_data_agent_sync_sample(string $formattedName): void
{
// Create a client.
$dataAgentServiceClient = new DataAgentServiceClient();

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

// Call the API and handle any network failures.
try {
$dataAgentServiceClient->deleteDataAgentSync($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 = DataAgentServiceClient::dataAgentName('[PROJECT]', '[LOCATION]', '[DATA_AGENT]');

delete_data_agent_sync_sample($formattedName);
}
// [END geminidataanalytics_v1beta_generated_DataAgentService_DeleteDataAgentSync_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?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 geminidataanalytics_v1beta_generated_DataAgentService_UpdateDataAgentSync_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\GeminiDataAnalytics\V1beta\Client\DataAgentServiceClient;
use Google\Cloud\GeminiDataAnalytics\V1beta\DataAgent;
use Google\Cloud\GeminiDataAnalytics\V1beta\UpdateDataAgentRequest;

/**
* Updates the parameters of a single DataAgent synchronously.
*
* 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 update_data_agent_sync_sample(): void
{
// Create a client.
$dataAgentServiceClient = new DataAgentServiceClient();

// Prepare the request message.
$dataAgent = new DataAgent();
$request = (new UpdateDataAgentRequest())
->setDataAgent($dataAgent);

// Call the API and handle any network failures.
try {
/** @var DataAgent $response */
$response = $dataAgentServiceClient->updateDataAgentSync($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
// [END geminidataanalytics_v1beta_generated_DataAgentService_UpdateDataAgentSync_sync]
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@
* @experimental
*
* @method PromiseInterface<OperationResponse> createDataAgentAsync(CreateDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<DataAgent> createDataAgentSyncAsync(CreateDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<OperationResponse> deleteDataAgentAsync(DeleteDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<void> deleteDataAgentSyncAsync(DeleteDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<DataAgent> getDataAgentAsync(GetDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<Policy> getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listAccessibleDataAgentsAsync(ListAccessibleDataAgentsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listDataAgentsAsync(ListDataAgentsRequest $request, array $optionalArgs = [])
* @method PromiseInterface<Policy> setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface<OperationResponse> updateDataAgentAsync(UpdateDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<DataAgent> updateDataAgentSyncAsync(UpdateDataAgentRequest $request, array $optionalArgs = [])
* @method PromiseInterface<Location> getLocationAsync(GetLocationRequest $request, array $optionalArgs = [])
* @method PromiseInterface<PagedListResponse> listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = [])
*/
Expand Down Expand Up @@ -362,6 +365,34 @@ public function createDataAgent(CreateDataAgentRequest $request, array $callOpti
return $this->startApiCall('CreateDataAgent', $request, $callOptions)->wait();
}

/**
* Creates a new DataAgent in a given project and location synchronously.
*
* The async variant is {@see DataAgentServiceClient::createDataAgentSyncAsync()} .
*
* @example samples/V1beta/DataAgentServiceClient/create_data_agent_sync.php
*
* @param CreateDataAgentRequest $request A request to house fields associated with the call.
* @param array $callOptions {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return DataAgent
*
* @throws ApiException Thrown if the API call fails.
*
* @experimental
*/
public function createDataAgentSync(CreateDataAgentRequest $request, array $callOptions = []): DataAgent
{
return $this->startApiCall('CreateDataAgentSync', $request, $callOptions)->wait();
}

/**
* Deletes a single DataAgent.
*
Expand Down Expand Up @@ -390,6 +421,32 @@ public function deleteDataAgent(DeleteDataAgentRequest $request, array $callOpti
return $this->startApiCall('DeleteDataAgent', $request, $callOptions)->wait();
}

/**
* Deletes a single DataAgent synchronously.
*
* The async variant is {@see DataAgentServiceClient::deleteDataAgentSyncAsync()} .
*
* @example samples/V1beta/DataAgentServiceClient/delete_data_agent_sync.php
*
* @param DeleteDataAgentRequest $request A request to house fields associated with the call.
* @param array $callOptions {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @throws ApiException Thrown if the API call fails.
*
* @experimental
*/
public function deleteDataAgentSync(DeleteDataAgentRequest $request, array $callOptions = []): void
{
$this->startApiCall('DeleteDataAgentSync', $request, $callOptions)->wait();
}

/**
* Gets details of a single DataAgent.
*
Expand Down Expand Up @@ -562,6 +619,34 @@ public function updateDataAgent(UpdateDataAgentRequest $request, array $callOpti
return $this->startApiCall('UpdateDataAgent', $request, $callOptions)->wait();
}

/**
* Updates the parameters of a single DataAgent synchronously.
*
* The async variant is {@see DataAgentServiceClient::updateDataAgentSyncAsync()} .
*
* @example samples/V1beta/DataAgentServiceClient/update_data_agent_sync.php
*
* @param UpdateDataAgentRequest $request A request to house fields associated with the call.
* @param array $callOptions {
* Optional.
*
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return DataAgent
*
* @throws ApiException Thrown if the API call fails.
*
* @experimental
*/
public function updateDataAgentSync(UpdateDataAgentRequest $request, array $callOptions = []): DataAgent
{
return $this->startApiCall('UpdateDataAgentSync', $request, $callOptions)->wait();
}

/**
* Gets information about a location.
*
Expand Down
15 changes: 15 additions & 0 deletions GeminiDataAnalytics/src/V1beta/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@
"createDataAgent"
]
},
"CreateDataAgentSync": {
"methods": [
"createDataAgentSync"
]
},
"DeleteDataAgent": {
"methods": [
"deleteDataAgent"
]
},
"DeleteDataAgentSync": {
"methods": [
"deleteDataAgentSync"
]
},
"GetDataAgent": {
"methods": [
"getDataAgent"
Expand Down Expand Up @@ -50,6 +60,11 @@
"updateDataAgent"
]
},
"UpdateDataAgentSync": {
"methods": [
"updateDataAgentSync"
]
},
"GetLocation": {
"methods": [
"getLocation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
"CreateDataAgentSync": {
"timeout_millis": 600000,
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
"DeleteDataAgent": {
"timeout_millis": 600000,
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
"DeleteDataAgentSync": {
"timeout_millis": 600000,
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
"GetDataAgent": {
"timeout_millis": 600000,
"retry_codes_name": "retry_policy_1_codes",
Expand Down Expand Up @@ -68,6 +78,11 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
"UpdateDataAgentSync": {
"timeout_millis": 600000,
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
"GetLocation": {
"timeout_millis": 600000,
"retry_codes_name": "retry_policy_1_codes",
Expand Down
Loading
Loading