Method: TransferZero::RecipientsApi#patch_recipient_with_http_info

Defined in:
lib/transferzero-sdk/api/recipients_api.rb

#patch_recipient_with_http_info(recipient_id, recipient_request, opts = {}) ⇒ Array<(RecipientResponse, Fixnum, Hash)>

Updating a recipient Updates the recipient specified in the URL path. Please note that only recipients where the &#x60;editable&#x60; field is true can be modified. Once the recipient is modified any subsequent payout tries will be sent to the updated details.

Parameters:

  • recipient_id

    ID of recipient to update. Example: &#x60;/v1/recipients/9d4d7b73-a94c-4979-ab57-09074fd55d33&#x60;

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

    the optional parameters

Returns:

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

    RecipientResponse data, response status code and response headers



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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/transferzero-sdk/api/recipients_api.rb', line 177

def patch_recipient_with_http_info(recipient_id, recipient_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecipientsApi.patch_recipient ...'
  end
  # verify the required parameter 'recipient_id' is set
  if @api_client.config.client_side_validation && recipient_id.nil?
    fail ArgumentError, "Missing the required parameter 'recipient_id' when calling RecipientsApi.patch_recipient"
  end
  # verify the required parameter 'recipient_request' is set
  if @api_client.config.client_side_validation && recipient_request.nil?
    fail ArgumentError, "Missing the required parameter 'recipient_request' when calling RecipientsApi.patch_recipient"
  end
  # resource path
  local_var_path = '/recipients/{Recipient ID}'.sub('{' + 'Recipient ID' + '}', recipient_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(recipient_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 => 'RecipientResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RecipientsApi#patch_recipient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end