Class: StorecoveApi::InvoiceSubmissionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/storecove/api/invoice_submissions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InvoiceSubmissionsApi

Returns a new instance of InvoiceSubmissionsApi.



18
19
20
# File 'lib/storecove/api/invoice_submissions_api.rb', line 18

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/storecove/api/invoice_submissions_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#create_invoice_submission(invoice_submission, opts = {}) ⇒ InvoiceSubmissionResult

Submit a new invoice Submit an invoice for delivery. include::examples/invoice_submissions/create_invoice_submission/tabs.adoc[]

Parameters:

  • invoice_submission

    Invoice to submit

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/storecove/api/invoice_submissions_api.rb', line 27

def create_invoice_submission(invoice_submission, opts = {})
  data, _status_code, _headers = create_invoice_submission_with_http_info(invoice_submission, opts)
  return data
end

#create_invoice_submission_with_http_info(invoice_submission, opts = {}) ⇒ Array<(InvoiceSubmissionResult, Fixnum, Hash)>

Submit a new invoice Submit an invoice for delivery. include::examples/invoice_submissions/create_invoice_submission/tabs.adoc[]

Parameters:

  • invoice_submission

    Invoice to submit

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

    the optional parameters

Returns:

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

    InvoiceSubmissionResult data, response status code and response headers



37
38
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
# File 'lib/storecove/api/invoice_submissions_api.rb', line 37

def create_invoice_submission_with_http_info(invoice_submission, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoiceSubmissionsApi.create_invoice_submission ..."
  end
  # verify the required parameter 'invoice_submission' is set
  fail ArgumentError, "Missing the required parameter 'invoice_submission' when calling InvoiceSubmissionsApi.create_invoice_submission" if invoice_submission.nil?
  # resource path
  local_var_path = "/invoice_submissions".sub('{format}','json')

  # 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(invoice_submission)
  auth_names = ['Bearer']
  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 => 'InvoiceSubmissionResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoiceSubmissionsApi#create_invoice_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#preflight_invoice_recipient(invoice_recipient_preflight, opts = {}) ⇒ PreflightInvoiceRecipientResult

Preflight an invoice recipient Check whether Storecove can deliver an invoice for a list of ids. include::examples/invoice_submissions/preflight_invoice_recipient/tabs.adoc[]

Parameters:

  • invoice_recipient_preflight

    The invoice recipient to preflight

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

    the optional parameters

Returns:



80
81
82
83
# File 'lib/storecove/api/invoice_submissions_api.rb', line 80

def preflight_invoice_recipient(invoice_recipient_preflight, opts = {})
  data, _status_code, _headers = preflight_invoice_recipient_with_http_info(invoice_recipient_preflight, opts)
  return data
end

#preflight_invoice_recipient_with_http_info(invoice_recipient_preflight, opts = {}) ⇒ Array<(PreflightInvoiceRecipientResult, Fixnum, Hash)>

Preflight an invoice recipient Check whether Storecove can deliver an invoice for a list of ids. include::examples/invoice_submissions/preflight_invoice_recipient/tabs.adoc[]

Parameters:

  • invoice_recipient_preflight

    The invoice recipient to preflight

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

    the optional parameters

Returns:



90
91
92
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
# File 'lib/storecove/api/invoice_submissions_api.rb', line 90

def preflight_invoice_recipient_with_http_info(invoice_recipient_preflight, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: InvoiceSubmissionsApi.preflight_invoice_recipient ..."
  end
  # verify the required parameter 'invoice_recipient_preflight' is set
  fail ArgumentError, "Missing the required parameter 'invoice_recipient_preflight' when calling InvoiceSubmissionsApi.preflight_invoice_recipient" if invoice_recipient_preflight.nil?
  # resource path
  local_var_path = "/invoice_submissions/preflight".sub('{format}','json')

  # 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(invoice_recipient_preflight)
  auth_names = ['Bearer']
  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 => 'PreflightInvoiceRecipientResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InvoiceSubmissionsApi#preflight_invoice_recipient\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end