Class: Google::Apis::FirebasestorageV1beta::FirebasestorageService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/firebasestorage_v1beta/service.rb

Overview

Cloud Storage for Firebase API

The Cloud Storage for Firebase API enables programmatic management of Cloud Storage buckets for use in Firebase projects

Examples:

require 'google/apis/firebasestorage_v1beta'

Firebasestorage = Google::Apis::FirebasestorageV1beta # Alias the module
service = Firebasestorage::FirebasestorageService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://firebasestorage.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFirebasestorageService

Returns a new instance of FirebasestorageService.



48
49
50
51
52
53
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-firebasestorage_v1beta',
        client_version: Google::Apis::FirebasestorageV1beta::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns 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.

Returns:

  • (String)

    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.



41
42
43
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 41

def key
  @key
end

#quota_userString

Returns 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.

Returns:

  • (String)

    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.



46
47
48
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#add_bucket_firebase(bucket, add_firebase_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::Bucket

Links a Google Cloud Storage bucket to a Firebase project.

Parameters:

  • bucket (String)

    Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket, projects/project_id_or_number/buckets/bucket_id``.

  • add_firebase_request_object (Google::Apis::FirebasestorageV1beta::AddFirebaseRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



139
140
141
142
143
144
145
146
147
148
149
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 139

def add_bucket_firebase(bucket, add_firebase_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+bucket}:addFirebase', options)
  command.request_representation = Google::Apis::FirebasestorageV1beta::AddFirebaseRequest::Representation
  command.request_object = add_firebase_request_object
  command.response_representation = Google::Apis::FirebasestorageV1beta::Bucket::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::Bucket
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_default_bucket(parent, default_bucket_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::DefaultBucket

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.

Parameters:

  • parent (String)

    Required. The parent resource where the default bucket will be created, projects/project_id_or_number``.

  • default_bucket_object (Google::Apis::FirebasestorageV1beta::DefaultBucket) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



281
282
283
284
285
286
287
288
289
290
291
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 281

def create_project_default_bucket(parent, default_bucket_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+parent}/defaultBucket', options)
  command.request_representation = Google::Apis::FirebasestorageV1beta::DefaultBucket::Representation
  command.request_object = default_bucket_object
  command.response_representation = Google::Apis::FirebasestorageV1beta::DefaultBucket::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::DefaultBucket
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_default_bucket(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::Empty

Unlinks and deletes the default bucket.

Parameters:

  • name (String)

    Required. The name of the default bucket to delete, projects/ project_id_or_number/defaultBucket.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



76
77
78
79
80
81
82
83
84
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 76

def delete_project_default_bucket(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta/{+name}', options)
  command.response_representation = Google::Apis::FirebasestorageV1beta::Empty::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_bucket(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::Bucket

Gets a single linked storage bucket.

Parameters:

  • name (String)

    Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket, projects/project_id_or_number/buckets/bucket_id``.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



172
173
174
175
176
177
178
179
180
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 172

def get_project_bucket(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta/{+name}', options)
  command.response_representation = Google::Apis::FirebasestorageV1beta::Bucket::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::Bucket
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_default_bucket(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::DefaultBucket

Gets the default bucket.

Parameters:

  • name (String)

    Required. The name of the default bucket to retrieve, projects/ project_id_or_number/defaultBucket.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



107
108
109
110
111
112
113
114
115
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 107

def get_project_default_bucket(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta/{+name}', options)
  command.response_representation = Google::Apis::FirebasestorageV1beta::DefaultBucket::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::DefaultBucket
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_buckets(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::ListBucketsResponse

Lists the linked storage buckets for a project.

Parameters:

  • parent (String)

    Required. Resource name of the parent Firebase project, projects/ project_id_or_number``.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of buckets to return. If not set, the server will use a reasonable default.

  • page_token (String) (defaults to: nil)

    A page token, received from a previous ListBuckets call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListBuckets must match the call that provided the page token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



210
211
212
213
214
215
216
217
218
219
220
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 210

def list_project_buckets(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta/{+parent}/buckets', options)
  command.response_representation = Google::Apis::FirebasestorageV1beta::ListBucketsResponse::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::ListBucketsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#remove_bucket_firebase(bucket, remove_firebase_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasestorageV1beta::Empty

Unlinks a linked Google Cloud Storage bucket from a Firebase project.

Parameters:

  • bucket (String)

    Required. Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket, projects/project_id_or_number/buckets/bucket_id``.

  • remove_firebase_request_object (Google::Apis::FirebasestorageV1beta::RemoveFirebaseRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



244
245
246
247
248
249
250
251
252
253
254
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 244

def remove_bucket_firebase(bucket, remove_firebase_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+bucket}:removeFirebase', options)
  command.request_representation = Google::Apis::FirebasestorageV1beta::RemoveFirebaseRequest::Representation
  command.request_object = remove_firebase_request_object
  command.response_representation = Google::Apis::FirebasestorageV1beta::Empty::Representation
  command.response_class = Google::Apis::FirebasestorageV1beta::Empty
  command.params['bucket'] = bucket unless bucket.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end