Skip to content

Commit 1010b2f

Browse files
feat: [AiPlatform] add additional proto fields and GenerateFetchAccessToken API (#8655)
* feat: Add JAILBREAK category to SafetySettings for prediction service PiperOrigin-RevId: 817714487 Source-Link: googleapis/googleapis@d034736 Source-Link: googleapis/googleapis-gen@7271b40 Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiNzI3MWI0MDIwMzU4ZmI3MzhlYTBmYzJlYWFmMDkzMzVkYWY3ZGUwMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Add JAILBREAK as a new Prompt block reason in PredictionService PiperOrigin-RevId: 817715315 Source-Link: googleapis/googleapis@8d338e2 Source-Link: googleapis/googleapis-gen@40da391 Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiNDBkYTM5MTAyMWY4MGJkMDQ3ZWE1MjhjOWFiZTFiMjQ0ZDljYzQ0OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add additional proto fields and GenerateFetchAccessToken API PiperOrigin-RevId: 817715744 Source-Link: googleapis/googleapis@eadc874 Source-Link: googleapis/googleapis-gen@e2f9cec Copy-Tag: eyJwIjoiQWlQbGF0Zm9ybS8uT3dsQm90LnlhbWwiLCJoIjoiZTJmOWNlY2I1NDk4MGFmZmZhYzVjOWVlMGIwYTNmMWNkOWZhZmIwZCJ9 * 🦉 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 42f8e11 commit 1010b2f

20 files changed

Lines changed: 715 additions & 0 deletions

AiPlatform/metadata/V1/Content.php

29 Bytes
Binary file not shown.
236 Bytes
Binary file not shown.
477 Bytes
Binary file not shown.
141 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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_FeatureOnlineStoreService_GenerateFetchAccessToken_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\AIPlatform\V1\Client\FeatureOnlineStoreServiceClient;
28+
use Google\Cloud\AIPlatform\V1\GenerateFetchAccessTokenRequest;
29+
use Google\Cloud\AIPlatform\V1\GenerateFetchAccessTokenResponse;
30+
31+
/**
32+
* RPC to generate an access token for the given feature view. FeatureViews
33+
* under the same FeatureOnlineStore share the same access token.
34+
*
35+
* This sample has been automatically generated and should be regarded as a code
36+
* template only. It will require modifications to work:
37+
* - It may require correct/in-range values for request initialization.
38+
* - It may require specifying regional endpoints when creating the service client,
39+
* please see the apiEndpoint client configuration option for more details.
40+
*/
41+
function generate_fetch_access_token_sample(): void
42+
{
43+
// Create a client.
44+
$featureOnlineStoreServiceClient = new FeatureOnlineStoreServiceClient();
45+
46+
// Prepare the request message.
47+
$request = new GenerateFetchAccessTokenRequest();
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var GenerateFetchAccessTokenResponse $response */
52+
$response = $featureOnlineStoreServiceClient->generateFetchAccessToken($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
// [END aiplatform_v1_generated_FeatureOnlineStoreService_GenerateFetchAccessToken_sync]

AiPlatform/src/V1/Client/FeatureOnlineStoreServiceClient.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
use Google\Auth\FetchAuthTokenInterface;
3838
use Google\Cloud\AIPlatform\V1\FetchFeatureValuesRequest;
3939
use Google\Cloud\AIPlatform\V1\FetchFeatureValuesResponse;
40+
use Google\Cloud\AIPlatform\V1\GenerateFetchAccessTokenRequest;
41+
use Google\Cloud\AIPlatform\V1\GenerateFetchAccessTokenResponse;
4042
use Google\Cloud\AIPlatform\V1\SearchNearestEntitiesRequest;
4143
use Google\Cloud\AIPlatform\V1\SearchNearestEntitiesResponse;
4244
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
@@ -62,6 +64,7 @@
6264
* contained within formatted names that are returned by the API.
6365
*
6466
* @method PromiseInterface<FetchFeatureValuesResponse> fetchFeatureValuesAsync(FetchFeatureValuesRequest $request, array $optionalArgs = [])
67+
* @method PromiseInterface<GenerateFetchAccessTokenResponse> generateFetchAccessTokenAsync(GenerateFetchAccessTokenRequest $request, array $optionalArgs = [])
6568
* @method PromiseInterface<SearchNearestEntitiesResponse> searchNearestEntitiesAsync(SearchNearestEntitiesRequest $request, array $optionalArgs = [])
6669
* @method PromiseInterface<Location> getLocationAsync(GetLocationRequest $request, array $optionalArgs = [])
6770
* @method PromiseInterface<PagedListResponse> listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = [])
@@ -302,6 +305,36 @@ public function fetchFeatureValues(
302305
return $this->startApiCall('FetchFeatureValues', $request, $callOptions)->wait();
303306
}
304307

308+
/**
309+
* RPC to generate an access token for the given feature view. FeatureViews
310+
* under the same FeatureOnlineStore share the same access token.
311+
*
312+
* The async variant is
313+
* {@see FeatureOnlineStoreServiceClient::generateFetchAccessTokenAsync()} .
314+
*
315+
* @example samples/V1/FeatureOnlineStoreServiceClient/generate_fetch_access_token.php
316+
*
317+
* @param GenerateFetchAccessTokenRequest $request A request to house fields associated with the call.
318+
* @param array $callOptions {
319+
* Optional.
320+
*
321+
* @type RetrySettings|array $retrySettings
322+
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
323+
* associative array of retry settings parameters. See the documentation on
324+
* {@see RetrySettings} for example usage.
325+
* }
326+
*
327+
* @return GenerateFetchAccessTokenResponse
328+
*
329+
* @throws ApiException Thrown if the API call fails.
330+
*/
331+
public function generateFetchAccessToken(
332+
GenerateFetchAccessTokenRequest $request,
333+
array $callOptions = []
334+
): GenerateFetchAccessTokenResponse {
335+
return $this->startApiCall('GenerateFetchAccessToken', $request, $callOptions)->wait();
336+
}
337+
305338
/**
306339
* Search the nearest entities under a FeatureView.
307340
* Search only works for indexable feature view; if a feature view isn't

AiPlatform/src/V1/FeatureOnlineStore/Bigtable.php

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AiPlatform/src/V1/FeatureOnlineStore/Bigtable/BigtableMetadata.php

Lines changed: 137 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)