Skip to content

Commit 00c9703

Browse files
feat: Automated regeneration of AIPlatform client (googleapis#12910)
Auto-created at 2025-02-01 13:12:39 +0000 using the toys pull request generator.
1 parent 3b27c21 commit 00c9703

File tree

34 files changed

+1044
-7
lines changed

34 files changed

+1044
-7
lines changed

clients/ai_platform/lib/google_api/ai_platform/v1/api/endpoints.ex

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,70 @@ defmodule GoogleApi.AIPlatform.V1.Api.Endpoints do
225225
)
226226
end
227227

228+
@doc """
229+
Perform an online prediction.
230+
231+
## Parameters
232+
233+
* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
234+
* `endpoint` (*type:* `String.t`) - Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
235+
* `optional_params` (*type:* `keyword()`) - Optional parameters
236+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
237+
* `:access_token` (*type:* `String.t`) - OAuth access token.
238+
* `:alt` (*type:* `String.t`) - Data format for response.
239+
* `:callback` (*type:* `String.t`) - JSONP
240+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
241+
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
242+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
243+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
244+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
245+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
246+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
247+
* `:body` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictRequest.t`) -
248+
* `opts` (*type:* `keyword()`) - Call options
249+
250+
## Returns
251+
252+
* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictResponse{}}` on success
253+
* `{:error, info}` on failure
254+
"""
255+
@spec aiplatform_endpoints_predict(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
256+
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictResponse.t()}
257+
| {:ok, Tesla.Env.t()}
258+
| {:ok, list()}
259+
| {:error, any()}
260+
def aiplatform_endpoints_predict(connection, endpoint, optional_params \\ [], opts \\ []) do
261+
optional_params_config = %{
262+
:"$.xgafv" => :query,
263+
:access_token => :query,
264+
:alt => :query,
265+
:callback => :query,
266+
:fields => :query,
267+
:key => :query,
268+
:oauth_token => :query,
269+
:prettyPrint => :query,
270+
:quotaUser => :query,
271+
:uploadType => :query,
272+
:upload_protocol => :query,
273+
:body => :body
274+
}
275+
276+
request =
277+
Request.new()
278+
|> Request.method(:post)
279+
|> Request.url("/v1/{+endpoint}:predict", %{
280+
"endpoint" => URI.encode(endpoint, &URI.char_unreserved?/1)
281+
})
282+
|> Request.add_optional_params(optional_params_config, optional_params)
283+
|> Request.library_version(@library_version)
284+
285+
connection
286+
|> Connection.execute(request)
287+
|> Response.decode(
288+
opts ++ [struct: %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictResponse{}]
289+
)
290+
end
291+
228292
@doc """
229293
Generate content with multimodal inputs with streaming support.
230294

clients/ai_platform/lib/google_api/ai_platform/v1/api/projects.ex

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18912,7 +18912,7 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
1891218912
end
1891318913

1891418914
@doc """
18915-
Deploys an Index into this IndexEndpoint, creating a DeployedIndex within it. Only non-empty Indexes can be deployed.
18915+
Deploys an Index into this IndexEndpoint, creating a DeployedIndex within it.
1891618916

1891718917
## Parameters
1891818918

@@ -32685,6 +32685,87 @@ defmodule GoogleApi.AIPlatform.V1.Api.Projects do
3268532685
)
3268632686
end
3268732687

32688+
@doc """
32689+
Lists checkpoints of the specified model version.
32690+
32691+
## Parameters
32692+
32693+
* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
32694+
* `name` (*type:* `String.t`) - Required. The name of the model version to list checkpoints for. `projects/{project}/locations/{location}/models/{model}@{version}` Example: `projects/{project}/locations/{location}/models/{model}@2` or `projects/{project}/locations/{location}/models/{model}@golden` If no version ID or alias is specified, the latest version will be used.
32695+
* `optional_params` (*type:* `keyword()`) - Optional parameters
32696+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
32697+
* `:access_token` (*type:* `String.t`) - OAuth access token.
32698+
* `:alt` (*type:* `String.t`) - Data format for response.
32699+
* `:callback` (*type:* `String.t`) - JSONP
32700+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
32701+
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
32702+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
32703+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
32704+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
32705+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
32706+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
32707+
* `:pageSize` (*type:* `integer()`) - Optional. The standard list page size.
32708+
* `:pageToken` (*type:* `String.t`) - Optional. The standard list page token. Typically obtained via next_page_token of the previous ListModelVersionCheckpoints call.
32709+
* `opts` (*type:* `keyword()`) - Call options
32710+
32711+
## Returns
32712+
32713+
* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ListModelVersionCheckpointsResponse{}}` on success
32714+
* `{:error, info}` on failure
32715+
"""
32716+
@spec aiplatform_projects_locations_models_list_checkpoints(
32717+
Tesla.Env.client(),
32718+
String.t(),
32719+
keyword(),
32720+
keyword()
32721+
) ::
32722+
{:ok,
32723+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ListModelVersionCheckpointsResponse.t()}
32724+
| {:ok, Tesla.Env.t()}
32725+
| {:ok, list()}
32726+
| {:error, any()}
32727+
def aiplatform_projects_locations_models_list_checkpoints(
32728+
connection,
32729+
name,
32730+
optional_params \\ [],
32731+
opts \\ []
32732+
) do
32733+
optional_params_config = %{
32734+
:"$.xgafv" => :query,
32735+
:access_token => :query,
32736+
:alt => :query,
32737+
:callback => :query,
32738+
:fields => :query,
32739+
:key => :query,
32740+
:oauth_token => :query,
32741+
:prettyPrint => :query,
32742+
:quotaUser => :query,
32743+
:uploadType => :query,
32744+
:upload_protocol => :query,
32745+
:pageSize => :query,
32746+
:pageToken => :query
32747+
}
32748+
32749+
request =
32750+
Request.new()
32751+
|> Request.method(:get)
32752+
|> Request.url("/v1/{+name}:listCheckpoints", %{
32753+
"name" => URI.encode(name, &URI.char_unreserved?/1)
32754+
})
32755+
|> Request.add_optional_params(optional_params_config, optional_params)
32756+
|> Request.library_version(@library_version)
32757+
32758+
connection
32759+
|> Connection.execute(request)
32760+
|> Response.decode(
32761+
opts ++
32762+
[
32763+
struct:
32764+
%GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ListModelVersionCheckpointsResponse{}
32765+
]
32766+
)
32767+
end
32768+
3268832769
@doc """
3268932770
Lists versions of the specified model.
3269032771

clients/ai_platform/lib/google_api/ai_platform/v1/api/publishers.ex

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,75 @@ defmodule GoogleApi.AIPlatform.V1.Api.Publishers do
320320
)
321321
end
322322

323+
@doc """
324+
Perform an online prediction.
325+
326+
## Parameters
327+
328+
* `connection` (*type:* `GoogleApi.AIPlatform.V1.Connection.t`) - Connection to server
329+
* `endpoint` (*type:* `String.t`) - Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
330+
* `optional_params` (*type:* `keyword()`) - Optional parameters
331+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
332+
* `:access_token` (*type:* `String.t`) - OAuth access token.
333+
* `:alt` (*type:* `String.t`) - Data format for response.
334+
* `:callback` (*type:* `String.t`) - JSONP
335+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
336+
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
337+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
338+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
339+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
340+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
341+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
342+
* `:body` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictRequest.t`) -
343+
* `opts` (*type:* `keyword()`) - Call options
344+
345+
## Returns
346+
347+
* `{:ok, %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictResponse{}}` on success
348+
* `{:error, info}` on failure
349+
"""
350+
@spec aiplatform_publishers_models_predict(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
351+
{:ok, GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictResponse.t()}
352+
| {:ok, Tesla.Env.t()}
353+
| {:ok, list()}
354+
| {:error, any()}
355+
def aiplatform_publishers_models_predict(
356+
connection,
357+
endpoint,
358+
optional_params \\ [],
359+
opts \\ []
360+
) do
361+
optional_params_config = %{
362+
:"$.xgafv" => :query,
363+
:access_token => :query,
364+
:alt => :query,
365+
:callback => :query,
366+
:fields => :query,
367+
:key => :query,
368+
:oauth_token => :query,
369+
:prettyPrint => :query,
370+
:quotaUser => :query,
371+
:uploadType => :query,
372+
:upload_protocol => :query,
373+
:body => :body
374+
}
375+
376+
request =
377+
Request.new()
378+
|> Request.method(:post)
379+
|> Request.url("/v1/{+endpoint}:predict", %{
380+
"endpoint" => URI.encode(endpoint, &URI.char_unreserved?/1)
381+
})
382+
|> Request.add_optional_params(optional_params_config, optional_params)
383+
|> Request.library_version(@library_version)
384+
385+
connection
386+
|> Connection.execute(request)
387+
|> Response.decode(
388+
opts ++ [struct: %GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PredictResponse{}]
389+
)
390+
end
391+
323392
@doc """
324393
Generate content with multimodal inputs with streaming support.
325394

clients/ai_platform/lib/google_api/ai_platform/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.AIPlatform.V1 do
2020
API client metadata for GoogleApi.AIPlatform.V1.
2121
"""
2222

23-
@discovery_revision "20250114"
23+
@discovery_revision "20250131"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_blob.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Blob do
2222
## Attributes
2323
2424
* `data` (*type:* `String.t`, *default:* `nil`) - Required. Raw bytes.
25+
* `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is not currently used in the Gemini GenerateContent calls.
2526
* `mimeType` (*type:* `String.t`, *default:* `nil`) - Required. The IANA standard MIME type of the source data.
2627
"""
2728

2829
use GoogleApi.Gax.ModelBase
2930

3031
@type t :: %__MODULE__{
3132
:data => String.t() | nil,
33+
:displayName => String.t() | nil,
3234
:mimeType => String.t() | nil
3335
}
3436

3537
field(:data)
38+
field(:displayName)
3639
field(:mimeType)
3740
end
3841

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_cached_content.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CachedContent do
2222
## Attributes
2323
2424
* `contents` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Content.t)`, *default:* `nil`) - Optional. Input only. Immutable. The content to cache
25-
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Creatation time of the cache entry.
25+
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Creation time of the cache entry.
2626
* `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Immutable. The user-generated meaningful display name of the cached content.
2727
* `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what was sent on input.
2828
* `model` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the publisher model to use for cached content. Format: projects/{project}/locations/{location}/publishers/{publisher}/models/{model}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CodeExecutionResult do
19+
@moduledoc """
20+
Result of executing the [ExecutableCode]. Always follows a `part` containing the [ExecutableCode].
21+
22+
## Attributes
23+
24+
* `outcome` (*type:* `String.t`, *default:* `nil`) - Required. Outcome of the code execution.
25+
* `output` (*type:* `String.t`, *default:* `nil`) - Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:outcome => String.t() | nil,
32+
:output => String.t() | nil
33+
}
34+
35+
field(:outcome)
36+
field(:output)
37+
end
38+
39+
defimpl Poison.Decoder,
40+
for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CodeExecutionResult do
41+
def decode(value, options) do
42+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CodeExecutionResult.decode(
43+
value,
44+
options
45+
)
46+
end
47+
end
48+
49+
defimpl Poison.Encoder,
50+
for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CodeExecutionResult do
51+
def encode(value, options) do
52+
GoogleApi.Gax.ModelBase.encode(value, options)
53+
end
54+
end

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_count_tokens_response.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,26 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CountTokensRespon
2121
2222
## Attributes
2323
24+
* `promptTokensDetails` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModalityTokenCount.t)`, *default:* `nil`) - Output only. List of modalities that were processed in the request input.
2425
* `totalBillableCharacters` (*type:* `integer()`, *default:* `nil`) - The total number of billable characters counted across all instances from the request.
2526
* `totalTokens` (*type:* `integer()`, *default:* `nil`) - The total number of tokens counted across all instances from the request.
2627
"""
2728

2829
use GoogleApi.Gax.ModelBase
2930

3031
@type t :: %__MODULE__{
32+
:promptTokensDetails =>
33+
list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModalityTokenCount.t())
34+
| nil,
3135
:totalBillableCharacters => integer() | nil,
3236
:totalTokens => integer() | nil
3337
}
3438

39+
field(:promptTokensDetails,
40+
as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModalityTokenCount,
41+
type: :list
42+
)
43+
3544
field(:totalBillableCharacters)
3645
field(:totalTokens)
3746
end

clients/ai_platform/lib/google_api/ai_platform/v1/model/google_cloud_aiplatform_v1_deployed_model.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DeployedModel do
3636
* `privateEndpoints` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PrivateEndpoints.t`, *default:* `nil`) - Output only. Provide paths for users to send predict/explain/health requests directly to the deployed model services running on Cloud via private services access. This field is populated if network is configured.
3737
* `serviceAccount` (*type:* `String.t`, *default:* `nil`) - The service account that the DeployedModel's container runs as. Specify the email address of the service account. If this service account is not specified, the container runs as a service account that doesn't have access to the resource project. Users deploying the Model must have the `iam.serviceAccounts.actAs` permission on this service account.
3838
* `sharedResources` (*type:* `String.t`, *default:* `nil`) - The resource name of the shared DeploymentResourcePool to deploy on. Format: `projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}`
39+
* `speculativeDecodingSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SpeculativeDecodingSpec.t`, *default:* `nil`) - Optional. Spec for configuring speculative decoding.
3940
* `status` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DeployedModelStatus.t`, *default:* `nil`) - Output only. Runtime status of the deployed model.
4041
* `systemLabels` (*type:* `map()`, *default:* `nil`) - System labels to apply to Model Garden deployments. System labels are managed by Google for internal use only.
4142
"""
@@ -63,6 +64,8 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DeployedModel do
6364
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1PrivateEndpoints.t() | nil,
6465
:serviceAccount => String.t() | nil,
6566
:sharedResources => String.t() | nil,
67+
:speculativeDecodingSpec =>
68+
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SpeculativeDecodingSpec.t() | nil,
6669
:status =>
6770
GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DeployedModelStatus.t() | nil,
6871
:systemLabels => map() | nil
@@ -99,6 +102,11 @@ defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DeployedModel do
99102

100103
field(:serviceAccount)
101104
field(:sharedResources)
105+
106+
field(:speculativeDecodingSpec,
107+
as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SpeculativeDecodingSpec
108+
)
109+
102110
field(:status, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DeployedModelStatus)
103111
field(:systemLabels, type: :map)
104112
end

0 commit comments

Comments
 (0)