Method: Bitpesa::SendersApi#patch_sender_with_http_info

Defined in:
lib/bitpesa-sdk/api/senders_api.rb

#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.

Parameters:

  • sender_id

    ID of the sender to get. Example: &#x60;/v1/senders/bf9ff782-e182-45ac-abea-5bce83ad6670&#x60;

  • sender_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SenderResponse, Fixnum, Hash)>)

    SenderResponse data, response status code and response headers



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/bitpesa-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