clayful 2.2.1 → 2.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 520bd962bbad2c341df746dad5df92a758e47287
4
- data.tar.gz: ac8d444ccfe6743ec478920b47c4e5f0fe78c401
3
+ metadata.gz: c075c7fc4b65aaada9d0e7a03f758e67030cd51a
4
+ data.tar.gz: 450c41d6e1bb8240678391e835849142757c634b
5
5
  SHA512:
6
- metadata.gz: 3eead27d9ba1b84ddb01625d1ebb0e900ed0e72bfe0093e101529988b7273e89fa7b13dc11d20c9f393e0827a9d10db82e5afdd636e5620b87c3dd6cb86c65ef
7
- data.tar.gz: fc6bc3090e79947b1c9a5721cb498fd29696fec65300db8d0c96f32da7db012f39ef0b0c754f94f984e4f9af3d0092da52285a282220bf8a0922aa211e176cf8
6
+ metadata.gz: 87366c138e641bd49e74916f5b2836e6f8269344ff61ebf82fba02a05c32e21e450884e35c6e25b8a8261cae218e7fe12290b6270cdcdd5d33c7472315ff8cef
7
+ data.tar.gz: ab22509ca90262d01d5962da050966578125b14684328903655cda314bf9cc2b044838ef0898707e445d5a6fd8f7fed544d34a0e3a1d789f2d191cdc85ec7535
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
File without changes
data/lib/clayful.rb CHANGED
File without changes
data/lib/exception.rb CHANGED
File without changes
data/lib/models/binder.rb CHANGED
@@ -17,6 +17,7 @@ require_relative './product'
17
17
  require_relative './review'
18
18
  require_relative './review_comment'
19
19
  require_relative './shipping_method'
20
+ require_relative './shipping_policy'
20
21
  require_relative './store'
21
22
  require_relative './subscription'
22
23
  require_relative './subscription_plan'
data/lib/models/brand.rb CHANGED
@@ -13,38 +13,38 @@ module Clayful
13
13
  @@path
14
14
  end
15
15
 
16
- def self.list(*args)
16
+ def self.count(*args)
17
17
 
18
18
  Clayful.call_api({
19
19
  'model_name' => @@name,
20
- 'method_name' => 'list',
20
+ 'method_name' => 'count',
21
21
  'http_method' => 'GET',
22
- 'path' => '/v1/brands',
22
+ 'path' => '/v1/brands/count',
23
23
  'params' => [],
24
24
  'args' => args
25
25
  })
26
26
 
27
27
  end
28
28
 
29
- def self.count(*args)
29
+ def self.create(*args)
30
30
 
31
31
  Clayful.call_api({
32
32
  'model_name' => @@name,
33
- 'method_name' => 'count',
34
- 'http_method' => 'GET',
35
- 'path' => '/v1/brands/count',
33
+ 'method_name' => 'create',
34
+ 'http_method' => 'POST',
35
+ 'path' => '/v1/brands',
36
36
  'params' => [],
37
37
  'args' => args
38
38
  })
39
39
 
40
40
  end
41
41
 
42
- def self.get(*args)
42
+ def self.delete(*args)
43
43
 
44
44
  Clayful.call_api({
45
45
  'model_name' => @@name,
46
- 'method_name' => 'get',
47
- 'http_method' => 'GET',
46
+ 'method_name' => 'delete',
47
+ 'http_method' => 'DELETE',
48
48
  'path' => '/v1/brands/{brandId}',
49
49
  'params' => ['brandId', ],
50
50
  'args' => args
@@ -52,14 +52,27 @@ module Clayful
52
52
 
53
53
  end
54
54
 
55
- def self.create(*args)
55
+ def self.delete_metafield(*args)
56
56
 
57
57
  Clayful.call_api({
58
58
  'model_name' => @@name,
59
- 'method_name' => 'create',
60
- 'http_method' => 'POST',
61
- 'path' => '/v1/brands',
62
- 'params' => [],
59
+ 'method_name' => 'delete_metafield',
60
+ 'http_method' => 'DELETE',
61
+ 'path' => '/v1/brands/{brandId}/meta/{field}',
62
+ 'params' => ['brandId', 'field', ],
63
+ 'args' => args
64
+ })
65
+
66
+ end
67
+
68
+ def self.get(*args)
69
+
70
+ Clayful.call_api({
71
+ 'model_name' => @@name,
72
+ 'method_name' => 'get',
73
+ 'http_method' => 'GET',
74
+ 'path' => '/v1/brands/{brandId}',
75
+ 'params' => ['brandId', ],
63
76
  'args' => args
64
77
  })
65
78
 
@@ -78,6 +91,19 @@ module Clayful
78
91
 
79
92
  end
80
93
 
94
+ def self.list(*args)
95
+
96
+ Clayful.call_api({
97
+ 'model_name' => @@name,
98
+ 'method_name' => 'list',
99
+ 'http_method' => 'GET',
100
+ 'path' => '/v1/brands',
101
+ 'params' => [],
102
+ 'args' => args
103
+ })
104
+
105
+ end
106
+
81
107
  def self.pull_from_metafield(*args)
82
108
 
83
109
  Clayful.call_api({
@@ -117,32 +143,6 @@ module Clayful
117
143
 
118
144
  end
119
145
 
120
- def self.delete(*args)
121
-
122
- Clayful.call_api({
123
- 'model_name' => @@name,
124
- 'method_name' => 'delete',
125
- 'http_method' => 'DELETE',
126
- 'path' => '/v1/brands/{brandId}',
127
- 'params' => ['brandId', ],
128
- 'args' => args
129
- })
130
-
131
- end
132
-
133
- def self.delete_metafield(*args)
134
-
135
- Clayful.call_api({
136
- 'model_name' => @@name,
137
- 'method_name' => 'delete_metafield',
138
- 'http_method' => 'DELETE',
139
- 'path' => '/v1/brands/{brandId}/meta/{field}',
140
- 'params' => ['brandId', 'field', ],
141
- 'args' => args
142
- })
143
-
144
- end
145
-
146
146
  end
147
147
 
148
148
  end
data/lib/models/cart.rb CHANGED
@@ -13,235 +13,235 @@ module Clayful
13
13
  @@path
14
14
  end
15
15
 
16
- def self.count_items_for_me(*args)
16
+ def self.add_item(*args)
17
17
 
18
18
  Clayful.call_api({
19
19
  'model_name' => @@name,
20
- 'method_name' => 'count_items_for_me',
21
- 'http_method' => 'GET',
22
- 'path' => '/v1/me/cart/items/count',
23
- 'params' => [],
20
+ 'method_name' => 'add_item',
21
+ 'http_method' => 'POST',
22
+ 'path' => '/v1/customers/{customerId}/cart/items',
23
+ 'params' => ['customerId', ],
24
24
  'args' => args
25
25
  })
26
26
 
27
27
  end
28
28
 
29
- def self.count_items(*args)
29
+ def self.add_item_for_me(*args)
30
30
 
31
31
  Clayful.call_api({
32
32
  'model_name' => @@name,
33
- 'method_name' => 'count_items',
34
- 'http_method' => 'GET',
35
- 'path' => '/v1/customers/{customerId}/cart/items/count',
36
- 'params' => ['customerId', ],
33
+ 'method_name' => 'add_item_for_me',
34
+ 'http_method' => 'POST',
35
+ 'path' => '/v1/me/cart/items',
36
+ 'params' => [],
37
37
  'args' => args
38
38
  })
39
39
 
40
40
  end
41
41
 
42
- def self.get_for_me(*args)
42
+ def self.checkout(*args)
43
43
 
44
44
  Clayful.call_api({
45
45
  'model_name' => @@name,
46
- 'method_name' => 'get_for_me',
46
+ 'method_name' => 'checkout',
47
47
  'http_method' => 'POST',
48
- 'path' => '/v1/me/cart',
49
- 'params' => [],
48
+ 'path' => '/v1/customers/{customerId}/cart/checkout/{type}',
49
+ 'params' => ['customerId', 'type', ],
50
50
  'args' => args
51
51
  })
52
52
 
53
53
  end
54
54
 
55
- def self.get_as_non_registered(*args)
55
+ def self.checkout_as_non_registered(*args)
56
56
 
57
57
  Clayful.call_api({
58
58
  'model_name' => @@name,
59
- 'method_name' => 'get_as_non_registered',
59
+ 'method_name' => 'checkout_as_non_registered',
60
60
  'http_method' => 'POST',
61
- 'path' => '/v1/customers/non-registered/cart',
62
- 'params' => [],
61
+ 'path' => '/v1/customers/non-registered/cart/checkout/{type}',
62
+ 'params' => ['type', ],
63
63
  'args' => args
64
64
  })
65
65
 
66
66
  end
67
67
 
68
- def self.get(*args)
68
+ def self.checkout_as_non_registered_for_me(*args)
69
69
 
70
70
  Clayful.call_api({
71
71
  'model_name' => @@name,
72
- 'method_name' => 'get',
72
+ 'method_name' => 'checkout_as_non_registered_for_me',
73
73
  'http_method' => 'POST',
74
- 'path' => '/v1/customers/{customerId}/cart',
75
- 'params' => ['customerId', ],
74
+ 'path' => '/v1/me/non-registered/cart/checkout/{type}',
75
+ 'params' => ['type', ],
76
76
  'args' => args
77
77
  })
78
78
 
79
79
  end
80
80
 
81
- def self.add_item_for_me(*args)
81
+ def self.checkout_for_me(*args)
82
82
 
83
83
  Clayful.call_api({
84
84
  'model_name' => @@name,
85
- 'method_name' => 'add_item_for_me',
85
+ 'method_name' => 'checkout_for_me',
86
86
  'http_method' => 'POST',
87
- 'path' => '/v1/me/cart/items',
88
- 'params' => [],
87
+ 'path' => '/v1/me/cart/checkout/{type}',
88
+ 'params' => ['type', ],
89
89
  'args' => args
90
90
  })
91
91
 
92
92
  end
93
93
 
94
- def self.get_as_non_registered_for_me(*args)
94
+ def self.count_items(*args)
95
95
 
96
96
  Clayful.call_api({
97
97
  'model_name' => @@name,
98
- 'method_name' => 'get_as_non_registered_for_me',
99
- 'http_method' => 'POST',
100
- 'path' => '/v1/me/non-registered/cart',
101
- 'params' => [],
98
+ 'method_name' => 'count_items',
99
+ 'http_method' => 'GET',
100
+ 'path' => '/v1/customers/{customerId}/cart/items/count',
101
+ 'params' => ['customerId', ],
102
102
  'args' => args
103
103
  })
104
104
 
105
105
  end
106
106
 
107
- def self.add_item(*args)
107
+ def self.count_items_for_me(*args)
108
108
 
109
109
  Clayful.call_api({
110
110
  'model_name' => @@name,
111
- 'method_name' => 'add_item',
112
- 'http_method' => 'POST',
113
- 'path' => '/v1/customers/{customerId}/cart/items',
114
- 'params' => ['customerId', ],
111
+ 'method_name' => 'count_items_for_me',
112
+ 'http_method' => 'GET',
113
+ 'path' => '/v1/me/cart/items/count',
114
+ 'params' => [],
115
115
  'args' => args
116
116
  })
117
117
 
118
118
  end
119
119
 
120
- def self.checkout_for_me(*args)
120
+ def self.delete_item(*args)
121
121
 
122
122
  Clayful.call_api({
123
123
  'model_name' => @@name,
124
- 'method_name' => 'checkout_for_me',
125
- 'http_method' => 'POST',
126
- 'path' => '/v1/me/cart/checkout/{type}',
127
- 'params' => ['type', ],
124
+ 'method_name' => 'delete_item',
125
+ 'http_method' => 'DELETE',
126
+ 'path' => '/v1/customers/{customerId}/cart/items/{itemId}',
127
+ 'params' => ['customerId', 'itemId', ],
128
128
  'args' => args
129
129
  })
130
130
 
131
131
  end
132
132
 
133
- def self.checkout_as_non_registered(*args)
133
+ def self.delete_item_for_me(*args)
134
134
 
135
135
  Clayful.call_api({
136
136
  'model_name' => @@name,
137
- 'method_name' => 'checkout_as_non_registered',
138
- 'http_method' => 'POST',
139
- 'path' => '/v1/customers/non-registered/cart/checkout/{type}',
140
- 'params' => ['type', ],
137
+ 'method_name' => 'delete_item_for_me',
138
+ 'http_method' => 'DELETE',
139
+ 'path' => '/v1/me/cart/items/{itemId}',
140
+ 'params' => ['itemId', ],
141
141
  'args' => args
142
142
  })
143
143
 
144
144
  end
145
145
 
146
- def self.checkout(*args)
146
+ def self.empty(*args)
147
147
 
148
148
  Clayful.call_api({
149
149
  'model_name' => @@name,
150
- 'method_name' => 'checkout',
151
- 'http_method' => 'POST',
152
- 'path' => '/v1/customers/{customerId}/cart/checkout/{type}',
153
- 'params' => ['customerId', 'type', ],
150
+ 'method_name' => 'empty',
151
+ 'http_method' => 'DELETE',
152
+ 'path' => '/v1/customers/{customerId}/cart/items',
153
+ 'params' => ['customerId', ],
154
154
  'args' => args
155
155
  })
156
156
 
157
157
  end
158
158
 
159
- def self.checkout_as_non_registered_for_me(*args)
159
+ def self.empty_for_me(*args)
160
160
 
161
161
  Clayful.call_api({
162
162
  'model_name' => @@name,
163
- 'method_name' => 'checkout_as_non_registered_for_me',
164
- 'http_method' => 'POST',
165
- 'path' => '/v1/me/non-registered/cart/checkout/{type}',
166
- 'params' => ['type', ],
163
+ 'method_name' => 'empty_for_me',
164
+ 'http_method' => 'DELETE',
165
+ 'path' => '/v1/me/cart/items',
166
+ 'params' => [],
167
167
  'args' => args
168
168
  })
169
169
 
170
170
  end
171
171
 
172
- def self.update_item_for_me(*args)
172
+ def self.get(*args)
173
173
 
174
174
  Clayful.call_api({
175
175
  'model_name' => @@name,
176
- 'method_name' => 'update_item_for_me',
177
- 'http_method' => 'PUT',
178
- 'path' => '/v1/me/cart/items/{itemId}',
179
- 'params' => ['itemId', ],
176
+ 'method_name' => 'get',
177
+ 'http_method' => 'POST',
178
+ 'path' => '/v1/customers/{customerId}/cart',
179
+ 'params' => ['customerId', ],
180
180
  'args' => args
181
181
  })
182
182
 
183
183
  end
184
184
 
185
- def self.update_item(*args)
185
+ def self.get_as_non_registered(*args)
186
186
 
187
187
  Clayful.call_api({
188
188
  'model_name' => @@name,
189
- 'method_name' => 'update_item',
190
- 'http_method' => 'PUT',
191
- 'path' => '/v1/customers/{customerId}/cart/items/{itemId}',
192
- 'params' => ['customerId', 'itemId', ],
189
+ 'method_name' => 'get_as_non_registered',
190
+ 'http_method' => 'POST',
191
+ 'path' => '/v1/customers/non-registered/cart',
192
+ 'params' => [],
193
193
  'args' => args
194
194
  })
195
195
 
196
196
  end
197
197
 
198
- def self.empty_for_me(*args)
198
+ def self.get_as_non_registered_for_me(*args)
199
199
 
200
200
  Clayful.call_api({
201
201
  'model_name' => @@name,
202
- 'method_name' => 'empty_for_me',
203
- 'http_method' => 'DELETE',
204
- 'path' => '/v1/me/cart/items',
202
+ 'method_name' => 'get_as_non_registered_for_me',
203
+ 'http_method' => 'POST',
204
+ 'path' => '/v1/me/non-registered/cart',
205
205
  'params' => [],
206
206
  'args' => args
207
207
  })
208
208
 
209
209
  end
210
210
 
211
- def self.empty(*args)
211
+ def self.get_for_me(*args)
212
212
 
213
213
  Clayful.call_api({
214
214
  'model_name' => @@name,
215
- 'method_name' => 'empty',
216
- 'http_method' => 'DELETE',
217
- 'path' => '/v1/customers/{customerId}/cart/items',
218
- 'params' => ['customerId', ],
215
+ 'method_name' => 'get_for_me',
216
+ 'http_method' => 'POST',
217
+ 'path' => '/v1/me/cart',
218
+ 'params' => [],
219
219
  'args' => args
220
220
  })
221
221
 
222
222
  end
223
223
 
224
- def self.delete_item_for_me(*args)
224
+ def self.update_item(*args)
225
225
 
226
226
  Clayful.call_api({
227
227
  'model_name' => @@name,
228
- 'method_name' => 'delete_item_for_me',
229
- 'http_method' => 'DELETE',
230
- 'path' => '/v1/me/cart/items/{itemId}',
231
- 'params' => ['itemId', ],
228
+ 'method_name' => 'update_item',
229
+ 'http_method' => 'PUT',
230
+ 'path' => '/v1/customers/{customerId}/cart/items/{itemId}',
231
+ 'params' => ['customerId', 'itemId', ],
232
232
  'args' => args
233
233
  })
234
234
 
235
235
  end
236
236
 
237
- def self.delete_item(*args)
237
+ def self.update_item_for_me(*args)
238
238
 
239
239
  Clayful.call_api({
240
240
  'model_name' => @@name,
241
- 'method_name' => 'delete_item',
242
- 'http_method' => 'DELETE',
243
- 'path' => '/v1/customers/{customerId}/cart/items/{itemId}',
244
- 'params' => ['customerId', 'itemId', ],
241
+ 'method_name' => 'update_item_for_me',
242
+ 'http_method' => 'PUT',
243
+ 'path' => '/v1/me/cart/items/{itemId}',
244
+ 'params' => ['itemId', ],
245
245
  'args' => args
246
246
  })
247
247