Class: Google::Apis::AppstateV1::AppStateService

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

Overview

Google App State API

The Google App State API.

Examples:

require 'google/apis/appstate_v1'

Appstate = Google::Apis::AppstateV1 # Alias the module
service = Appstate::AppStateService.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

Methods included from Core::Logging

#logger

Constructor Details

#initializeAppStateService


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

#keyString


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

def key
  @key
end

#quota_userString


43
44
45
# File 'generated/google/apis/appstate_v1/service.rb', line 43

def quota_user
  @quota_user
end

#user_ipString


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.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


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', options)
  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.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:


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}', options)
  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.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


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}', options)
  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.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


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', options)
  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.

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Raises:


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}', options)
  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