Skip to content

Commit 57f8ec9

Browse files
feat: Automated regeneration of FirebaseStorage client (googleapis#12525)
Auto-created at 2024-11-14 13:16:29 +0000 using the toys pull request generator.
1 parent 006325e commit 57f8ec9

File tree

5 files changed

+271
-4
lines changed

5 files changed

+271
-4
lines changed

clients/firebase_storage/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_firebase_storage, "~> 0.3"}]
14+
[{:google_api_firebase_storage, "~> 0.4"}]
1515
end
1616
```
1717

clients/firebase_storage/lib/google_api/firebase_storage/v1beta/api/projects.ex

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,146 @@ defmodule GoogleApi.FirebaseStorage.V1beta.Api.Projects do
2525

2626
@library_version Mix.Project.config() |> Keyword.get(:version, "")
2727

28+
@doc """
29+
Unlinks and deletes the default bucket.
30+
31+
## Parameters
32+
33+
* `connection` (*type:* `GoogleApi.FirebaseStorage.V1beta.Connection.t`) - Connection to server
34+
* `name` (*type:* `String.t`) - Required. The name of the default bucket to delete, `projects/{project_id_or_number}/defaultBucket`.
35+
* `optional_params` (*type:* `keyword()`) - Optional parameters
36+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
37+
* `:access_token` (*type:* `String.t`) - OAuth access token.
38+
* `:alt` (*type:* `String.t`) - Data format for response.
39+
* `:callback` (*type:* `String.t`) - JSONP
40+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
41+
* `: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.
42+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
43+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
44+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
45+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
46+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
47+
* `opts` (*type:* `keyword()`) - Call options
48+
49+
## Returns
50+
51+
* `{:ok, %GoogleApi.FirebaseStorage.V1beta.Model.Empty{}}` on success
52+
* `{:error, info}` on failure
53+
"""
54+
@spec firebasestorage_projects_delete_default_bucket(
55+
Tesla.Env.client(),
56+
String.t(),
57+
keyword(),
58+
keyword()
59+
) ::
60+
{:ok, GoogleApi.FirebaseStorage.V1beta.Model.Empty.t()}
61+
| {:ok, Tesla.Env.t()}
62+
| {:ok, list()}
63+
| {:error, any()}
64+
def firebasestorage_projects_delete_default_bucket(
65+
connection,
66+
name,
67+
optional_params \\ [],
68+
opts \\ []
69+
) do
70+
optional_params_config = %{
71+
:"$.xgafv" => :query,
72+
:access_token => :query,
73+
:alt => :query,
74+
:callback => :query,
75+
:fields => :query,
76+
:key => :query,
77+
:oauth_token => :query,
78+
:prettyPrint => :query,
79+
:quotaUser => :query,
80+
:uploadType => :query,
81+
:upload_protocol => :query
82+
}
83+
84+
request =
85+
Request.new()
86+
|> Request.method(:delete)
87+
|> Request.url("/v1beta/{+name}", %{
88+
"name" => URI.encode(name, &URI.char_unreserved?/1)
89+
})
90+
|> Request.add_optional_params(optional_params_config, optional_params)
91+
|> Request.library_version(@library_version)
92+
93+
connection
94+
|> Connection.execute(request)
95+
|> Response.decode(opts ++ [struct: %GoogleApi.FirebaseStorage.V1beta.Model.Empty{}])
96+
end
97+
98+
@doc """
99+
Gets the default bucket.
100+
101+
## Parameters
102+
103+
* `connection` (*type:* `GoogleApi.FirebaseStorage.V1beta.Connection.t`) - Connection to server
104+
* `name` (*type:* `String.t`) - Required. The name of the default bucket to retrieve, `projects/{project_id_or_number}/defaultBucket`.
105+
* `optional_params` (*type:* `keyword()`) - Optional parameters
106+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
107+
* `:access_token` (*type:* `String.t`) - OAuth access token.
108+
* `:alt` (*type:* `String.t`) - Data format for response.
109+
* `:callback` (*type:* `String.t`) - JSONP
110+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
111+
* `: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.
112+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
113+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
114+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
115+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
116+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
117+
* `opts` (*type:* `keyword()`) - Call options
118+
119+
## Returns
120+
121+
* `{:ok, %GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket{}}` on success
122+
* `{:error, info}` on failure
123+
"""
124+
@spec firebasestorage_projects_get_default_bucket(
125+
Tesla.Env.client(),
126+
String.t(),
127+
keyword(),
128+
keyword()
129+
) ::
130+
{:ok, GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket.t()}
131+
| {:ok, Tesla.Env.t()}
132+
| {:ok, list()}
133+
| {:error, any()}
134+
def firebasestorage_projects_get_default_bucket(
135+
connection,
136+
name,
137+
optional_params \\ [],
138+
opts \\ []
139+
) do
140+
optional_params_config = %{
141+
:"$.xgafv" => :query,
142+
:access_token => :query,
143+
:alt => :query,
144+
:callback => :query,
145+
:fields => :query,
146+
:key => :query,
147+
:oauth_token => :query,
148+
:prettyPrint => :query,
149+
:quotaUser => :query,
150+
:uploadType => :query,
151+
:upload_protocol => :query
152+
}
153+
154+
request =
155+
Request.new()
156+
|> Request.method(:get)
157+
|> Request.url("/v1beta/{+name}", %{
158+
"name" => URI.encode(name, &URI.char_unreserved?/1)
159+
})
160+
|> Request.add_optional_params(optional_params_config, optional_params)
161+
|> Request.library_version(@library_version)
162+
163+
connection
164+
|> Connection.execute(request)
165+
|> Response.decode(opts ++ [struct: %GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket{}])
166+
end
167+
28168
@doc """
29169
Links a Google Cloud Storage bucket to a Firebase project.
30170
@@ -299,4 +439,76 @@ defmodule GoogleApi.FirebaseStorage.V1beta.Api.Projects do
299439
|> Connection.execute(request)
300440
|> Response.decode(opts ++ [struct: %GoogleApi.FirebaseStorage.V1beta.Model.Empty{}])
301441
end
442+
443+
@doc """
444+
Creates a Spark tier-eligible Cloud Storage bucket and links it to your Firebase project. If the default bucket already exists, this method will re-link it to your Firebase project. See https://firebase.google.com/pricing for pricing details.
445+
446+
## Parameters
447+
448+
* `connection` (*type:* `GoogleApi.FirebaseStorage.V1beta.Connection.t`) - Connection to server
449+
* `parent` (*type:* `String.t`) - Required. The parent resource where the default bucket will be created, `projects/{project_id_or_number}`.
450+
* `optional_params` (*type:* `keyword()`) - Optional parameters
451+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
452+
* `:access_token` (*type:* `String.t`) - OAuth access token.
453+
* `:alt` (*type:* `String.t`) - Data format for response.
454+
* `:callback` (*type:* `String.t`) - JSONP
455+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
456+
* `: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.
457+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
458+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
459+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
460+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
461+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
462+
* `:body` (*type:* `GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket.t`) -
463+
* `opts` (*type:* `keyword()`) - Call options
464+
465+
## Returns
466+
467+
* `{:ok, %GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket{}}` on success
468+
* `{:error, info}` on failure
469+
"""
470+
@spec firebasestorage_projects_default_bucket_create(
471+
Tesla.Env.client(),
472+
String.t(),
473+
keyword(),
474+
keyword()
475+
) ::
476+
{:ok, GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket.t()}
477+
| {:ok, Tesla.Env.t()}
478+
| {:ok, list()}
479+
| {:error, any()}
480+
def firebasestorage_projects_default_bucket_create(
481+
connection,
482+
parent,
483+
optional_params \\ [],
484+
opts \\ []
485+
) do
486+
optional_params_config = %{
487+
:"$.xgafv" => :query,
488+
:access_token => :query,
489+
:alt => :query,
490+
:callback => :query,
491+
:fields => :query,
492+
:key => :query,
493+
:oauth_token => :query,
494+
:prettyPrint => :query,
495+
:quotaUser => :query,
496+
:uploadType => :query,
497+
:upload_protocol => :query,
498+
:body => :body
499+
}
500+
501+
request =
502+
Request.new()
503+
|> Request.method(:post)
504+
|> Request.url("/v1beta/{+parent}/defaultBucket", %{
505+
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
506+
})
507+
|> Request.add_optional_params(optional_params_config, optional_params)
508+
|> Request.library_version(@library_version)
509+
510+
connection
511+
|> Connection.execute(request)
512+
|> Response.decode(opts ++ [struct: %GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket{}])
513+
end
302514
end

clients/firebase_storage/lib/google_api/firebase_storage/v1beta/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.FirebaseStorage.V1beta do
2020
API client metadata for GoogleApi.FirebaseStorage.V1beta.
2121
"""
2222

23-
@discovery_revision "20240301"
23+
@discovery_revision "20241111"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket do
19+
@moduledoc """
20+
Spark tier-eligible Cloud Storage bucket. One per project. This resource exists if the underlying Cloud Storage bucket exists and it is linked to your Firebase project. See https://firebase.google.com/pricing for pricing details.
21+
22+
## Attributes
23+
24+
* `bucket` (*type:* `GoogleApi.FirebaseStorage.V1beta.Model.Bucket.t`, *default:* `nil`) - Output only. Underlying bucket resource.
25+
* `location` (*type:* `String.t`, *default:* `nil`) - Immutable. Location of the default bucket.
26+
* `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the default bucket.
27+
* `storageClass` (*type:* `String.t`, *default:* `nil`) - Immutable. Storage class of the default bucket. Supported values are available at https://cloud.google.com/storage/docs/storage-classes#classes.
28+
"""
29+
30+
use GoogleApi.Gax.ModelBase
31+
32+
@type t :: %__MODULE__{
33+
:bucket => GoogleApi.FirebaseStorage.V1beta.Model.Bucket.t() | nil,
34+
:location => String.t() | nil,
35+
:name => String.t() | nil,
36+
:storageClass => String.t() | nil
37+
}
38+
39+
field(:bucket, as: GoogleApi.FirebaseStorage.V1beta.Model.Bucket)
40+
field(:location)
41+
field(:name)
42+
field(:storageClass)
43+
end
44+
45+
defimpl Poison.Decoder, for: GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket do
46+
def decode(value, options) do
47+
GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket.decode(value, options)
48+
end
49+
end
50+
51+
defimpl Poison.Encoder, for: GoogleApi.FirebaseStorage.V1beta.Model.DefaultBucket do
52+
def encode(value, options) do
53+
GoogleApi.Gax.ModelBase.encode(value, options)
54+
end
55+
end

clients/firebase_storage/mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
defmodule GoogleApi.FirebaseStorage.Mixfile do
1919
use Mix.Project
2020

21-
@version "0.3.0"
21+
@version "0.4.0"
2222

2323
def project() do
2424
[
@@ -56,7 +56,7 @@ defmodule GoogleApi.FirebaseStorage.Mixfile do
5656
[
5757
files: ["lib", "mix.exs", "README*", "LICENSE"],
5858
maintainers: ["Jeff Ching", "Daniel Azuma"],
59-
licenses: ["Apache 2.0"],
59+
licenses: ["Apache-2.0"],
6060
links: %{
6161
"GitHub" => "https://github.com/googleapis/elixir-google-api/tree/master/clients/firebase_storage",
6262
"Homepage" => "https://firebase.google.com/docs/storage"

0 commit comments

Comments
 (0)