Class: Google::Apis::DatastoreV1beta3::DatastoreService

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

Overview

Cloud Datastore API

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

Examples:

require 'google/apis/datastore_v1beta3'

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

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDatastoreService

Returns a new instance of DatastoreService.



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

def initialize
  super('https://datastore.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/datastore_v1beta3/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_v1beta3/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

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

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

Parameters:

  • project_id (String)

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

  • allocate_ids_request_object (Google::Apis::DatastoreV1beta3::AllocateIdsRequest) (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



73
74
75
76
77
78
79
80
81
82
83
# File 'generated/google/apis/datastore_v1beta3/service.rb', line 73

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) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta3::BeginTransactionResponse

Begins a new transaction.

Parameters:

  • project_id (String)

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

  • begin_transaction_request_object (Google::Apis::DatastoreV1beta3::BeginTransactionRequest) (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



106
107
108
109
110
111
112
113
114
115
116
# File 'generated/google/apis/datastore_v1beta3/service.rb', line 106

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) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta3::CommitResponse

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

Parameters:

  • project_id (String)

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

  • commit_request_object (Google::Apis::DatastoreV1beta3::CommitRequest) (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



140
141
142
143
144
145
146
147
148
149
150
# File 'generated/google/apis/datastore_v1beta3/service.rb', line 140

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) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta3::LookupResponse

Looks up entities by key.

Parameters:

  • project_id (String)

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

  • lookup_request_object (Google::Apis::DatastoreV1beta3::LookupRequest) (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



173
174
175
176
177
178
179
180
181
182
183
# File 'generated/google/apis/datastore_v1beta3/service.rb', line 173

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) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta3::ReserveIdsResponse

Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.

Parameters:

  • project_id (String)

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

  • reserve_ids_request_object (Google::Apis::DatastoreV1beta3::ReserveIdsRequest) (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



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

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) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta3::RollbackResponse

Rolls back a transaction.

Parameters:

  • project_id (String)

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

  • rollback_request_object (Google::Apis::DatastoreV1beta3::RollbackRequest) (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



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

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) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta3::RunQueryResponse

Queries for entities.

Parameters:

  • project_id (String)

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

  • run_query_request_object (Google::Apis::DatastoreV1beta3::RunQueryRequest) (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



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

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