Method: UltracartClient::StorefrontApi#insert_email_flow_with_http_info

Defined in:
lib/ultracart_api/api/storefront_api.rb

#insert_email_flow_with_http_info(storefront_oid, email_flow, opts = {}) ⇒ Array<(EmailFlowResponse, Integer, Hash)>

Insert email flow

Parameters:

  • storefront_oid (Integer)
  • email_flow (EmailFlow)

    Email flow

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

    the optional parameters

Returns:

  • (Array<(EmailFlowResponse, Integer, Hash)>)

    EmailFlowResponse data, response status code and response headers



8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
# File 'lib/ultracart_api/api/storefront_api.rb', line 8422

def insert_email_flow_with_http_info(storefront_oid, email_flow, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StorefrontApi.insert_email_flow ...'
  end
  # verify the required parameter 'storefront_oid' is set
  if @api_client.config.client_side_validation && storefront_oid.nil?
    fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.insert_email_flow"
  end
  # verify the required parameter 'email_flow' is set
  if @api_client.config.client_side_validation && email_flow.nil?
    fail ArgumentError, "Missing the required parameter 'email_flow' when calling StorefrontApi.insert_email_flow"
  end
  # resource path
  local_var_path = '/storefront/{storefront_oid}/email/flows'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(email_flow)

  # return_type
  return_type = opts[:debug_return_type] || 'EmailFlowResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"StorefrontApi.insert_email_flow",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorefrontApi#insert_email_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end