class Google::Apis::DatastoreV1beta3::DatastoreService

Cloud Datastore API

Accesses the schemaless NoSQL database to provide fully managed, robust,

scalable storage for your application.

@example

require 'google/apis/datastore_v1beta3'

Datastore = Google::Apis::DatastoreV1beta3 # Alias the module
service = Datastore::DatastoreService.new

@see cloud.google.com/datastore/

Attributes

key[RW]

@return [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.
quota_user[RW]

@return [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.

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/google/apis/datastore_v1beta3/service.rb, line 46
def initialize
  super('https://datastore.googleapis.com/', '',
        client_name: 'google-apis-datastore_v1beta3',
        client_version: Google::Apis::DatastoreV1beta3::GEM_VERSION)
  @batch_path = 'batch'
end

Public Instance Methods

allocate_project_ids(project_id, allocate_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::AllocateIdsRequest] allocate_ids_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::AllocateIdsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::AllocateIdsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 75
def allocate_project_ids(project_id, allocate_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:allocateIds', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::AllocateIdsRequest::Representation
  command.request_object = allocate_ids_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::AllocateIdsResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::AllocateIdsResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
begin_project_transaction(project_id, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Begins a new transaction. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::BeginTransactionRequest] begin_transaction_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::BeginTransactionResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::BeginTransactionResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 108
def begin_project_transaction(project_id, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:beginTransaction', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::BeginTransactionRequest::Representation
  command.request_object = begin_transaction_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::BeginTransactionResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::BeginTransactionResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
commit_project(project_id, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Commits a transaction, optionally creating, deleting or modifying some entities. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::CommitRequest] commit_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::CommitResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::CommitResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 142
def commit_project(project_id, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:commit', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::CommitRequest::Representation
  command.request_object = commit_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::CommitResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::CommitResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
lookup_project(project_id, lookup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Looks up entities by key. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::LookupRequest] lookup_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::LookupResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::LookupResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 175
def lookup_project(project_id, lookup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:lookup', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::LookupRequest::Representation
  command.request_object = lookup_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::LookupResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::LookupResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
reserve_project_ids(project_id, reserve_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::ReserveIdsRequest] reserve_ids_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::ReserveIdsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::ReserveIdsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 208
def reserve_project_ids(project_id, reserve_ids_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:reserveIds', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::ReserveIdsRequest::Representation
  command.request_object = reserve_ids_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::ReserveIdsResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::ReserveIdsResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
rollback_project(project_id, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Rolls back a transaction. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::RollbackRequest] rollback_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::RollbackResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::RollbackResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 241
def rollback_project(project_id, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:rollback', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::RollbackRequest::Representation
  command.request_object = rollback_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::RollbackResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::RollbackResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
run_project_query(project_id, run_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Queries for entities. @param [String] project_id

Required. The ID of the project against which to make the request.

@param [Google::Apis::DatastoreV1beta3::RunQueryRequest] run_query_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] quota_user

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.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::DatastoreV1beta3::RunQueryResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::DatastoreV1beta3::RunQueryResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File lib/google/apis/datastore_v1beta3/service.rb, line 274
def run_project_query(project_id, run_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1beta3/projects/{projectId}:runQuery', options)
  command.request_representation = Google::Apis::DatastoreV1beta3::RunQueryRequest::Representation
  command.request_object = run_query_request_object
  command.response_representation = Google::Apis::DatastoreV1beta3::RunQueryResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta3::RunQueryResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Protected Instance Methods

apply_command_defaults(command) click to toggle source
# File lib/google/apis/datastore_v1beta3/service.rb, line 288
def apply_command_defaults(command)
  command.query['key'] = key unless key.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
end