Class: Google::Apis::AppstateV1::AppStateService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::AppstateV1::AppStateService
- Defined in:
- generated/google/apis/appstate_v1/service.rb
Overview
Google App State API
The Google App State API.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
An opaque string that represents a user for quota purposes.
-
#user_ip ⇒ String
Deprecated.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#clear_state(state_key, current_data_version: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::WriteResult
Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version.
-
#delete_state(state_key, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
Deletes a key and the data associated with it.
-
#get_state(state_key, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::GetResponse
Retrieves the data corresponding to the passed key.
-
#initialize ⇒ AppStateService
constructor
A new instance of AppStateService.
-
#list_states(include_data: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::ListResponse
Lists all the states keys, and optionally the state data.
-
#update_state(state_key, update_request_object = nil, current_state_version: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::WriteResult
Update the data associated with the input key if and only if the passed version matches the currently stored version.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ AppStateService
Returns a new instance of AppStateService
49 50 51 52 |
# File 'generated/google/apis/appstate_v1/service.rb', line 49 def initialize super('https://www.googleapis.com/', 'appstate/v1/') @batch_path = 'batch/appstate/v1' 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/appstate_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/appstate_v1/service.rb', line 43 def quota_user @quota_user end |
#user_ip ⇒ String
Returns Deprecated. Please use quotaUser instead.
47 48 49 |
# File 'generated/google/apis/appstate_v1/service.rb', line 47 def user_ip @user_ip end |
Instance Method Details
#clear_state(state_key, current_data_version: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::WriteResult
Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.
81 82 83 84 85 86 87 88 89 90 91 |
# File 'generated/google/apis/appstate_v1/service.rb', line 81 def clear_state(state_key, current_data_version: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:post, 'states/{stateKey}/clear', ) command.response_representation = Google::Apis::AppstateV1::WriteResult::Representation command.response_class = Google::Apis::AppstateV1::WriteResult command.params['stateKey'] = state_key unless state_key.nil? command.query['currentDataVersion'] = current_data_version unless current_data_version.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 |
#delete_state(state_key, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... }
This method returns an undefined value.
Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.
119 120 121 122 123 124 125 126 |
# File 'generated/google/apis/appstate_v1/service.rb', line 119 def delete_state(state_key, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:delete, 'states/{stateKey}', ) command.params['stateKey'] = state_key unless state_key.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 |
#get_state(state_key, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::GetResponse
Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.
151 152 153 154 155 156 157 158 159 160 |
# File 'generated/google/apis/appstate_v1/service.rb', line 151 def get_state(state_key, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'states/{stateKey}', ) command.response_representation = Google::Apis::AppstateV1::GetResponse::Representation command.response_class = Google::Apis::AppstateV1::GetResponse command.params['stateKey'] = state_key unless state_key.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 |
#list_states(include_data: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::ListResponse
Lists all the states keys, and optionally the state data.
184 185 186 187 188 189 190 191 192 193 |
# File 'generated/google/apis/appstate_v1/service.rb', line 184 def list_states(include_data: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:get, 'states', ) command.response_representation = Google::Apis::AppstateV1::ListResponse::Representation command.response_class = Google::Apis::AppstateV1::ListResponse command.query['includeData'] = include_data unless include_data.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 |
#update_state(state_key, update_request_object = nil, current_state_version: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AppstateV1::WriteResult
Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.
225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'generated/google/apis/appstate_v1/service.rb', line 225 def update_state(state_key, update_request_object = nil, current_state_version: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block) command = make_simple_command(:put, 'states/{stateKey}', ) command.request_representation = Google::Apis::AppstateV1::UpdateRequest::Representation command.request_object = update_request_object command.response_representation = Google::Apis::AppstateV1::WriteResult::Representation command.response_class = Google::Apis::AppstateV1::WriteResult command.params['stateKey'] = state_key unless state_key.nil? command.query['currentStateVersion'] = current_state_version unless current_state_version.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 |