Current section
Files
Jump to
Current section
Files
lib/googly/document_ai/projects/locations.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.DocumentAI.Projects.Locations do
@moduledoc """
Endpoints for the `Projects.Locations` resource.
"""
alias Googly.DocumentAI.Request
@doc """
Fetches processor types. Note that we don't use ListProcessorTypes here, because it isn't paginated.
## Parameters
* `parent` (*type:* `String.t()`) - Required. The location of processor types to list. Format: `projects/{project}/locations/{location}`.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `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.
* `pretty_print` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `quota_user` (*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.
* `upload_protocol` (*type:* `String.t()`) - Upload protocol for media (e.g. "raw", "multipart").
* `upload_type` (*type:* `String.t()`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `xgafv` (*type:* `String.t()`) - V1 error format.
## Returns
* `{:ok, %Googly.DocumentAI.Model.GoogleCloudDocumentaiV1FetchProcessorTypesResponse{}}` on success
* `{:error, %Googly.DocumentAI.Error{}}` on failure
"""
@spec fetch_processor_types(String.t(), keyword()) ::
{:ok, Googly.DocumentAI.Model.GoogleCloudDocumentaiV1FetchProcessorTypesResponse.t()}
| {:error, term()}
def fetch_processor_types(parent, opts \\ []) do
Request.run(
method: :get,
url: "/v1/{+parent}:fetchProcessorTypes",
path_params: %{"parent" => URI.encode(parent, &(URI.char_unreserved?(&1) or &1 == ?/))},
query: [],
params: %{
access_token: {:query, "access_token"},
alt: {:query, "alt"},
callback: {:query, "callback"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_protocol: {:query, "upload_protocol"},
upload_type: {:query, "uploadType"},
xgafv: {:query, "$.xgafv"}
},
decode: Googly.DocumentAI.Model.GoogleCloudDocumentaiV1FetchProcessorTypesResponse,
opts: opts
)
end
@doc """
Gets information about a location.
## Parameters
* `name` (*type:* `String.t()`) - Resource name for the location.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `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.
* `pretty_print` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `quota_user` (*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.
* `upload_protocol` (*type:* `String.t()`) - Upload protocol for media (e.g. "raw", "multipart").
* `upload_type` (*type:* `String.t()`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `xgafv` (*type:* `String.t()`) - V1 error format.
## Returns
* `{:ok, %Googly.DocumentAI.Model.GoogleCloudLocationLocation{}}` on success
* `{:error, %Googly.DocumentAI.Error{}}` on failure
"""
@spec get(String.t(), keyword()) ::
{:ok, Googly.DocumentAI.Model.GoogleCloudLocationLocation.t()} | {:error, term()}
def get(name, opts \\ []) do
Request.run(
method: :get,
url: "/v1/{+name}",
path_params: %{"name" => URI.encode(name, &(URI.char_unreserved?(&1) or &1 == ?/))},
query: [],
params: %{
access_token: {:query, "access_token"},
alt: {:query, "alt"},
callback: {:query, "callback"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_protocol: {:query, "upload_protocol"},
upload_type: {:query, "uploadType"},
xgafv: {:query, "$.xgafv"}
},
decode: Googly.DocumentAI.Model.GoogleCloudLocationLocation,
opts: opts
)
end
@doc """
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided in the ListLocationsRequest.name field: * **Global locations**: If `name` is empty, the method lists the public locations available to all projects. * **Project-specific locations**: If `name` follows the format `projects/{project}`, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project. For gRPC and client library implementations, the resource name is passed as the `name` field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
## Parameters
* `name` (*type:* `String.t()`) - The resource that owns the locations collection, if applicable.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `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.
* `pretty_print` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `quota_user` (*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.
* `upload_protocol` (*type:* `String.t()`) - Upload protocol for media (e.g. "raw", "multipart").
* `upload_type` (*type:* `String.t()`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `xgafv` (*type:* `String.t()`) - V1 error format.
* `extra_location_types` (*type:* `list(String.t())`) - Optional. Do not use this field unless explicitly documented otherwise. This is primarily for internal usage.
* `filter` (*type:* `String.t()`) - A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
* `page_size` (*type:* `integer()`) - The maximum number of results to return. If not set, the service selects a default.
* `page_token` (*type:* `String.t()`) - A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
## Returns
* `{:ok, %Googly.DocumentAI.Model.GoogleCloudLocationListLocationsResponse{}}` on success
* `{:error, %Googly.DocumentAI.Error{}}` on failure
"""
@spec list(String.t(), keyword()) ::
{:ok, Googly.DocumentAI.Model.GoogleCloudLocationListLocationsResponse.t()}
| {:error, term()}
def list(name, opts \\ []) do
Request.run(
method: :get,
url: "/v1/{+name}/locations",
path_params: %{"name" => URI.encode(name, &(URI.char_unreserved?(&1) or &1 == ?/))},
query: [],
params: %{
access_token: {:query, "access_token"},
alt: {:query, "alt"},
callback: {:query, "callback"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_protocol: {:query, "upload_protocol"},
upload_type: {:query, "uploadType"},
xgafv: {:query, "$.xgafv"},
extra_location_types: {:query, "extraLocationTypes"},
filter: {:query, "filter"},
page_size: {:query, "pageSize"},
page_token: {:query, "pageToken"}
},
decode: Googly.DocumentAI.Model.GoogleCloudLocationListLocationsResponse,
opts: opts
)
end
end