diff --git a/clients/storage/lib/google_api/storage/v1/api/anywhere_caches.ex b/clients/storage/lib/google_api/storage/v1/api/anywhere_caches.ex new file mode 100644 index 0000000000..41c8a631d5 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/api/anywhere_caches.ex @@ -0,0 +1,485 @@ +# 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.Storage.V1.Api.AnywhereCaches do + @moduledoc """ + API calls for all endpoints tagged `AnywhereCaches`. + """ + + alias GoogleApi.Storage.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Disables an Anywhere Cache instance. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `anywhere_cache_id` (*type:* `String.t`) - The ID of requested Anywhere Cache instance. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.AnywhereCache{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_disable( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.AnywhereCache.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_disable( + connection, + bucket, + anywhere_cache_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}/disable", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.AnywhereCache{}]) + end + + @doc """ + Returns the metadata of an Anywhere Cache instance. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `anywhere_cache_id` (*type:* `String.t`) - The ID of requested Anywhere Cache instance. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.AnywhereCache{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_get( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.AnywhereCache.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_get( + connection, + bucket, + anywhere_cache_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "anywhereCacheId" => + URI.encode(anywhere_cache_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.AnywhereCache{}]) + end + + @doc """ + Creates an Anywhere Cache instance. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:body` (*type:* `GoogleApi.Storage.V1.Model.AnywhereCache.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_insert(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_insert(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}]) + end + + @doc """ + Returns a list of Anywhere Cache instances of the bucket matching the criteria. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:pageSize` (*type:* `integer()`) - Maximum number of items to return in a single page of responses. Maximum 1000. + * `:pageToken` (*type:* `String.t`) - A previously-returned page token representing part of the larger set of results to view. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.AnywhereCaches{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.AnywhereCaches.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_list(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.AnywhereCaches{}]) + end + + @doc """ + Pauses an Anywhere Cache instance. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `anywhere_cache_id` (*type:* `String.t`) - The ID of requested Anywhere Cache instance. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.AnywhereCache{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_pause( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.AnywhereCache.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_pause( + connection, + bucket, + anywhere_cache_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}/pause", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.AnywhereCache{}]) + end + + @doc """ + Resumes a paused or disabled Anywhere Cache instance. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `anywhere_cache_id` (*type:* `String.t`) - The ID of requested Anywhere Cache instance. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.AnywhereCache{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_resume( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.AnywhereCache.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_resume( + connection, + bucket, + anywhere_cache_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}/resume", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "anywhereCacheId" => URI.encode(anywhere_cache_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.AnywhereCache{}]) + end + + @doc """ + Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the parent bucket. + * `anywhere_cache_id` (*type:* `String.t`) - The ID of requested Anywhere Cache instance. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:body` (*type:* `GoogleApi.Storage.V1.Model.AnywhereCache.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec storage_anywhere_caches_update( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_anywhere_caches_update( + connection, + bucket, + anywhere_cache_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:patch) + |> Request.url("/storage/v1/b/{bucket}/anywhereCaches/{anywhereCacheId}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "anywhereCacheId" => + URI.encode(anywhere_cache_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}]) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/api/buckets.ex b/clients/storage/lib/google_api/storage/v1/api/buckets.ex index 38bccba528..37b74ede70 100644 --- a/clients/storage/lib/google_api/storage/v1/api/buckets.ex +++ b/clients/storage/lib/google_api/storage/v1/api/buckets.ex @@ -218,6 +218,7 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:enableObjectRetention` (*type:* `boolean()`) - When set to true, object retention is enabled for this bucket. * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this bucket. * `:predefinedDefaultObjectAcl` (*type:* `String.t`) - Apply a predefined set of default object access controls to this bucket. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. @@ -245,6 +246,7 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do :quotaUser => :query, :uploadType => :query, :userIp => :query, + :enableObjectRetention => :query, :predefinedAcl => :query, :predefinedDefaultObjectAcl => :query, :projection => :query, diff --git a/clients/storage/lib/google_api/storage/v1/api/folders.ex b/clients/storage/lib/google_api/storage/v1/api/folders.ex new file mode 100644 index 0000000000..d0d507d5dc --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/api/folders.ex @@ -0,0 +1,348 @@ +# 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.Storage.V1.Api.Folders do + @moduledoc """ + API calls for all endpoints tagged `Folders`. + """ + + alias GoogleApi.Storage.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Permanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which the folder resides. + * `folder` (*type:* `String.t`) - Name of a folder. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:ifMetagenerationMatch` (*type:* `String.t`) - If set, only deletes the folder if its metageneration matches this value. + * `:ifMetagenerationNotMatch` (*type:* `String.t`) - If set, only deletes the folder if its metageneration does not match this value. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %{}}` on success + * `{:error, info}` on failure + """ + @spec storage_folders_delete(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: + {:ok, nil} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} + def storage_folders_delete(connection, bucket, folder, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :ifMetagenerationMatch => :query, + :ifMetagenerationNotMatch => :query + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url("/storage/v1/b/{bucket}/folders/{folder}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "folder" => URI.encode(folder, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [decode: false]) + end + + @doc """ + Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which the folder resides. + * `folder` (*type:* `String.t`) - Name of a folder. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the return of the folder metadata conditional on whether the folder's current metageneration matches the given value. + * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the return of the folder metadata conditional on whether the folder's current metageneration does not match the given value. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.Folder{}}` on success + * `{:error, info}` on failure + """ + @spec storage_folders_get(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.Folder.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_folders_get(connection, bucket, folder, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :ifMetagenerationMatch => :query, + :ifMetagenerationNotMatch => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/folders/{folder}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "folder" => URI.encode(folder, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Folder{}]) + end + + @doc """ + Creates a new folder. Only applicable to buckets with hierarchical namespace enabled. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which the folder resides. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:recursive` (*type:* `boolean()`) - If true, any parent folder which doesn’t exist will be created automatically. + * `:body` (*type:* `GoogleApi.Storage.V1.Model.Folder.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.Folder{}}` on success + * `{:error, info}` on failure + """ + @spec storage_folders_insert(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.Folder.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_folders_insert(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :recursive => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/folders", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Folder{}]) + end + + @doc """ + Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which to look for folders. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:delimiter` (*type:* `String.t`) - Returns results in a directory-like mode. The only supported value is '/'. If set, items will only contain folders that either exactly match the prefix, or are one level below the prefix. + * `:endOffset` (*type:* `String.t`) - Filter results to folders whose names are lexicographically before endOffset. If startOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive). + * `:pageSize` (*type:* `integer()`) - Maximum number of items to return in a single page of responses. + * `:pageToken` (*type:* `String.t`) - A previously-returned page token representing part of the larger set of results to view. + * `:prefix` (*type:* `String.t`) - Filter results to folders whose paths begin with this prefix. If set, the value must either be an empty string or end with a '/'. + * `:startOffset` (*type:* `String.t`) - Filter results to folders whose names are lexicographically equal to or after startOffset. If endOffset is also set, the folders listed will have names between startOffset (inclusive) and endOffset (exclusive). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.Folders{}}` on success + * `{:error, info}` on failure + """ + @spec storage_folders_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.Folders.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_folders_list(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :delimiter => :query, + :endOffset => :query, + :pageSize => :query, + :pageToken => :query, + :prefix => :query, + :startOffset => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/folders", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Folders{}]) + end + + @doc """ + Renames a source folder to a destination folder. Only applicable to buckets with hierarchical namespace enabled. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which the folders are in. + * `source_folder` (*type:* `String.t`) - Name of the source folder. + * `destination_folder` (*type:* `String.t`) - Name of the destination folder. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:ifSourceMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the source object's current metageneration matches the given value. + * `:ifSourceMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec storage_folders_rename( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_folders_rename( + connection, + bucket, + source_folder, + destination_folder, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :ifSourceMetagenerationMatch => :query, + :ifSourceMetagenerationNotMatch => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url( + "/storage/v1/b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}", + %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "sourceFolder" => URI.encode(source_folder, &URI.char_unreserved?/1), + "destinationFolder" => + URI.encode(destination_folder, &(URI.char_unreserved?(&1) || &1 == ?/)) + } + ) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}]) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/api/managed_folders.ex b/clients/storage/lib/google_api/storage/v1/api/managed_folders.ex new file mode 100644 index 0000000000..4221158313 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/api/managed_folders.ex @@ -0,0 +1,504 @@ +# 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.Storage.V1.Api.ManagedFolders do + @moduledoc """ + API calls for all endpoints tagged `ManagedFolders`. + """ + + alias GoogleApi.Storage.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Permanently deletes a managed folder. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `managed_folder` (*type:* `String.t`) - The managed folder name/path. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:ifMetagenerationMatch` (*type:* `String.t`) - If set, only deletes the managed folder if its metageneration matches this value. + * `:ifMetagenerationNotMatch` (*type:* `String.t`) - If set, only deletes the managed folder if its metageneration does not match this value. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_delete( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: {:ok, nil} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} + def storage_managed_folders_delete( + connection, + bucket, + managed_folder, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :ifMetagenerationMatch => :query, + :ifMetagenerationNotMatch => :query + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url("/storage/v1/b/{bucket}/managedFolders/{managedFolder}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "managedFolder" => URI.encode(managed_folder, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [decode: false]) + end + + @doc """ + Returns metadata of the specified managed folder. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `managed_folder` (*type:* `String.t`) - The managed folder name/path. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration matches the given value. + * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration does not match the given value. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.ManagedFolder{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_get( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.ManagedFolder.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_managed_folders_get( + connection, + bucket, + managed_folder, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :ifMetagenerationMatch => :query, + :ifMetagenerationNotMatch => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/managedFolders/{managedFolder}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "managedFolder" => URI.encode(managed_folder, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.ManagedFolder{}]) + end + + @doc """ + Returns an IAM policy for the specified managed folder. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `managed_folder` (*type:* `String.t`) - The managed folder name/path. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:optionsRequestedPolicyVersion` (*type:* `integer()`) - The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails. + * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.Policy{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_get_iam_policy( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.Policy.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_managed_folders_get_iam_policy( + connection, + bucket, + managed_folder, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :optionsRequestedPolicyVersion => :query, + :userProject => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/managedFolders/{managedFolder}/iam", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "managedFolder" => URI.encode(managed_folder, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Policy{}]) + end + + @doc """ + Creates a new managed folder. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:body` (*type:* `GoogleApi.Storage.V1.Model.ManagedFolder.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.ManagedFolder{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_insert(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.ManagedFolder.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_managed_folders_insert(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/managedFolders", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.ManagedFolder{}]) + end + + @doc """ + Lists managed folders in the given bucket. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:pageSize` (*type:* `integer()`) - Maximum number of items to return in a single page of responses. + * `:pageToken` (*type:* `String.t`) - A previously-returned page token representing part of the larger set of results to view. + * `:prefix` (*type:* `String.t`) - The managed folder name/path prefix to filter the output list of results. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.ManagedFolders{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.ManagedFolders.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_managed_folders_list(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :pageSize => :query, + :pageToken => :query, + :prefix => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/managedFolders", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.ManagedFolders{}]) + end + + @doc """ + Updates an IAM policy for the specified managed folder. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `managed_folder` (*type:* `String.t`) - The managed folder name/path. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. + * `:body` (*type:* `GoogleApi.Storage.V1.Model.Policy.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.Policy{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_set_iam_policy( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.Policy.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_managed_folders_set_iam_policy( + connection, + bucket, + managed_folder, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :userProject => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:put) + |> Request.url("/storage/v1/b/{bucket}/managedFolders/{managedFolder}/iam", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "managedFolder" => URI.encode(managed_folder, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Policy{}]) + end + + @doc """ + Tests a set of permissions on the given managed folder to see which, if any, are held by the caller. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket containing the managed folder. + * `managed_folder` (*type:* `String.t`) - The managed folder name/path. + * `permissions` (*type:* `list(String.t)`) - Permissions to test. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.TestIamPermissionsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec storage_managed_folders_test_iam_permissions( + Tesla.Env.client(), + String.t(), + String.t(), + list(String.t()), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.TestIamPermissionsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_managed_folders_test_iam_permissions( + connection, + bucket, + managed_folder, + permissions, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :userProject => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url( + "/storage/v1/b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions", + %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "managedFolder" => URI.encode(managed_folder, &URI.char_unreserved?/1) + } + ) + |> Request.add_param(:query, :permissions, permissions) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.TestIamPermissionsResponse{}]) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/api/object_access_controls.ex b/clients/storage/lib/google_api/storage/v1/api/object_access_controls.ex index 228f4f12e8..f105deb3d1 100644 --- a/clients/storage/lib/google_api/storage/v1/api/object_access_controls.ex +++ b/clients/storage/lib/google_api/storage/v1/api/object_access_controls.ex @@ -32,7 +32,7 @@ defmodule GoogleApi.Storage.V1.Api.ObjectAccessControls do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of a bucket. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `entity` (*type:* `String.t`) - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. @@ -104,7 +104,7 @@ defmodule GoogleApi.Storage.V1.Api.ObjectAccessControls do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of a bucket. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `entity` (*type:* `String.t`) - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. @@ -180,7 +180,7 @@ defmodule GoogleApi.Storage.V1.Api.ObjectAccessControls do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of a bucket. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -254,7 +254,7 @@ defmodule GoogleApi.Storage.V1.Api.ObjectAccessControls do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of a bucket. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -326,7 +326,7 @@ defmodule GoogleApi.Storage.V1.Api.ObjectAccessControls do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of a bucket. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `entity` (*type:* `String.t`) - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. @@ -404,7 +404,7 @@ defmodule GoogleApi.Storage.V1.Api.ObjectAccessControls do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of a bucket. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `entity` (*type:* `String.t`) - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. diff --git a/clients/storage/lib/google_api/storage/v1/api/objects.ex b/clients/storage/lib/google_api/storage/v1/api/objects.ex index c1d0a3debd..379bda81df 100644 --- a/clients/storage/lib/google_api/storage/v1/api/objects.ex +++ b/clients/storage/lib/google_api/storage/v1/api/objects.ex @@ -25,6 +25,62 @@ defmodule GoogleApi.Storage.V1.Api.Objects do @library_version Mix.Project.config() |> Keyword.get(:version, "") + @doc """ + Initiates a long-running bulk restore operation on the specified bucket. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:body` (*type:* `GoogleApi.Storage.V1.Model.BulkRestoreObjectsRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec storage_objects_bulk_restore(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_objects_bulk_restore(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/o/bulkRestore", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}]) + end + @doc """ Concatenates a list of existing objects into a new object in the same bucket. @@ -32,7 +88,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `destination_bucket` (*type:* `String.t`) - Name of the bucket containing the source objects. The destination object is stored in this bucket. - * `destination_object` (*type:* `String.t`) - Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `destination_object` (*type:* `String.t`) - Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -106,8 +162,8 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `source_bucket` (*type:* `String.t`) - Name of the bucket in which to find the source object. - * `source_object` (*type:* `String.t`) - Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * `destination_bucket` (*type:* `String.t`) - Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `source_object` (*type:* `String.t`) - Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). + * `destination_bucket` (*type:* `String.t`) - Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `destination_object` (*type:* `String.t`) - Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. @@ -213,7 +269,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -278,7 +334,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -294,6 +350,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl. + * `:softDeleted` (*type:* `boolean()`) - If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete. * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. * `opts` (*type:* `keyword()`) - Call options @@ -328,6 +385,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do :ifMetagenerationMatch => :query, :ifMetagenerationNotMatch => :query, :projection => :query, + :softDeleted => :query, :userProject => :query } @@ -353,7 +411,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -440,7 +498,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. * `:kmsKeyName` (*type:* `String.t`) - Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. - * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this object. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. @@ -519,7 +577,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. * `:kmsKeyName` (*type:* `String.t`) - Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. - * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this object. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. @@ -613,7 +671,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. * `:kmsKeyName` (*type:* `String.t`) - Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. - * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this object. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. @@ -701,7 +759,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. * `:kmsKeyName` (*type:* `String.t`) - Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. - * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `:name` (*type:* `String.t`) - Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this object. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. @@ -790,11 +848,14 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:delimiter` (*type:* `String.t`) - Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. * `:endOffset` (*type:* `String.t`) - Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). + * `:includeFoldersAsPrefixes` (*type:* `boolean()`) - Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes. * `:includeTrailingDelimiter` (*type:* `boolean()`) - If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes. + * `:matchGlob` (*type:* `String.t`) - Filter results to objects and prefixes that match this glob pattern. * `:maxResults` (*type:* `integer()`) - Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. * `:pageToken` (*type:* `String.t`) - A previously-returned page token representing part of the larger set of results to view. * `:prefix` (*type:* `String.t`) - Filter results to objects whose names begin with this prefix. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to noAcl. + * `:softDeleted` (*type:* `boolean()`) - If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete. * `:startOffset` (*type:* `String.t`) - Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive). * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. * `:versions` (*type:* `boolean()`) - If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. @@ -822,11 +883,14 @@ defmodule GoogleApi.Storage.V1.Api.Objects do :userIp => :query, :delimiter => :query, :endOffset => :query, + :includeFoldersAsPrefixes => :query, :includeTrailingDelimiter => :query, + :matchGlob => :query, :maxResults => :query, :pageToken => :query, :prefix => :query, :projection => :query, + :softDeleted => :query, :startOffset => :query, :userProject => :query, :versions => :query @@ -853,7 +917,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -868,6 +932,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifGenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. + * `:overrideUnlockedRetention` (*type:* `boolean()`) - Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked. * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this object. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to full. * `:userProject` (*type:* `String.t`) - The project to be billed for this request, for Requester Pays buckets. @@ -899,6 +964,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do :ifGenerationNotMatch => :query, :ifMetagenerationMatch => :query, :ifMetagenerationNotMatch => :query, + :overrideUnlockedRetention => :query, :predefinedAcl => :query, :projection => :query, :userProject => :query, @@ -920,6 +986,76 @@ defmodule GoogleApi.Storage.V1.Api.Objects do |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Object{}]) end + @doc """ + Restores a soft-deleted object. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:copySourceAcl` (*type:* `boolean()`) - If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false. + * `:ifGenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * `:ifGenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's one live metageneration matches the given value. + * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether none of the object's live metagenerations match the given value. + * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to full. + * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.Object{}}` on success + * `{:error, info}` on failure + """ + @spec storage_objects_restore(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.Object.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_objects_restore(connection, bucket, object, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :copySourceAcl => :query, + :ifGenerationMatch => :query, + :ifGenerationNotMatch => :query, + :ifMetagenerationMatch => :query, + :ifMetagenerationNotMatch => :query, + :projection => :query, + :userProject => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/o/{object}/restore", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "object" => URI.encode(object, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Object{}]) + end + @doc """ Rewrites a source object to a destination object. Optionally overrides metadata. @@ -927,9 +1063,9 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `source_bucket` (*type:* `String.t`) - Name of the bucket in which to find the source object. - * `source_object` (*type:* `String.t`) - Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `source_object` (*type:* `String.t`) - Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `destination_bucket` (*type:* `String.t`) - Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. - * `destination_object` (*type:* `String.t`) - Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `destination_object` (*type:* `String.t`) - Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -1038,7 +1174,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -1112,7 +1248,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `permissions` (*type:* `list(String.t)`) - Permissions to test. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. @@ -1188,7 +1324,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server * `bucket` (*type:* `String.t`) - Name of the bucket in which the object resides. - * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * `object` (*type:* `String.t`) - Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. @@ -1203,6 +1339,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do * `:ifGenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. * `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration matches the given value. * `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the operation conditional on whether the object's current metageneration does not match the given value. + * `:overrideUnlockedRetention` (*type:* `boolean()`) - Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked. * `:predefinedAcl` (*type:* `String.t`) - Apply a predefined set of access controls to this object. * `:projection` (*type:* `String.t`) - Set of properties to return. Defaults to full. * `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets. @@ -1234,6 +1371,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do :ifGenerationNotMatch => :query, :ifMetagenerationMatch => :query, :ifMetagenerationNotMatch => :query, + :overrideUnlockedRetention => :query, :predefinedAcl => :query, :projection => :query, :userProject => :query, diff --git a/clients/storage/lib/google_api/storage/v1/api/operations.ex b/clients/storage/lib/google_api/storage/v1/api/operations.ex new file mode 100644 index 0000000000..f52e9192d2 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/api/operations.ex @@ -0,0 +1,221 @@ +# 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.Storage.V1.Api.Operations do + @moduledoc """ + API calls for all endpoints tagged `Operations`. + """ + + alias GoogleApi.Storage.V1.Connection + alias GoogleApi.Gax.{Request, Response} + + @library_version Mix.Project.config() |> Keyword.get(:version, "") + + @doc """ + Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - The parent bucket of the operation resource. + * `operation_id` (*type:* `String.t`) - The ID of the operation resource. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %{}}` on success + * `{:error, info}` on failure + """ + @spec storage_buckets_operations_cancel( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: {:ok, nil} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} + def storage_buckets_operations_cancel( + connection, + bucket, + operation_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/storage/v1/b/{bucket}/operations/{operationId}/cancel", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "operationId" => URI.encode(operation_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [decode: false]) + end + + @doc """ + Gets the latest state of a long-running operation. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - The parent bucket of the operation resource. + * `operation_id` (*type:* `String.t`) - The ID of the operation resource. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}}` on success + * `{:error, info}` on failure + """ + @spec storage_buckets_operations_get( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_buckets_operations_get( + connection, + bucket, + operation_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/operations/{operationId}", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1), + "operationId" => URI.encode(operation_id, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningOperation{}]) + end + + @doc """ + Lists operations that match the specified filter in the request. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server + * `bucket` (*type:* `String.t`) - Name of the bucket in which to look for operations. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `: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. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. + * `:uploadType` (*type:* `String.t`) - Upload protocol for media (e.g. "media", "multipart", "resumable"). + * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. + * `:filter` (*type:* `String.t`) - A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160). + * `:pageSize` (*type:* `integer()`) - Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller. + * `:pageToken` (*type:* `String.t`) - A previously-returned page token representing part of the larger set of results to view. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Storage.V1.Model.GoogleLongrunningListOperationsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec storage_buckets_operations_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Storage.V1.Model.GoogleLongrunningListOperationsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def storage_buckets_operations_list(connection, bucket, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :alt => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :userIp => :query, + :filter => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/storage/v1/b/{bucket}/operations", %{ + "bucket" => URI.encode(bucket, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode( + opts ++ [struct: %GoogleApi.Storage.V1.Model.GoogleLongrunningListOperationsResponse{}] + ) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/metadata.ex b/clients/storage/lib/google_api/storage/v1/metadata.ex index 2b728b06dd..4ddab223c2 100644 --- a/clients/storage/lib/google_api/storage/v1/metadata.ex +++ b/clients/storage/lib/google_api/storage/v1/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.Storage.V1 do API client metadata for GoogleApi.Storage.V1. """ - @discovery_revision "20220705" + @discovery_revision "20240307" def discovery_revision(), do: @discovery_revision end diff --git a/clients/storage/lib/google_api/storage/v1/model/anywhere_cache.ex b/clients/storage/lib/google_api/storage/v1/model/anywhere_cache.ex new file mode 100644 index 0000000000..cd0369006e --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/anywhere_cache.ex @@ -0,0 +1,79 @@ +# 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.Storage.V1.Model.AnywhereCache do + @moduledoc """ + An Anywhere Cache instance. + + ## Attributes + + * `admissionPolicy` (*type:* `String.t`, *default:* `nil`) - The cache-level entry admission policy. + * `anywhereCacheId` (*type:* `String.t`, *default:* `nil`) - The ID of the Anywhere cache instance. + * `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this cache instance. + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the cache instance in RFC 3339 format. + * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the resource, including the project number, bucket name and anywhere cache ID. + * `kind` (*type:* `String.t`, *default:* `storage#anywhereCache`) - The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache. + * `pendingUpdate` (*type:* `boolean()`, *default:* `nil`) - True if the cache instance has an active Update long-running operation. + * `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this cache instance. + * `state` (*type:* `String.t`, *default:* `nil`) - The current state of the cache instance. + * `ttl` (*type:* `String.t`, *default:* `nil`) - The TTL of all cache entries in whole seconds. e.g., "7200s". + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The modification time of the cache instance metadata in RFC 3339 format. + * `zone` (*type:* `String.t`, *default:* `nil`) - The zone in which the cache instance is running. For example, us-central1-a. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :admissionPolicy => String.t() | nil, + :anywhereCacheId => String.t() | nil, + :bucket => String.t() | nil, + :createTime => DateTime.t() | nil, + :id => String.t() | nil, + :kind => String.t() | nil, + :pendingUpdate => boolean() | nil, + :selfLink => String.t() | nil, + :state => String.t() | nil, + :ttl => String.t() | nil, + :updateTime => DateTime.t() | nil, + :zone => String.t() | nil + } + + field(:admissionPolicy) + field(:anywhereCacheId) + field(:bucket) + field(:createTime, as: DateTime) + field(:id) + field(:kind) + field(:pendingUpdate) + field(:selfLink) + field(:state) + field(:ttl) + field(:updateTime, as: DateTime) + field(:zone) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.AnywhereCache do + def decode(value, options) do + GoogleApi.Storage.V1.Model.AnywhereCache.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.AnywhereCache do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/anywhere_caches.ex b/clients/storage/lib/google_api/storage/v1/model/anywhere_caches.ex new file mode 100644 index 0000000000..f2648d2bb5 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/anywhere_caches.ex @@ -0,0 +1,52 @@ +# 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.Storage.V1.Model.AnywhereCaches do + @moduledoc """ + A list of Anywhere Caches. + + ## Attributes + + * `items` (*type:* `list(GoogleApi.Storage.V1.Model.AnywhereCache.t)`, *default:* `nil`) - The list of items. + * `kind` (*type:* `String.t`, *default:* `storage#anywhereCaches`) - The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :items => list(GoogleApi.Storage.V1.Model.AnywhereCache.t()) | nil, + :kind => String.t() | nil, + :nextPageToken => String.t() | nil + } + + field(:items, as: GoogleApi.Storage.V1.Model.AnywhereCache, type: :list) + field(:kind) + field(:nextPageToken) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.AnywhereCaches do + def decode(value, options) do + GoogleApi.Storage.V1.Model.AnywhereCaches.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.AnywhereCaches do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/bucket.ex b/clients/storage/lib/google_api/storage/v1/model/bucket.ex index 978a58c46b..c90df7c2d8 100644 --- a/clients/storage/lib/google_api/storage/v1/model/bucket.ex +++ b/clients/storage/lib/google_api/storage/v1/model/bucket.ex @@ -21,104 +21,114 @@ defmodule GoogleApi.Storage.V1.Model.Bucket do ## Attributes - * `acl` (*type:* `list(GoogleApi.Storage.V1.Model.BucketAccessControl.t)`, *default:* `nil`) - Access controls on the bucket. + * `iamConfiguration` (*type:* `GoogleApi.Storage.V1.Model.BucketIamConfiguration.t`, *default:* `nil`) - The bucket's IAM configuration. * `autoclass` (*type:* `GoogleApi.Storage.V1.Model.BucketAutoclass.t`, *default:* `nil`) - The bucket's Autoclass configuration. - * `billing` (*type:* `GoogleApi.Storage.V1.Model.BucketBilling.t`, *default:* `nil`) - The bucket's billing configuration. - * `cors` (*type:* `list(GoogleApi.Storage.V1.Model.BucketCors.t)`, *default:* `nil`) - The bucket's Cross-Origin Resource Sharing (CORS) configuration. - * `customPlacementConfig` (*type:* `GoogleApi.Storage.V1.Model.BucketCustomPlacementConfig.t`, *default:* `nil`) - The bucket's custom placement configuration for Custom Dual Regions. - * `defaultEventBasedHold` (*type:* `boolean()`, *default:* `nil`) - The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed. - * `defaultObjectAcl` (*type:* `list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t)`, *default:* `nil`) - Default access controls to apply to new objects when no ACL is provided. - * `encryption` (*type:* `GoogleApi.Storage.V1.Model.BucketEncryption.t`, *default:* `nil`) - Encryption configuration for a bucket. * `etag` (*type:* `String.t`, *default:* `nil`) - HTTP 1.1 Entity tag for the bucket. - * `iamConfiguration` (*type:* `GoogleApi.Storage.V1.Model.BucketIamConfiguration.t`, *default:* `nil`) - The bucket's IAM configuration. - * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the bucket. For buckets, the id and name properties are the same. - * `kind` (*type:* `String.t`, *default:* `storage#bucket`) - The kind of item this is. For buckets, this is always storage#bucket. - * `labels` (*type:* `map()`, *default:* `nil`) - User-provided labels, in key/value pairs. + * `timeCreated` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the bucket in RFC 3339 format. + * `projectNumber` (*type:* `String.t`, *default:* `nil`) - The project number of the project the bucket belongs to. + * `website` (*type:* `GoogleApi.Storage.V1.Model.BucketWebsite.t`, *default:* `nil`) - The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. * `lifecycle` (*type:* `GoogleApi.Storage.V1.Model.BucketLifecycle.t`, *default:* `nil`) - The bucket's lifecycle configuration. See lifecycle management for more information. - * `location` (*type:* `String.t`, *default:* `nil`) - The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list. - * `locationType` (*type:* `String.t`, *default:* `nil`) - The type of the bucket location. - * `logging` (*type:* `GoogleApi.Storage.V1.Model.BucketLogging.t`, *default:* `nil`) - The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. - * `metageneration` (*type:* `String.t`, *default:* `nil`) - The metadata generation of this bucket. + * `storageClass` (*type:* `String.t`, *default:* `nil`) - The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. + * `kind` (*type:* `String.t`, *default:* `storage#bucket`) - The kind of item this is. For buckets, this is always storage#bucket. + * `defaultEventBasedHold` (*type:* `boolean()`, *default:* `nil`) - The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed. + * `cors` (*type:* `list(GoogleApi.Storage.V1.Model.BucketCors.t)`, *default:* `nil`) - The bucket's Cross-Origin Resource Sharing (CORS) configuration. + * `rpo` (*type:* `String.t`, *default:* `nil`) - The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket. * `name` (*type:* `String.t`, *default:* `nil`) - The name of the bucket. + * `location` (*type:* `String.t`, *default:* `nil`) - The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list. + * `customPlacementConfig` (*type:* `GoogleApi.Storage.V1.Model.BucketCustomPlacementConfig.t`, *default:* `nil`) - The bucket's custom placement configuration for Custom Dual Regions. + * `encryption` (*type:* `GoogleApi.Storage.V1.Model.BucketEncryption.t`, *default:* `nil`) - Encryption configuration for a bucket. * `owner` (*type:* `GoogleApi.Storage.V1.Model.BucketOwner.t`, *default:* `nil`) - The owner of the bucket. This is always the project team's owner group. - * `projectNumber` (*type:* `String.t`, *default:* `nil`) - The project number of the project the bucket belongs to. + * `softDeletePolicy` (*type:* `GoogleApi.Storage.V1.Model.BucketSoftDeletePolicy.t`, *default:* `nil`) - The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. + * `logging` (*type:* `GoogleApi.Storage.V1.Model.BucketLogging.t`, *default:* `nil`) - The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. * `retentionPolicy` (*type:* `GoogleApi.Storage.V1.Model.BucketRetentionPolicy.t`, *default:* `nil`) - The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error. - * `rpo` (*type:* `String.t`, *default:* `nil`) - The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket. + * `versioning` (*type:* `GoogleApi.Storage.V1.Model.BucketVersioning.t`, *default:* `nil`) - The bucket's versioning configuration. + * `defaultObjectAcl` (*type:* `list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t)`, *default:* `nil`) - Default access controls to apply to new objects when no ACL is provided. + * `locationType` (*type:* `String.t`, *default:* `nil`) - The type of the bucket location. + * `acl` (*type:* `list(GoogleApi.Storage.V1.Model.BucketAccessControl.t)`, *default:* `nil`) - Access controls on the bucket. + * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the bucket. For buckets, the id and name properties are the same. + * `objectRetention` (*type:* `GoogleApi.Storage.V1.Model.BucketObjectRetention.t`, *default:* `nil`) - The bucket's object retention config. * `satisfiesPZS` (*type:* `boolean()`, *default:* `nil`) - Reserved for future use. - * `selfLink` (*type:* `String.t`, *default:* `nil`) - The URI of this bucket. - * `storageClass` (*type:* `String.t`, *default:* `nil`) - The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. - * `timeCreated` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the bucket in RFC 3339 format. * `updated` (*type:* `DateTime.t`, *default:* `nil`) - The modification time of the bucket in RFC 3339 format. - * `versioning` (*type:* `GoogleApi.Storage.V1.Model.BucketVersioning.t`, *default:* `nil`) - The bucket's versioning configuration. - * `website` (*type:* `GoogleApi.Storage.V1.Model.BucketWebsite.t`, *default:* `nil`) - The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. + * `labels` (*type:* `map()`, *default:* `nil`) - User-provided labels, in key/value pairs. + * `hierarchicalNamespace` (*type:* `GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace.t`, *default:* `nil`) - The bucket's hierarchical namespace configuration. + * `selfLink` (*type:* `String.t`, *default:* `nil`) - The URI of this bucket. + * `metageneration` (*type:* `String.t`, *default:* `nil`) - The metadata generation of this bucket. + * `billing` (*type:* `GoogleApi.Storage.V1.Model.BucketBilling.t`, *default:* `nil`) - The bucket's billing configuration. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ - :acl => list(GoogleApi.Storage.V1.Model.BucketAccessControl.t()) | nil, + :iamConfiguration => GoogleApi.Storage.V1.Model.BucketIamConfiguration.t() | nil, :autoclass => GoogleApi.Storage.V1.Model.BucketAutoclass.t() | nil, - :billing => GoogleApi.Storage.V1.Model.BucketBilling.t() | nil, + :etag => String.t() | nil, + :timeCreated => DateTime.t() | nil, + :projectNumber => String.t() | nil, + :website => GoogleApi.Storage.V1.Model.BucketWebsite.t() | nil, + :lifecycle => GoogleApi.Storage.V1.Model.BucketLifecycle.t() | nil, + :storageClass => String.t() | nil, + :kind => String.t() | nil, + :defaultEventBasedHold => boolean() | nil, :cors => list(GoogleApi.Storage.V1.Model.BucketCors.t()) | nil, + :rpo => String.t() | nil, + :name => String.t() | nil, + :location => String.t() | nil, :customPlacementConfig => GoogleApi.Storage.V1.Model.BucketCustomPlacementConfig.t() | nil, - :defaultEventBasedHold => boolean() | nil, - :defaultObjectAcl => list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t()) | nil, :encryption => GoogleApi.Storage.V1.Model.BucketEncryption.t() | nil, - :etag => String.t() | nil, - :iamConfiguration => GoogleApi.Storage.V1.Model.BucketIamConfiguration.t() | nil, - :id => String.t() | nil, - :kind => String.t() | nil, - :labels => map() | nil, - :lifecycle => GoogleApi.Storage.V1.Model.BucketLifecycle.t() | nil, - :location => String.t() | nil, - :locationType => String.t() | nil, - :logging => GoogleApi.Storage.V1.Model.BucketLogging.t() | nil, - :metageneration => String.t() | nil, - :name => String.t() | nil, :owner => GoogleApi.Storage.V1.Model.BucketOwner.t() | nil, - :projectNumber => String.t() | nil, + :softDeletePolicy => GoogleApi.Storage.V1.Model.BucketSoftDeletePolicy.t() | nil, + :logging => GoogleApi.Storage.V1.Model.BucketLogging.t() | nil, :retentionPolicy => GoogleApi.Storage.V1.Model.BucketRetentionPolicy.t() | nil, - :rpo => String.t() | nil, + :versioning => GoogleApi.Storage.V1.Model.BucketVersioning.t() | nil, + :defaultObjectAcl => list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t()) | nil, + :locationType => String.t() | nil, + :acl => list(GoogleApi.Storage.V1.Model.BucketAccessControl.t()) | nil, + :id => String.t() | nil, + :objectRetention => GoogleApi.Storage.V1.Model.BucketObjectRetention.t() | nil, :satisfiesPZS => boolean() | nil, - :selfLink => String.t() | nil, - :storageClass => String.t() | nil, - :timeCreated => DateTime.t() | nil, :updated => DateTime.t() | nil, - :versioning => GoogleApi.Storage.V1.Model.BucketVersioning.t() | nil, - :website => GoogleApi.Storage.V1.Model.BucketWebsite.t() | nil + :labels => map() | nil, + :hierarchicalNamespace => + GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace.t() | nil, + :selfLink => String.t() | nil, + :metageneration => String.t() | nil, + :billing => GoogleApi.Storage.V1.Model.BucketBilling.t() | nil } - field(:acl, as: GoogleApi.Storage.V1.Model.BucketAccessControl, type: :list) + field(:iamConfiguration, as: GoogleApi.Storage.V1.Model.BucketIamConfiguration) field(:autoclass, as: GoogleApi.Storage.V1.Model.BucketAutoclass) - field(:billing, as: GoogleApi.Storage.V1.Model.BucketBilling) - field(:cors, as: GoogleApi.Storage.V1.Model.BucketCors, type: :list) - field(:customPlacementConfig, as: GoogleApi.Storage.V1.Model.BucketCustomPlacementConfig) - field(:defaultEventBasedHold) - field(:defaultObjectAcl, as: GoogleApi.Storage.V1.Model.ObjectAccessControl, type: :list) - field(:encryption, as: GoogleApi.Storage.V1.Model.BucketEncryption) field(:etag) - field(:iamConfiguration, as: GoogleApi.Storage.V1.Model.BucketIamConfiguration) - field(:id) - field(:kind) - field(:labels, type: :map) + field(:timeCreated, as: DateTime) + field(:projectNumber) + field(:website, as: GoogleApi.Storage.V1.Model.BucketWebsite) field(:lifecycle, as: GoogleApi.Storage.V1.Model.BucketLifecycle) - field(:location) - field(:locationType) - field(:logging, as: GoogleApi.Storage.V1.Model.BucketLogging) - field(:metageneration) + field(:storageClass) + field(:kind) + field(:defaultEventBasedHold) + field(:cors, as: GoogleApi.Storage.V1.Model.BucketCors, type: :list) + field(:rpo) field(:name) + field(:location) + field(:customPlacementConfig, as: GoogleApi.Storage.V1.Model.BucketCustomPlacementConfig) + field(:encryption, as: GoogleApi.Storage.V1.Model.BucketEncryption) field(:owner, as: GoogleApi.Storage.V1.Model.BucketOwner) - field(:projectNumber) + field(:softDeletePolicy, as: GoogleApi.Storage.V1.Model.BucketSoftDeletePolicy) + field(:logging, as: GoogleApi.Storage.V1.Model.BucketLogging) field(:retentionPolicy, as: GoogleApi.Storage.V1.Model.BucketRetentionPolicy) - field(:rpo) + field(:versioning, as: GoogleApi.Storage.V1.Model.BucketVersioning) + field(:defaultObjectAcl, as: GoogleApi.Storage.V1.Model.ObjectAccessControl, type: :list) + field(:locationType) + field(:acl, as: GoogleApi.Storage.V1.Model.BucketAccessControl, type: :list) + field(:id) + field(:objectRetention, as: GoogleApi.Storage.V1.Model.BucketObjectRetention) field(:satisfiesPZS) - field(:selfLink) - field(:storageClass) - field(:timeCreated, as: DateTime) field(:updated, as: DateTime) - field(:versioning, as: GoogleApi.Storage.V1.Model.BucketVersioning) - field(:website, as: GoogleApi.Storage.V1.Model.BucketWebsite) + field(:labels, type: :map) + field(:hierarchicalNamespace, as: GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace) + field(:selfLink) + field(:metageneration) + field(:billing, as: GoogleApi.Storage.V1.Model.BucketBilling) end defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.Bucket do diff --git a/clients/storage/lib/google_api/storage/v1/model/bucket_autoclass.ex b/clients/storage/lib/google_api/storage/v1/model/bucket_autoclass.ex index 2eb15feb99..f4c8f90536 100644 --- a/clients/storage/lib/google_api/storage/v1/model/bucket_autoclass.ex +++ b/clients/storage/lib/google_api/storage/v1/model/bucket_autoclass.ex @@ -22,6 +22,8 @@ defmodule GoogleApi.Storage.V1.Model.BucketAutoclass do ## Attributes * `enabled` (*type:* `boolean()`, *default:* `nil`) - Whether or not Autoclass is enabled on this bucket + * `terminalStorageClass` (*type:* `String.t`, *default:* `nil`) - The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE. + * `terminalStorageClassUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - A date and time in RFC 3339 format representing the time of the most recent update to "terminalStorageClass". * `toggleTime` (*type:* `DateTime.t`, *default:* `nil`) - A date and time in RFC 3339 format representing the instant at which "enabled" was last toggled. """ @@ -29,10 +31,14 @@ defmodule GoogleApi.Storage.V1.Model.BucketAutoclass do @type t :: %__MODULE__{ :enabled => boolean() | nil, + :terminalStorageClass => String.t() | nil, + :terminalStorageClassUpdateTime => DateTime.t() | nil, :toggleTime => DateTime.t() | nil } field(:enabled) + field(:terminalStorageClass) + field(:terminalStorageClassUpdateTime, as: DateTime) field(:toggleTime, as: DateTime) end diff --git a/clients/storage/lib/google_api/storage/v1/model/bucket_hierarchical_namespace.ex b/clients/storage/lib/google_api/storage/v1/model/bucket_hierarchical_namespace.ex new file mode 100644 index 0000000000..74257d434a --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/bucket_hierarchical_namespace.ex @@ -0,0 +1,46 @@ +# 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.Storage.V1.Model.BucketHierarchicalNamespace do + @moduledoc """ + The bucket's hierarchical namespace configuration. + + ## Attributes + + * `enabled` (*type:* `boolean()`, *default:* `nil`) - When set to true, hierarchical namespace is enabled for this bucket. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :enabled => boolean() | nil + } + + field(:enabled) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace do + def decode(value, options) do + GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/bucket_object_retention.ex b/clients/storage/lib/google_api/storage/v1/model/bucket_object_retention.ex new file mode 100644 index 0000000000..ac3d64aa0d --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/bucket_object_retention.ex @@ -0,0 +1,46 @@ +# 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.Storage.V1.Model.BucketObjectRetention do + @moduledoc """ + The bucket's object retention config. + + ## Attributes + + * `mode` (*type:* `String.t`, *default:* `nil`) - The bucket's object retention mode. Can be Enabled. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :mode => String.t() | nil + } + + field(:mode) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.BucketObjectRetention do + def decode(value, options) do + GoogleApi.Storage.V1.Model.BucketObjectRetention.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.BucketObjectRetention do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/bucket_soft_delete_policy.ex b/clients/storage/lib/google_api/storage/v1/model/bucket_soft_delete_policy.ex new file mode 100644 index 0000000000..87084f8013 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/bucket_soft_delete_policy.ex @@ -0,0 +1,49 @@ +# 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.Storage.V1.Model.BucketSoftDeletePolicy do + @moduledoc """ + The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. + + ## Attributes + + * `effectiveTime` (*type:* `DateTime.t`, *default:* `nil`) - Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format. + * `retentionDurationSeconds` (*type:* `String.t`, *default:* `nil`) - The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :effectiveTime => DateTime.t() | nil, + :retentionDurationSeconds => String.t() | nil + } + + field(:effectiveTime, as: DateTime) + field(:retentionDurationSeconds) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.BucketSoftDeletePolicy do + def decode(value, options) do + GoogleApi.Storage.V1.Model.BucketSoftDeletePolicy.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.BucketSoftDeletePolicy do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/bulk_restore_objects_request.ex b/clients/storage/lib/google_api/storage/v1/model/bulk_restore_objects_request.ex new file mode 100644 index 0000000000..765f5e9152 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/bulk_restore_objects_request.ex @@ -0,0 +1,58 @@ +# 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.Storage.V1.Model.BulkRestoreObjectsRequest do + @moduledoc """ + A bulk restore objects request. + + ## Attributes + + * `allowOverwrite` (*type:* `boolean()`, *default:* `nil`) - If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue. + * `copySourceAcl` (*type:* `boolean()`, *default:* `nil`) - If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false. + * `matchGlobs` (*type:* `list(String.t)`, *default:* `nil`) - Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range. + * `softDeletedAfterTime` (*type:* `DateTime.t`, *default:* `nil`) - Restores only the objects that were soft-deleted after this time. + * `softDeletedBeforeTime` (*type:* `DateTime.t`, *default:* `nil`) - Restores only the objects that were soft-deleted before this time. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :allowOverwrite => boolean() | nil, + :copySourceAcl => boolean() | nil, + :matchGlobs => list(String.t()) | nil, + :softDeletedAfterTime => DateTime.t() | nil, + :softDeletedBeforeTime => DateTime.t() | nil + } + + field(:allowOverwrite) + field(:copySourceAcl) + field(:matchGlobs, type: :list) + field(:softDeletedAfterTime, as: DateTime) + field(:softDeletedBeforeTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.BulkRestoreObjectsRequest do + def decode(value, options) do + GoogleApi.Storage.V1.Model.BulkRestoreObjectsRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.BulkRestoreObjectsRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/folder.ex b/clients/storage/lib/google_api/storage/v1/model/folder.ex new file mode 100644 index 0000000000..a7b8b91b14 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/folder.ex @@ -0,0 +1,70 @@ +# 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.Storage.V1.Model.Folder do + @moduledoc """ + A folder. Only available in buckets with hierarchical namespace enabled. + + ## Attributes + + * `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this folder. + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the folder in RFC 3339 format. + * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the folder, including the bucket name, folder name. + * `kind` (*type:* `String.t`, *default:* `storage#folder`) - The kind of item this is. For folders, this is always storage#folder. + * `metageneration` (*type:* `String.t`, *default:* `nil`) - The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata. + * `name` (*type:* `String.t`, *default:* `nil`) - The name of the folder. Required if not specified by URL parameter. + * `pendingRenameInfo` (*type:* `GoogleApi.Storage.V1.Model.FolderPendingRenameInfo.t`, *default:* `nil`) - Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status. + * `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this folder. + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The modification time of the folder metadata in RFC 3339 format. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :bucket => String.t() | nil, + :createTime => DateTime.t() | nil, + :id => String.t() | nil, + :kind => String.t() | nil, + :metageneration => String.t() | nil, + :name => String.t() | nil, + :pendingRenameInfo => GoogleApi.Storage.V1.Model.FolderPendingRenameInfo.t() | nil, + :selfLink => String.t() | nil, + :updateTime => DateTime.t() | nil + } + + field(:bucket) + field(:createTime, as: DateTime) + field(:id) + field(:kind) + field(:metageneration) + field(:name) + field(:pendingRenameInfo, as: GoogleApi.Storage.V1.Model.FolderPendingRenameInfo) + field(:selfLink) + field(:updateTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.Folder do + def decode(value, options) do + GoogleApi.Storage.V1.Model.Folder.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.Folder do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/folder_pending_rename_info.ex b/clients/storage/lib/google_api/storage/v1/model/folder_pending_rename_info.ex new file mode 100644 index 0000000000..31dfe4ee17 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/folder_pending_rename_info.ex @@ -0,0 +1,46 @@ +# 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.Storage.V1.Model.FolderPendingRenameInfo do + @moduledoc """ + Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status. + + ## Attributes + + * `operationId` (*type:* `String.t`, *default:* `nil`) - The ID of the rename folder operation. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :operationId => String.t() | nil + } + + field(:operationId) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.FolderPendingRenameInfo do + def decode(value, options) do + GoogleApi.Storage.V1.Model.FolderPendingRenameInfo.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.FolderPendingRenameInfo do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/folders.ex b/clients/storage/lib/google_api/storage/v1/model/folders.ex new file mode 100644 index 0000000000..b80bebd967 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/folders.ex @@ -0,0 +1,52 @@ +# 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.Storage.V1.Model.Folders do + @moduledoc """ + A list of folders. + + ## Attributes + + * `items` (*type:* `list(GoogleApi.Storage.V1.Model.Folder.t)`, *default:* `nil`) - The list of items. + * `kind` (*type:* `String.t`, *default:* `storage#folders`) - The kind of item this is. For lists of folders, this is always storage#folders. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :items => list(GoogleApi.Storage.V1.Model.Folder.t()) | nil, + :kind => String.t() | nil, + :nextPageToken => String.t() | nil + } + + field(:items, as: GoogleApi.Storage.V1.Model.Folder, type: :list) + field(:kind) + field(:nextPageToken) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.Folders do + def decode(value, options) do + GoogleApi.Storage.V1.Model.Folders.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.Folders do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/google_longrunning_list_operations_response.ex b/clients/storage/lib/google_api/storage/v1/model/google_longrunning_list_operations_response.ex new file mode 100644 index 0000000000..5a965e110d --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/google_longrunning_list_operations_response.ex @@ -0,0 +1,49 @@ +# 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.Storage.V1.Model.GoogleLongrunningListOperationsResponse do + @moduledoc """ + The response message for storage.buckets.operations.list. + + ## Attributes + + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + * `operations` (*type:* `list(GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t)`, *default:* `nil`) - A list of operations that matches the specified filter in the request. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :nextPageToken => String.t() | nil, + :operations => list(GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.t()) | nil + } + + field(:nextPageToken) + field(:operations, as: GoogleApi.Storage.V1.Model.GoogleLongrunningOperation, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.GoogleLongrunningListOperationsResponse do + def decode(value, options) do + GoogleApi.Storage.V1.Model.GoogleLongrunningListOperationsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.GoogleLongrunningListOperationsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/google_longrunning_operation.ex b/clients/storage/lib/google_api/storage/v1/model/google_longrunning_operation.ex new file mode 100644 index 0000000000..485a3cd7ed --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/google_longrunning_operation.ex @@ -0,0 +1,58 @@ +# 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.Storage.V1.Model.GoogleLongrunningOperation do + @moduledoc """ + This resource represents a long-running operation that is the result of a network API call. + + ## Attributes + + * `done` (*type:* `boolean()`, *default:* `nil`) - If the value is "false", it means the operation is still in progress. If "true", the operation is completed, and either "error" or "response" is available. + * `error` (*type:* `GoogleApi.Storage.V1.Model.GoogleRpcStatus.t`, *default:* `nil`) - The error result of the operation in case of failure or cancellation. + * `metadata` (*type:* `map()`, *default:* `nil`) - Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + * `name` (*type:* `String.t`, *default:* `nil`) - The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the "name" should be a resource name ending with "operations/{operationId}". + * `response` (*type:* `map()`, *default:* `nil`) - The normal response of the operation in case of success. If the original method returns no data on success, such as "Delete", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type "XxxResponse", where "Xxx" is the original method name. For example, if the original method name is "TakeSnapshot()", the inferred response type is "TakeSnapshotResponse". + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :done => boolean() | nil, + :error => GoogleApi.Storage.V1.Model.GoogleRpcStatus.t() | nil, + :metadata => map() | nil, + :name => String.t() | nil, + :response => map() | nil + } + + field(:done) + field(:error, as: GoogleApi.Storage.V1.Model.GoogleRpcStatus) + field(:metadata, type: :map) + field(:name) + field(:response, type: :map) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.GoogleLongrunningOperation do + def decode(value, options) do + GoogleApi.Storage.V1.Model.GoogleLongrunningOperation.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.GoogleLongrunningOperation do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/google_rpc_status.ex b/clients/storage/lib/google_api/storage/v1/model/google_rpc_status.ex new file mode 100644 index 0000000000..bcda8e6978 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/google_rpc_status.ex @@ -0,0 +1,52 @@ +# 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.Storage.V1.Model.GoogleRpcStatus do + @moduledoc """ + The "Status" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each "Status" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + + ## Attributes + + * `code` (*type:* `integer()`, *default:* `nil`) - The status code, which should be an enum value of google.rpc.Code. + * `details` (*type:* `list(map())`, *default:* `nil`) - A list of messages that carry the error details. There is a common set of message types for APIs to use. + * `message` (*type:* `String.t`, *default:* `nil`) - A developer-facing error message, which should be in English. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :code => integer() | nil, + :details => list(map()) | nil, + :message => String.t() | nil + } + + field(:code) + field(:details, type: :list) + field(:message) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.GoogleRpcStatus do + def decode(value, options) do + GoogleApi.Storage.V1.Model.GoogleRpcStatus.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.GoogleRpcStatus do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/managed_folder.ex b/clients/storage/lib/google_api/storage/v1/model/managed_folder.ex new file mode 100644 index 0000000000..c598f4756c --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/managed_folder.ex @@ -0,0 +1,67 @@ +# 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.Storage.V1.Model.ManagedFolder do + @moduledoc """ + A managed folder. + + ## Attributes + + * `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this managed folder. + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the managed folder in RFC 3339 format. + * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the managed folder, including the bucket name and managed folder name. + * `kind` (*type:* `String.t`, *default:* `storage#managedFolder`) - The kind of item this is. For managed folders, this is always storage#managedFolder. + * `metageneration` (*type:* `String.t`, *default:* `nil`) - The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata. + * `name` (*type:* `String.t`, *default:* `nil`) - The name of the managed folder. Required if not specified by URL parameter. + * `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this managed folder. + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - The last update time of the managed folder metadata in RFC 3339 format. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :bucket => String.t() | nil, + :createTime => DateTime.t() | nil, + :id => String.t() | nil, + :kind => String.t() | nil, + :metageneration => String.t() | nil, + :name => String.t() | nil, + :selfLink => String.t() | nil, + :updateTime => DateTime.t() | nil + } + + field(:bucket) + field(:createTime, as: DateTime) + field(:id) + field(:kind) + field(:metageneration) + field(:name) + field(:selfLink) + field(:updateTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.ManagedFolder do + def decode(value, options) do + GoogleApi.Storage.V1.Model.ManagedFolder.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.ManagedFolder do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/managed_folders.ex b/clients/storage/lib/google_api/storage/v1/model/managed_folders.ex new file mode 100644 index 0000000000..4da08779be --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/managed_folders.ex @@ -0,0 +1,52 @@ +# 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.Storage.V1.Model.ManagedFolders do + @moduledoc """ + A list of managed folders. + + ## Attributes + + * `items` (*type:* `list(GoogleApi.Storage.V1.Model.ManagedFolder.t)`, *default:* `nil`) - The list of items. + * `kind` (*type:* `String.t`, *default:* `storage#managedFolders`) - The kind of item this is. For lists of managed folders, this is always storage#managedFolders. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :items => list(GoogleApi.Storage.V1.Model.ManagedFolder.t()) | nil, + :kind => String.t() | nil, + :nextPageToken => String.t() | nil + } + + field(:items, as: GoogleApi.Storage.V1.Model.ManagedFolder, type: :list) + field(:kind) + field(:nextPageToken) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.ManagedFolders do + def decode(value, options) do + GoogleApi.Storage.V1.Model.ManagedFolders.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.ManagedFolders do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/object.ex b/clients/storage/lib/google_api/storage/v1/model/object.ex index b7f157f5f1..2c5d9535fd 100644 --- a/clients/storage/lib/google_api/storage/v1/model/object.ex +++ b/clients/storage/lib/google_api/storage/v1/model/object.ex @@ -21,109 +21,118 @@ defmodule GoogleApi.Storage.V1.Model.Object do ## Attributes - * `acl` (*type:* `list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t)`, *default:* `nil`) - Access controls on the object. - * `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this object. - * `cacheControl` (*type:* `String.t`, *default:* `nil`) - Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. - * `componentCount` (*type:* `integer()`, *default:* `nil`) - Number of underlying components that make up this object. Components are accumulated by compose operations. - * `contentDisposition` (*type:* `String.t`, *default:* `nil`) - Content-Disposition of the object data. - * `contentEncoding` (*type:* `String.t`, *default:* `nil`) - Content-Encoding of the object data. - * `contentLanguage` (*type:* `String.t`, *default:* `nil`) - Content-Language of the object data. - * `contentType` (*type:* `String.t`, *default:* `nil`) - Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. - * `crc32c` (*type:* `String.t`, *default:* `nil`) - CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices. - * `customTime` (*type:* `DateTime.t`, *default:* `nil`) - A timestamp in RFC 3339 format specified by the user for an object. - * `customerEncryption` (*type:* `GoogleApi.Storage.V1.Model.ObjectCustomerEncryption.t`, *default:* `nil`) - Metadata of customer-supplied encryption key, if the object is encrypted by such a key. - * `etag` (*type:* `String.t`, *default:* `nil`) - HTTP 1.1 Entity tag for the object. * `eventBasedHold` (*type:* `boolean()`, *default:* `nil`) - Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. - * `generation` (*type:* `String.t`, *default:* `nil`) - The content generation of this object. Used for object versioning. - * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the object, including the bucket name, object name, and generation number. - * `kind` (*type:* `String.t`, *default:* `storage#object`) - The kind of item this is. For objects, this is always storage#object. - * `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. - * `md5Hash` (*type:* `String.t`, *default:* `nil`) - MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. + * `etag` (*type:* `String.t`, *default:* `nil`) - HTTP 1.1 Entity tag for the object. + * `hardDeleteTime` (*type:* `DateTime.t`, *default:* `nil`) - This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket. + * `size` (*type:* `String.t`, *default:* `nil`) - Content-Length of the data in bytes. + * `contentEncoding` (*type:* `String.t`, *default:* `nil`) - Content-Encoding of the object data. + * `timeCreated` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the object in RFC 3339 format. * `mediaLink` (*type:* `String.t`, *default:* `nil`) - Media download link. + * `temporaryHold` (*type:* `boolean()`, *default:* `nil`) - Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object. * `metadata` (*type:* `map()`, *default:* `nil`) - User-provided metadata, in key/value pairs. - * `metageneration` (*type:* `String.t`, *default:* `nil`) - The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. + * `storageClass` (*type:* `String.t`, *default:* `nil`) - Storage class of the object. + * `generation` (*type:* `String.t`, *default:* `nil`) - The content generation of this object. Used for object versioning. + * `kind` (*type:* `String.t`, *default:* `storage#object`) - The kind of item this is. For objects, this is always storage#object. + * `componentCount` (*type:* `integer()`, *default:* `nil`) - Number of underlying components that make up this object. Components are accumulated by compose operations. + * `cacheControl` (*type:* `String.t`, *default:* `nil`) - Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. * `name` (*type:* `String.t`, *default:* `nil`) - The name of the object. Required if not specified by URL parameter. + * `contentDisposition` (*type:* `String.t`, *default:* `nil`) - Content-Disposition of the object data. * `owner` (*type:* `GoogleApi.Storage.V1.Model.ObjectOwner.t`, *default:* `nil`) - The owner of the object. This will always be the uploader of the object. - * `retentionExpirationTime` (*type:* `DateTime.t`, *default:* `nil`) - A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold). - * `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this object. - * `size` (*type:* `String.t`, *default:* `nil`) - Content-Length of the data in bytes. - * `storageClass` (*type:* `String.t`, *default:* `nil`) - Storage class of the object. - * `temporaryHold` (*type:* `boolean()`, *default:* `nil`) - Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object. - * `timeCreated` (*type:* `DateTime.t`, *default:* `nil`) - The creation time of the object in RFC 3339 format. - * `timeDeleted` (*type:* `DateTime.t`, *default:* `nil`) - The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. + * `softDeleteTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the object became soft-deleted in RFC 3339 format. + * `contentType` (*type:* `String.t`, *default:* `nil`) - Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. * `timeStorageClassUpdated` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. + * `timeDeleted` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. + * `acl` (*type:* `list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t)`, *default:* `nil`) - Access controls on the object. + * `retentionExpirationTime` (*type:* `DateTime.t`, *default:* `nil`) - A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold). + * `bucket` (*type:* `String.t`, *default:* `nil`) - The name of the bucket containing this object. + * `id` (*type:* `String.t`, *default:* `nil`) - The ID of the object, including the bucket name, object name, and generation number. + * `customTime` (*type:* `DateTime.t`, *default:* `nil`) - A timestamp in RFC 3339 format specified by the user for an object. * `updated` (*type:* `DateTime.t`, *default:* `nil`) - The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. + * `md5Hash` (*type:* `String.t`, *default:* `nil`) - MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. + * `crc32c` (*type:* `String.t`, *default:* `nil`) - CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices. + * `selfLink` (*type:* `String.t`, *default:* `nil`) - The link to this object. + * `contentLanguage` (*type:* `String.t`, *default:* `nil`) - Content-Language of the object data. + * `customerEncryption` (*type:* `GoogleApi.Storage.V1.Model.ObjectCustomerEncryption.t`, *default:* `nil`) - Metadata of customer-supplied encryption key, if the object is encrypted by such a key. + * `metageneration` (*type:* `String.t`, *default:* `nil`) - The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. + * `retention` (*type:* `GoogleApi.Storage.V1.Model.ObjectRetention.t`, *default:* `nil`) - A collection of object level retention parameters. + * `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ - :acl => list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t()) | nil, - :bucket => String.t() | nil, - :cacheControl => String.t() | nil, - :componentCount => integer() | nil, - :contentDisposition => String.t() | nil, - :contentEncoding => String.t() | nil, - :contentLanguage => String.t() | nil, - :contentType => String.t() | nil, - :crc32c => String.t() | nil, - :customTime => DateTime.t() | nil, - :customerEncryption => GoogleApi.Storage.V1.Model.ObjectCustomerEncryption.t() | nil, - :etag => String.t() | nil, :eventBasedHold => boolean() | nil, - :generation => String.t() | nil, - :id => String.t() | nil, - :kind => String.t() | nil, - :kmsKeyName => String.t() | nil, - :md5Hash => String.t() | nil, + :etag => String.t() | nil, + :hardDeleteTime => DateTime.t() | nil, + :size => String.t() | nil, + :contentEncoding => String.t() | nil, + :timeCreated => DateTime.t() | nil, :mediaLink => String.t() | nil, + :temporaryHold => boolean() | nil, :metadata => map() | nil, - :metageneration => String.t() | nil, + :storageClass => String.t() | nil, + :generation => String.t() | nil, + :kind => String.t() | nil, + :componentCount => integer() | nil, + :cacheControl => String.t() | nil, :name => String.t() | nil, + :contentDisposition => String.t() | nil, :owner => GoogleApi.Storage.V1.Model.ObjectOwner.t() | nil, + :softDeleteTime => DateTime.t() | nil, + :contentType => String.t() | nil, + :timeStorageClassUpdated => DateTime.t() | nil, + :timeDeleted => DateTime.t() | nil, + :acl => list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t()) | nil, :retentionExpirationTime => DateTime.t() | nil, + :bucket => String.t() | nil, + :id => String.t() | nil, + :customTime => DateTime.t() | nil, + :updated => DateTime.t() | nil, + :md5Hash => String.t() | nil, + :crc32c => String.t() | nil, :selfLink => String.t() | nil, - :size => String.t() | nil, - :storageClass => String.t() | nil, - :temporaryHold => boolean() | nil, - :timeCreated => DateTime.t() | nil, - :timeDeleted => DateTime.t() | nil, - :timeStorageClassUpdated => DateTime.t() | nil, - :updated => DateTime.t() | nil + :contentLanguage => String.t() | nil, + :customerEncryption => GoogleApi.Storage.V1.Model.ObjectCustomerEncryption.t() | nil, + :metageneration => String.t() | nil, + :retention => GoogleApi.Storage.V1.Model.ObjectRetention.t() | nil, + :kmsKeyName => String.t() | nil } - field(:acl, as: GoogleApi.Storage.V1.Model.ObjectAccessControl, type: :list) - field(:bucket) - field(:cacheControl) - field(:componentCount) - field(:contentDisposition) - field(:contentEncoding) - field(:contentLanguage) - field(:contentType) - field(:crc32c) - field(:customTime, as: DateTime) - field(:customerEncryption, as: GoogleApi.Storage.V1.Model.ObjectCustomerEncryption) - field(:etag) field(:eventBasedHold) - field(:generation) - field(:id) - field(:kind) - field(:kmsKeyName) - field(:md5Hash) + field(:etag) + field(:hardDeleteTime, as: DateTime) + field(:size) + field(:contentEncoding) + field(:timeCreated, as: DateTime) field(:mediaLink) + field(:temporaryHold) field(:metadata, type: :map) - field(:metageneration) + field(:storageClass) + field(:generation) + field(:kind) + field(:componentCount) + field(:cacheControl) field(:name) + field(:contentDisposition) field(:owner, as: GoogleApi.Storage.V1.Model.ObjectOwner) - field(:retentionExpirationTime, as: DateTime) - field(:selfLink) - field(:size) - field(:storageClass) - field(:temporaryHold) - field(:timeCreated, as: DateTime) - field(:timeDeleted, as: DateTime) + field(:softDeleteTime, as: DateTime) + field(:contentType) field(:timeStorageClassUpdated, as: DateTime) + field(:timeDeleted, as: DateTime) + field(:acl, as: GoogleApi.Storage.V1.Model.ObjectAccessControl, type: :list) + field(:retentionExpirationTime, as: DateTime) + field(:bucket) + field(:id) + field(:customTime, as: DateTime) field(:updated, as: DateTime) + field(:md5Hash) + field(:crc32c) + field(:selfLink) + field(:contentLanguage) + field(:customerEncryption, as: GoogleApi.Storage.V1.Model.ObjectCustomerEncryption) + field(:metageneration) + field(:retention, as: GoogleApi.Storage.V1.Model.ObjectRetention) + field(:kmsKeyName) end defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.Object do diff --git a/clients/storage/lib/google_api/storage/v1/model/object_retention.ex b/clients/storage/lib/google_api/storage/v1/model/object_retention.ex new file mode 100644 index 0000000000..e710787785 --- /dev/null +++ b/clients/storage/lib/google_api/storage/v1/model/object_retention.ex @@ -0,0 +1,49 @@ +# 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.Storage.V1.Model.ObjectRetention do + @moduledoc """ + A collection of object level retention parameters. + + ## Attributes + + * `mode` (*type:* `String.t`, *default:* `nil`) - The bucket's object retention mode, can only be Unlocked or Locked. + * `retainUntilTime` (*type:* `DateTime.t`, *default:* `nil`) - A time in RFC 3339 format until which object retention protects this object. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :mode => String.t() | nil, + :retainUntilTime => DateTime.t() | nil + } + + field(:mode) + field(:retainUntilTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.Storage.V1.Model.ObjectRetention do + def decode(value, options) do + GoogleApi.Storage.V1.Model.ObjectRetention.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Storage.V1.Model.ObjectRetention do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/storage/lib/google_api/storage/v1/model/policy.ex b/clients/storage/lib/google_api/storage/v1/model/policy.ex index ff74023b4f..3251b74017 100644 --- a/clients/storage/lib/google_api/storage/v1/model/policy.ex +++ b/clients/storage/lib/google_api/storage/v1/model/policy.ex @@ -17,14 +17,14 @@ defmodule GoogleApi.Storage.V1.Model.Policy do @moduledoc """ - A bucket/object IAM policy. + A bucket/object/managedFolder IAM policy. ## Attributes * `bindings` (*type:* `list(GoogleApi.Storage.V1.Model.PolicyBindings.t)`, *default:* `nil`) - An association between a role, which comes with a set of permissions, and members who may assume that role. * `etag` (*type:* `String.t`, *default:* `nil`) - HTTP 1.1 Entity tag for the policy. * `kind` (*type:* `String.t`, *default:* `storage#policy`) - The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. - * `resourceId` (*type:* `String.t`, *default:* `nil`) - The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input. + * `resourceId` (*type:* `String.t`, *default:* `nil`) - The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input. * `version` (*type:* `integer()`, *default:* `nil`) - The IAM policy format version. """ diff --git a/clients/storage/lib/google_api/storage/v1/model/test_iam_permissions_response.ex b/clients/storage/lib/google_api/storage/v1/model/test_iam_permissions_response.ex index 335c84d102..7bf7f9bacd 100644 --- a/clients/storage/lib/google_api/storage/v1/model/test_iam_permissions_response.ex +++ b/clients/storage/lib/google_api/storage/v1/model/test_iam_permissions_response.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Storage.V1.Model.TestIamPermissionsResponse do @moduledoc """ - A storage.(buckets|objects).testIamPermissions response. + A storage.(buckets|objects|managedFolders).testIamPermissions response. ## Attributes * `kind` (*type:* `String.t`, *default:* `storage#testIamPermissionsResponse`) - The kind of item this is. - * `permissions` (*type:* `list(String.t)`, *default:* `nil`) - The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: + * `permissions` (*type:* `list(String.t)`, *default:* `nil`) - The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows: - storage.buckets.delete — Delete bucket. - storage.buckets.get — Read bucket metadata. - storage.buckets.getIamPolicy — Read bucket IAM policy. @@ -36,7 +36,13 @@ defmodule GoogleApi.Storage.V1.Model.TestIamPermissionsResponse do - storage.objects.create — Create object. - storage.objects.list — List objects. - storage.objects.setIamPolicy — Update object IAM policy. - - storage.objects.update — Update object metadata. + - storage.objects.update — Update object metadata. + - storage.managedFolders.delete — Delete managed folder. + - storage.managedFolders.get — Read managed folder metadata. + - storage.managedFolders.getIamPolicy — Read managed folder IAM policy. + - storage.managedFolders.create — Create managed folder. + - storage.managedFolders.list — List managed folders. + - storage.managedFolders.setIamPolicy — Update managed folder IAM policy. """ use GoogleApi.Gax.ModelBase