Class: Teleswagger::GamesApi
- Inherits:
-
Object
- Object
- Teleswagger::GamesApi
- Defined in:
- lib/teleswagger/api/games_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
- #get_game_high_scores(token, user_id, opts = {}) ⇒ InlineResponse2008
-
#get_game_high_scores_with_http_info(token, user_id, opts = {}) ⇒ Array<(InlineResponse2008, Fixnum, Hash)>
InlineResponse2008 data, response status code and response headers.
-
#initialize(api_client = ApiClient.default) ⇒ GamesApi
constructor
A new instance of GamesApi.
- #send_game(token, opts = {}) ⇒ ResponseMessage
-
#send_game_with_http_info(token, opts = {}) ⇒ Array<(ResponseMessage, Fixnum, Hash)>
ResponseMessage data, response status code and response headers.
- #set_game_score(token, user_id, score, opts = {}) ⇒ InlineResponse2007
-
#set_game_score_with_http_info(token, user_id, score, opts = {}) ⇒ Array<(InlineResponse2007, Fixnum, Hash)>
InlineResponse2007 data, response status code and response headers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ GamesApi
Returns a new instance of GamesApi.
19 20 21 |
# File 'lib/teleswagger/api/games_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/teleswagger/api/games_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_game_high_scores(token, user_id, opts = {}) ⇒ InlineResponse2008
32 33 34 35 |
# File 'lib/teleswagger/api/games_api.rb', line 32 def get_game_high_scores(token, user_id, opts = {}) data, _status_code, _headers = get_game_high_scores_with_http_info(token, user_id, opts) return data end |
#get_game_high_scores_with_http_info(token, user_id, opts = {}) ⇒ Array<(InlineResponse2008, Fixnum, Hash)>
Returns InlineResponse2008 data, response status code and response headers.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/teleswagger/api/games_api.rb', line 46 def get_game_high_scores_with_http_info(token, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: GamesApi.get_game_high_scores ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.get_game_high_scores" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling GamesApi.get_game_high_scores" end # resource path local_var_path = "/bot{token}/getGameHighScores".sub('{' + 'token' + '}', token.to_s) # query parameters query_params = {} query_params[:'user_id'] = user_id query_params[:'chat_id'] = opts[:'chat_id'] if !opts[:'chat_id'].nil? query_params[:'message_id'] = opts[:'message_id'] if !opts[:'message_id'].nil? query_params[:'inline_message_id'] = opts[:'inline_message_id'] if !opts[:'inline_message_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2008') if @api_client.config.debugging @api_client.config.logger.debug "API called: GamesApi#get_game_high_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_game(token, opts = {}) ⇒ ResponseMessage
100 101 102 103 |
# File 'lib/teleswagger/api/games_api.rb', line 100 def send_game(token, opts = {}) data, _status_code, _headers = send_game_with_http_info(token, opts) return data end |
#send_game_with_http_info(token, opts = {}) ⇒ Array<(ResponseMessage, Fixnum, Hash)>
Returns ResponseMessage data, response status code and response headers.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/teleswagger/api/games_api.rb', line 111 def send_game_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: GamesApi.send_game ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.send_game" end # resource path local_var_path = "/bot{token}/sendGame".sub('{' + 'token' + '}', token.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ResponseMessage') if @api_client.config.debugging @api_client.config.logger.debug "API called: GamesApi#send_game\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#set_game_score(token, user_id, score, opts = {}) ⇒ InlineResponse2007
163 164 165 166 |
# File 'lib/teleswagger/api/games_api.rb', line 163 def set_game_score(token, user_id, score, opts = {}) data, _status_code, _headers = set_game_score_with_http_info(token, user_id, score, opts) return data end |
#set_game_score_with_http_info(token, user_id, score, opts = {}) ⇒ Array<(InlineResponse2007, Fixnum, Hash)>
Returns InlineResponse2007 data, response status code and response headers.
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/teleswagger/api/games_api.rb', line 180 def set_game_score_with_http_info(token, user_id, score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: GamesApi.set_game_score ..." end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.set_game_score" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling GamesApi.set_game_score" end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling GamesApi.set_game_score" end # resource path local_var_path = "/bot{token}/setGameScore".sub('{' + 'token' + '}', token.to_s) # query parameters query_params = {} query_params[:'user_id'] = user_id query_params[:'score'] = score query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil? query_params[:'disable_edit_message'] = opts[:'disable_edit_message'] if !opts[:'disable_edit_message'].nil? query_params[:'chat_id'] = opts[:'chat_id'] if !opts[:'chat_id'].nil? query_params[:'message_id'] = opts[:'message_id'] if !opts[:'message_id'].nil? query_params[:'inline_message_id'] = opts[:'inline_message_id'] if !opts[:'inline_message_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2007') if @api_client.config.debugging @api_client.config.logger.debug "API called: GamesApi#set_game_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |