noths 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +10 -23
  4. data/bin/generate_gem +3 -1
  5. data/bin/refresh_schemas +22 -16
  6. data/docs/AcceptanceBulkModel.md +2 -2
  7. data/docs/DispatchBulkModel.md +1 -1
  8. data/docs/Financials.md +1 -1
  9. data/docs/Order.md +12 -11
  10. data/docs/OrdersApi.md +104 -151
  11. data/docs/RefundsApi.md +8 -12
  12. data/git_push.sh +55 -0
  13. data/lib/noths.rb +1 -11
  14. data/lib/noths/api/orders_api.rb +234 -114
  15. data/lib/noths/api/refunds_api.rb +25 -15
  16. data/lib/noths/api_client.rb +3 -12
  17. data/lib/noths/api_error.rb +16 -11
  18. data/lib/noths/configuration.rb +3 -20
  19. data/lib/noths/models/acceptance_bulk_model.rb +3 -14
  20. data/lib/noths/models/currency.rb +1 -12
  21. data/lib/noths/models/decline_bulk_model.rb +1 -12
  22. data/lib/noths/models/delivery_address.rb +1 -12
  23. data/lib/noths/models/delivery_service.rb +1 -12
  24. data/lib/noths/models/delivery_zone.rb +1 -12
  25. data/lib/noths/models/dispatch_bulk_model.rb +2 -13
  26. data/lib/noths/models/dispatch_notes_bulk_model.rb +1 -12
  27. data/lib/noths/models/enquiry.rb +1 -12
  28. data/lib/noths/models/enquiry_message.rb +1 -12
  29. data/lib/noths/models/error.rb +1 -12
  30. data/lib/noths/models/financials.rb +5 -14
  31. data/lib/noths/models/financials_details.rb +1 -12
  32. data/lib/noths/models/image_url.rb +1 -12
  33. data/lib/noths/models/item.rb +1 -12
  34. data/lib/noths/models/item_financials.rb +1 -12
  35. data/lib/noths/models/link.rb +1 -12
  36. data/lib/noths/models/manual_payment.rb +1 -12
  37. data/lib/noths/models/money.rb +1 -12
  38. data/lib/noths/models/order.rb +28 -28
  39. data/lib/noths/models/order_detail.rb +1 -12
  40. data/lib/noths/models/order_details_bulk_model.rb +1 -12
  41. data/lib/noths/models/order_index.rb +1 -12
  42. data/lib/noths/models/order_refund.rb +1 -12
  43. data/lib/noths/models/product.rb +1 -12
  44. data/lib/noths/models/product_option.rb +1 -12
  45. data/lib/noths/models/refund_response.rb +1 -12
  46. data/lib/noths/models/search_result_meta.rb +1 -12
  47. data/lib/noths/models/user.rb +1 -12
  48. data/lib/noths/version.rb +2 -12
  49. data/noths.gemspec +1 -11
  50. data/schemas/api-docs.json +3 -7
  51. data/schemas/orders.json +163 -88
  52. data/schemas/refunds.json +10 -5
  53. data/spec/api/orders_api_spec.rb +53 -99
  54. data/spec/api/refunds_api_spec.rb +6 -28
  55. data/spec/api_client_spec.rb +2 -14
  56. data/spec/configuration_spec.rb +9 -25
  57. data/spec/models/acceptance_bulk_model_spec.rb +7 -38
  58. data/spec/models/currency_spec.rb +7 -38
  59. data/spec/models/decline_bulk_model_spec.rb +5 -32
  60. data/spec/models/delivery_address_spec.rb +9 -44
  61. data/spec/models/delivery_service_spec.rb +5 -32
  62. data/spec/models/delivery_zone_spec.rb +5 -32
  63. data/spec/models/dispatch_bulk_model_spec.rb +8 -41
  64. data/spec/models/dispatch_notes_bulk_model_spec.rb +4 -29
  65. data/spec/models/enquiry_message_spec.rb +4 -29
  66. data/spec/models/enquiry_spec.rb +6 -35
  67. data/spec/models/error_spec.rb +5 -32
  68. data/spec/models/financials_details_spec.rb +6 -35
  69. data/spec/models/financials_spec.rb +21 -80
  70. data/spec/models/image_url_spec.rb +9 -44
  71. data/spec/models/item_financials_spec.rb +9 -44
  72. data/spec/models/item_spec.rb +11 -50
  73. data/spec/models/link_spec.rb +6 -35
  74. data/spec/models/manual_payment_spec.rb +7 -38
  75. data/spec/models/money_spec.rb +5 -32
  76. data/spec/models/order_detail_spec.rb +5 -32
  77. data/spec/models/order_details_bulk_model_spec.rb +4 -29
  78. data/spec/models/order_index_spec.rb +6 -35
  79. data/spec/models/order_refund_spec.rb +4 -29
  80. data/spec/models/order_spec.rb +53 -164
  81. data/spec/models/product_option_spec.rb +5 -32
  82. data/spec/models/product_spec.rb +8 -41
  83. data/spec/models/refund_response_spec.rb +6 -35
  84. data/spec/models/search_result_meta_spec.rb +5 -32
  85. data/spec/models/user_spec.rb +6 -35
  86. data/spec/spec_helper.rb +1 -11
  87. data/swagger_config.json +1 -1
  88. data/templates/Gemfile.mustache +7 -0
  89. data/templates/README.mustache +127 -0
  90. data/templates/Rakefile.mustache +8 -0
  91. data/templates/api.mustache +194 -0
  92. data/templates/api_client.mustache +383 -0
  93. data/templates/api_client_spec.mustache +214 -0
  94. data/templates/api_doc.mustache +79 -0
  95. data/templates/api_error.mustache +43 -0
  96. data/templates/api_info.mustache +12 -0
  97. data/templates/api_test.mustache +29 -0
  98. data/templates/base_object.mustache +102 -0
  99. data/templates/base_object_spec.mustache +107 -0
  100. data/templates/configuration.mustache +221 -0
  101. data/templates/configuration_spec.mustache +26 -0
  102. data/templates/gem.mustache +38 -0
  103. data/templates/gemspec.mustache +41 -0
  104. data/templates/git_push.sh.mustache +55 -0
  105. data/templates/gitignore.mustache +35 -0
  106. data/templates/model.mustache +7 -0
  107. data/templates/model_doc.mustache +9 -0
  108. data/templates/model_test.mustache +19 -0
  109. data/templates/partial_model_enum_class.mustache +13 -0
  110. data/templates/partial_model_generic.mustache +275 -0
  111. data/templates/rspec.mustache +2 -0
  112. data/templates/spec_helper.mustache +101 -0
  113. data/templates/version.mustache +5 -0
  114. metadata +30 -3
@@ -1,6 +1,6 @@
1
1
  # Noths::RefundsApi
2
2
 
3
- All URIs are relative to *http://localhost*
3
+ All URIs are relative to https://api.notonthehighstreet.com
4
4
 
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
@@ -8,7 +8,7 @@ Method | HTTP request | Description
8
8
 
9
9
 
10
10
  # **refunds_create**
11
- > RefundResponse refunds_create(order_id, refund_reason, cents)
11
+ > RefundResponse refunds_create(token, order_id, refund_reason, cents)
12
12
 
13
13
  Refund an order
14
14
 
@@ -18,16 +18,11 @@ Refunds all or part of an order
18
18
  ```ruby
19
19
  # load the gem
20
20
  require 'noths'
21
- # setup authorization
22
- Noths.configure do |config|
23
- # Configure API key authorization: token
24
- config.api_key['token'] = 'YOUR API KEY'
25
- # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
26
- #config.api_key_prefix['token'] = 'Bearer'
27
- end
28
21
 
29
22
  api_instance = Noths::RefundsApi.new
30
23
 
24
+ token = "token_example" # String | Authentication credential
25
+
31
26
  order_id = 56 # Integer | Order id
32
27
 
33
28
  refund_reason = "refund_reason_example" # String | Customer will see this message
@@ -37,7 +32,7 @@ cents = 56 # Integer |
37
32
 
38
33
  begin
39
34
  #Refund an order
40
- result = api_instance.refunds_create(order_id, refund_reason, cents)
35
+ result = api_instance.refunds_create(token, order_id, refund_reason, cents)
41
36
  p result
42
37
  rescue Noths::ApiError => e
43
38
  puts "Exception when calling RefundsApi->refunds_create: #{e}"
@@ -48,6 +43,7 @@ end
48
43
 
49
44
  Name | Type | Description | Notes
50
45
  ------------- | ------------- | ------------- | -------------
46
+ **token** | **String**| Authentication credential |
51
47
  **order_id** | **Integer**| Order id |
52
48
  **refund_reason** | **String**| Customer will see this message |
53
49
  **cents** | **Integer**| |
@@ -58,11 +54,11 @@ Name | Type | Description | Notes
58
54
 
59
55
  ### Authorization
60
56
 
61
- [token](../README.md#token)
57
+ No authorization required
62
58
 
63
59
  ### HTTP request headers
64
60
 
65
- - **Content-Type**: Not defined
61
+ - **Content-Type**: application/x-www-form-urlencoded
66
62
  - **Accept**: Not defined
67
63
 
68
64
 
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="veeqo"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="noths"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -1,14 +1,4 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
1
+ # frozen_string_literal: true
12
2
 
13
3
  # Common files
14
4
  require 'noths/api_client'
@@ -1,14 +1,4 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
1
+ # frozen_string_literal: true
12
2
 
13
3
  require "uri"
14
4
 
@@ -22,29 +12,35 @@ module Noths
22
12
 
23
13
  # Accept an order
24
14
  # Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
15
+ # @param token Authentication credential
25
16
  # @param id Order id
26
17
  # @param estimated_delivery_date 'yyyy-mm-dd'
27
18
  # @param estimated_dispatch_at 'yyyy-mm-dd'
28
19
  # @param [Hash] opts the optional parameters
29
20
  # @option opts [String] :confirmation_note
30
21
  # @return [nil]
31
- def orders_acceptance(id, estimated_delivery_date, estimated_dispatch_at, opts = {})
32
- orders_acceptance_with_http_info(id, estimated_delivery_date, estimated_dispatch_at, opts)
22
+ def orders_acceptance(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {})
23
+ orders_acceptance_with_http_info(token, id, estimated_delivery_date, estimated_dispatch_at, opts)
33
24
  return nil
34
25
  end
35
26
 
36
27
  # Accept an order
37
28
  # Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
29
+ # @param token Authentication credential
38
30
  # @param id Order id
39
31
  # @param estimated_delivery_date 'yyyy-mm-dd'
40
32
  # @param estimated_dispatch_at 'yyyy-mm-dd'
41
33
  # @param [Hash] opts the optional parameters
42
34
  # @option opts [String] :confirmation_note
43
35
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
44
- def orders_acceptance_with_http_info(id, estimated_delivery_date, estimated_dispatch_at, opts = {})
36
+ def orders_acceptance_with_http_info(token, id, estimated_delivery_date, estimated_dispatch_at, opts = {})
45
37
  if @api_client.config.debugging
46
38
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_acceptance ..."
47
39
  end
40
+ # verify the required parameter 'token' is set
41
+ if @api_client.config.client_side_validation && token.nil?
42
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_acceptance"
43
+ end
48
44
  # verify the required parameter 'id' is set
49
45
  if @api_client.config.client_side_validation && id.nil?
50
46
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_acceptance"
@@ -62,9 +58,12 @@ module Noths
62
58
 
63
59
  # query parameters
64
60
  query_params = {}
61
+ query_params[:'token'] = token
65
62
 
66
63
  # header parameters
67
64
  header_params = {}
65
+ # HTTP header 'Content-Type'
66
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
68
67
 
69
68
  # form parameters
70
69
  form_params = {}
@@ -74,7 +73,7 @@ module Noths
74
73
 
75
74
  # http body (model)
76
75
  post_body = nil
77
- auth_names = ['token']
76
+ auth_names = []
78
77
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
79
78
  :header_params => header_params,
80
79
  :query_params => query_params,
@@ -89,23 +88,29 @@ module Noths
89
88
 
90
89
  # Accept multiple orders
91
90
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates that the order was eligible to be accepted and is expected to be processed successfully. This is not a guarantee that the order will be accepted. Processing acceptance is not instantaneous and may take some time while funds are captured. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
91
+ # @param token Authentication credential
92
92
  # @param payload
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @return [nil]
95
- def orders_acceptance_bulk(payload, opts = {})
96
- orders_acceptance_bulk_with_http_info(payload, opts)
95
+ def orders_acceptance_bulk(token, payload, opts = {})
96
+ orders_acceptance_bulk_with_http_info(token, payload, opts)
97
97
  return nil
98
98
  end
99
99
 
100
100
  # Accept multiple orders
101
101
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates that the order was eligible to be accepted and is expected to be processed successfully. This is not a guarantee that the order will be accepted. Processing acceptance is not instantaneous and may take some time while funds are captured. Example response: &lt;pre&gt; [ { \&quot;id\&quot;: 12, \&quot;status\&quot;: 200, \&quot;errors\&quot;: [] }, { \&quot;id\&quot;: 22, \&quot;status\&quot;: 404, \&quot;errors\&quot;: [ { \&quot;code\&quot;: \&quot;RESOURCE_NOT_FOUND\&quot;, \&quot;title\&quot;: \&quot;Couldn&#39;t find the requested resource\&quot; } ] } ] &lt;/pre&gt;
102
+ # @param token Authentication credential
102
103
  # @param payload
103
104
  # @param [Hash] opts the optional parameters
104
105
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
105
- def orders_acceptance_bulk_with_http_info(payload, opts = {})
106
+ def orders_acceptance_bulk_with_http_info(token, payload, opts = {})
106
107
  if @api_client.config.debugging
107
108
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_acceptance_bulk ..."
108
109
  end
110
+ # verify the required parameter 'token' is set
111
+ if @api_client.config.client_side_validation && token.nil?
112
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_acceptance_bulk"
113
+ end
109
114
  # verify the required parameter 'payload' is set
110
115
  if @api_client.config.client_side_validation && payload.nil?
111
116
  fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_acceptance_bulk"
@@ -115,16 +120,19 @@ module Noths
115
120
 
116
121
  # query parameters
117
122
  query_params = {}
123
+ query_params[:'token'] = token
118
124
 
119
125
  # header parameters
120
126
  header_params = {}
127
+ # HTTP header 'Content-Type'
128
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
121
129
 
122
130
  # form parameters
123
131
  form_params = {}
124
132
 
125
133
  # http body (model)
126
134
  post_body = @api_client.object_to_http_body(payload)
127
- auth_names = ['token']
135
+ auth_names = []
128
136
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
129
137
  :header_params => header_params,
130
138
  :query_params => query_params,
@@ -139,25 +147,31 @@ module Noths
139
147
 
140
148
  # Decline an order
141
149
  # Declines an order that is in the placed state
150
+ # @param token Authentication credential
142
151
  # @param id Order id
143
152
  # @param decline_reason
144
153
  # @param [Hash] opts the optional parameters
145
154
  # @return [nil]
146
- def orders_decline(id, decline_reason, opts = {})
147
- orders_decline_with_http_info(id, decline_reason, opts)
155
+ def orders_decline(token, id, decline_reason, opts = {})
156
+ orders_decline_with_http_info(token, id, decline_reason, opts)
148
157
  return nil
149
158
  end
150
159
 
151
160
  # Decline an order
152
161
  # Declines an order that is in the placed state
162
+ # @param token Authentication credential
153
163
  # @param id Order id
154
164
  # @param decline_reason
155
165
  # @param [Hash] opts the optional parameters
156
166
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
157
- def orders_decline_with_http_info(id, decline_reason, opts = {})
167
+ def orders_decline_with_http_info(token, id, decline_reason, opts = {})
158
168
  if @api_client.config.debugging
159
169
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_decline ..."
160
170
  end
171
+ # verify the required parameter 'token' is set
172
+ if @api_client.config.client_side_validation && token.nil?
173
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_decline"
174
+ end
161
175
  # verify the required parameter 'id' is set
162
176
  if @api_client.config.client_side_validation && id.nil?
163
177
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_decline"
@@ -171,9 +185,12 @@ module Noths
171
185
 
172
186
  # query parameters
173
187
  query_params = {}
188
+ query_params[:'token'] = token
174
189
 
175
190
  # header parameters
176
191
  header_params = {}
192
+ # HTTP header 'Content-Type'
193
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
177
194
 
178
195
  # form parameters
179
196
  form_params = {}
@@ -181,7 +198,7 @@ module Noths
181
198
 
182
199
  # http body (model)
183
200
  post_body = nil
184
- auth_names = ['token']
201
+ auth_names = []
185
202
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
186
203
  :header_params => header_params,
187
204
  :query_params => query_params,
@@ -196,23 +213,29 @@ module Noths
196
213
 
197
214
  # Decline multiple orders
198
215
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
216
+ # @param token Authentication credential
199
217
  # @param payload
200
218
  # @param [Hash] opts the optional parameters
201
219
  # @return [nil]
202
- def orders_decline_bulk(payload, opts = {})
203
- orders_decline_bulk_with_http_info(payload, opts)
220
+ def orders_decline_bulk(token, payload, opts = {})
221
+ orders_decline_bulk_with_http_info(token, payload, opts)
204
222
  return nil
205
223
  end
206
224
 
207
225
  # Decline multiple orders
208
226
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: &lt;pre&gt; [ { \&quot;id\&quot;: 12, \&quot;status\&quot;: 200, \&quot;errors\&quot;: [] }, { \&quot;id\&quot;: 22, \&quot;status\&quot;: 404, \&quot;errors\&quot;: [ { \&quot;code\&quot;: \&quot;RESOURCE_NOT_FOUND\&quot;, \&quot;title\&quot;: \&quot;Couldn&#39;t find the requested resource\&quot; } ] } ] &lt;/pre&gt;
227
+ # @param token Authentication credential
209
228
  # @param payload
210
229
  # @param [Hash] opts the optional parameters
211
230
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
212
- def orders_decline_bulk_with_http_info(payload, opts = {})
231
+ def orders_decline_bulk_with_http_info(token, payload, opts = {})
213
232
  if @api_client.config.debugging
214
233
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_decline_bulk ..."
215
234
  end
235
+ # verify the required parameter 'token' is set
236
+ if @api_client.config.client_side_validation && token.nil?
237
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_decline_bulk"
238
+ end
216
239
  # verify the required parameter 'payload' is set
217
240
  if @api_client.config.client_side_validation && payload.nil?
218
241
  fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_decline_bulk"
@@ -222,16 +245,19 @@ module Noths
222
245
 
223
246
  # query parameters
224
247
  query_params = {}
248
+ query_params[:'token'] = token
225
249
 
226
250
  # header parameters
227
251
  header_params = {}
252
+ # HTTP header 'Content-Type'
253
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
228
254
 
229
255
  # form parameters
230
256
  form_params = {}
231
257
 
232
258
  # http body (model)
233
259
  post_body = @api_client.object_to_http_body(payload)
234
- auth_names = ['token']
260
+ auth_names = []
235
261
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
236
262
  :header_params => header_params,
237
263
  :query_params => query_params,
@@ -246,25 +272,31 @@ module Noths
246
272
 
247
273
  # Generate a dispatch note pdf or gift note pdf.
248
274
  # Force the kind of document by passing the force_type parameter. A gift note can only be printed for an order that is a gift, which will be the default behaviour.<p/>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
275
+ # @param token Authentication credential
249
276
  # @param id Order id
250
277
  # @param [Hash] opts the optional parameters
251
278
  # @option opts [String] :force_type Type of document
252
- # @return [nil]
253
- def orders_dispatch_note(id, opts = {})
254
- orders_dispatch_note_with_http_info(id, opts)
255
- return nil
279
+ # @return [File]
280
+ def orders_dispatch_note(token, id, opts = {})
281
+ data, _status_code, _headers = orders_dispatch_note_with_http_info(token, id, opts)
282
+ return data
256
283
  end
257
284
 
258
285
  # Generate a dispatch note pdf or gift note pdf.
259
286
  # Force the kind of document by passing the force_type parameter. A gift note can only be printed for an order that is a gift, which will be the default behaviour.&lt;p/&gt;Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -XPOST [URL] &gt; document.pdf&lt;/pre&gt;
287
+ # @param token Authentication credential
260
288
  # @param id Order id
261
289
  # @param [Hash] opts the optional parameters
262
290
  # @option opts [String] :force_type Type of document
263
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
264
- def orders_dispatch_note_with_http_info(id, opts = {})
291
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
292
+ def orders_dispatch_note_with_http_info(token, id, opts = {})
265
293
  if @api_client.config.debugging
266
294
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_note ..."
267
295
  end
296
+ # verify the required parameter 'token' is set
297
+ if @api_client.config.client_side_validation && token.nil?
298
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_note"
299
+ end
268
300
  # verify the required parameter 'id' is set
269
301
  if @api_client.config.client_side_validation && id.nil?
270
302
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_dispatch_note"
@@ -277,23 +309,27 @@ module Noths
277
309
 
278
310
  # query parameters
279
311
  query_params = {}
280
- query_params[:'force_type'] = opts[:'force_type'] if !opts[:'force_type'].nil?
312
+ query_params[:'token'] = token
313
+ query_params[:'force_type'] = normalize(opts[:'force_type']) if !opts[:'force_type'].nil?
281
314
 
282
315
  # header parameters
283
316
  header_params = {}
317
+ # HTTP header 'Accept' (if needed)
318
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
284
319
 
285
320
  # form parameters
286
321
  form_params = {}
287
322
 
288
323
  # http body (model)
289
324
  post_body = nil
290
- auth_names = ['token']
325
+ auth_names = []
291
326
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
292
327
  :header_params => header_params,
293
328
  :query_params => query_params,
294
329
  :form_params => form_params,
295
330
  :body => post_body,
296
- :auth_names => auth_names)
331
+ :auth_names => auth_names,
332
+ :return_type => 'File')
297
333
  if @api_client.config.debugging
298
334
  @api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
299
335
  end
@@ -302,23 +338,29 @@ module Noths
302
338
 
303
339
  # Generate pdf with dispatch note for each order
304
340
  # <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
341
+ # @param token Authentication credential
305
342
  # @param payload
306
343
  # @param [Hash] opts the optional parameters
307
- # @return [nil]
308
- def orders_dispatch_notes_bulk(payload, opts = {})
309
- orders_dispatch_notes_bulk_with_http_info(payload, opts)
310
- return nil
344
+ # @return [File]
345
+ def orders_dispatch_notes_bulk(token, payload, opts = {})
346
+ data, _status_code, _headers = orders_dispatch_notes_bulk_with_http_info(token, payload, opts)
347
+ return data
311
348
  end
312
349
 
313
350
  # Generate pdf with dispatch note for each order
314
351
  # &lt;p/&gt; Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -H \&quot;Content-Type: application/json\&quot; -d &#39;[{\&quot;id\&quot;: 123}, {\&quot;id\&quot;: 456}]&#39; -XPOST [URL] &gt; document.pdf&lt;/pre&gt;&lt;p/&gt; Ensure that the Content-Type header is set to \&quot;Content-Type: application/json\&quot;.&lt;p/&gt;
352
+ # @param token Authentication credential
315
353
  # @param payload
316
354
  # @param [Hash] opts the optional parameters
317
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
318
- def orders_dispatch_notes_bulk_with_http_info(payload, opts = {})
355
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
356
+ def orders_dispatch_notes_bulk_with_http_info(token, payload, opts = {})
319
357
  if @api_client.config.debugging
320
358
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_notes_bulk ..."
321
359
  end
360
+ # verify the required parameter 'token' is set
361
+ if @api_client.config.client_side_validation && token.nil?
362
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_notes_bulk"
363
+ end
322
364
  # verify the required parameter 'payload' is set
323
365
  if @api_client.config.client_side_validation && payload.nil?
324
366
  fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_dispatch_notes_bulk"
@@ -328,22 +370,28 @@ module Noths
328
370
 
329
371
  # query parameters
330
372
  query_params = {}
373
+ query_params[:'token'] = token
331
374
 
332
375
  # header parameters
333
376
  header_params = {}
377
+ # HTTP header 'Accept' (if needed)
378
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
379
+ # HTTP header 'Content-Type'
380
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
334
381
 
335
382
  # form parameters
336
383
  form_params = {}
337
384
 
338
385
  # http body (model)
339
386
  post_body = @api_client.object_to_http_body(payload)
340
- auth_names = ['token']
387
+ auth_names = []
341
388
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
342
389
  :header_params => header_params,
343
390
  :query_params => query_params,
344
391
  :form_params => form_params,
345
392
  :body => post_body,
346
- :auth_names => auth_names)
393
+ :auth_names => auth_names,
394
+ :return_type => 'File')
347
395
  if @api_client.config.debugging
348
396
  @api_client.config.logger.debug "API called: OrdersApi#orders_dispatch_notes_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
349
397
  end
@@ -352,6 +400,7 @@ module Noths
352
400
 
353
401
  # Dispatch an order
354
402
  # Dispatches an order that is in an accepted state and has also had its dispatch note printed
403
+ # @param token Authentication credential
355
404
  # @param id Order id
356
405
  # @param estimated_delivery_date &#39;yyyy-mm-dd&#39;
357
406
  # @param [Hash] opts the optional parameters
@@ -360,13 +409,14 @@ module Noths
360
409
  # @option opts [String] :parcel_tracking_url
361
410
  # @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
362
411
  # @return [nil]
363
- def orders_dispatch_order(id, estimated_delivery_date, opts = {})
364
- orders_dispatch_order_with_http_info(id, estimated_delivery_date, opts)
412
+ def orders_dispatch_order(token, id, estimated_delivery_date, opts = {})
413
+ orders_dispatch_order_with_http_info(token, id, estimated_delivery_date, opts)
365
414
  return nil
366
415
  end
367
416
 
368
417
  # Dispatch an order
369
418
  # Dispatches an order that is in an accepted state and has also had its dispatch note printed
419
+ # @param token Authentication credential
370
420
  # @param id Order id
371
421
  # @param estimated_delivery_date &#39;yyyy-mm-dd&#39;
372
422
  # @param [Hash] opts the optional parameters
@@ -375,10 +425,14 @@ module Noths
375
425
  # @option opts [String] :parcel_tracking_url
376
426
  # @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
377
427
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
378
- def orders_dispatch_order_with_http_info(id, estimated_delivery_date, opts = {})
428
+ def orders_dispatch_order_with_http_info(token, id, estimated_delivery_date, opts = {})
379
429
  if @api_client.config.debugging
380
430
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_order ..."
381
431
  end
432
+ # verify the required parameter 'token' is set
433
+ if @api_client.config.client_side_validation && token.nil?
434
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_order"
435
+ end
382
436
  # verify the required parameter 'id' is set
383
437
  if @api_client.config.client_side_validation && id.nil?
384
438
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_dispatch_order"
@@ -392,9 +446,12 @@ module Noths
392
446
 
393
447
  # query parameters
394
448
  query_params = {}
449
+ query_params[:'token'] = token
395
450
 
396
451
  # header parameters
397
452
  header_params = {}
453
+ # HTTP header 'Content-Type'
454
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
398
455
 
399
456
  # form parameters
400
457
  form_params = {}
@@ -406,7 +463,7 @@ module Noths
406
463
 
407
464
  # http body (model)
408
465
  post_body = nil
409
- auth_names = ['token']
466
+ auth_names = []
410
467
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
411
468
  :header_params => header_params,
412
469
  :query_params => query_params,
@@ -421,25 +478,31 @@ module Noths
421
478
 
422
479
  # Dispatch multiple orders
423
480
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
481
+ # @param token Authentication credential
424
482
  # @param payload
425
483
  # @param [Hash] opts the optional parameters
426
484
  # @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
427
485
  # @return [nil]
428
- def orders_dispatch_orders_bulk(payload, opts = {})
429
- orders_dispatch_orders_bulk_with_http_info(payload, opts)
486
+ def orders_dispatch_orders_bulk(token, payload, opts = {})
487
+ orders_dispatch_orders_bulk_with_http_info(token, payload, opts)
430
488
  return nil
431
489
  end
432
490
 
433
491
  # Dispatch multiple orders
434
492
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: &lt;pre&gt; [ { \&quot;id\&quot;: 12, \&quot;status\&quot;: 200, \&quot;errors\&quot;: [] }, { \&quot;id\&quot;: 22, \&quot;status\&quot;: 404, \&quot;errors\&quot;: [ { \&quot;code\&quot;: \&quot;RESOURCE_NOT_FOUND\&quot;, \&quot;title\&quot;: \&quot;Couldn&#39;t find the requested resource\&quot; } ] } ] &lt;/pre&gt;
493
+ # @param token Authentication credential
435
494
  # @param payload
436
495
  # @param [Hash] opts the optional parameters
437
496
  # @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
438
497
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
439
- def orders_dispatch_orders_bulk_with_http_info(payload, opts = {})
498
+ def orders_dispatch_orders_bulk_with_http_info(token, payload, opts = {})
440
499
  if @api_client.config.debugging
441
500
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_dispatch_orders_bulk ..."
442
501
  end
502
+ # verify the required parameter 'token' is set
503
+ if @api_client.config.client_side_validation && token.nil?
504
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_dispatch_orders_bulk"
505
+ end
443
506
  # verify the required parameter 'payload' is set
444
507
  if @api_client.config.client_side_validation && payload.nil?
445
508
  fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_dispatch_orders_bulk"
@@ -449,17 +512,20 @@ module Noths
449
512
 
450
513
  # query parameters
451
514
  query_params = {}
452
- query_params[:'ignore_unresolved_enquiries'] = opts[:'ignore_unresolved_enquiries'] if !opts[:'ignore_unresolved_enquiries'].nil?
515
+ query_params[:'token'] = token
516
+ query_params[:'ignore_unresolved_enquiries'] = normalize(opts[:'ignore_unresolved_enquiries']) if !opts[:'ignore_unresolved_enquiries'].nil?
453
517
 
454
518
  # header parameters
455
519
  header_params = {}
520
+ # HTTP header 'Content-Type'
521
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
456
522
 
457
523
  # form parameters
458
524
  form_params = {}
459
525
 
460
526
  # http body (model)
461
527
  post_body = @api_client.object_to_http_body(payload)
462
- auth_names = ['token']
528
+ auth_names = []
463
529
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
464
530
  :header_params => header_params,
465
531
  :query_params => query_params,
@@ -474,6 +540,7 @@ module Noths
474
540
 
475
541
  # Fetch orders
476
542
  # Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
543
+ # @param token Authentication credential
477
544
  # @param [Hash] opts the optional parameters
478
545
  # @option opts [DateTime] :customer_expected_delivery_date_from Earliest customer_expected_delivery_date datetime - format iso8601 eg &#39;2011-10-05T22:26:12-04:00&#39;
479
546
  # @option opts [DateTime] :customer_expected_delivery_date_to Latest customer_expected_delivery_date datetime - format iso8601 eg &#39;2011-10-05T22:26:12-04:00&#39;
@@ -497,15 +564,16 @@ module Noths
497
564
  # @option opts [String] :query Matches your query to information related to your orders
498
565
  # @option opts [BOOLEAN] :repeat_customer
499
566
  # @option opts [String] :sort Defaults to placed_at
500
- # @option opts [String] :state State
567
+ # @option opts [Array<String>] :state State
501
568
  # @return [OrderIndex]
502
- def orders_index(opts = {})
503
- data, _status_code, _headers = orders_index_with_http_info(opts)
569
+ def orders_index(token, opts = {})
570
+ data, _status_code, _headers = orders_index_with_http_info(token, opts)
504
571
  return data
505
572
  end
506
573
 
507
574
  # Fetch orders
508
575
  # Lists orders descending by placed at time by default.&lt;p/&gt;If you just want a count, use per_page&#x3D;0 and offset&#x3D;0 .
576
+ # @param token Authentication credential
509
577
  # @param [Hash] opts the optional parameters
510
578
  # @option opts [DateTime] :customer_expected_delivery_date_from Earliest customer_expected_delivery_date datetime - format iso8601 eg &#39;2011-10-05T22:26:12-04:00&#39;
511
579
  # @option opts [DateTime] :customer_expected_delivery_date_to Latest customer_expected_delivery_date datetime - format iso8601 eg &#39;2011-10-05T22:26:12-04:00&#39;
@@ -529,12 +597,16 @@ module Noths
529
597
  # @option opts [String] :query Matches your query to information related to your orders
530
598
  # @option opts [BOOLEAN] :repeat_customer
531
599
  # @option opts [String] :sort Defaults to placed_at
532
- # @option opts [String] :state State
600
+ # @option opts [Array<String>] :state State
533
601
  # @return [Array<(OrderIndex, Fixnum, Hash)>] OrderIndex data, response status code and response headers
534
- def orders_index_with_http_info(opts = {})
602
+ def orders_index_with_http_info(token, opts = {})
535
603
  if @api_client.config.debugging
536
604
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_index ..."
537
605
  end
606
+ # verify the required parameter 'token' is set
607
+ if @api_client.config.client_side_validation && token.nil?
608
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_index"
609
+ end
538
610
  if @api_client.config.client_side_validation && opts[:'delivery_service_code'] && !['EXPRESS_12', 'EXPRESS_24', 'EXPRESS_48', 'FREE', 'SATURDAY', 'STANDARD', 'STANDARD_COURIER'].include?(opts[:'delivery_service_code'])
539
611
  fail ArgumentError, 'invalid value for "delivery_service_code", must be one of EXPRESS_12, EXPRESS_24, EXPRESS_48, FREE, SATURDAY, STANDARD, STANDARD_COURIER'
540
612
  end
@@ -547,37 +619,35 @@ module Noths
547
619
  if @api_client.config.client_side_validation && opts[:'sort'] && !['accepted_at', 'confirm_by', 'customer_email', 'customer_expected_delivery_date', 'customer_name', 'declined_at', 'delivery_recipient_name', 'delivery_service_code', 'dispatch_note_viewed', 'dispatched_at', 'enquiry_state', 'estimated_delivery_date', 'estimated_dispatch_at', 'expired_at', 'gift', 'international', 'listing_total_gross_value', 'partner_name', 'partner_shortcode', 'placed_at', 'state'].include?(opts[:'sort'])
548
620
  fail ArgumentError, 'invalid value for "sort", must be one of accepted_at, confirm_by, customer_email, customer_expected_delivery_date, customer_name, declined_at, delivery_recipient_name, delivery_service_code, dispatch_note_viewed, dispatched_at, enquiry_state, estimated_delivery_date, estimated_dispatch_at, expired_at, gift, international, listing_total_gross_value, partner_name, partner_shortcode, placed_at, state'
549
621
  end
550
- if @api_client.config.client_side_validation && opts[:'state'] && !['placed', 'expired', 'accepted', 'declined', 'dispatched', 'refunded', 'archived'].include?(opts[:'state'])
551
- fail ArgumentError, 'invalid value for "state", must be one of placed, expired, accepted, declined, dispatched, refunded, archived'
552
- end
553
622
  # resource path
554
623
  local_var_path = "/api/v1/orders"
555
624
 
556
625
  # query parameters
557
626
  query_params = {}
558
- query_params[:'customer_expected_delivery_date[from]'] = opts[:'customer_expected_delivery_date_from'] if !opts[:'customer_expected_delivery_date_from'].nil?
559
- query_params[:'customer_expected_delivery_date[to]'] = opts[:'customer_expected_delivery_date_to'] if !opts[:'customer_expected_delivery_date_to'].nil?
560
- query_params[:'delivery_service_code'] = opts[:'delivery_service_code'] if !opts[:'delivery_service_code'].nil?
561
- query_params[:'delivery_zone_ids'] = opts[:'delivery_zone_ids'] if !opts[:'delivery_zone_ids'].nil?
562
- query_params[:'dir'] = opts[:'dir'] if !opts[:'dir'].nil?
563
- query_params[:'dispatch_note_viewed'] = opts[:'dispatch_note_viewed'] if !opts[:'dispatch_note_viewed'].nil?
564
- query_params[:'enquiry_state'] = opts[:'enquiry_state'] if !opts[:'enquiry_state'].nil?
565
- query_params[:'estimated_delivery_date[from]'] = opts[:'estimated_delivery_date_from'] if !opts[:'estimated_delivery_date_from'].nil?
566
- query_params[:'estimated_delivery_date[to]'] = opts[:'estimated_delivery_date_to'] if !opts[:'estimated_delivery_date_to'].nil?
567
- query_params[:'estimated_dispatch_at[from]'] = opts[:'estimated_dispatch_at_from'] if !opts[:'estimated_dispatch_at_from'].nil?
568
- query_params[:'estimated_dispatch_at[to]'] = opts[:'estimated_dispatch_at_to'] if !opts[:'estimated_dispatch_at_to'].nil?
569
- query_params[:'updated_at[from]'] = opts[:'updated_at_from'] if !opts[:'updated_at_from'].nil?
570
- query_params[:'updated_at[to]'] = opts[:'updated_at_to'] if !opts[:'updated_at_to'].nil?
571
- query_params[:'gift'] = opts[:'gift'] if !opts[:'gift'].nil?
572
- query_params[:'unresolved_enquiry'] = opts[:'unresolved_enquiry'] if !opts[:'unresolved_enquiry'].nil?
573
- query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?
574
- query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
575
- query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
576
- query_params[:'product_ids'] = opts[:'product_ids'] if !opts[:'product_ids'].nil?
577
- query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
578
- query_params[:'repeat_customer'] = opts[:'repeat_customer'] if !opts[:'repeat_customer'].nil?
579
- query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
580
- query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
627
+ query_params[:'token'] = token
628
+ query_params[:'customer_expected_delivery_date[from]'] = normalize(opts[:'customer_expected_delivery_date_from']) if !opts[:'customer_expected_delivery_date_from'].nil?
629
+ query_params[:'customer_expected_delivery_date[to]'] = normalize(opts[:'customer_expected_delivery_date_to']) if !opts[:'customer_expected_delivery_date_to'].nil?
630
+ query_params[:'delivery_service_code'] = normalize(opts[:'delivery_service_code']) if !opts[:'delivery_service_code'].nil?
631
+ query_params[:'delivery_zone_ids'] = normalize(opts[:'delivery_zone_ids']) if !opts[:'delivery_zone_ids'].nil?
632
+ query_params[:'dir'] = normalize(opts[:'dir']) if !opts[:'dir'].nil?
633
+ query_params[:'dispatch_note_viewed'] = normalize(opts[:'dispatch_note_viewed']) if !opts[:'dispatch_note_viewed'].nil?
634
+ query_params[:'enquiry_state'] = normalize(opts[:'enquiry_state']) if !opts[:'enquiry_state'].nil?
635
+ query_params[:'estimated_delivery_date[from]'] = normalize(opts[:'estimated_delivery_date_from']) if !opts[:'estimated_delivery_date_from'].nil?
636
+ query_params[:'estimated_delivery_date[to]'] = normalize(opts[:'estimated_delivery_date_to']) if !opts[:'estimated_delivery_date_to'].nil?
637
+ query_params[:'estimated_dispatch_at[from]'] = normalize(opts[:'estimated_dispatch_at_from']) if !opts[:'estimated_dispatch_at_from'].nil?
638
+ query_params[:'estimated_dispatch_at[to]'] = normalize(opts[:'estimated_dispatch_at_to']) if !opts[:'estimated_dispatch_at_to'].nil?
639
+ query_params[:'updated_at[from]'] = normalize(opts[:'updated_at_from']) if !opts[:'updated_at_from'].nil?
640
+ query_params[:'updated_at[to]'] = normalize(opts[:'updated_at_to']) if !opts[:'updated_at_to'].nil?
641
+ query_params[:'gift'] = normalize(opts[:'gift']) if !opts[:'gift'].nil?
642
+ query_params[:'unresolved_enquiry'] = normalize(opts[:'unresolved_enquiry']) if !opts[:'unresolved_enquiry'].nil?
643
+ query_params[:'ids'] = normalize(opts[:'ids']) if !opts[:'ids'].nil?
644
+ query_params[:'offset'] = normalize(opts[:'offset']) if !opts[:'offset'].nil?
645
+ query_params[:'per_page'] = normalize(opts[:'per_page']) if !opts[:'per_page'].nil?
646
+ query_params[:'product_ids'] = normalize(opts[:'product_ids']) if !opts[:'product_ids'].nil?
647
+ query_params[:'query'] = normalize(opts[:'query']) if !opts[:'query'].nil?
648
+ query_params[:'repeat_customer'] = normalize(opts[:'repeat_customer']) if !opts[:'repeat_customer'].nil?
649
+ query_params[:'sort'] = normalize(opts[:'sort']) if !opts[:'sort'].nil?
650
+ query_params[:'state'] = normalize(@api_client.build_collection_param(opts[:'state'], :csv)) if !opts[:'state'].nil?
581
651
 
582
652
  # header parameters
583
653
  header_params = {}
@@ -587,7 +657,7 @@ module Noths
587
657
 
588
658
  # http body (model)
589
659
  post_body = nil
590
- auth_names = ['token']
660
+ auth_names = []
591
661
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
592
662
  :header_params => header_params,
593
663
  :query_params => query_params,
@@ -603,25 +673,31 @@ module Noths
603
673
 
604
674
  # Generate a vat invoice pdf.
605
675
  # <p>Invoices are currently only applicable for the UK site</p>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
676
+ # @param token Authentication credential
606
677
  # @param id Order id
607
678
  # @param type Type of invoice
608
679
  # @param [Hash] opts the optional parameters
609
- # @return [nil]
610
- def orders_invoice(id, type, opts = {})
611
- orders_invoice_with_http_info(id, type, opts)
612
- return nil
680
+ # @return [File]
681
+ def orders_invoice(token, id, type, opts = {})
682
+ data, _status_code, _headers = orders_invoice_with_http_info(token, id, type, opts)
683
+ return data
613
684
  end
614
685
 
615
686
  # Generate a vat invoice pdf.
616
687
  # &lt;p&gt;Invoices are currently only applicable for the UK site&lt;/p&gt;Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -XPOST [URL] &gt; document.pdf&lt;/pre&gt;
688
+ # @param token Authentication credential
617
689
  # @param id Order id
618
690
  # @param type Type of invoice
619
691
  # @param [Hash] opts the optional parameters
620
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
621
- def orders_invoice_with_http_info(id, type, opts = {})
692
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
693
+ def orders_invoice_with_http_info(token, id, type, opts = {})
622
694
  if @api_client.config.debugging
623
695
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_invoice ..."
624
696
  end
697
+ # verify the required parameter 'token' is set
698
+ if @api_client.config.client_side_validation && token.nil?
699
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_invoice"
700
+ end
625
701
  # verify the required parameter 'id' is set
626
702
  if @api_client.config.client_side_validation && id.nil?
627
703
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_invoice"
@@ -639,23 +715,27 @@ module Noths
639
715
 
640
716
  # query parameters
641
717
  query_params = {}
718
+ query_params[:'token'] = token
642
719
  query_params[:'type'] = type
643
720
 
644
721
  # header parameters
645
722
  header_params = {}
723
+ # HTTP header 'Accept' (if needed)
724
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
646
725
 
647
726
  # form parameters
648
727
  form_params = {}
649
728
 
650
729
  # http body (model)
651
730
  post_body = nil
652
- auth_names = ['token']
731
+ auth_names = []
653
732
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
654
733
  :header_params => header_params,
655
734
  :query_params => query_params,
656
735
  :form_params => form_params,
657
736
  :body => post_body,
658
- :auth_names => auth_names)
737
+ :auth_names => auth_names,
738
+ :return_type => 'File')
659
739
  if @api_client.config.debugging
660
740
  @api_client.config.logger.debug "API called: OrdersApi#orders_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
661
741
  end
@@ -664,23 +744,29 @@ module Noths
664
744
 
665
745
  # Generate an order details pdf
666
746
  # Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
747
+ # @param token Authentication credential
667
748
  # @param id Order id
668
749
  # @param [Hash] opts the optional parameters
669
- # @return [nil]
670
- def orders_order_details(id, opts = {})
671
- orders_order_details_with_http_info(id, opts)
672
- return nil
750
+ # @return [File]
751
+ def orders_order_details(token, id, opts = {})
752
+ data, _status_code, _headers = orders_order_details_with_http_info(token, id, opts)
753
+ return data
673
754
  end
674
755
 
675
756
  # Generate an order details pdf
676
757
  # Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -XPOST [URL] &gt; document.pdf&lt;/pre&gt;
758
+ # @param token Authentication credential
677
759
  # @param id Order id
678
760
  # @param [Hash] opts the optional parameters
679
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
680
- def orders_order_details_with_http_info(id, opts = {})
761
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
762
+ def orders_order_details_with_http_info(token, id, opts = {})
681
763
  if @api_client.config.debugging
682
764
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_order_details ..."
683
765
  end
766
+ # verify the required parameter 'token' is set
767
+ if @api_client.config.client_side_validation && token.nil?
768
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_order_details"
769
+ end
684
770
  # verify the required parameter 'id' is set
685
771
  if @api_client.config.client_side_validation && id.nil?
686
772
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_order_details"
@@ -690,22 +776,26 @@ module Noths
690
776
 
691
777
  # query parameters
692
778
  query_params = {}
779
+ query_params[:'token'] = token
693
780
 
694
781
  # header parameters
695
782
  header_params = {}
783
+ # HTTP header 'Accept' (if needed)
784
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
696
785
 
697
786
  # form parameters
698
787
  form_params = {}
699
788
 
700
789
  # http body (model)
701
790
  post_body = nil
702
- auth_names = ['token']
791
+ auth_names = []
703
792
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
704
793
  :header_params => header_params,
705
794
  :query_params => query_params,
706
795
  :form_params => form_params,
707
796
  :body => post_body,
708
- :auth_names => auth_names)
797
+ :auth_names => auth_names,
798
+ :return_type => 'File')
709
799
  if @api_client.config.debugging
710
800
  @api_client.config.logger.debug "API called: OrdersApi#orders_order_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
711
801
  end
@@ -714,23 +804,29 @@ module Noths
714
804
 
715
805
  # Generate pdf with order details for each order
716
806
  # <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
807
+ # @param token Authentication credential
717
808
  # @param payload
718
809
  # @param [Hash] opts the optional parameters
719
- # @return [nil]
720
- def orders_order_details_bulk(payload, opts = {})
721
- orders_order_details_bulk_with_http_info(payload, opts)
722
- return nil
810
+ # @return [File]
811
+ def orders_order_details_bulk(token, payload, opts = {})
812
+ data, _status_code, _headers = orders_order_details_bulk_with_http_info(token, payload, opts)
813
+ return data
723
814
  end
724
815
 
725
816
  # Generate pdf with order details for each order
726
817
  # &lt;p/&gt; Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -H \&quot;Content-Type: application/json\&quot; -d &#39;[{\&quot;id\&quot;: 123}, {\&quot;id\&quot;: 456}]&#39; -XPOST [URL] &gt; document.pdf&lt;/pre&gt;&lt;p/&gt; Ensure that the Content-Type header is set to \&quot;Content-Type: application/json\&quot;.&lt;p/&gt;
818
+ # @param token Authentication credential
727
819
  # @param payload
728
820
  # @param [Hash] opts the optional parameters
729
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
730
- def orders_order_details_bulk_with_http_info(payload, opts = {})
821
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
822
+ def orders_order_details_bulk_with_http_info(token, payload, opts = {})
731
823
  if @api_client.config.debugging
732
824
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_order_details_bulk ..."
733
825
  end
826
+ # verify the required parameter 'token' is set
827
+ if @api_client.config.client_side_validation && token.nil?
828
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_order_details_bulk"
829
+ end
734
830
  # verify the required parameter 'payload' is set
735
831
  if @api_client.config.client_side_validation && payload.nil?
736
832
  fail ArgumentError, "Missing the required parameter 'payload' when calling OrdersApi.orders_order_details_bulk"
@@ -740,22 +836,28 @@ module Noths
740
836
 
741
837
  # query parameters
742
838
  query_params = {}
839
+ query_params[:'token'] = token
743
840
 
744
841
  # header parameters
745
842
  header_params = {}
843
+ # HTTP header 'Accept' (if needed)
844
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/json'])
845
+ # HTTP header 'Content-Type'
846
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
746
847
 
747
848
  # form parameters
748
849
  form_params = {}
749
850
 
750
851
  # http body (model)
751
852
  post_body = @api_client.object_to_http_body(payload)
752
- auth_names = ['token']
853
+ auth_names = []
753
854
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
754
855
  :header_params => header_params,
755
856
  :query_params => query_params,
756
857
  :form_params => form_params,
757
858
  :body => post_body,
758
- :auth_names => auth_names)
859
+ :auth_names => auth_names,
860
+ :return_type => 'File')
759
861
  if @api_client.config.debugging
760
862
  @api_client.config.logger.debug "API called: OrdersApi#orders_order_details_bulk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
761
863
  end
@@ -764,25 +866,31 @@ module Noths
764
866
 
765
867
  # Fetch a single Order
766
868
  #
869
+ # @param token Authentication credential
767
870
  # @param id Order Id
768
871
  # @param [Hash] opts the optional parameters
769
872
  # @option opts [String] :include Comma separated list of nodes to expand. Currently the available values are: &lt;br /&gt;&lt;b style&#x3D;\&quot;margin-left: 10px\&quot;&gt;financials&lt;/b&gt; &lt;p style&#x3D;\&quot;margin-left: 20px\&quot;&gt; Additional financial data about this order, eg: commission and discount amounts. &lt;/p&gt;
770
873
  # @return [Order]
771
- def orders_show(id, opts = {})
772
- data, _status_code, _headers = orders_show_with_http_info(id, opts)
874
+ def orders_show(token, id, opts = {})
875
+ data, _status_code, _headers = orders_show_with_http_info(token, id, opts)
773
876
  return data
774
877
  end
775
878
 
776
879
  # Fetch a single Order
777
880
  #
881
+ # @param token Authentication credential
778
882
  # @param id Order Id
779
883
  # @param [Hash] opts the optional parameters
780
884
  # @option opts [String] :include Comma separated list of nodes to expand. Currently the available values are: &lt;br /&gt;&lt;b style&#x3D;\&quot;margin-left: 10px\&quot;&gt;financials&lt;/b&gt; &lt;p style&#x3D;\&quot;margin-left: 20px\&quot;&gt; Additional financial data about this order, eg: commission and discount amounts. &lt;/p&gt;
781
885
  # @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers
782
- def orders_show_with_http_info(id, opts = {})
886
+ def orders_show_with_http_info(token, id, opts = {})
783
887
  if @api_client.config.debugging
784
888
  @api_client.config.logger.debug "Calling API: OrdersApi.orders_show ..."
785
889
  end
890
+ # verify the required parameter 'token' is set
891
+ if @api_client.config.client_side_validation && token.nil?
892
+ fail ArgumentError, "Missing the required parameter 'token' when calling OrdersApi.orders_show"
893
+ end
786
894
  # verify the required parameter 'id' is set
787
895
  if @api_client.config.client_side_validation && id.nil?
788
896
  fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_show"
@@ -792,7 +900,8 @@ module Noths
792
900
 
793
901
  # query parameters
794
902
  query_params = {}
795
- query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
903
+ query_params[:'token'] = token
904
+ query_params[:'include'] = normalize(opts[:'include']) if !opts[:'include'].nil?
796
905
 
797
906
  # header parameters
798
907
  header_params = {}
@@ -802,7 +911,7 @@ module Noths
802
911
 
803
912
  # http body (model)
804
913
  post_body = nil
805
- auth_names = ['token']
914
+ auth_names = []
806
915
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
807
916
  :header_params => header_params,
808
917
  :query_params => query_params,
@@ -815,5 +924,16 @@ module Noths
815
924
  end
816
925
  return data, status_code, headers
817
926
  end
927
+
928
+ private
929
+
930
+ def normalize(param)
931
+ case param
932
+ when Date, DateTime, Time
933
+ param.to_s(:iso8601)
934
+ else
935
+ param
936
+ end
937
+ end
818
938
  end
819
939
  end