Skip to content

Commit

Permalink
feat: Automated regeneration of Storage client (googleapis#11929)
Browse files Browse the repository at this point in the history
Auto-created at 2024-08-11 13:10:38 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Aug 11, 2024
1 parent c8d4095 commit beeaadb
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clients/storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_storage, "~> 0.39"}]
[{:google_api_storage, "~> 0.40"}]
end
```

Expand Down
63 changes: 62 additions & 1 deletion clients/storage/lib/google_api/storage/v1/api/buckets.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
Permanently deletes an empty bucket.
Deletes an empty bucket. Deletions are permanent unless soft delete is enabled on the bucket.
## Parameters
Expand Down Expand Up @@ -98,9 +98,11 @@ 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.
* `:generation` (*type:* `String.t`) - If present, specifies the generation of the bucket. This is required if softDeleted is true.
* `:ifMetagenerationMatch` (*type:* `String.t`) - Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.
* `:ifMetagenerationNotMatch` (*type:* `String.t`) - Makes the return of the bucket metadata conditional on whether the bucket'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, return the soft-deleted version of this bucket. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
* `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets.
* `opts` (*type:* `keyword()`) - Call options
Expand All @@ -124,9 +126,11 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
:quotaUser => :query,
:uploadType => :query,
:userIp => :query,
:generation => :query,
:ifMetagenerationMatch => :query,
:ifMetagenerationNotMatch => :query,
:projection => :query,
:softDeleted => :query,
:userProject => :query
}

Expand Down Expand Up @@ -343,6 +347,7 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
* `: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 buckets 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 bucket versions will be returned. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
* `:userProject` (*type:* `String.t`) - The project to be billed for this request.
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -370,6 +375,7 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
:pageToken => :query,
:prefix => :query,
:projection => :query,
:softDeleted => :query,
:userProject => :query
}

Expand Down Expand Up @@ -524,6 +530,61 @@ defmodule GoogleApi.Storage.V1.Api.Buckets do
|> Response.decode(opts ++ [struct: %GoogleApi.Storage.V1.Model.Bucket{}])
end

@doc """
Restores a soft-deleted bucket.
## Parameters
* `connection` (*type:* `GoogleApi.Storage.V1.Connection.t`) - Connection to server
* `bucket` (*type:* `String.t`) - Name of a bucket.
* `generation` (*type:* `String.t`) - Generation of a 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.
* `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %{}}` on success
* `{:error, info}` on failure
"""
@spec storage_buckets_restore(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) ::
{:ok, nil} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()}
def storage_buckets_restore(connection, bucket, generation, 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(:post)
|> Request.url("/storage/v1/b/{bucket}/restore", %{
"bucket" => URI.encode(bucket, &URI.char_unreserved?/1)
})
|> Request.add_param(:query, :generation, generation)
|> 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 """
Updates an IAM policy for the specified bucket.
Expand Down
4 changes: 2 additions & 2 deletions clients/storage/lib/google_api/storage/v1/api/objects.ex
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +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.
* `:softDeleted` (*type:* `boolean()`) - If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
* `:userProject` (*type:* `String.t`) - The project to be billed for this request. Required for Requester Pays buckets.
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -855,7 +855,7 @@ defmodule GoogleApi.Storage.V1.Api.Objects do
* `: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.
* `:softDeleted` (*type:* `boolean()`) - If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/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.
Expand Down
2 changes: 1 addition & 1 deletion clients/storage/lib/google_api/storage/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Storage.V1 do
API client metadata for GoogleApi.Storage.V1.
"""

@discovery_revision "20240706"
@discovery_revision "20240805"

def discovery_revision(), do: @discovery_revision
end
6 changes: 6 additions & 0 deletions clients/storage/lib/google_api/storage/v1/model/bucket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ defmodule GoogleApi.Storage.V1.Model.Bucket do
* `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.
* `defaultObjectAcl` (*type:* `list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t)`, *default:* `nil`) - Default access controls to apply to new objects when no ACL is provided.
* `metageneration` (*type:* `String.t`, *default:* `nil`) - The metadata generation of this bucket.
* `generation` (*type:* `String.t`, *default:* `nil`) - The 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.
* `cors` (*type:* `list(GoogleApi.Storage.V1.Model.BucketCors.t)`, *default:* `nil`) - The bucket's Cross-Origin Resource Sharing (CORS) configuration.
* `billing` (*type:* `GoogleApi.Storage.V1.Model.BucketBilling.t`, *default:* `nil`) - The bucket's billing configuration.
* `hierarchicalNamespace` (*type:* `GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace.t`, *default:* `nil`) - The bucket's hierarchical namespace configuration.
* `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.
* `etag` (*type:* `String.t`, *default:* `nil`) - HTTP 1.1 Entity tag for the bucket.
* `satisfiesPZI` (*type:* `boolean()`, *default:* `nil`) - Reserved for future use.
* `id` (*type:* `String.t`, *default:* `nil`) - The ID of the bucket. For buckets, the id and name properties are the same.
* `versioning` (*type:* `GoogleApi.Storage.V1.Model.BucketVersioning.t`, *default:* `nil`) - The bucket's versioning configuration.
* `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.
Expand Down Expand Up @@ -85,13 +87,15 @@ defmodule GoogleApi.Storage.V1.Model.Bucket do
:location => String.t() | nil,
:defaultObjectAcl => list(GoogleApi.Storage.V1.Model.ObjectAccessControl.t()) | nil,
:metageneration => String.t() | nil,
:generation => String.t() | nil,
:storageClass => String.t() | nil,
:cors => list(GoogleApi.Storage.V1.Model.BucketCors.t()) | nil,
:billing => GoogleApi.Storage.V1.Model.BucketBilling.t() | nil,
:hierarchicalNamespace =>
GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace.t() | nil,
:retentionPolicy => GoogleApi.Storage.V1.Model.BucketRetentionPolicy.t() | nil,
:etag => String.t() | nil,
:satisfiesPZI => boolean() | nil,
:id => String.t() | nil,
:versioning => GoogleApi.Storage.V1.Model.BucketVersioning.t() | nil,
:logging => GoogleApi.Storage.V1.Model.BucketLogging.t() | nil,
Expand Down Expand Up @@ -122,12 +126,14 @@ defmodule GoogleApi.Storage.V1.Model.Bucket do
field(:location)
field(:defaultObjectAcl, as: GoogleApi.Storage.V1.Model.ObjectAccessControl, type: :list)
field(:metageneration)
field(:generation)
field(:storageClass)
field(:cors, as: GoogleApi.Storage.V1.Model.BucketCors, type: :list)
field(:billing, as: GoogleApi.Storage.V1.Model.BucketBilling)
field(:hierarchicalNamespace, as: GoogleApi.Storage.V1.Model.BucketHierarchicalNamespace)
field(:retentionPolicy, as: GoogleApi.Storage.V1.Model.BucketRetentionPolicy)
field(:etag)
field(:satisfiesPZI)
field(:id)
field(:versioning, as: GoogleApi.Storage.V1.Model.BucketVersioning)
field(:logging, as: GoogleApi.Storage.V1.Model.BucketLogging)
Expand Down
2 changes: 1 addition & 1 deletion clients/storage/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.Storage.Mixfile do
use Mix.Project

@version "0.39.0"
@version "0.40.0"

def project() do
[
Expand Down

0 comments on commit beeaadb

Please sign in to comment.