noths 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,311 +1,200 @@
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
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
1
+ # frozen_string_literal: true
16
2
 
17
3
  # Unit tests for Noths::Order
18
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
- # Please update as you see appropriate
20
4
  describe 'Order' do
21
- before do
22
- # run before each test
23
- @instance = Noths::Order.new
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
5
+ let(:instance) { Noths::Order.new }
29
6
 
30
7
  describe 'test an instance of Order' do
31
8
  it 'should create an instance of Order' do
32
- expect(@instance).to be_instance_of(Noths::Order)
9
+ expect(instance).to be_instance_of(Noths::Order)
33
10
  end
34
11
  end
35
12
  describe 'test attribute "id"' do
36
- it 'should work' do
37
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
- end
13
+ it 'should work'
39
14
  end
40
15
 
41
16
  describe 'test attribute "state"' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
17
+ it 'should work'
45
18
  end
46
19
 
47
20
  describe 'test attribute "confirm_by"' do
48
- it 'should work' do
49
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
- end
21
+ it 'should work'
51
22
  end
52
23
 
53
24
  describe 'test attribute "estimated_dispatch_at"' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
25
+ it 'should work'
57
26
  end
58
27
 
59
28
  describe 'test attribute "placed_at"' do
60
- it 'should work' do
61
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
- end
29
+ it 'should work'
63
30
  end
64
31
 
65
32
  describe 'test attribute "expired_at"' do
66
- it 'should work' do
67
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
- end
33
+ it 'should work'
69
34
  end
70
35
 
71
36
  describe 'test attribute "declined_at"' do
72
- it 'should work' do
73
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
- end
37
+ it 'should work'
75
38
  end
76
39
 
77
40
  describe 'test attribute "accepted_at"' do
78
- it 'should work' do
79
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
- end
41
+ it 'should work'
81
42
  end
82
43
 
83
44
  describe 'test attribute "dispatched_at"' do
84
- it 'should work' do
85
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
- end
45
+ it 'should work'
87
46
  end
88
47
 
89
48
  describe 'test attribute "archived_at"' do
90
- it 'should work' do
91
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
- end
49
+ it 'should work'
93
50
  end
94
51
 
95
52
  describe 'test attribute "repeat_customer"' do
96
- it 'should work' do
97
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
98
- end
53
+ it 'should work'
99
54
  end
100
55
 
101
56
  describe 'test attribute "customer_expected_delivery_date"' do
102
- it 'should work' do
103
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
104
- end
57
+ it 'should work'
105
58
  end
106
59
 
107
60
  describe 'test attribute "number"' do
108
- it 'should work' do
109
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
110
- end
61
+ it 'should work'
111
62
  end
112
63
 
113
64
  describe 'test attribute "dispatch_note_viewed"' do
114
- it 'should work' do
115
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
116
- end
65
+ it 'should work'
117
66
  end
118
67
 
119
68
  describe 'test attribute "express"' do
120
- it 'should work' do
121
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
122
- end
69
+ it 'should work'
123
70
  end
124
71
 
125
72
  describe 'test attribute "partner_name"' do
126
- it 'should work' do
127
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
128
- end
73
+ it 'should work'
129
74
  end
130
75
 
131
76
  describe 'test attribute "delivery_recipient_name"' do
132
- it 'should work' do
133
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
134
- end
77
+ it 'should work'
135
78
  end
136
79
 
137
80
  describe 'test attribute "delivery_recipient_first_name"' do
138
- it 'should work' do
139
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
140
- end
81
+ it 'should work'
141
82
  end
142
83
 
143
84
  describe 'test attribute "delivery_recipient_last_name"' do
144
- it 'should work' do
145
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
146
- end
85
+ it 'should work'
147
86
  end
148
87
 
149
88
  describe 'test attribute "international"' do
150
- it 'should work' do
151
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
152
- end
89
+ it 'should work'
153
90
  end
154
91
 
155
92
  describe 'test attribute "dispatch_overdue"' do
156
- it 'should work' do
157
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
158
- end
93
+ it 'should work'
159
94
  end
160
95
 
161
96
  describe 'test attribute "gift"' do
162
- it 'should work' do
163
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
164
- end
97
+ it 'should work'
165
98
  end
166
99
 
167
100
  describe 'test attribute "gift_message"' do
168
- it 'should work' do
169
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
170
- end
101
+ it 'should work'
171
102
  end
172
103
 
173
104
  describe 'test attribute "gift_wrap"' do
174
- it 'should work' do
175
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
176
- end
105
+ it 'should work'
177
106
  end
178
107
 
179
108
  describe 'test attribute "gift_receipt"' do
180
- it 'should work' do
181
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
182
- end
109
+ it 'should work'
183
110
  end
184
111
 
185
112
  describe 'test attribute "delivery_note"' do
186
- it 'should work' do
187
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
188
- end
113
+ it 'should work'
189
114
  end
190
115
 
191
116
  describe 'test attribute "has_enquiry"' do
192
- it 'should work' do
193
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
194
- end
117
+ it 'should work'
195
118
  end
196
119
 
197
120
  describe 'test attribute "estimated_delivery_date"' do
198
- it 'should work' do
199
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
200
- end
121
+ it 'should work'
201
122
  end
202
123
 
203
124
  describe 'test attribute "rebate_qualified"' do
204
- it 'should work' do
205
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
206
- end
125
+ it 'should work'
207
126
  end
208
127
 
209
128
  describe 'test attribute "rebate_achieved"' do
210
- it 'should work' do
211
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
212
- end
129
+ it 'should work'
213
130
  end
214
131
 
215
132
  describe 'test attribute "financials"' do
216
- it 'should work' do
217
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
218
- end
133
+ it 'should work'
219
134
  end
220
135
 
221
136
  describe 'test attribute "promotion_discount"' do
222
- it 'should work' do
223
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
224
- end
137
+ it 'should work'
225
138
  end
226
139
 
227
140
  describe 'test attribute "promotion_present"' do
228
- it 'should work' do
229
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
230
- end
141
+ it 'should work'
231
142
  end
232
143
 
233
144
  describe 'test attribute "remaining_refund_amount"' do
234
- it 'should work' do
235
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
236
- end
145
+ it 'should work'
237
146
  end
238
147
 
239
148
  describe 'test attribute "refund_total"' do
240
- it 'should work' do
241
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
242
- end
149
+ it 'should work'
243
150
  end
244
151
 
245
152
  describe 'test attribute "extra_refund_amount"' do
246
- it 'should work' do
247
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
248
- end
153
+ it 'should work'
249
154
  end
250
155
 
251
156
  describe 'test attribute "user"' do
252
- it 'should work' do
253
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
254
- end
157
+ it 'should work'
255
158
  end
256
159
 
257
160
  describe 'test attribute "delivery_address"' do
258
- it 'should work' do
259
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
260
- end
161
+ it 'should work'
261
162
  end
262
163
 
263
164
  describe 'test attribute "delivery_zone"' do
264
- it 'should work' do
265
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
266
- end
165
+ it 'should work'
267
166
  end
268
167
 
269
168
  describe 'test attribute "delivery_service"' do
270
- it 'should work' do
271
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
272
- end
169
+ it 'should work'
273
170
  end
274
171
 
275
172
  describe 'test attribute "order_detail"' do
276
- it 'should work' do
277
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
278
- end
173
+ it 'should work'
279
174
  end
280
175
 
281
176
  describe 'test attribute "order_total"' do
282
- it 'should work' do
283
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
284
- end
177
+ it 'should work'
285
178
  end
286
179
 
287
180
  describe 'test attribute "delivery_total"' do
288
- it 'should work' do
289
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
290
- end
181
+ it 'should work'
291
182
  end
292
183
 
293
184
  describe 'test attribute "enquiry"' do
294
- it 'should work' do
295
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
296
- end
185
+ it 'should work'
297
186
  end
298
187
 
299
188
  describe 'test attribute "items"' do
300
- it 'should work' do
301
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
302
- end
189
+ it 'should work'
303
190
  end
304
191
 
305
192
  describe 'test attribute "links"' do
306
- it 'should work' do
307
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
308
- end
193
+ it 'should work'
194
+ end
195
+
196
+ describe 'test attribute "updated_at"' do
197
+ it 'should work'
309
198
  end
310
199
 
311
200
  end
@@ -1,47 +1,20 @@
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
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
1
+ # frozen_string_literal: true
16
2
 
17
3
  # Unit tests for Noths::ProductOption
18
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
- # Please update as you see appropriate
20
4
  describe 'ProductOption' do
21
- before do
22
- # run before each test
23
- @instance = Noths::ProductOption.new
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
5
+ let(:instance) { Noths::ProductOption.new }
29
6
 
30
7
  describe 'test an instance of ProductOption' do
31
8
  it 'should create an instance of ProductOption' do
32
- expect(@instance).to be_instance_of(Noths::ProductOption)
9
+ expect(instance).to be_instance_of(Noths::ProductOption)
33
10
  end
34
11
  end
35
12
  describe 'test attribute "name"' do
36
- it 'should work' do
37
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
- end
13
+ it 'should work'
39
14
  end
40
15
 
41
16
  describe 'test attribute "value"' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
17
+ it 'should work'
45
18
  end
46
19
 
47
20
  end
@@ -1,65 +1,32 @@
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
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
1
+ # frozen_string_literal: true
16
2
 
17
3
  # Unit tests for Noths::Product
18
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
- # Please update as you see appropriate
20
4
  describe 'Product' do
21
- before do
22
- # run before each test
23
- @instance = Noths::Product.new
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
5
+ let(:instance) { Noths::Product.new }
29
6
 
30
7
  describe 'test an instance of Product' do
31
8
  it 'should create an instance of Product' do
32
- expect(@instance).to be_instance_of(Noths::Product)
9
+ expect(instance).to be_instance_of(Noths::Product)
33
10
  end
34
11
  end
35
12
  describe 'test attribute "id"' do
36
- it 'should work' do
37
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
- end
13
+ it 'should work'
39
14
  end
40
15
 
41
16
  describe 'test attribute "sku"' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
17
+ it 'should work'
45
18
  end
46
19
 
47
20
  describe 'test attribute "title"' do
48
- it 'should work' do
49
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
- end
21
+ it 'should work'
51
22
  end
52
23
 
53
24
  describe 'test attribute "personalisable"' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
25
+ it 'should work'
57
26
  end
58
27
 
59
28
  describe 'test attribute "image"' do
60
- it 'should work' do
61
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
- end
29
+ it 'should work'
63
30
  end
64
31
 
65
32
  end