-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Automated regeneration of Checks client (#12436)
Auto-created at 2024-10-30 13:14:22 +0000 using the toys pull request generator.
- Loading branch information
1 parent
b35ca1e
commit 6d72b0b
Showing
11 changed files
with
504 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
clients/checks/lib/google_api/checks/v1alpha/api/aisafety.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Copyright 2019 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 | ||
# | ||
# http://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. | ||
|
||
# NOTE: This file is auto generated by the elixir code generator program. | ||
# Do not edit this file manually. | ||
|
||
defmodule GoogleApi.Checks.V1alpha.Api.Aisafety do | ||
@moduledoc """ | ||
API calls for all endpoints tagged `Aisafety`. | ||
""" | ||
|
||
alias GoogleApi.Checks.V1alpha.Connection | ||
alias GoogleApi.Gax.{Request, Response} | ||
|
||
@library_version Mix.Project.config() |> Keyword.get(:version, "") | ||
|
||
@doc """ | ||
Analyze a piece of content with the provided set of policies. | ||
## Parameters | ||
* `connection` (*type:* `GoogleApi.Checks.V1alpha.Connection.t`) - Connection to server | ||
* `optional_params` (*type:* `keyword()`) - Optional parameters | ||
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format. | ||
* `:access_token` (*type:* `String.t`) - OAuth access token. | ||
* `:alt` (*type:* `String.t`) - Data format for response. | ||
* `:callback` (*type:* `String.t`) - JSONP | ||
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. | ||
* `: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. | ||
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. | ||
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. | ||
* `: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. | ||
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). | ||
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). | ||
* `:body` (*type:* `GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequest.t`) - | ||
* `opts` (*type:* `keyword()`) - Call options | ||
## Returns | ||
* `{:ok, %GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentResponse{}}` on success | ||
* `{:error, info}` on failure | ||
""" | ||
@spec checks_aisafety_classify_content(Tesla.Env.client(), keyword(), keyword()) :: | ||
{:ok, | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentResponse.t()} | ||
| {:ok, Tesla.Env.t()} | ||
| {:ok, list()} | ||
| {:error, any()} | ||
def checks_aisafety_classify_content(connection, optional_params \\ [], opts \\ []) do | ||
optional_params_config = %{ | ||
:"$.xgafv" => :query, | ||
:access_token => :query, | ||
:alt => :query, | ||
:callback => :query, | ||
:fields => :query, | ||
:key => :query, | ||
:oauth_token => :query, | ||
:prettyPrint => :query, | ||
:quotaUser => :query, | ||
:uploadType => :query, | ||
:upload_protocol => :query, | ||
:body => :body | ||
} | ||
|
||
request = | ||
Request.new() | ||
|> Request.method(:post) | ||
|> Request.url("/v1alpha/aisafety:classifyContent", %{}) | ||
|> Request.add_optional_params(optional_params_config, optional_params) | ||
|> Request.library_version(@library_version) | ||
|
||
connection | ||
|> Connection.execute(request) | ||
|> Response.decode( | ||
opts ++ | ||
[ | ||
struct: | ||
%GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentResponse{} | ||
] | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...oogle_api/checks/v1alpha/model/google_checks_aisafety_v1alpha_classify_content_request.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright 2019 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 | ||
# | ||
# http://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. | ||
|
||
# NOTE: This file is auto generated by the elixir code generator program. | ||
# Do not edit this file manually. | ||
|
||
defmodule GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequest do | ||
@moduledoc """ | ||
Request proto for ClassifyContent RPC. | ||
## Attributes | ||
* `classifierVersion` (*type:* `String.t`, *default:* `nil`) - Optional. Version of the classifier to use. If not specified, the latest version will be used. | ||
* `context` (*type:* `GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext.t`, *default:* `nil`) - Optional. Context about the input that will be used to help on the classification. | ||
* `input` (*type:* `GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent.t`, *default:* `nil`) - Required. Content to be classified. | ||
* `policies` (*type:* `list(GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig.t)`, *default:* `nil`) - Required. List of policies to classify against. | ||
""" | ||
|
||
use GoogleApi.Gax.ModelBase | ||
|
||
@type t :: %__MODULE__{ | ||
:classifierVersion => String.t() | nil, | ||
:context => | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext.t() | ||
| nil, | ||
:input => | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent.t() | ||
| nil, | ||
:policies => | ||
list( | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig.t() | ||
) | ||
| nil | ||
} | ||
|
||
field(:classifierVersion) | ||
|
||
field(:context, | ||
as: GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext | ||
) | ||
|
||
field(:input, | ||
as: | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent | ||
) | ||
|
||
field(:policies, | ||
as: | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig, | ||
type: :list | ||
) | ||
end | ||
|
||
defimpl Poison.Decoder, | ||
for: GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequest do | ||
def decode(value, options) do | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequest.decode( | ||
value, | ||
options | ||
) | ||
end | ||
end | ||
|
||
defimpl Poison.Encoder, | ||
for: GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequest do | ||
def encode(value, options) do | ||
GoogleApi.Gax.ModelBase.encode(value, options) | ||
end | ||
end |
51 changes: 51 additions & 0 deletions
51
...i/checks/v1alpha/model/google_checks_aisafety_v1alpha_classify_content_request_context.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2019 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 | ||
# | ||
# http://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. | ||
|
||
# NOTE: This file is auto generated by the elixir code generator program. | ||
# Do not edit this file manually. | ||
|
||
defmodule GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext do | ||
@moduledoc """ | ||
Context about the input that will be used to help on the classification. | ||
## Attributes | ||
* `prompt` (*type:* `String.t`, *default:* `nil`) - Optional. Prompt that generated the model response. | ||
""" | ||
|
||
use GoogleApi.Gax.ModelBase | ||
|
||
@type t :: %__MODULE__{ | ||
:prompt => String.t() | nil | ||
} | ||
|
||
field(:prompt) | ||
end | ||
|
||
defimpl Poison.Decoder, | ||
for: GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext do | ||
def decode(value, options) do | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext.decode( | ||
value, | ||
options | ||
) | ||
end | ||
end | ||
|
||
defimpl Poison.Encoder, | ||
for: GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestContext do | ||
def encode(value, options) do | ||
GoogleApi.Gax.ModelBase.encode(value, options) | ||
end | ||
end |
54 changes: 54 additions & 0 deletions
54
...ks/v1alpha/model/google_checks_aisafety_v1alpha_classify_content_request_input_content.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright 2019 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 | ||
# | ||
# http://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. | ||
|
||
# NOTE: This file is auto generated by the elixir code generator program. | ||
# Do not edit this file manually. | ||
|
||
defmodule GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent do | ||
@moduledoc """ | ||
Content to be classified. | ||
## Attributes | ||
* `textInput` (*type:* `GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaTextInput.t`, *default:* `nil`) - Content in text format. | ||
""" | ||
|
||
use GoogleApi.Gax.ModelBase | ||
|
||
@type t :: %__MODULE__{ | ||
:textInput => | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaTextInput.t() | nil | ||
} | ||
|
||
field(:textInput, as: GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaTextInput) | ||
end | ||
|
||
defimpl Poison.Decoder, | ||
for: | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent do | ||
def decode(value, options) do | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent.decode( | ||
value, | ||
options | ||
) | ||
end | ||
end | ||
|
||
defimpl Poison.Encoder, | ||
for: | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent do | ||
def encode(value, options) do | ||
GoogleApi.Gax.ModelBase.encode(value, options) | ||
end | ||
end |
56 changes: 56 additions & 0 deletions
56
...ks/v1alpha/model/google_checks_aisafety_v1alpha_classify_content_request_policy_config.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright 2019 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 | ||
# | ||
# http://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. | ||
|
||
# NOTE: This file is auto generated by the elixir code generator program. | ||
# Do not edit this file manually. | ||
|
||
defmodule GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig do | ||
@moduledoc """ | ||
List of policies to classify against. | ||
## Attributes | ||
* `policyType` (*type:* `String.t`, *default:* `nil`) - Required. Type of the policy. | ||
* `threshold` (*type:* `number()`, *default:* `nil`) - Optional. Score threshold to use when deciding if the content is violative or non-violative. If not specified, the default 0.5 threshold for the policy will be used. | ||
""" | ||
|
||
use GoogleApi.Gax.ModelBase | ||
|
||
@type t :: %__MODULE__{ | ||
:policyType => String.t() | nil, | ||
:threshold => number() | nil | ||
} | ||
|
||
field(:policyType) | ||
field(:threshold) | ||
end | ||
|
||
defimpl Poison.Decoder, | ||
for: | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig do | ||
def decode(value, options) do | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig.decode( | ||
value, | ||
options | ||
) | ||
end | ||
end | ||
|
||
defimpl Poison.Encoder, | ||
for: | ||
GoogleApi.Checks.V1alpha.Model.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig do | ||
def encode(value, options) do | ||
GoogleApi.Gax.ModelBase.encode(value, options) | ||
end | ||
end |
Oops, something went wrong.