bigcommerce-oauth-api 1.1.2 → 1.1.3

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: 7f6019efb2862df605d51ddc295b27fe454155a7
4
- data.tar.gz: 5b10eca0204bc2609c58f2f9e5fcbacafe919d98
3
+ metadata.gz: d02f158acbd54aee73655c787eb9839e52bd0436
4
+ data.tar.gz: 2b6e941e06502832605d09b129f595f838701e45
5
5
  SHA512:
6
- metadata.gz: ca140e744fca66c4b14f9b51cdb36c33ae59e470178d56c3dda48acbaab0d346ec6099c532be63113b0ef05632a25c7e5ba4b3600c7cd35fc8edadcf94b10927
7
- data.tar.gz: 633316c3b35e61ad303afc1dc18f9c97afce27e0f384369392b1b29fcd113fbf0918d1056b3a2d4b9f27f1c7ae2bf1d81bff6e58f259c287d4a3ad3e2dd5151e
6
+ metadata.gz: 737004403507a3a7b4ae6fbc978ffc256f1d695a0a307f167da13d25ccf929fcda00bdbeb6541ba428b3a8e8b59fffac3e5fc509aa59e4374fff3e631a2df78a
7
+ data.tar.gz: ad56c904b4dc3e0cd939026a746e797d5229d75a0ac830bba09b4787a84346fa4fb9880fcc81660bc9a0f311b40ef0c3d6b2e293cfd354fe3d962d737e7bece1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.1.3 (2014-11-05)
2
+
3
+ Bugfixes:
4
+
5
+ - return nil on HTTP 204
6
+ - make Resource objects comparable using .eql? and ==
7
+ - add rdoc markup for dynamically added methods
8
+
1
9
  ### 1.1.2 (2014-11-04)
2
10
 
3
11
  Bugfixes:
@@ -3,7 +3,7 @@ require File.expand_path('../lib/bigcommerce-oauth-api/version', __FILE__)
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'bigcommerce-oauth-api'
5
5
  s.version = BigcommerceOAuthAPI::VERSION.dup
6
- s.date = '2014-11-04'
6
+ s.date = '2014-11-05'
7
7
  s.summary = "Ruby wrapper for the Bigcommerce REST API using OAuth"
8
8
  s.description = "Connect Ruby applications with the Bigcommerce REST API using OAuth"
9
9
  s.authors = ["Christian Orthmann"]
@@ -56,5 +56,950 @@ module BigcommerceOAuthAPI
56
56
  :tax_class => { api_module: :tax_class, scope: :self, methods: [:all, :select]},
57
57
  :web_hook => { api_module: :hook, scope: :self, methods: [:all, :select, :create, :update, :delete]}
58
58
 
59
+ ##
60
+ # :method: blog_posts
61
+ # gets a list of posts
62
+ #
63
+ # :call-seq:
64
+ # blog_posts(options = {})
65
+
66
+ ##
67
+ # :method: blog_post
68
+ # gets the post with the given id
69
+ #
70
+ # :call-seq:
71
+ # blog_post(id, options = {})
72
+
73
+ ##
74
+ # :method: create_blog_post
75
+ # creates a post with the given attributes
76
+ #
77
+ # :call-seq:
78
+ # create_blog_post(options = {})
79
+
80
+ ##
81
+ # :method: update_blog_post
82
+ # updates a post with the given attributes
83
+ #
84
+ # :call-seq:
85
+ # update_blog_post(id, options = {})
86
+
87
+ ##
88
+ # :method: delete_blog_post
89
+ # deletes the post with the given id
90
+ #
91
+ # :call-seq:
92
+ # delete_blog_post(id)
93
+
94
+ ##
95
+ # :method: blog_tags
96
+ # gets a list of tags
97
+ #
98
+ # :call-seq:
99
+ # blog_tags(options = {})
100
+
101
+ ##
102
+ # :method: brands
103
+ # gets a list of brands
104
+ #
105
+ # :call-seq:
106
+ # brands(options = {})
107
+
108
+ ##
109
+ # :method: brand
110
+ # gets the brand with the given id
111
+ #
112
+ # :call-seq:
113
+ # brand(id, options = {})
114
+
115
+ ##
116
+ # :method: create_brand
117
+ # creates a brand with the given attributes
118
+ #
119
+ # :call-seq:
120
+ # create_brand(options = {})
121
+
122
+ ##
123
+ # :method: update_brand
124
+ # updates a brand with the given attributes
125
+ #
126
+ # :call-seq:
127
+ # update_brand(id, options = {})
128
+
129
+ ##
130
+ # :method: delete_brand
131
+ # deletes the brand with the given id
132
+ #
133
+ # :call-seq:
134
+ # delete_brand(id)
135
+
136
+ ##
137
+ # :method: categories
138
+ # gets a list of categories
139
+ #
140
+ # :call-seq:
141
+ # categories(options = {})
142
+
143
+ ##
144
+ # :method: category
145
+ # gets the category with the given id
146
+ #
147
+ # :call-seq:
148
+ # category(id, options = {})
149
+
150
+ ##
151
+ # :method: create_category
152
+ # creates a category with the given attributes
153
+ #
154
+ # :call-seq:
155
+ # create_category(options = {})
156
+
157
+ ##
158
+ # :method: update_category
159
+ # updates a category with the given attributes
160
+ #
161
+ # :call-seq:
162
+ # update_category(id, options = {})
163
+
164
+ ##
165
+ # :method: delete_category
166
+ # deletes the category with the given id
167
+ #
168
+ # :call-seq:
169
+ # delete_category(id)
170
+
171
+ ##
172
+ # :method: customers
173
+ # gets a list of customers
174
+ #
175
+ # :call-seq:
176
+ # customers(options = {})
177
+
178
+ ##
179
+ # :method: customer
180
+ # gets the customer with the given id
181
+ #
182
+ # :call-seq:
183
+ # customer(id, options = {})
184
+
185
+ ##
186
+ # :method: create_customer
187
+ # creates a customer with the given attributes
188
+ #
189
+ # :call-seq:
190
+ # create_customer(options = {})
191
+
192
+ ##
193
+ # :method: update_customer
194
+ # updates a customer with the given attributes
195
+ #
196
+ # :call-seq:
197
+ # update_customer(id, options = {})
198
+
199
+ ##
200
+ # :method: delete_customer
201
+ # deletes the customer with the given id
202
+ #
203
+ # :call-seq:
204
+ # delete_customer(id)
205
+
206
+ ##
207
+ # :method: customers_count
208
+ # counts the number of customers
209
+ #
210
+ # :call-seq:
211
+ # customers_count(options = {})
212
+
213
+ ##
214
+ # :method: customer_addresses
215
+ # gets a list of addresses for the given customer
216
+ #
217
+ # :call-seq:
218
+ # customer_addresses(customer_id, options = {})
219
+
220
+ ##
221
+ # :method: customer_address
222
+ # gets the address with the given id for the given customer
223
+ #
224
+ # :call-seq:
225
+ # customer_address(customer_id, id, options = {})
226
+
227
+ ##
228
+ # :method: create_customer_address
229
+ # creates a address with the given attributes for the given customer
230
+ #
231
+ # :call-seq:
232
+ # create_customer_address(customer_id, options = {})
233
+
234
+ ##
235
+ # :method: update_customer_address
236
+ # updates a address with the given attributes for the given customer
237
+ #
238
+ # :call-seq:
239
+ # update_customer_address(customer_id, id, options = {})
240
+
241
+ ##
242
+ # :method: delete_customer_address
243
+ # deletes the address with the given id for the given customer
244
+ #
245
+ # :call-seq:
246
+ # delete_customer_address(customer_id, id)
247
+
248
+ ##
249
+ # :method: customer_groups
250
+ # gets a list of customer_groups
251
+ #
252
+ # :call-seq:
253
+ # customer_groups(options = {})
254
+
255
+ ##
256
+ # :method: customer_group
257
+ # gets the customer_group with the given id
258
+ #
259
+ # :call-seq:
260
+ # customer_group(id, options = {})
261
+
262
+ ##
263
+ # :method: create_customer_group
264
+ # creates a customer_group with the given attributes
265
+ #
266
+ # :call-seq:
267
+ # create_customer_group(options = {})
268
+
269
+ ##
270
+ # :method: update_customer_group
271
+ # updates a customer_group with the given attributes
272
+ #
273
+ # :call-seq:
274
+ # update_customer_group(id, options = {})
275
+
276
+ ##
277
+ # :method: delete_customer_group
278
+ # deletes the customer_group with the given id
279
+ #
280
+ # :call-seq:
281
+ # delete_customer_group(id)
282
+
283
+ ##
284
+ # :method: countries
285
+ # gets a list of countries
286
+ #
287
+ # :call-seq:
288
+ # countries(options = {})
289
+
290
+ ##
291
+ # :method: country
292
+ # gets the country with the given id
293
+ #
294
+ # :call-seq:
295
+ # country(id, options = {})
296
+
297
+ ##
298
+ # :method: states
299
+ # gets a list of states
300
+ #
301
+ # :call-seq:
302
+ # states(options = {})
303
+
304
+ ##
305
+ # :method: state
306
+ # gets the state with the given id
307
+ #
308
+ # :call-seq:
309
+ # state(id, options = {})
310
+
311
+ ##
312
+ # :method: coupons
313
+ # gets a list of coupons
314
+ #
315
+ # :call-seq:
316
+ # coupons(options = {})
317
+
318
+ ##
319
+ # :method: coupon
320
+ # gets the coupon with the given id
321
+ #
322
+ # :call-seq:
323
+ # coupon(id, options = {})
324
+
325
+ ##
326
+ # :method: create_coupon
327
+ # creates a coupon with the given attributes
328
+ #
329
+ # :call-seq:
330
+ # create_coupon(options = {})
331
+
332
+ ##
333
+ # :method: update_coupon
334
+ # updates a coupon with the given attributes
335
+ #
336
+ # :call-seq:
337
+ # update_coupon(id, options = {})
338
+
339
+ ##
340
+ # :method: delete_coupon
341
+ # deletes the coupon with the given id
342
+ #
343
+ # :call-seq:
344
+ # delete_coupon(id)
345
+
346
+ ##
347
+ # :method: options
348
+ # gets a list of options
349
+ #
350
+ # :call-seq:
351
+ # options(options = {})
352
+
353
+ ##
354
+ # :method: option
355
+ # gets the option with the given id
356
+ #
357
+ # :call-seq:
358
+ # option(id, options = {})
359
+
360
+ ##
361
+ # :method: create_option
362
+ # creates a option with the given attributes
363
+ #
364
+ # :call-seq:
365
+ # create_option(options = {})
366
+
367
+ ##
368
+ # :method: update_option
369
+ # updates a option with the given attributes
370
+ #
371
+ # :call-seq:
372
+ # update_option(id, options = {})
373
+
374
+ ##
375
+ # :method: delete_option
376
+ # deletes the option with the given id
377
+ #
378
+ # :call-seq:
379
+ # delete_option(id)
380
+
381
+ ##
382
+ # :method: option_sets
383
+ # gets a list of option_sets
384
+ #
385
+ # :call-seq:
386
+ # option_sets(options = {})
387
+
388
+ ##
389
+ # :method: option_set
390
+ # gets the option_set with the given id
391
+ #
392
+ # :call-seq:
393
+ # option_set(id, options = {})
394
+
395
+ ##
396
+ # :method: create_option_set
397
+ # creates a option_set with the given attributes
398
+ #
399
+ # :call-seq:
400
+ # create_option_set(options = {})
401
+
402
+ ##
403
+ # :method: update_option_set
404
+ # updates a option_set with the given attributes
405
+ #
406
+ # :call-seq:
407
+ # update_option_set(id, options = {})
408
+
409
+ ##
410
+ # :method: delete_option_set
411
+ # deletes the option_set with the given id
412
+ #
413
+ # :call-seq:
414
+ # delete_option_set(id)
415
+
416
+ ##
417
+ # :method: option_set_options
418
+ # gets a list of options for the given option_set
419
+ #
420
+ # :call-seq:
421
+ # option_set_options(option_set_id, options = {})
422
+
423
+ ##
424
+ # :method: option_set_option
425
+ # gets the option with the given id for the given option_set
426
+ #
427
+ # :call-seq:
428
+ # option_set_option(option_set_id, id, options = {})
429
+
430
+ ##
431
+ # :method: create_option_set_option
432
+ # creates a option with the given attributes for the given option_set
433
+ #
434
+ # :call-seq:
435
+ # create_option_set_option(option_set_id, options = {})
436
+
437
+ ##
438
+ # :method: update_option_set_option
439
+ # updates a option with the given attributes for the given option_set
440
+ #
441
+ # :call-seq:
442
+ # update_option_set_option(option_set_id, id, options = {})
443
+
444
+ ##
445
+ # :method: delete_option_set_option
446
+ # deletes the option with the given id for the given option_set
447
+ #
448
+ # :call-seq:
449
+ # delete_option_set_option(option_set_id, id)
450
+
451
+ ##
452
+ # :method: option_set_values
453
+ # gets a list of values for the given option_set
454
+ #
455
+ # :call-seq:
456
+ # option_set_values(option_set_id, options = {})
457
+
458
+ ##
459
+ # :method: option_set_value
460
+ # gets the value with the given id for the given option_set
461
+ #
462
+ # :call-seq:
463
+ # option_set_value(option_set_id, id, options = {})
464
+
465
+ ##
466
+ # :method: create_option_set_value
467
+ # creates a value with the given attributes for the given option_set
468
+ #
469
+ # :call-seq:
470
+ # create_option_set_value(option_set_id, options = {})
471
+
472
+ ##
473
+ # :method: update_option_set_value
474
+ # updates a value with the given attributes for the given option_set
475
+ #
476
+ # :call-seq:
477
+ # update_option_set_value(option_set_id, id, options = {})
478
+
479
+ ##
480
+ # :method: delete_option_set_value
481
+ # deletes the value with the given id for the given option_set
482
+ #
483
+ # :call-seq:
484
+ # delete_option_set_value(option_set_id, id)
485
+
486
+ ##
487
+ # :method: orders
488
+ # gets a list of orders
489
+ #
490
+ # :call-seq:
491
+ # orders(options = {})
492
+
493
+ ##
494
+ # :method: order
495
+ # gets the order with the given id
496
+ #
497
+ # :call-seq:
498
+ # order(id, options = {})
499
+
500
+ ##
501
+ # :method: create_order
502
+ # creates a order with the given attributes
503
+ #
504
+ # :call-seq:
505
+ # create_order(options = {})
506
+
507
+ ##
508
+ # :method: update_order
509
+ # updates a order with the given attributes
510
+ #
511
+ # :call-seq:
512
+ # update_order(id, options = {})
513
+
514
+ ##
515
+ # :method: delete_order
516
+ # deletes the order with the given id
517
+ #
518
+ # :call-seq:
519
+ # delete_order(id)
520
+
521
+ ##
522
+ # :method: orders_count
523
+ # counts the number of orders
524
+ #
525
+ # :call-seq:
526
+ # orders_count(options = {})
527
+
528
+ ##
529
+ # :method: order_messages
530
+ # gets a list of messages for the given order
531
+ #
532
+ # :call-seq:
533
+ # order_messages(order_id, options = {})
534
+
535
+ ##
536
+ # :method: order_message
537
+ # gets the message with the given id for the given order
538
+ #
539
+ # :call-seq:
540
+ # order_message(order_id, id, options = {})
541
+
542
+ ##
543
+ # :method: order_products
544
+ # gets a list of products for the given order
545
+ #
546
+ # :call-seq:
547
+ # order_products(order_id, options = {})
548
+
549
+ ##
550
+ # :method: order_product
551
+ # gets the product with the given id for the given order
552
+ #
553
+ # :call-seq:
554
+ # order_product(order_id, id, options = {})
555
+
556
+ ##
557
+ # :method: order_shipments
558
+ # gets a list of shipments for the given order
559
+ #
560
+ # :call-seq:
561
+ # order_shipments(order_id, options = {})
562
+
563
+ ##
564
+ # :method: order_shipment
565
+ # gets the shipment with the given id for the given order
566
+ #
567
+ # :call-seq:
568
+ # order_shipment(order_id, id, options = {})
569
+
570
+ ##
571
+ # :method: create_order_shipment
572
+ # creates a shipment with the given attributes for the given order
573
+ #
574
+ # :call-seq:
575
+ # create_order_shipment(order_id, options = {})
576
+
577
+ ##
578
+ # :method: update_order_shipment
579
+ # updates a shipment with the given attributes for the given order
580
+ #
581
+ # :call-seq:
582
+ # update_order_shipment(order_id, id, options = {})
583
+
584
+ ##
585
+ # :method: delete_order_shipment
586
+ # deletes the shipment with the given id for the given order
587
+ #
588
+ # :call-seq:
589
+ # delete_order_shipment(order_id, id)
590
+
591
+ ##
592
+ # :method: order_shipping_addresses
593
+ # gets a list of shipping_addresses for the given order
594
+ #
595
+ # :call-seq:
596
+ # order_shipping_addresses(order_id, options = {})
597
+
598
+ ##
599
+ # :method: order_shipping_address
600
+ # gets the shipping_address with the given id for the given order
601
+ #
602
+ # :call-seq:
603
+ # order_shipping_address(order_id, id, options = {})
604
+
605
+ ##
606
+ # :method: payment_methods
607
+ # gets a list of methods
608
+ #
609
+ # :call-seq:
610
+ # payment_methods(options = {})
611
+
612
+ ##
613
+ # :method: products
614
+ # gets a list of products
615
+ #
616
+ # :call-seq:
617
+ # products(options = {})
618
+
619
+ ##
620
+ # :method: product
621
+ # gets the product with the given id
622
+ #
623
+ # :call-seq:
624
+ # product(id, options = {})
625
+
626
+ ##
627
+ # :method: create_product
628
+ # creates a product with the given attributes
629
+ #
630
+ # :call-seq:
631
+ # create_product(options = {})
632
+
633
+ ##
634
+ # :method: update_product
635
+ # updates a product with the given attributes
636
+ #
637
+ # :call-seq:
638
+ # update_product(id, options = {})
639
+
640
+ ##
641
+ # :method: delete_product
642
+ # deletes the product with the given id
643
+ #
644
+ # :call-seq:
645
+ # delete_product(id)
646
+
647
+ ##
648
+ # :method: products_count
649
+ # counts the number of products
650
+ #
651
+ # :call-seq:
652
+ # products_count(options = {})
653
+
654
+ ##
655
+ # :method: product_custom_fields
656
+ # gets a list of custom_fields for the given product
657
+ #
658
+ # :call-seq:
659
+ # product_custom_fields(product_id, options = {})
660
+
661
+ ##
662
+ # :method: product_custom_field
663
+ # gets the custom_field with the given id for the given product
664
+ #
665
+ # :call-seq:
666
+ # product_custom_field(product_id, id, options = {})
667
+
668
+ ##
669
+ # :method: create_product_custom_field
670
+ # creates a custom_field with the given attributes for the given product
671
+ #
672
+ # :call-seq:
673
+ # create_product_custom_field(product_id, options = {})
674
+
675
+ ##
676
+ # :method: update_product_custom_field
677
+ # updates a custom_field with the given attributes for the given product
678
+ #
679
+ # :call-seq:
680
+ # update_product_custom_field(product_id, id, options = {})
681
+
682
+ ##
683
+ # :method: delete_product_custom_field
684
+ # deletes the custom_field with the given id for the given product
685
+ #
686
+ # :call-seq:
687
+ # delete_product_custom_field(product_id, id)
688
+
689
+ ##
690
+ # :method: product_discount_rules
691
+ # gets a list of discount_rules for the given product
692
+ #
693
+ # :call-seq:
694
+ # product_discount_rules(product_id, options = {})
695
+
696
+ ##
697
+ # :method: product_discount_rule
698
+ # gets the discount_rule with the given id for the given product
699
+ #
700
+ # :call-seq:
701
+ # product_discount_rule(product_id, id, options = {})
702
+
703
+ ##
704
+ # :method: create_product_discount_rule
705
+ # creates a discount_rule with the given attributes for the given product
706
+ #
707
+ # :call-seq:
708
+ # create_product_discount_rule(product_id, options = {})
709
+
710
+ ##
711
+ # :method: update_product_discount_rule
712
+ # updates a discount_rule with the given attributes for the given product
713
+ #
714
+ # :call-seq:
715
+ # update_product_discount_rule(product_id, id, options = {})
716
+
717
+ ##
718
+ # :method: delete_product_discount_rule
719
+ # deletes the discount_rule with the given id for the given product
720
+ #
721
+ # :call-seq:
722
+ # delete_product_discount_rule(product_id, id)
723
+
724
+ ##
725
+ # :method: product_configurable_fields
726
+ # gets a list of configurable_fields for the given product
727
+ #
728
+ # :call-seq:
729
+ # product_configurable_fields(product_id, options = {})
730
+
731
+ ##
732
+ # :method: product_configurable_field
733
+ # gets the configurable_field with the given id for the given product
734
+ #
735
+ # :call-seq:
736
+ # product_configurable_field(product_id, id, options = {})
737
+
738
+ ##
739
+ # :method: delete_product_configurable_field
740
+ # deletes the configurable_field with the given id for the given product
741
+ #
742
+ # :call-seq:
743
+ # delete_product_configurable_field(product_id, id)
744
+
745
+ ##
746
+ # :method: product_images
747
+ # gets a list of images for the given product
748
+ #
749
+ # :call-seq:
750
+ # product_images(product_id, options = {})
751
+
752
+ ##
753
+ # :method: product_image
754
+ # gets the image with the given id for the given product
755
+ #
756
+ # :call-seq:
757
+ # product_image(product_id, id, options = {})
758
+
759
+ ##
760
+ # :method: create_product_image
761
+ # creates a image with the given attributes for the given product
762
+ #
763
+ # :call-seq:
764
+ # create_product_image(product_id, options = {})
765
+
766
+ ##
767
+ # :method: update_product_image
768
+ # updates a image with the given attributes for the given product
769
+ #
770
+ # :call-seq:
771
+ # update_product_image(product_id, id, options = {})
772
+
773
+ ##
774
+ # :method: delete_product_image
775
+ # deletes the image with the given id for the given product
776
+ #
777
+ # :call-seq:
778
+ # delete_product_image(product_id, id)
779
+
780
+ ##
781
+ # :method: product_options
782
+ # gets a list of options for the given product
783
+ #
784
+ # :call-seq:
785
+ # product_options(product_id, options = {})
786
+
787
+ ##
788
+ # :method: product_option
789
+ # gets the option with the given id for the given product
790
+ #
791
+ # :call-seq:
792
+ # product_option(product_id, id, options = {})
793
+
794
+ ##
795
+ # :method: product_reviews
796
+ # gets a list of reviews for the given product
797
+ #
798
+ # :call-seq:
799
+ # product_reviews(product_id, options = {})
800
+
801
+ ##
802
+ # :method: product_rules
803
+ # gets a list of rules for the given product
804
+ #
805
+ # :call-seq:
806
+ # product_rules(product_id, options = {})
807
+
808
+ ##
809
+ # :method: product_rule
810
+ # gets the rule with the given id for the given product
811
+ #
812
+ # :call-seq:
813
+ # product_rule(product_id, id, options = {})
814
+
815
+ ##
816
+ # :method: create_product_rule
817
+ # creates a rule with the given attributes for the given product
818
+ #
819
+ # :call-seq:
820
+ # create_product_rule(product_id, options = {})
821
+
822
+ ##
823
+ # :method: update_product_rule
824
+ # updates a rule with the given attributes for the given product
825
+ #
826
+ # :call-seq:
827
+ # update_product_rule(product_id, id, options = {})
828
+
829
+ ##
830
+ # :method: delete_product_rule
831
+ # deletes the rule with the given id for the given product
832
+ #
833
+ # :call-seq:
834
+ # delete_product_rule(product_id, id)
835
+
836
+ ##
837
+ # :method: product_videos
838
+ # gets a list of videos for the given product
839
+ #
840
+ # :call-seq:
841
+ # product_videos(product_id, options = {})
842
+
843
+ ##
844
+ # :method: product_video
845
+ # gets the video with the given id for the given product
846
+ #
847
+ # :call-seq:
848
+ # product_video(product_id, id, options = {})
849
+
850
+ ##
851
+ # :method: create_product_video
852
+ # creates a video with the given attributes for the given product
853
+ #
854
+ # :call-seq:
855
+ # create_product_video(product_id, options = {})
856
+
857
+ ##
858
+ # :method: update_product_video
859
+ # updates a video with the given attributes for the given product
860
+ #
861
+ # :call-seq:
862
+ # update_product_video(product_id, id, options = {})
863
+
864
+ ##
865
+ # :method: delete_product_video
866
+ # deletes the video with the given id for the given product
867
+ #
868
+ # :call-seq:
869
+ # delete_product_video(product_id, id)
870
+
871
+ ##
872
+ # :method: product_skus
873
+ # gets a list of skus for the given product
874
+ #
875
+ # :call-seq:
876
+ # product_skus(product_id, options = {})
877
+
878
+ ##
879
+ # :method: product_sku
880
+ # gets the sku with the given id for the given product
881
+ #
882
+ # :call-seq:
883
+ # product_sku(product_id, id, options = {})
884
+
885
+ ##
886
+ # :method: create_product_sku
887
+ # creates a sku with the given attributes for the given product
888
+ #
889
+ # :call-seq:
890
+ # create_product_sku(product_id, options = {})
891
+
892
+ ##
893
+ # :method: update_product_sku
894
+ # updates a sku with the given attributes for the given product
895
+ #
896
+ # :call-seq:
897
+ # update_product_sku(product_id, id, options = {})
898
+
899
+ ##
900
+ # :method: delete_product_sku
901
+ # deletes the sku with the given id for the given product
902
+ #
903
+ # :call-seq:
904
+ # delete_product_sku(product_id, id)
905
+
906
+ ##
907
+ # :method: redirects
908
+ # gets a list of redirects
909
+ #
910
+ # :call-seq:
911
+ # redirects(options = {})
912
+
913
+ ##
914
+ # :method: redirect
915
+ # gets the redirect with the given id
916
+ #
917
+ # :call-seq:
918
+ # redirect(id, options = {})
919
+
920
+ ##
921
+ # :method: create_redirect
922
+ # creates a redirect with the given attributes
923
+ #
924
+ # :call-seq:
925
+ # create_redirect(options = {})
926
+
927
+ ##
928
+ # :method: update_redirect
929
+ # updates a redirect with the given attributes
930
+ #
931
+ # :call-seq:
932
+ # update_redirect(id, options = {})
933
+
934
+ ##
935
+ # :method: delete_redirect
936
+ # deletes the redirect with the given id
937
+ #
938
+ # :call-seq:
939
+ # delete_redirect(id)
940
+
941
+ ##
942
+ # :method: shipping_methods
943
+ # gets a list of methods
944
+ #
945
+ # :call-seq:
946
+ # shipping_methods(options = {})
947
+
948
+ ##
949
+ # :method: shipping_method
950
+ # gets the method with the given id
951
+ #
952
+ # :call-seq:
953
+ # shipping_method(id, options = {})
954
+
955
+ ##
956
+ # :method: tax_classes
957
+ # gets a list of tax_classes
958
+ #
959
+ # :call-seq:
960
+ # tax_classes(options = {})
961
+
962
+ ##
963
+ # :method: tax_class
964
+ # gets the tax_class with the given id
965
+ #
966
+ # :call-seq:
967
+ # tax_class(id, options = {})
968
+
969
+ ##
970
+ # :method: hooks
971
+ # gets a list of hooks
972
+ #
973
+ # :call-seq:
974
+ # hooks(options = {})
975
+
976
+ ##
977
+ # :method: hook
978
+ # gets the hook with the given id
979
+ #
980
+ # :call-seq:
981
+ # hook(id, options = {})
982
+
983
+ ##
984
+ # :method: create_hook
985
+ # creates a hook with the given attributes
986
+ #
987
+ # :call-seq:
988
+ # create_hook(options = {})
989
+
990
+ ##
991
+ # :method: update_hook
992
+ # updates a hook with the given attributes
993
+ #
994
+ # :call-seq:
995
+ # update_hook(id, options = {})
996
+
997
+ ##
998
+ # :method: delete_hook
999
+ # deletes the hook with the given id
1000
+ #
1001
+ # :call-seq:
1002
+ # delete_hook(id)
1003
+
59
1004
  end
60
1005
  end
@@ -31,7 +31,9 @@ module BigcommerceOAuthAPI
31
31
  request.body = options if !options.empty?
32
32
  end
33
33
  end
34
- if response.body.is_a?(Array)
34
+ if response.status == 204
35
+ nil
36
+ elsif response.body.is_a?(Array)
35
37
  response.body.map { |resource| Resource.new(resource) }
36
38
  else
37
39
  Resource.new(response.body)
@@ -14,10 +14,22 @@ module BigcommerceOAuthAPI
14
14
  @attributes[key.to_sym] = value
15
15
  end
16
16
 
17
+ def ==(other)
18
+ self.to_h == other.to_h
19
+ end
20
+
21
+ def eql?(other)
22
+ self == other
23
+ end
24
+
17
25
  def respond_to?(method_name)
18
26
  super(method_name) ? true : @attributes.include?(method_name.to_s.gsub(/(\?$)|(=$)/, '').to_sym)
19
27
  end
20
28
 
29
+ def to_h
30
+ @attributes.to_h
31
+ end
32
+
21
33
  def method_missing(method_sym, *arguments)
22
34
  method_name = method_sym.to_s
23
35
  attribute_name = method_name.gsub(/(\?$)|(=$)/, '')
@@ -1,3 +1,3 @@
1
1
  module BigcommerceOAuthAPI
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
@@ -1,23 +1,44 @@
1
+ require 'spec_helper'
1
2
  require 'bigcommerce-oauth-api/request'
2
3
  require 'bigcommerce-oauth-api/client'
4
+ require 'bigcommerce-oauth-api/resource'
3
5
 
4
6
  describe BigcommerceOAuthAPI::Request do
5
7
  describe '#get' do
8
+ before do
9
+ @client = BigcommerceOAuthAPI::Client.new(
10
+ :store_hash => 'TEST_STORE',
11
+ :client_id => 'SECRET_ID',
12
+ :access_token => 'SECRET_TOKEN')
13
+ end
14
+
6
15
  context 'given a path and set of options' do
7
16
  it 'should perform HTTP GET with OAuth headers' do
8
- client = BigcommerceOAuthAPI::Client.new(
9
- :store_hash => 'TEST_STORE',
10
- :client_id => 'SECRET_ID',
11
- :access_token => 'SECRET_TOKEN')
12
17
  path = '/awesome/1/path/1'
13
- url = client.send(:connection).build_url(path).to_s
14
- stub_request(:get, url).to_return(:status => 200, :body => '', :headers => {})
18
+ options = { foo: 'bar', bar: { oof: 'rab' } }
19
+ url = @client.send(:connection).build_url(path).to_s
20
+ stub_request(:get, url).to_return(:status => 200, :body => options.to_json, :headers => {})
15
21
 
16
- client.get(path, {})
22
+ expect(@client.get(path, {})).to eql(BigcommerceOAuthAPI::Resource.new(options))
17
23
  expect(a_request(:get, url).
18
24
  with(:headers => {'X-Auth-Client' => 'SECRET_ID',
19
25
  'X-Auth-Token' => 'SECRET_TOKEN'})).to have_been_made
20
26
  end
21
27
  end
28
+
29
+ context 'given a request that returns no content' do
30
+ it 'returns nil' do
31
+ path = '/awesome/1/path/1'
32
+ url = @client.send(:connection).build_url(path).to_s
33
+ stub_request(:get, url).to_return(:status => 204, :body => '', :headers => {})
34
+
35
+ expect(@client.get(path, {})).to eql(nil)
36
+ expect(a_request(:get, url).
37
+ with(:headers => {'X-Auth-Client' => 'SECRET_ID',
38
+ 'X-Auth-Token' => 'SECRET_TOKEN'})).to have_been_made
39
+
40
+ end
41
+ end
42
+
22
43
  end
23
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigcommerce-oauth-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Orthmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-04 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake