Skip to content

Commit 8d03c90

Browse files
committed
Merge branch 'main' into fix-add-sample-to-readme
2 parents 73694dd + 95d8954 commit 8d03c90

48 files changed

Lines changed: 4725 additions & 56 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.repo-metadata-full.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,94 +1381,94 @@
13811381
"ShoppingMerchantAccounts": {
13821382
"language": "php",
13831383
"distribution_name": "google/shopping-merchant-accounts",
1384-
"release_level": "preview",
1384+
"release_level": "stable",
13851385
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-accounts/latest",
13861386
"library_type": "GAPIC_AUTO",
13871387
"api_shortname": "merchantapi"
13881388
},
13891389
"ShoppingMerchantConversions": {
13901390
"language": "php",
13911391
"distribution_name": "google/shopping-merchant-conversions",
1392-
"release_level": "preview",
1392+
"release_level": "stable",
13931393
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-conversions/latest",
13941394
"library_type": "GAPIC_AUTO",
13951395
"api_shortname": "merchantapi"
13961396
},
13971397
"ShoppingMerchantDataSources": {
13981398
"language": "php",
13991399
"distribution_name": "google/shopping-merchant-datasources",
1400-
"release_level": "preview",
1400+
"release_level": "stable",
14011401
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest",
14021402
"library_type": "GAPIC_AUTO",
14031403
"api_shortname": "merchantapi"
14041404
},
14051405
"ShoppingMerchantInventories": {
14061406
"distribution_name": "google/shopping-merchant-inventories",
1407-
"release_level": "preview",
1407+
"release_level": "stable",
14081408
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-inventories/latest",
14091409
"library_type": "GAPIC_AUTO",
14101410
"api_shortname": "merchantapi"
14111411
},
14121412
"ShoppingMerchantIssueResolution": {
14131413
"language": "php",
14141414
"distribution_name": "google/shopping-merchant-issueresolution",
1415-
"release_level": "preview",
1415+
"release_level": "stable",
14161416
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-issueresolution/latest",
14171417
"library_type": "GAPIC_AUTO",
14181418
"api_shortname": "merchantapi"
14191419
},
14201420
"ShoppingMerchantLfp": {
14211421
"language": "php",
14221422
"distribution_name": "google/shopping-merchant-lfp",
1423-
"release_level": "preview",
1423+
"release_level": "stable",
14241424
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-lfp/latest",
14251425
"library_type": "GAPIC_AUTO",
14261426
"api_shortname": "merchantapi"
14271427
},
14281428
"ShoppingMerchantNotifications": {
14291429
"language": "php",
14301430
"distribution_name": "google/shopping-merchant-notifications",
1431-
"release_level": "preview",
1431+
"release_level": "stable",
14321432
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-notifications/latest",
14331433
"library_type": "GAPIC_AUTO",
14341434
"api_shortname": "merchantapi"
14351435
},
14361436
"ShoppingMerchantOrderTracking": {
14371437
"language": "php",
14381438
"distribution_name": "google/shopping-merchant-ordertracking",
1439-
"release_level": "preview",
1439+
"release_level": "stable",
14401440
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-ordertracking/latest",
14411441
"library_type": "GAPIC_AUTO",
14421442
"api_shortname": "merchantapi"
14431443
},
14441444
"ShoppingMerchantProducts": {
14451445
"language": "php",
14461446
"distribution_name": "google/shopping-merchant-products",
1447-
"release_level": "preview",
1447+
"release_level": "stable",
14481448
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-products/latest",
14491449
"library_type": "GAPIC_AUTO",
14501450
"api_shortname": "merchantapi"
14511451
},
14521452
"ShoppingMerchantPromotions": {
14531453
"language": "php",
14541454
"distribution_name": "google/shopping-merchant-promotions",
1455-
"release_level": "preview",
1455+
"release_level": "stable",
14561456
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-promotions/latest",
14571457
"library_type": "GAPIC_AUTO",
14581458
"api_shortname": "merchantapi"
14591459
},
14601460
"ShoppingMerchantQuota": {
14611461
"language": "php",
14621462
"distribution_name": "google/shopping-merchant-quota",
1463-
"release_level": "preview",
1463+
"release_level": "stable",
14641464
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-quota/latest",
14651465
"library_type": "GAPIC_AUTO",
14661466
"api_shortname": "merchantapi"
14671467
},
14681468
"ShoppingMerchantReports": {
14691469
"language": "php",
14701470
"distribution_name": "google/shopping-merchant-reports",
1471-
"release_level": "preview",
1471+
"release_level": "stable",
14721472
"client_documentation": "https://cloud.google.com/php/docs/reference/shopping-merchant-reports/latest",
14731473
"library_type": "GAPIC_AUTO",
14741474
"api_shortname": "merchantapi"

AiPlatform/README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,20 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
3232

3333
```php
3434
use Google\ApiCore\ApiException;
35-
use Google\Cloud\AIPlatform\V1\AnnotationSpec;
36-
use Google\Cloud\AIPlatform\V1\Client\DatasetServiceClient;
37-
use Google\Cloud\AIPlatform\V1\GetAnnotationSpecRequest;
35+
use Google\Cloud\AIPlatform\V1\Client\DataFoundryServiceClient;
36+
use Google\Cloud\Location\GetLocationRequest;
37+
use Google\Cloud\Location\Location;
3838

3939
// Create a client.
40-
$datasetServiceClient = new DatasetServiceClient();
40+
$dataFoundryServiceClient = new DataFoundryServiceClient();
4141

4242
// Prepare the request message.
43-
$request = (new GetAnnotationSpecRequest())
44-
->setName($formattedName);
43+
$request = new GetLocationRequest();
4544

4645
// Call the API and handle any network failures.
4746
try {
48-
/** @var AnnotationSpec $response */
49-
$response = $datasetServiceClient->getAnnotationSpec($request);
47+
/** @var Location $response */
48+
$response = $dataFoundryServiceClient->getLocation($request);
5049
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
5150
} catch (ApiException $ex) {
5251
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
2.5 KB
Binary file not shown.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 aiplatform_v1_generated_DataFoundryService_GenerateSyntheticData_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\AIPlatform\V1\Client\DataFoundryServiceClient;
28+
use Google\Cloud\AIPlatform\V1\GenerateSyntheticDataRequest;
29+
use Google\Cloud\AIPlatform\V1\GenerateSyntheticDataResponse;
30+
use Google\Cloud\AIPlatform\V1\OutputFieldSpec;
31+
32+
/**
33+
* Generates synthetic data based on the provided configuration.
34+
*
35+
* @param string $formattedLocation The resource name of the Location to run the job.
36+
* Format: `projects/{project}/locations/{location}`
37+
* Please see {@see DataFoundryServiceClient::locationName()} for help formatting this field.
38+
* @param int $count The number of synthetic examples to generate.
39+
* For this stateless API, the count is limited to a small number.
40+
* @param string $outputFieldSpecsFieldName The name of the output field.
41+
*/
42+
function generate_synthetic_data_sample(
43+
string $formattedLocation,
44+
int $count,
45+
string $outputFieldSpecsFieldName
46+
): void {
47+
// Create a client.
48+
$dataFoundryServiceClient = new DataFoundryServiceClient();
49+
50+
// Prepare the request message.
51+
$outputFieldSpec = (new OutputFieldSpec())
52+
->setFieldName($outputFieldSpecsFieldName);
53+
$outputFieldSpecs = [$outputFieldSpec,];
54+
$request = (new GenerateSyntheticDataRequest())
55+
->setLocation($formattedLocation)
56+
->setCount($count)
57+
->setOutputFieldSpecs($outputFieldSpecs);
58+
59+
// Call the API and handle any network failures.
60+
try {
61+
/** @var GenerateSyntheticDataResponse $response */
62+
$response = $dataFoundryServiceClient->generateSyntheticData($request);
63+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
64+
} catch (ApiException $ex) {
65+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
66+
}
67+
}
68+
69+
/**
70+
* Helper to execute the sample.
71+
*
72+
* This sample has been automatically generated and should be regarded as a code
73+
* template only. It will require modifications to work:
74+
* - It may require correct/in-range values for request initialization.
75+
* - It may require specifying regional endpoints when creating the service client,
76+
* please see the apiEndpoint client configuration option for more details.
77+
*/
78+
function callSample(): void
79+
{
80+
$formattedLocation = DataFoundryServiceClient::locationName('[PROJECT]', '[LOCATION]');
81+
$count = 0;
82+
$outputFieldSpecsFieldName = '[FIELD_NAME]';
83+
84+
generate_synthetic_data_sample($formattedLocation, $count, $outputFieldSpecsFieldName);
85+
}
86+
// [END aiplatform_v1_generated_DataFoundryService_GenerateSyntheticData_sync]
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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 aiplatform_v1_generated_DataFoundryService_GetIamPolicy_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\AIPlatform\V1\Client\DataFoundryServiceClient;
28+
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
29+
use Google\Cloud\Iam\V1\Policy;
30+
31+
/**
32+
* Gets the access control policy for a resource. Returns an empty policy
33+
if the resource exists and does not have a policy set.
34+
*
35+
* @param string $resource REQUIRED: The resource for which the policy is being requested.
36+
* See the operation documentation for the appropriate value for this field.
37+
*/
38+
function get_iam_policy_sample(string $resource): void
39+
{
40+
// Create a client.
41+
$dataFoundryServiceClient = new DataFoundryServiceClient();
42+
43+
// Prepare the request message.
44+
$request = (new GetIamPolicyRequest())
45+
->setResource($resource);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var Policy $response */
50+
$response = $dataFoundryServiceClient->getIamPolicy($request);
51+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
52+
} catch (ApiException $ex) {
53+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
54+
}
55+
}
56+
57+
/**
58+
* Helper to execute the sample.
59+
*
60+
* This sample has been automatically generated and should be regarded as a code
61+
* template only. It will require modifications to work:
62+
* - It may require correct/in-range values for request initialization.
63+
* - It may require specifying regional endpoints when creating the service client,
64+
* please see the apiEndpoint client configuration option for more details.
65+
*/
66+
function callSample(): void
67+
{
68+
$resource = '[RESOURCE]';
69+
70+
get_iam_policy_sample($resource);
71+
}
72+
// [END aiplatform_v1_generated_DataFoundryService_GetIamPolicy_sync]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 aiplatform_v1_generated_DataFoundryService_GetLocation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\AIPlatform\V1\Client\DataFoundryServiceClient;
28+
use Google\Cloud\Location\GetLocationRequest;
29+
use Google\Cloud\Location\Location;
30+
31+
/**
32+
* Gets information about a location.
33+
*
34+
* This sample has been automatically generated and should be regarded as a code
35+
* template only. It will require modifications to work:
36+
* - It may require correct/in-range values for request initialization.
37+
* - It may require specifying regional endpoints when creating the service client,
38+
* please see the apiEndpoint client configuration option for more details.
39+
*/
40+
function get_location_sample(): void
41+
{
42+
// Create a client.
43+
$dataFoundryServiceClient = new DataFoundryServiceClient();
44+
45+
// Prepare the request message.
46+
$request = new GetLocationRequest();
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var Location $response */
51+
$response = $dataFoundryServiceClient->getLocation($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
// [END aiplatform_v1_generated_DataFoundryService_GetLocation_sync]

0 commit comments

Comments
 (0)