Class: Google::Apis::DatastoreV1beta2::DatastoreService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::DatastoreV1beta2::DatastoreService
- Defined in:
- generated/google/apis/datastore_v1beta2/service.rb
Overview
Google Cloud Datastore API
Stores and queries data in Google Cloud Datastore.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
-
#user_ip ⇒ String
IP address of the site where the request originates.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#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).
-
#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.
-
#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.
-
#initialize ⇒ DatastoreService
constructor
A new instance of DatastoreService.
-
#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.
-
#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.
-
#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.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Constructor Details
#initialize ⇒ DatastoreService
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
#key ⇒ String
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.
38 39 40 |
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 38 def key @key end |
#quota_user ⇒ String
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.
44 45 46 |
# File 'generated/google/apis/datastore_v1beta2/service.rb', line 44 def quota_user @quota_user end |
#user_ip ⇒ String
Returns 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).
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', ) 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.
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', ) 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.
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', ) 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.
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', ) 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.
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', ) 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.
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', ) 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 |