Current section
Files
Jump to
Current section
Files
lib/googly/cloud_storage/anywhere_caches.ex
# NOTE: This file is auto generated by googly. Do not edit it manually.
defmodule Googly.CloudStorage.AnywhereCaches do
@moduledoc """
Endpoints for the `AnywhereCaches` resource.
"""
alias Googly.CloudStorage.Request
@doc """
Disables an Anywhere Cache instance.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `anywhere_cache_id` (*type:* `String.t()`) - The ID of requested Anywhere Cache instance.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
## Returns
* `{:ok, %Googly.CloudStorage.Model.AnywhereCache{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec disable(String.t(), String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.AnywhereCache.t()} | {:error, term()}
def disable(bucket, anywhere_cache_id, opts \\ []) do
Request.run(
method: :post,
url: "/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}/disable",
path_params: %{
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1),
"anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1)
},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"}
},
decode: Googly.CloudStorage.Model.AnywhereCache,
opts: opts
)
end
@doc """
Returns the metadata of an Anywhere Cache instance.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `anywhere_cache_id` (*type:* `String.t()`) - The ID of requested Anywhere Cache instance.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
## Returns
* `{:ok, %Googly.CloudStorage.Model.AnywhereCache{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec get(String.t(), String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.AnywhereCache.t()} | {:error, term()}
def get(bucket, anywhere_cache_id, opts \\ []) do
Request.run(
method: :get,
url: "/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}",
path_params: %{
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1),
"anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1)
},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"}
},
decode: Googly.CloudStorage.Model.AnywhereCache,
opts: opts
)
end
@doc """
Creates an Anywhere Cache instance.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
* `body` (*type:* `Googly.CloudStorage.Model.AnywhereCache.t()`) -
## Returns
* `{:ok, %Googly.CloudStorage.Model.GoogleLongrunningOperation{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec insert(String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.GoogleLongrunningOperation.t()} | {:error, term()}
def insert(bucket, opts \\ []) do
Request.run(
method: :post,
url: "/storage/v1/b/{bucket}/anywhereCaches",
path_params: %{"bucket" => URI.encode(bucket, &URI.char_unreserved?/1)},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"},
body: {:body, nil}
},
decode: Googly.CloudStorage.Model.GoogleLongrunningOperation,
opts: opts
)
end
@doc """
Returns a list of Anywhere Cache instances of the bucket matching the criteria.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
* `page_size` (*type:* `integer()`) - Maximum number of items to return in a single page of responses. Maximum 1000.
* `page_token` (*type:* `String.t()`) - A previously-returned page token representing part of the larger set of results to view.
## Returns
* `{:ok, %Googly.CloudStorage.Model.AnywhereCaches{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec list(String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.AnywhereCaches.t()} | {:error, term()}
def list(bucket, opts \\ []) do
Request.run(
method: :get,
url: "/storage/v1/b/{bucket}/anywhereCaches",
path_params: %{"bucket" => URI.encode(bucket, &URI.char_unreserved?/1)},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"},
page_size: {:query, "pageSize"},
page_token: {:query, "pageToken"}
},
decode: Googly.CloudStorage.Model.AnywhereCaches,
opts: opts
)
end
@doc """
Pauses an Anywhere Cache instance.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `anywhere_cache_id` (*type:* `String.t()`) - The ID of requested Anywhere Cache instance.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
## Returns
* `{:ok, %Googly.CloudStorage.Model.AnywhereCache{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec pause(String.t(), String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.AnywhereCache.t()} | {:error, term()}
def pause(bucket, anywhere_cache_id, opts \\ []) do
Request.run(
method: :post,
url: "/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}/pause",
path_params: %{
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1),
"anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1)
},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"}
},
decode: Googly.CloudStorage.Model.AnywhereCache,
opts: opts
)
end
@doc """
Resumes a paused or disabled Anywhere Cache instance.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `anywhere_cache_id` (*type:* `String.t()`) - The ID of requested Anywhere Cache instance.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
## Returns
* `{:ok, %Googly.CloudStorage.Model.AnywhereCache{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec resume(String.t(), String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.AnywhereCache.t()} | {:error, term()}
def resume(bucket, anywhere_cache_id, opts \\ []) do
Request.run(
method: :post,
url: "/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}/resume",
path_params: %{
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1),
"anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1)
},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"}
},
decode: Googly.CloudStorage.Model.AnywhereCache,
opts: opts
)
end
@doc """
Updates the config of an Anywhere Cache instance.
## Parameters
* `bucket` (*type:* `String.t()`) - Name of the parent bucket.
* `anywhere_cache_id` (*type:* `String.t()`) - The ID of requested Anywhere Cache instance.
* `opts` (*type:* `keyword()`) - Query and call options (`:token`, plus any of the below)
* `alt` (*type:* `String.t()`) - Data format for the response.
* `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()`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* `upload_type` (*type:* `String.t()`) - Upload protocol for media (e.g. "media", "multipart", "resumable").
* `user_ip` (*type:* `String.t()`) - Deprecated. Please use quotaUser instead.
* `body` (*type:* `Googly.CloudStorage.Model.AnywhereCache.t()`) -
## Returns
* `{:ok, %Googly.CloudStorage.Model.GoogleLongrunningOperation{}}` on success
* `{:error, %Googly.CloudStorage.Error{}}` on failure
"""
@spec update(String.t(), String.t(), keyword()) ::
{:ok, Googly.CloudStorage.Model.GoogleLongrunningOperation.t()} | {:error, term()}
def update(bucket, anywhere_cache_id, opts \\ []) do
Request.run(
method: :patch,
url: "/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}",
path_params: %{
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1),
"anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1)
},
query: [],
params: %{
alt: {:query, "alt"},
fields: {:query, "fields"},
key: {:query, "key"},
oauth_token: {:query, "oauth_token"},
pretty_print: {:query, "prettyPrint"},
quota_user: {:query, "quotaUser"},
upload_type: {:query, "uploadType"},
user_ip: {:query, "userIp"},
body: {:body, nil}
},
decode: Googly.CloudStorage.Model.GoogleLongrunningOperation,
opts: opts
)
end
end