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

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

Overview

Firebase Realtime Database Management API

The Firebase Realtime Database Management 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:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFirebaseRealtimeDatabaseService

Returns a new instance of FirebaseRealtimeDatabaseService.



46
47
48
49
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 46

def initialize
  super('https://firebasedatabase.googleapis.com/', '')
  @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 'generated/google/apis/firebasedatabase_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 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 44

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)

    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



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 82

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 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)

    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



120
121
122
123
124
125
126
127
128
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 120

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)

    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



154
155
156
157
158
159
160
161
162
163
164
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 154

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)

    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



192
193
194
195
196
197
198
199
200
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 192

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, 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)

    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.

  • 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



235
236
237
238
239
240
241
242
243
244
245
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 235

def list_project_location_instances(parent, page_size: nil, page_token: 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['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)

    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



271
272
273
274
275
276
277
278
279
280
281
# File 'generated/google/apis/firebasedatabase_v1beta/service.rb', line 271

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