Class: Google::Apis::FirebasedatabaseV1beta::FirebaseRealtimeDatabaseService

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

Overview

Firebase Realtime Database API

The Firebase Realtime Database API enables programmatic provisioning and management of Realtime Database instances.

Examples:

require 'google/apis/firebasedatabase_v1beta'

Firebasedatabase = Google::Apis::FirebasedatabaseV1beta # Alias the module
service = Firebasedatabase::FirebaseRealtimeDatabaseService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFirebaseRealtimeDatabaseService

Returns a new instance of FirebaseRealtimeDatabaseService.



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

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-firebasedatabase_v1beta',
        client_version: Google::Apis::FirebasedatabaseV1beta::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/firebasedatabase_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/firebasedatabase_v1beta/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#create_project_location_instance(parent, database_instance_object = nil, database_id: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::DatabaseInstance

Requests that a new DatabaseInstance be created. The state of a successfully created DatabaseInstance is ACTIVE. Only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud. google.com/billing/reference/rest/v1/projects/updateBillingInfo. Note that it might take a few minutes for billing enablement state to propagate to Firebase systems.

Parameters:

  • parent (String)

    Required. The parent project for which to create a database instance, in the form: projects/project-number/locations/location-id``.

  • database_instance_object (Google::Apis::FirebasedatabaseV1beta::DatabaseInstance) (defaults to: nil)
  • database_id (String) (defaults to: nil)

    The globally unique identifier of the database instance.

  • validate_only (Boolean) (defaults to: nil)

    When set to true, the request will be validated but not submitted.

  • 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



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/google/apis/firebasedatabase_v1beta/service.rb', line 86

def create_project_location_instance(parent, database_instance_object = nil, database_id: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+parent}/instances', options)
  command.request_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.request_object = database_instance_object
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance
  command.params['parent'] = parent unless parent.nil?
  command.query['databaseId'] = database_id unless database_id.nil?
  command.query['validateOnly'] = validate_only unless validate_only.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_location_instance(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::DatabaseInstance

Marks a DatabaseInstance to be deleted. The DatabaseInstance will be set to the DELETED state for 20 days, and will be purged within 30 days. The default database cannot be deleted. IDs for deleted database instances may never be recovered or re-used. The Database may only be deleted if it is already in a DISABLED state.

Parameters:

  • name (String)

    Required. The fully qualified resource name of the database instance, in the form: projects/project-number/locations/location-id/instances/database- 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



126
127
128
129
130
131
132
133
134
# File 'lib/google/apis/firebasedatabase_v1beta/service.rb', line 126

def delete_project_location_instance(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1beta/{+name}', options)
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance
  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

#disable_database_instance(name, disable_database_instance_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::DatabaseInstance

Disables a DatabaseInstance. The database can be re-enabled later using ReenableDatabaseInstance. When a database is disabled, all reads and writes are denied, including view access in the Firebase console.

Parameters:

  • name (String)

    Required. The fully qualified resource name of the database instance, in the form: projects/project-number/locations/location-id/instances/database- id``

  • disable_database_instance_request_object (Google::Apis::FirebasedatabaseV1beta::DisableDatabaseInstanceRequest) (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



161
162
163
164
165
166
167
168
169
170
171
# File 'lib/google/apis/firebasedatabase_v1beta/service.rb', line 161

def disable_database_instance(name, disable_database_instance_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+name}:disable', options)
  command.request_representation = Google::Apis::FirebasedatabaseV1beta::DisableDatabaseInstanceRequest::Representation
  command.request_object = disable_database_instance_request_object
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance
  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_location_instance(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::DatabaseInstance

Gets the DatabaseInstance identified by the specified resource name.

Parameters:

  • name (String)

    Required. The fully qualified resource name of the database instance, in the form: projects/project-number/locations/location-id/instances/database- id. `database-id` is a globally unique identifier across all parent collections. For convenience, this method allows you to supply `-` as a wildcard character in place of specific collections under `projects` and ` locations`. The resulting wildcarding form of the method is: `projects/-/ locations/-/instances/`database-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



199
200
201
202
203
204
205
206
207
# File 'lib/google/apis/firebasedatabase_v1beta/service.rb', line 199

def get_project_location_instance(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta/{+name}', options)
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance
  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_location_instances(parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::ListDatabaseInstancesResponse

Lists each DatabaseInstance associated with the specified parent project. The list items are returned in no particular order, but will be a consistent view of the database instances when additional requests are made with a pageToken. The resulting list contains instances in any STATE. The list results may be stale by a few seconds. Use GetDatabaseInstance for consistent reads.

Parameters:

  • parent (String)

    Required. The parent project for which to list database instances, in the form: projects/project-number/locations/location-id`To list across all locations, use a parent in the form:projects/project-number/locations/-`

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of database instances to return in the response. The server may return fewer than this at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit.

  • page_token (String) (defaults to: nil)

    Token returned from a previous call to ListDatabaseInstances indicating where in the set of database instances to resume listing.

  • show_deleted (Boolean) (defaults to: nil)

    Indicate that DatabaseInstances in the DELETED state should also be returned.

  • 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
255
# File 'lib/google/apis/firebasedatabase_v1beta/service.rb', line 244

def list_project_location_instances(parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1beta/{+parent}/instances', options)
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::ListDatabaseInstancesResponse::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::ListDatabaseInstancesResponse
  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['showDeleted'] = show_deleted unless show_deleted.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#reenable_database_instance(name, reenable_database_instance_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::DatabaseInstance

Enables a DatabaseInstance. The database must have been disabled previously using DisableDatabaseInstance. The state of a successfully reenabled DatabaseInstance is ACTIVE.

Parameters:

  • name (String)

    Required. The fully qualified resource name of the database instance, in the form: projects/project-number/locations/location-id/instances/database- id``

  • reenable_database_instance_request_object (Google::Apis::FirebasedatabaseV1beta::ReenableDatabaseInstanceRequest) (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



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

def reenable_database_instance(name, reenable_database_instance_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+name}:reenable', options)
  command.request_representation = Google::Apis::FirebasedatabaseV1beta::ReenableDatabaseInstanceRequest::Representation
  command.request_object = reenable_database_instance_request_object
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance
  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

#undelete_database_instance(name, undelete_database_instance_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::FirebasedatabaseV1beta::DatabaseInstance

Restores a DatabaseInstance that was previously marked to be deleted. After the delete method is used, DatabaseInstances are set to the DELETED state for 20 days, and will be purged within 30 days. Databases in the DELETED state can be undeleted without losing any data. This method may only be used on a DatabaseInstance in the DELETED state. Purged DatabaseInstances may not be recovered.

Parameters:

  • name (String)

    Required. The fully qualified resource name of the database instance, in the form: projects/project-number/locations/location-id/instances/database- id``

  • undelete_database_instance_request_object (Google::Apis::FirebasedatabaseV1beta::UndeleteDatabaseInstanceRequest) (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



322
323
324
325
326
327
328
329
330
331
332
# File 'lib/google/apis/firebasedatabase_v1beta/service.rb', line 322

def undelete_database_instance(name, undelete_database_instance_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta/{+name}:undelete', options)
  command.request_representation = Google::Apis::FirebasedatabaseV1beta::UndeleteDatabaseInstanceRequest::Representation
  command.request_object = undelete_database_instance_request_object
  command.response_representation = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance::Representation
  command.response_class = Google::Apis::FirebasedatabaseV1beta::DatabaseInstance
  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