Class: Google::Apis::DatastoreV1::DatastoreService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/datastore_v1/service.rb

Overview

Google Cloud Datastore API

Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application.

Examples:

require 'google/apis/datastore_v1'

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

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Constructor Details

#initializeDatastoreService

Returns a new instance of DatastoreService.



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

def initialize
  super('https://datastore.googleapis.com/', '')
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/datastore_v1/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/datastore_v1/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#allocate_project_ids(project_id, allocate_ids_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1::AllocateIdsResponse

Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.

Parameters:

  • project_id (String)

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

  • allocate_ids_request_object (Google::Apis::DatastoreV1::AllocateIdsRequest) (defaults to: nil)
  • 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



138
139
140
141
142
143
144
145
146
147
148
# File 'generated/google/apis/datastore_v1/service.rb', line 138

def allocate_project_ids(project_id, allocate_ids_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}:allocateIds', options)
  command.request_representation = Google::Apis::DatastoreV1::AllocateIdsRequest::Representation
  command.request_object = allocate_ids_request_object
  command.response_representation = Google::Apis::DatastoreV1::AllocateIdsResponse::Representation
  command.response_class = Google::Apis::DatastoreV1::AllocateIdsResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#begin_project_transaction(project_id, begin_transaction_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1::BeginTransactionResponse

Begins a new transaction.

Parameters:

  • project_id (String)

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

  • begin_transaction_request_object (Google::Apis::DatastoreV1::BeginTransactionRequest) (defaults to: nil)
  • 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



104
105
106
107
108
109
110
111
112
113
114
# File 'generated/google/apis/datastore_v1/service.rb', line 104

def begin_project_transaction(project_id, begin_transaction_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}:beginTransaction', options)
  command.request_representation = Google::Apis::DatastoreV1::BeginTransactionRequest::Representation
  command.request_object = begin_transaction_request_object
  command.response_representation = Google::Apis::DatastoreV1::BeginTransactionResponse::Representation
  command.response_class = Google::Apis::DatastoreV1::BeginTransactionResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#commit_project(project_id, commit_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1::CommitResponse

Commits a transaction, optionally creating, deleting or modifying some entities.

Parameters:

  • project_id (String)

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

  • commit_request_object (Google::Apis::DatastoreV1::CommitRequest) (defaults to: nil)
  • 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



205
206
207
208
209
210
211
212
213
214
215
# File 'generated/google/apis/datastore_v1/service.rb', line 205

def commit_project(project_id, commit_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}:commit', options)
  command.request_representation = Google::Apis::DatastoreV1::CommitRequest::Representation
  command.request_object = commit_request_object
  command.response_representation = Google::Apis::DatastoreV1::CommitResponse::Representation
  command.response_class = Google::Apis::DatastoreV1::CommitResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#lookup_project(project_id, lookup_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1::LookupResponse

Looks up entities by key.

Parameters:

  • project_id (String)

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

  • lookup_request_object (Google::Apis::DatastoreV1::LookupRequest) (defaults to: nil)
  • 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



171
172
173
174
175
176
177
178
179
180
181
# File 'generated/google/apis/datastore_v1/service.rb', line 171

def lookup_project(project_id, lookup_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}:lookup', options)
  command.request_representation = Google::Apis::DatastoreV1::LookupRequest::Representation
  command.request_object = lookup_request_object
  command.response_representation = Google::Apis::DatastoreV1::LookupResponse::Representation
  command.response_class = Google::Apis::DatastoreV1::LookupResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#rollback_project(project_id, rollback_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1::RollbackResponse

Rolls back a transaction.

Parameters:

  • project_id (String)

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

  • rollback_request_object (Google::Apis::DatastoreV1::RollbackRequest) (defaults to: nil)
  • 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



238
239
240
241
242
243
244
245
246
247
248
# File 'generated/google/apis/datastore_v1/service.rb', line 238

def rollback_project(project_id, rollback_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}:rollback', options)
  command.request_representation = Google::Apis::DatastoreV1::RollbackRequest::Representation
  command.request_object = rollback_request_object
  command.response_representation = Google::Apis::DatastoreV1::RollbackResponse::Representation
  command.response_class = Google::Apis::DatastoreV1::RollbackResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end

#run_project_query(project_id, run_query_request_object = nil, quota_user: nil, fields: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1::RunQueryResponse

Queries for entities.

Parameters:

  • project_id (String)

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

  • run_query_request_object (Google::Apis::DatastoreV1::RunQueryRequest) (defaults to: nil)
  • 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.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



71
72
73
74
75
76
77
78
79
80
81
# File 'generated/google/apis/datastore_v1/service.rb', line 71

def run_project_query(project_id, run_query_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}:runQuery', options)
  command.request_representation = Google::Apis::DatastoreV1::RunQueryRequest::Representation
  command.request_object = run_query_request_object
  command.response_representation = Google::Apis::DatastoreV1::RunQueryResponse::Representation
  command.response_class = Google::Apis::DatastoreV1::RunQueryResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['fields'] = fields unless fields.nil?
  execute_or_queue_command(command, &block)
end