-
Notifications
You must be signed in to change notification settings - Fork 461
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 Language client
- Loading branch information
1 parent
f7ca789
commit 592cfaf
Showing
141 changed files
with
8,117 additions
and
0 deletions.
There are no files selected for viewing
322 changes: 322 additions & 0 deletions
322
clients/language/lib/google_api/language/v2/api/documents.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,322 @@ | ||
# 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.Language.V2.Api.Documents do | ||
@moduledoc """ | ||
API calls for all endpoints tagged `Documents`. | ||
""" | ||
|
||
alias GoogleApi.Language.V2.Connection | ||
alias GoogleApi.Gax.{Request, Response} | ||
|
||
@library_version Mix.Project.config() |> Keyword.get(:version, "") | ||
|
||
@doc """ | ||
Finds named entities (currently proper names and common nouns) in the text along with entity types, probability, mentions for each entity, and other properties. | ||
## Parameters | ||
* `connection` (*type:* `GoogleApi.Language.V2.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.Language.V2.Model.AnalyzeEntitiesRequest.t`) - | ||
* `opts` (*type:* `keyword()`) - Call options | ||
## Returns | ||
* `{:ok, %GoogleApi.Language.V2.Model.AnalyzeEntitiesResponse{}}` on success | ||
* `{:error, info}` on failure | ||
""" | ||
@spec language_documents_analyze_entities(Tesla.Env.client(), keyword(), keyword()) :: | ||
{:ok, GoogleApi.Language.V2.Model.AnalyzeEntitiesResponse.t()} | ||
| {:ok, Tesla.Env.t()} | ||
| {:ok, list()} | ||
| {:error, any()} | ||
def language_documents_analyze_entities(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("/v2/documents:analyzeEntities", %{}) | ||
|> Request.add_optional_params(optional_params_config, optional_params) | ||
|> Request.library_version(@library_version) | ||
|
||
connection | ||
|> Connection.execute(request) | ||
|> Response.decode(opts ++ [struct: %GoogleApi.Language.V2.Model.AnalyzeEntitiesResponse{}]) | ||
end | ||
|
||
@doc """ | ||
Analyzes the sentiment of the provided text. | ||
## Parameters | ||
* `connection` (*type:* `GoogleApi.Language.V2.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.Language.V2.Model.AnalyzeSentimentRequest.t`) - | ||
* `opts` (*type:* `keyword()`) - Call options | ||
## Returns | ||
* `{:ok, %GoogleApi.Language.V2.Model.AnalyzeSentimentResponse{}}` on success | ||
* `{:error, info}` on failure | ||
""" | ||
@spec language_documents_analyze_sentiment(Tesla.Env.client(), keyword(), keyword()) :: | ||
{:ok, GoogleApi.Language.V2.Model.AnalyzeSentimentResponse.t()} | ||
| {:ok, Tesla.Env.t()} | ||
| {:ok, list()} | ||
| {:error, any()} | ||
def language_documents_analyze_sentiment(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("/v2/documents:analyzeSentiment", %{}) | ||
|> Request.add_optional_params(optional_params_config, optional_params) | ||
|> Request.library_version(@library_version) | ||
|
||
connection | ||
|> Connection.execute(request) | ||
|> Response.decode(opts ++ [struct: %GoogleApi.Language.V2.Model.AnalyzeSentimentResponse{}]) | ||
end | ||
|
||
@doc """ | ||
A convenience method that provides all features in one call. | ||
## Parameters | ||
* `connection` (*type:* `GoogleApi.Language.V2.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.Language.V2.Model.AnnotateTextRequest.t`) - | ||
* `opts` (*type:* `keyword()`) - Call options | ||
## Returns | ||
* `{:ok, %GoogleApi.Language.V2.Model.AnnotateTextResponse{}}` on success | ||
* `{:error, info}` on failure | ||
""" | ||
@spec language_documents_annotate_text(Tesla.Env.client(), keyword(), keyword()) :: | ||
{:ok, GoogleApi.Language.V2.Model.AnnotateTextResponse.t()} | ||
| {:ok, Tesla.Env.t()} | ||
| {:ok, list()} | ||
| {:error, any()} | ||
def language_documents_annotate_text(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("/v2/documents:annotateText", %{}) | ||
|> Request.add_optional_params(optional_params_config, optional_params) | ||
|> Request.library_version(@library_version) | ||
|
||
connection | ||
|> Connection.execute(request) | ||
|> Response.decode(opts ++ [struct: %GoogleApi.Language.V2.Model.AnnotateTextResponse{}]) | ||
end | ||
|
||
@doc """ | ||
Classifies a document into categories. | ||
## Parameters | ||
* `connection` (*type:* `GoogleApi.Language.V2.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.Language.V2.Model.ClassifyTextRequest.t`) - | ||
* `opts` (*type:* `keyword()`) - Call options | ||
## Returns | ||
* `{:ok, %GoogleApi.Language.V2.Model.ClassifyTextResponse{}}` on success | ||
* `{:error, info}` on failure | ||
""" | ||
@spec language_documents_classify_text(Tesla.Env.client(), keyword(), keyword()) :: | ||
{:ok, GoogleApi.Language.V2.Model.ClassifyTextResponse.t()} | ||
| {:ok, Tesla.Env.t()} | ||
| {:ok, list()} | ||
| {:error, any()} | ||
def language_documents_classify_text(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("/v2/documents:classifyText", %{}) | ||
|> Request.add_optional_params(optional_params_config, optional_params) | ||
|> Request.library_version(@library_version) | ||
|
||
connection | ||
|> Connection.execute(request) | ||
|> Response.decode(opts ++ [struct: %GoogleApi.Language.V2.Model.ClassifyTextResponse{}]) | ||
end | ||
|
||
@doc """ | ||
Moderates a document for harmful and sensitive categories. | ||
## Parameters | ||
* `connection` (*type:* `GoogleApi.Language.V2.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.Language.V2.Model.ModerateTextRequest.t`) - | ||
* `opts` (*type:* `keyword()`) - Call options | ||
## Returns | ||
* `{:ok, %GoogleApi.Language.V2.Model.ModerateTextResponse{}}` on success | ||
* `{:error, info}` on failure | ||
""" | ||
@spec language_documents_moderate_text(Tesla.Env.client(), keyword(), keyword()) :: | ||
{:ok, GoogleApi.Language.V2.Model.ModerateTextResponse.t()} | ||
| {:ok, Tesla.Env.t()} | ||
| {:ok, list()} | ||
| {:error, any()} | ||
def language_documents_moderate_text(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("/v2/documents:moderateText", %{}) | ||
|> Request.add_optional_params(optional_params_config, optional_params) | ||
|> Request.library_version(@library_version) | ||
|
||
connection | ||
|> Connection.execute(request) | ||
|> Response.decode(opts ++ [struct: %GoogleApi.Language.V2.Model.ModerateTextResponse{}]) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 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.Language.V2.Connection do | ||
@moduledoc """ | ||
Handle Tesla connections for GoogleApi.Language.V2. | ||
""" | ||
|
||
@type t :: Tesla.Env.client() | ||
|
||
use GoogleApi.Gax.Connection, | ||
scopes: [ | ||
# Apply machine learning models to reveal the structure and meaning of text | ||
"https://www.googleapis.com/auth/cloud-language", | ||
|
||
# See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. | ||
"https://www.googleapis.com/auth/cloud-platform" | ||
], | ||
otp_app: :google_api_language, | ||
base_url: "https://language.googleapis.com/" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2020 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.Language.V2 do | ||
@moduledoc """ | ||
API client metadata for GoogleApi.Language.V2. | ||
""" | ||
|
||
@discovery_revision "20240310" | ||
|
||
def discovery_revision(), do: @discovery_revision | ||
end |
Oops, something went wrong.