Class: Google::Apis::DatastoreV1beta2::DatastoreService

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

Overview

Google Cloud Datastore API

Stores and queries data in Google Cloud Datastore.

Examples:

require 'google/apis/datastore_v1beta2'

Datastore = Google::Apis::DatastoreV1beta2 # 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.



51
52
53
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 51

def initialize
  super('https://www.googleapis.com/', 'datastore/v1beta2/datasets/')
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.



38
39
40
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 38

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. Overrides userIp if both are provided.

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. Overrides userIp if both are provided.



44
45
46
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



49
50
51
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 49

def user_ip
  @user_ip
end

Instance Method Details

#allocate_dataset_ids(dataset_id, allocate_ids_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta2::AllocateIdsResponse

Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).

Parameters:

  • dataset_id (String)

    Identifies the dataset.

  • allocate_ids_request_object (Google::Apis::DatastoreV1beta2::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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def allocate_dataset_ids(dataset_id, allocate_ids_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{datasetId}/allocateIds', options)
  command.request_representation = Google::Apis::DatastoreV1beta2::AllocateIdsRequest::Representation
  command.request_object = allocate_ids_request_object
  command.response_representation = Google::Apis::DatastoreV1beta2::AllocateIdsResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta2::AllocateIdsResponse
  command.params['datasetId'] = dataset_id unless dataset_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#begin_dataset_transaction(dataset_id, begin_transaction_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta2::BeginTransactionResponse

Begin a new transaction.

Parameters:

  • dataset_id (String)

    Identifies the dataset.

  • begin_transaction_request_object (Google::Apis::DatastoreV1beta2::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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def begin_dataset_transaction(dataset_id, begin_transaction_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{datasetId}/beginTransaction', options)
  command.request_representation = Google::Apis::DatastoreV1beta2::BeginTransactionRequest::Representation
  command.request_object = begin_transaction_request_object
  command.response_representation = Google::Apis::DatastoreV1beta2::BeginTransactionResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta2::BeginTransactionResponse
  command.params['datasetId'] = dataset_id unless dataset_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#commit_dataset(dataset_id, commit_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta2::CommitResponse

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

Parameters:

  • dataset_id (String)

    Identifies the dataset.

  • commit_request_object (Google::Apis::DatastoreV1beta2::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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



157
158
159
160
161
162
163
164
165
166
167
168
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 157

def commit_dataset(dataset_id, commit_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{datasetId}/commit', options)
  command.request_representation = Google::Apis::DatastoreV1beta2::CommitRequest::Representation
  command.request_object = commit_request_object
  command.response_representation = Google::Apis::DatastoreV1beta2::CommitResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta2::CommitResponse
  command.params['datasetId'] = dataset_id unless dataset_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#lookup_dataset(dataset_id, lookup_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta2::LookupResponse

Look up some entities by key.

Parameters:

  • dataset_id (String)

    Identifies the dataset.

  • lookup_request_object (Google::Apis::DatastoreV1beta2::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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



195
196
197
198
199
200
201
202
203
204
205
206
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 195

def lookup_dataset(dataset_id, lookup_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{datasetId}/lookup', options)
  command.request_representation = Google::Apis::DatastoreV1beta2::LookupRequest::Representation
  command.request_object = lookup_request_object
  command.response_representation = Google::Apis::DatastoreV1beta2::LookupResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta2::LookupResponse
  command.params['datasetId'] = dataset_id unless dataset_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#rollback_dataset(dataset_id, rollback_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta2::RollbackResponse

Roll back a transaction.

Parameters:

  • dataset_id (String)

    Identifies the dataset.

  • rollback_request_object (Google::Apis::DatastoreV1beta2::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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def rollback_dataset(dataset_id, rollback_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{datasetId}/rollback', options)
  command.request_representation = Google::Apis::DatastoreV1beta2::RollbackRequest::Representation
  command.request_object = rollback_request_object
  command.response_representation = Google::Apis::DatastoreV1beta2::RollbackResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta2::RollbackResponse
  command.params['datasetId'] = dataset_id unless dataset_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#run_dataset_query(dataset_id, run_query_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DatastoreV1beta2::RunQueryResponse

Query for entities.

Parameters:

  • dataset_id (String)

    Identifies the dataset.

  • run_query_request_object (Google::Apis::DatastoreV1beta2::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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def run_dataset_query(dataset_id, run_query_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{datasetId}/runQuery', options)
  command.request_representation = Google::Apis::DatastoreV1beta2::RunQueryRequest::Representation
  command.request_object = run_query_request_object
  command.response_representation = Google::Apis::DatastoreV1beta2::RunQueryResponse::Representation
  command.response_class = Google::Apis::DatastoreV1beta2::RunQueryResponse
  command.params['datasetId'] = dataset_id unless dataset_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end