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:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFirebasestorageService

Returns a new instance of FirebasestorageService.



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

def initialize
  super('https://firebasestorage.googleapis.com/', '',
        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.



39
40
41
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 39

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.



44
45
46
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 44

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. Because bucket resource names are unique across projects, you may omit the project number, projects/-/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



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

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

#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. Because bucket resource names are unique across projects, you may omit the project number, projects/-/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



110
111
112
113
114
115
116
117
118
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 110

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

#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_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



148
149
150
151
152
153
154
155
156
157
158
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 148

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. Because bucket resource names are unique across projects, you may omit the project number, projects/-/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



183
184
185
186
187
188
189
190
191
192
193
# File 'lib/google/apis/firebasestorage_v1beta/service.rb', line 183

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