bigcommerce 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Bigcommerce API V2 - Ruby Client
2
2
  ================================
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/bigcommerce-api-ruby.png)](https://rubygems.org/gems/bigcommerce-api-ruby)
4
+ [![Gem Version](https://badge.fury.io/rb/bigcommerce.png)](https://rubygems.org/gems/bigcommerce)
5
5
  [![Build Status](https://travis-ci.org/bigcommerce/bigcommerce-api-ruby.png?branch=master)](https://travis-ci.org/bigcommerce/bigcommerce-api-ruby)
6
6
  [![Dependency Status](https://gemnasium.com/bigcommerce/bigcommerce-api-ruby.png?travis)](https://gemnasium.com/bigcommerce/bigcommerce-api-ruby)
7
7
  [![Code Climate](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby.png)](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby)
@@ -41,6 +41,10 @@ module Bigcommerce
41
41
  @connection.get("/brands", options)
42
42
  end
43
43
 
44
+ def get_brands_count
45
+ @connection.get '/brands/count'
46
+ end
47
+
44
48
  def get_brand(id)
45
49
  @connection.get("/brands/#{id}", {})
46
50
  end
@@ -52,6 +56,10 @@ module Bigcommerce
52
56
  def update_brand(id, options={})
53
57
  @connection.put("/brands/#{id}", options)
54
58
  end
59
+
60
+ def delete_brand(id)
61
+ @connection.delete("/brands/#{id}")
62
+ end
55
63
 
56
64
  def get_coupons(options={})
57
65
  @connection.get("/coupons", options)
@@ -70,7 +78,7 @@ module Bigcommerce
70
78
  end
71
79
 
72
80
  def get_categories_count
73
- @connection.get '/categories/count/'
81
+ @connection.get '/categories/count'
74
82
  end
75
83
 
76
84
  def get_category(id)
@@ -84,7 +92,11 @@ module Bigcommerce
84
92
  def update_category(id, options={})
85
93
  @connection.put("/categories/#{id}", options)
86
94
  end
87
-
95
+
96
+ def delete_category(id)
97
+ @connection.delete("/categories/#{id}")
98
+ end
99
+
88
100
  def get_countries(options={})
89
101
  @connection.get("/countries", options)
90
102
  end
@@ -121,6 +133,10 @@ module Bigcommerce
121
133
  @connection.get("/options", options)
122
134
  end
123
135
 
136
+ def get_options_count
137
+ @connection.get '/options/count'
138
+ end
139
+
124
140
  def get_option(id)
125
141
  @connection.get("/options/#{id}",{})
126
142
  end
@@ -132,6 +148,10 @@ module Bigcommerce
132
148
  def update_option(id, options={})
133
149
  @connection.put("/options/#{id}", options)
134
150
  end
151
+
152
+ def delete_option(id)
153
+ @connection.delete("/options/#{id}")
154
+ end
135
155
 
136
156
  def get_options_values(options={})
137
157
  @connection.get("/options/values", options)
@@ -152,7 +172,11 @@ module Bigcommerce
152
172
  def get_optionsets(options={})
153
173
  @connection.get("/optionsets", options)
154
174
  end
155
-
175
+
176
+ def get_optionsets_count
177
+ @connection.get '/optionsets/count'
178
+ end
179
+
156
180
  def get_optionset(id)
157
181
  @connection.get("/optionsets/#{id}", {})
158
182
  end
@@ -164,11 +188,19 @@ module Bigcommerce
164
188
  def update_optionset(id, options={})
165
189
  @connection.put("/optionsets/#{id}", options)
166
190
  end
191
+
192
+ def delete_optionset(id)
193
+ @connection.delete("/optionsets/#{id}")
194
+ end
167
195
 
168
196
  def get_optionsets_options(options={})
169
197
  @connection.get("/optionsets/options", options)
170
198
  end
171
199
 
200
+ def get_optionset_options(id)
201
+ @connection.get("/optionsets/#{id}/options", {})
202
+ end
203
+
172
204
  def get_optionsets_option(id)
173
205
  @connection.get("/optionsets/options/#{id}", {})
174
206
  end
@@ -256,6 +288,10 @@ module Bigcommerce
256
288
  @connection.get("/products", options)
257
289
  end
258
290
 
291
+ def get_products_count
292
+ @connection.get '/products/count'
293
+ end
294
+
259
295
  def get_product(id)
260
296
  @connection.get("/products/#{id}", {})
261
297
  end
@@ -271,7 +307,11 @@ module Bigcommerce
271
307
  def get_products_discountrules(options={})
272
308
  @connection.get("/products/discountrules", options)
273
309
  end
274
-
310
+
311
+ def get_product_discountrules(product_id, options={})
312
+ @connection.get("/products/#{product_id}/discountrules", options)
313
+ end
314
+
275
315
  def get_products_discountrule(product_id, discountrule_id)
276
316
  @connection.get("/products/#{product_id}/discountrules/#{discountrule_id}", {})
277
317
  end
@@ -280,6 +320,10 @@ module Bigcommerce
280
320
  @connection.get("/products/configurablefields", options)
281
321
  end
282
322
 
323
+ def get_product_configurablefields(product_id, options={})
324
+ @connection.get("/products/#{product_id}/configurablefields", options)
325
+ end
326
+
283
327
  def get_products_configurablefield(product_id, configurable_field_id)
284
328
  @connection.get("/products/#{product_id}/configurablefields/#{configurable_field_id}", {})
285
329
  end
@@ -287,6 +331,10 @@ module Bigcommerce
287
331
  def get_products_customfields(options={})
288
332
  @connection.get("/products/customfields", options)
289
333
  end
334
+
335
+ def get_product_customfields(product_id, options={})
336
+ @connection.get("/products/#{product_id}/customfields", options)
337
+ end
290
338
 
291
339
  def get_products_customfield(product_id, custom_field_id)
292
340
  @connection.get("/products/#{product_id}/customfields/#{custom_field_id}", {})
@@ -319,6 +367,10 @@ module Bigcommerce
319
367
  def get_products_customfields(options={})
320
368
  @connection.get("/products/options", options)
321
369
  end
370
+
371
+ def get_product_options(product_id, options={})
372
+ @connection.get("/products/#{product_id}/options", options)
373
+ end
322
374
 
323
375
  def get_products_option(product_id,option_id)
324
376
  @connection.get("/products/#{product_id}/options/#{option_id}", {})
@@ -328,6 +380,10 @@ module Bigcommerce
328
380
  @connection.get("/products/rules", options)
329
381
  end
330
382
 
383
+ def get_product_rules(product_id, options={})
384
+ @connection.get("/products/#{product_id}/rules", options)
385
+ end
386
+
331
387
  def create_products_rules(options={})
332
388
  @connection.post("/products/rules", options)
333
389
  end
@@ -343,6 +399,10 @@ module Bigcommerce
343
399
  def get_products_skus(options={})
344
400
  @connection.get("/products/skus", options)
345
401
  end
402
+
403
+ def get_product_skus(product_id, options={})
404
+ @connection.get("/products/#{product_id}/skus", options)
405
+ end
346
406
 
347
407
  def create_products_skus(options={})
348
408
  @connection.post("/products/skus", options)
@@ -359,6 +419,10 @@ module Bigcommerce
359
419
  def get_products_videos(options={})
360
420
  @connection.get("/products/videos", options)
361
421
  end
422
+
423
+ def get_product_videos(product_id, options={})
424
+ @connection.get("/products/#{product_id}/videos", options)
425
+ end
362
426
 
363
427
  def get_products_video(product_id, video_id)
364
428
  @connection.get("/products/#{product_id}/videos/#{video_id}", {})
@@ -85,7 +85,7 @@ module Bigcommerce
85
85
  when :delete then
86
86
  restclient.delete
87
87
  end
88
- if(response.code == 200)
88
+ if((200..201) === response.code)
89
89
  JSON.parse response
90
90
  elsif response.code == 204
91
91
  nil
@@ -1,6 +1,6 @@
1
1
  module Bigcommerce
2
2
  major = 0
3
3
  minor = 8
4
- patch = 3
4
+ patch = 4
5
5
  VERSION = [major, minor, patch].join('.') unless defined? Bigcommerce::VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigcommerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-08-05 00:00:00.000000000 Z
15
+ date: 2013-09-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
228
  version: '0'
229
229
  requirements: []
230
230
  rubyforge_project:
231
- rubygems_version: 1.8.24
231
+ rubygems_version: 1.8.23
232
232
  signing_key:
233
233
  specification_version: 3
234
234
  summary: Enables Ruby applications to communicate with the Bigcommerce API