Skip to content

Commit d14df04

Browse files
authored
fix!: [VisionAi] remove deprecated clients and files (#9019)
fix!: remove deprecated clients and files
1 parent 780dd97 commit d14df04

294 files changed

Lines changed: 13228 additions & 14410 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.

VisionAi/samples/V1/AppPlatformClient/add_application_stream_input.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
// [START visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\VisionAI\V1\AddApplicationStreamInputRequest;
2829
use Google\Cloud\VisionAI\V1\AddApplicationStreamInputResponse;
29-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
30+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
3031
use Google\Rpc\Status;
3132

3233
/**
@@ -45,10 +46,14 @@ function add_application_stream_input_sample(string $formattedName): void
4546
// Create a client.
4647
$appPlatformClient = new AppPlatformClient();
4748

49+
// Prepare the request message.
50+
$request = (new AddApplicationStreamInputRequest())
51+
->setName($formattedName);
52+
4853
// Call the API and handle any network failures.
4954
try {
5055
/** @var OperationResponse $response */
51-
$response = $appPlatformClient->addApplicationStreamInput($formattedName);
56+
$response = $appPlatformClient->addApplicationStreamInput($request);
5257
$response->pollUntilComplete();
5358

5459
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/create_application.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
// [START visionai_v1_generated_AppPlatform_CreateApplication_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
2928
use Google\Cloud\VisionAI\V1\Application;
29+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
30+
use Google\Cloud\VisionAI\V1\CreateApplicationRequest;
3031
use Google\Rpc\Status;
3132

3233
/**
@@ -45,14 +46,18 @@ function create_application_sample(
4546
// Create a client.
4647
$appPlatformClient = new AppPlatformClient();
4748

48-
// Prepare any non-scalar elements to be passed along with the request.
49+
// Prepare the request message.
4950
$application = (new Application())
5051
->setDisplayName($applicationDisplayName);
52+
$request = (new CreateApplicationRequest())
53+
->setParent($formattedParent)
54+
->setApplicationId($applicationId)
55+
->setApplication($application);
5156

5257
// Call the API and handle any network failures.
5358
try {
5459
/** @var OperationResponse $response */
55-
$response = $appPlatformClient->createApplication($formattedParent, $applicationId, $application);
60+
$response = $appPlatformClient->createApplication($request);
5661
$response->pollUntilComplete();
5762

5863
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/create_application_instances.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
// [START visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
2928
use Google\Cloud\VisionAI\V1\ApplicationInstance;
29+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
30+
use Google\Cloud\VisionAI\V1\CreateApplicationInstancesRequest;
3031
use Google\Cloud\VisionAI\V1\CreateApplicationInstancesResponse;
3132
use Google\Cloud\VisionAI\V1\Instance;
3233
use Google\Rpc\Status;
@@ -52,18 +53,21 @@ function create_application_instances_sample(
5253
// Create a client.
5354
$appPlatformClient = new AppPlatformClient();
5455

55-
// Prepare any non-scalar elements to be passed along with the request.
56+
// Prepare the request message.
5657
$applicationInstancesInstance = (new Instance())
5758
->setDisplayName($applicationInstancesInstanceDisplayName);
5859
$applicationInstance = (new ApplicationInstance())
5960
->setInstanceId($applicationInstancesInstanceId)
6061
->setInstance($applicationInstancesInstance);
6162
$applicationInstances = [$applicationInstance,];
63+
$request = (new CreateApplicationInstancesRequest())
64+
->setName($formattedName)
65+
->setApplicationInstances($applicationInstances);
6266

6367
// Call the API and handle any network failures.
6468
try {
6569
/** @var OperationResponse $response */
66-
$response = $appPlatformClient->createApplicationInstances($formattedName, $applicationInstances);
70+
$response = $appPlatformClient->createApplicationInstances($request);
6771
$response->pollUntilComplete();
6872

6973
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/create_draft.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_CreateDraft_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\CreateDraftRequest;
2930
use Google\Cloud\VisionAI\V1\Draft;
3031
use Google\Rpc\Status;
3132

@@ -45,14 +46,18 @@ function create_draft_sample(
4546
// Create a client.
4647
$appPlatformClient = new AppPlatformClient();
4748

48-
// Prepare any non-scalar elements to be passed along with the request.
49+
// Prepare the request message.
4950
$draft = (new Draft())
5051
->setDisplayName($draftDisplayName);
52+
$request = (new CreateDraftRequest())
53+
->setParent($formattedParent)
54+
->setDraftId($draftId)
55+
->setDraft($draft);
5156

5257
// Call the API and handle any network failures.
5358
try {
5459
/** @var OperationResponse $response */
55-
$response = $appPlatformClient->createDraft($formattedParent, $draftId, $draft);
60+
$response = $appPlatformClient->createDraft($request);
5661
$response->pollUntilComplete();
5762

5863
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/create_processor.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_CreateProcessor_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\CreateProcessorRequest;
2930
use Google\Cloud\VisionAI\V1\Processor;
3031
use Google\Rpc\Status;
3132

@@ -45,14 +46,18 @@ function create_processor_sample(
4546
// Create a client.
4647
$appPlatformClient = new AppPlatformClient();
4748

48-
// Prepare any non-scalar elements to be passed along with the request.
49+
// Prepare the request message.
4950
$processor = (new Processor())
5051
->setDisplayName($processorDisplayName);
52+
$request = (new CreateProcessorRequest())
53+
->setParent($formattedParent)
54+
->setProcessorId($processorId)
55+
->setProcessor($processor);
5156

5257
// Call the API and handle any network failures.
5358
try {
5459
/** @var OperationResponse $response */
55-
$response = $appPlatformClient->createProcessor($formattedParent, $processorId, $processor);
60+
$response = $appPlatformClient->createProcessor($request);
5661
$response->pollUntilComplete();
5762

5863
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/delete_application.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_DeleteApplication_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\DeleteApplicationRequest;
2930
use Google\Rpc\Status;
3031

3132
/**
@@ -39,10 +40,14 @@ function delete_application_sample(string $formattedName): void
3940
// Create a client.
4041
$appPlatformClient = new AppPlatformClient();
4142

43+
// Prepare the request message.
44+
$request = (new DeleteApplicationRequest())
45+
->setName($formattedName);
46+
4247
// Call the API and handle any network failures.
4348
try {
4449
/** @var OperationResponse $response */
45-
$response = $appPlatformClient->deleteApplication($formattedName);
50+
$response = $appPlatformClient->deleteApplication($request);
4651
$response->pollUntilComplete();
4752

4853
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/delete_application_instances.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\DeleteApplicationInstancesRequest;
2930
use Google\Cloud\VisionAI\V1\Instance;
3031
use Google\Rpc\Status;
3132

@@ -48,13 +49,16 @@ function delete_application_instances_sample(
4849
// Create a client.
4950
$appPlatformClient = new AppPlatformClient();
5051

51-
// Prepare any non-scalar elements to be passed along with the request.
52+
// Prepare the request message.
5253
$formattedInstanceIds = [$formattedInstanceIdsElement,];
54+
$request = (new DeleteApplicationInstancesRequest())
55+
->setName($formattedName)
56+
->setInstanceIds($formattedInstanceIds);
5357

5458
// Call the API and handle any network failures.
5559
try {
5660
/** @var OperationResponse $response */
57-
$response = $appPlatformClient->deleteApplicationInstances($formattedName, $formattedInstanceIds);
61+
$response = $appPlatformClient->deleteApplicationInstances($request);
5862
$response->pollUntilComplete();
5963

6064
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/delete_draft.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_DeleteDraft_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\DeleteDraftRequest;
2930
use Google\Rpc\Status;
3031

3132
/**
@@ -39,10 +40,14 @@ function delete_draft_sample(string $formattedName): void
3940
// Create a client.
4041
$appPlatformClient = new AppPlatformClient();
4142

43+
// Prepare the request message.
44+
$request = (new DeleteDraftRequest())
45+
->setName($formattedName);
46+
4247
// Call the API and handle any network failures.
4348
try {
4449
/** @var OperationResponse $response */
45-
$response = $appPlatformClient->deleteDraft($formattedName);
50+
$response = $appPlatformClient->deleteDraft($request);
4651
$response->pollUntilComplete();
4752

4853
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/delete_processor.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_DeleteProcessor_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\DeleteProcessorRequest;
2930
use Google\Rpc\Status;
3031

3132
/**
@@ -39,10 +40,14 @@ function delete_processor_sample(string $formattedName): void
3940
// Create a client.
4041
$appPlatformClient = new AppPlatformClient();
4142

43+
// Prepare the request message.
44+
$request = (new DeleteProcessorRequest())
45+
->setName($formattedName);
46+
4247
// Call the API and handle any network failures.
4348
try {
4449
/** @var OperationResponse $response */
45-
$response = $appPlatformClient->deleteProcessor($formattedName);
50+
$response = $appPlatformClient->deleteProcessor($request);
4651
$response->pollUntilComplete();
4752

4853
if ($response->operationSucceeded()) {

VisionAi/samples/V1/AppPlatformClient/deploy_application.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
// [START visionai_v1_generated_AppPlatform_DeployApplication_sync]
2626
use Google\ApiCore\ApiException;
2727
use Google\ApiCore\OperationResponse;
28-
use Google\Cloud\VisionAI\V1\AppPlatformClient;
28+
use Google\Cloud\VisionAI\V1\Client\AppPlatformClient;
29+
use Google\Cloud\VisionAI\V1\DeployApplicationRequest;
2930
use Google\Cloud\VisionAI\V1\DeployApplicationResponse;
3031
use Google\Rpc\Status;
3132

@@ -42,10 +43,14 @@ function deploy_application_sample(string $formattedName): void
4243
// Create a client.
4344
$appPlatformClient = new AppPlatformClient();
4445

46+
// Prepare the request message.
47+
$request = (new DeployApplicationRequest())
48+
->setName($formattedName);
49+
4550
// Call the API and handle any network failures.
4651
try {
4752
/** @var OperationResponse $response */
48-
$response = $appPlatformClient->deployApplication($formattedName);
53+
$response = $appPlatformClient->deployApplication($request);
4954
$response->pollUntilComplete();
5055

5156
if ($response->operationSucceeded()) {

0 commit comments

Comments
 (0)