Current section
Files
Jump to
Current section
Files
lib/googly/document_ai/projects/operations.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.DocumentAI.Projects.Operations do
@moduledoc """
Endpoints for the `Projects.Operations` resource.
"""
alias Googly.DocumentAI.Request
@doc """
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
## Parameters
* `name` (*type:* `String.t()`) - The name of the operation resource.
* `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.GoogleLongrunningOperation{}}` on success
* `{:error, %Googly.DocumentAI.Error{}}` on failure
"""
@spec get(String.t(), keyword()) ::
{:ok, Googly.DocumentAI.Model.GoogleLongrunningOperation.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.GoogleLongrunningOperation,
opts: opts
)
end
end