Class: TransferZero::SendersApi
- Inherits:
-
Object
- Object
- TransferZero::SendersApi
- Defined in:
- lib/transferzero-sdk/api/senders_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_sender(sender_id, opts = {}) ⇒ SenderResponse
Deleting a sender Deletes a single sender by the Sender ID.
-
#delete_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Deleting a sender Deletes a single sender by the Sender ID.
-
#get_sender(sender_id, opts = {}) ⇒ SenderResponse
Fetching a sender Returns a single sender by the Sender ID.
-
#get_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Fetching a sender Returns a single sender by the Sender ID.
-
#get_senders(opts = {}) ⇒ SenderListResponse
Listing senders Get a list of available senders.
- #get_senders_all(opts = {}) ⇒ Object
-
#get_senders_with_http_info(opts = {}) ⇒ Array<(SenderListResponse, Fixnum, Hash)>
Listing senders Get a list of available senders.
-
#initialize(api_client = ApiClient.default) ⇒ SendersApi
constructor
A new instance of SendersApi.
-
#patch_sender(sender_id, sender_request, opts = {}) ⇒ SenderResponse
Updating a sender Updates the sender specified in the URL path.
-
#patch_sender_with_http_info(sender_id, sender_request, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Updating a sender Updates the sender specified in the URL path.
-
#post_senders(sender_request, opts = {}) ⇒ SenderResponse
Creating a sender Creates a new sender in our system.
-
#post_senders_with_http_info(sender_request, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Creating a sender Creates a new sender in our system.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ SendersApi
Returns a new instance of SendersApi.
19 20 21 |
# File 'lib/transferzero-sdk/api/senders_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/transferzero-sdk/api/senders_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_sender(sender_id, opts = {}) ⇒ SenderResponse
Deleting a sender Deletes a single sender by the Sender ID
29 30 31 32 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 29 def delete_sender(sender_id, opts = {}) data, _status_code, _headers = delete_sender_with_http_info(sender_id, opts) data end |
#delete_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Deleting a sender Deletes a single sender by the Sender ID
39 40 41 42 43 44 45 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 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 39 def delete_sender_with_http_info(sender_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.delete_sender ...' end # verify the required parameter 'sender_id' is set if @api_client.config.client_side_validation && sender_id.nil? fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.delete_sender" end # resource path local_var_path = '/senders/{Sender ID}'.sub('{' + 'Sender ID' + '}', sender_id.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']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SenderResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#delete_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_sender(sender_id, opts = {}) ⇒ SenderResponse
Fetching a sender Returns a single sender by the Sender ID
83 84 85 86 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 83 def get_sender(sender_id, opts = {}) data, _status_code, _headers = get_sender_with_http_info(sender_id, opts) data end |
#get_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Fetching a sender Returns a single sender by the Sender ID
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 93 def get_sender_with_http_info(sender_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.get_sender ...' end # verify the required parameter 'sender_id' is set if @api_client.config.client_side_validation && sender_id.nil? fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.get_sender" end # resource path local_var_path = '/senders/{Sender ID}'.sub('{' + 'Sender ID' + '}', sender_id.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']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] 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 => 'SenderResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#get_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_senders(opts = {}) ⇒ SenderListResponse
Listing senders Get a list of available senders
151 152 153 154 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 151 def get_senders(opts = {}) data, _status_code, _headers = get_senders_with_http_info(opts) data end |
#get_senders_all(opts = {}) ⇒ Object
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 131 def get_senders_all(opts = {}) result = [] response = get_senders(opts) result += response["object"] while next_page = response["meta"]["pagination"]["next_page"] response = get_senders(opts.merge(page: next_page)) result += response["object"] end result end |
#get_senders_with_http_info(opts = {}) ⇒ Array<(SenderListResponse, Fixnum, Hash)>
Listing senders Get a list of available senders
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 165 def get_senders_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.get_senders ...' end # resource path local_var_path = '/senders' # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per'] = opts[:'per'] if !opts[:'per'].nil? query_params[:'created_at_from'] = opts[:'created_at_from'] if !opts[:'created_at_from'].nil? query_params[:'created_at_to'] = opts[:'created_at_to'] if !opts[:'created_at_to'].nil? query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] 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 => 'SenderListResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#get_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#patch_sender(sender_id, sender_request, opts = {}) ⇒ SenderResponse
Updating a sender Updates the sender specified in the URL path.
211 212 213 214 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 211 def patch_sender(sender_id, sender_request, opts = {}) data, _status_code, _headers = patch_sender_with_http_info(sender_id, sender_request, opts) data end |
#patch_sender_with_http_info(sender_id, sender_request, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Updating a sender Updates the sender specified in the URL path.
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 222 def patch_sender_with_http_info(sender_id, sender_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.patch_sender ...' end # verify the required parameter 'sender_id' is set if @api_client.config.client_side_validation && sender_id.nil? fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.patch_sender" end # verify the required parameter 'sender_request' is set if @api_client.config.client_side_validation && sender_request.nil? fail ArgumentError, "Missing the required parameter 'sender_request' when calling SendersApi.patch_sender" end # resource path local_var_path = '/senders/{Sender ID}'.sub('{' + 'Sender ID' + '}', sender_id.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(sender_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SenderResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#patch_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_senders(sender_request, opts = {}) ⇒ SenderResponse
Creating a sender Creates a new sender in our system.
272 273 274 275 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 272 def post_senders(sender_request, opts = {}) data, _status_code, _headers = post_senders_with_http_info(sender_request, opts) data end |
#post_senders_with_http_info(sender_request, opts = {}) ⇒ Array<(SenderResponse, Fixnum, Hash)>
Creating a sender Creates a new sender in our system.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/transferzero-sdk/api/senders_api.rb', line 282 def post_senders_with_http_info(sender_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.post_senders ...' end # verify the required parameter 'sender_request' is set if @api_client.config.client_side_validation && sender_request.nil? fail ArgumentError, "Missing the required parameter 'sender_request' when calling SendersApi.post_senders" end # resource path local_var_path = '/senders' # 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(sender_request) auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature'] 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 => 'SenderResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#post_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |