bigcommerce 1.0.0.beta → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +115 -39
  3. data/bigcommerce.gemspec +12 -13
  4. data/lib/bigcommerce.rb +5 -34
  5. data/lib/bigcommerce/config.rb +14 -0
  6. data/lib/bigcommerce/connection.rb +26 -0
  7. data/lib/bigcommerce/exception.rb +25 -18
  8. data/lib/bigcommerce/request.rb +8 -9
  9. data/lib/bigcommerce/resource_actions.rb +11 -11
  10. data/lib/bigcommerce/resources/content/blog_post.rb +3 -5
  11. data/lib/bigcommerce/resources/content/blog_tag.rb +2 -3
  12. data/lib/bigcommerce/resources/content/redirect.rb +2 -2
  13. data/lib/bigcommerce/resources/customers/customer.rb +22 -2
  14. data/lib/bigcommerce/resources/customers/customer_address.rb +5 -5
  15. data/lib/bigcommerce/resources/customers/customer_group.rb +2 -2
  16. data/lib/bigcommerce/resources/geography/country.rb +4 -3
  17. data/lib/bigcommerce/resources/geography/state.rb +6 -5
  18. data/lib/bigcommerce/resources/marketing/banner.rb +21 -0
  19. data/lib/bigcommerce/resources/marketing/coupon.rb +2 -2
  20. data/lib/bigcommerce/resources/marketing/gift_certificates.rb +25 -0
  21. data/lib/bigcommerce/resources/orders/order.rb +46 -44
  22. data/lib/bigcommerce/resources/orders/order_coupon.rb +5 -5
  23. data/lib/bigcommerce/resources/orders/order_message.rb +8 -7
  24. data/lib/bigcommerce/resources/orders/order_product.rb +37 -36
  25. data/lib/bigcommerce/resources/orders/order_shipping_address.rb +24 -23
  26. data/lib/bigcommerce/resources/orders/order_status.rb +2 -1
  27. data/lib/bigcommerce/resources/orders/order_tax.rb +8 -7
  28. data/lib/bigcommerce/resources/orders/shipment.rb +11 -10
  29. data/lib/bigcommerce/resources/products/brand.rb +2 -2
  30. data/lib/bigcommerce/resources/products/bulk_pricing_rule.rb +6 -5
  31. data/lib/bigcommerce/resources/products/category.rb +2 -2
  32. data/lib/bigcommerce/resources/products/configurable_field.rb +6 -5
  33. data/lib/bigcommerce/resources/products/custom_field.rb +6 -5
  34. data/lib/bigcommerce/resources/products/google_product_search_mapping.rb +9 -8
  35. data/lib/bigcommerce/resources/products/option.rb +2 -2
  36. data/lib/bigcommerce/resources/products/option_set.rb +2 -2
  37. data/lib/bigcommerce/resources/products/option_set_option.rb +2 -1
  38. data/lib/bigcommerce/resources/products/option_value.rb +1 -0
  39. data/lib/bigcommerce/resources/products/product.rb +61 -61
  40. data/lib/bigcommerce/resources/products/product_image.rb +4 -4
  41. data/lib/bigcommerce/resources/products/product_option.rb +2 -1
  42. data/lib/bigcommerce/resources/products/product_review.rb +1 -5
  43. data/lib/bigcommerce/resources/products/product_rule.rb +4 -4
  44. data/lib/bigcommerce/resources/products/product_video.rb +4 -4
  45. data/lib/bigcommerce/resources/products/sku.rb +15 -9
  46. data/lib/bigcommerce/resources/shipping/shipping_method.rb +2 -1
  47. data/lib/bigcommerce/resources/store/store_information.rb +18 -14
  48. data/lib/bigcommerce/resources/system/time.rb +2 -2
  49. data/lib/bigcommerce/resources/tax/tax_class.rb +2 -1
  50. data/lib/bigcommerce/resources/webhooks/webhook.rb +2 -1
  51. data/lib/bigcommerce/subresource_actions.rb +14 -14
  52. data/lib/bigcommerce/version.rb +1 -1
  53. metadata +47 -166
  54. data/.gitignore +0 -17
  55. data/.rspec +0 -2
  56. data/.rubocop.yml +0 -620
  57. data/.travis.yml +0 -15
  58. data/CHANGELOG.md +0 -11
  59. data/CONTRIBUTING.md +0 -119
  60. data/DEPENDENCIES.md +0 -7
  61. data/Gemfile +0 -15
  62. data/Guardfile +0 -22
  63. data/LICENSE +0 -20
  64. data/RELEASING.md +0 -64
  65. data/Rakefile +0 -13
  66. data/examples/README.md +0 -148
  67. data/examples/configuration/legacy_auth.rb +0 -12
  68. data/examples/configuration/oauth.rb +0 -9
  69. data/examples/content/blog_post.rb +0 -39
  70. data/examples/content/blog_tag.rb +0 -10
  71. data/examples/content/redirect.rb +0 -43
  72. data/examples/customers/customer.rb +0 -36
  73. data/examples/customers/customer_address.rb +0 -50
  74. data/examples/customers/customer_group.rb +0 -35
  75. data/examples/exception_handling.rb +0 -50
  76. data/examples/geography/country.rb +0 -16
  77. data/examples/geography/state.rb +0 -19
  78. data/examples/marketing/coupon.rb +0 -44
  79. data/examples/orders/order.rb +0 -53
  80. data/examples/orders/order_coupon.rb +0 -17
  81. data/examples/orders/order_message.rb +0 -17
  82. data/examples/orders/order_product.rb +0 -23
  83. data/examples/orders/order_shipping_address.rb +0 -23
  84. data/examples/orders/order_status.rb +0 -15
  85. data/examples/orders/order_tax.rb +0 -17
  86. data/examples/orders/shipment.rb +0 -57
  87. data/examples/payments/payment_method.rb +0 -10
  88. data/examples/products/brand.rb +0 -36
  89. data/examples/products/bulk_pricing_rule.rb +0 -47
  90. data/examples/products/category.rb +0 -37
  91. data/examples/products/configurable_field.rb +0 -29
  92. data/examples/products/custom_field.rb +0 -44
  93. data/examples/products/google_product_search_mapping.rb +0 -12
  94. data/examples/products/option.rb +0 -37
  95. data/examples/products/option_set.rb +0 -35
  96. data/examples/products/option_set_option.rb +0 -50
  97. data/examples/products/option_value.rb +0 -43
  98. data/examples/products/product.rb +0 -44
  99. data/examples/products/product_image.rb +0 -42
  100. data/examples/products/product_option.rb +0 -17
  101. data/examples/products/product_review.rb +0 -12
  102. data/examples/products/product_rule.rb +0 -54
  103. data/examples/products/product_video.rb +0 -45
  104. data/examples/products/sku.rb +0 -48
  105. data/examples/shipping/shipping_method.rb +0 -13
  106. data/examples/store/store_info.rb +0 -10
  107. data/examples/system/time.rb +0 -10
  108. data/examples/tax/tax_class.rb +0 -13
  109. data/examples/webhooks/webhook.rb +0 -29
  110. data/spec/bigcommerce/bigcommerce_spec.rb +0 -76
  111. data/spec/bigcommerce/unit/actions_spec.rb +0 -151
  112. data/spec/bigcommerce/unit/exception_spec.rb +0 -53
  113. data/spec/bigcommerce/unit/middleware/auth_spec.rb +0 -18
  114. data/spec/bigcommerce/unit/middleware/http_exception_spec.rb +0 -40
  115. data/spec/bigcommerce/unit/request_spec.rb +0 -180
  116. data/spec/bigcommerce/unit/resources/content/blog_post_spec.rb +0 -12
  117. data/spec/bigcommerce/unit/resources/content/blog_tag_spec.rb +0 -12
  118. data/spec/bigcommerce/unit/resources/content/redirect_spec.rb +0 -12
  119. data/spec/bigcommerce/unit/resources/customers/customer_address_spec.rb +0 -21
  120. data/spec/bigcommerce/unit/resources/customers/customer_group_spec.rb +0 -12
  121. data/spec/bigcommerce/unit/resources/customers/customer_spec.rb +0 -12
  122. data/spec/bigcommerce/unit/resources/geography/country_spec.rb +0 -12
  123. data/spec/bigcommerce/unit/resources/geography/state_spec.rb +0 -21
  124. data/spec/bigcommerce/unit/resources/marketing/coupon_spec.rb +0 -12
  125. data/spec/bigcommerce/unit/resources/orders/order_product_spec.rb +0 -21
  126. data/spec/bigcommerce/unit/resources/orders/order_shipping_address_spec.rb +0 -21
  127. data/spec/bigcommerce/unit/resources/orders/order_spec.rb +0 -13
  128. data/spec/bigcommerce/unit/resources/orders/shipment_spec.rb +0 -21
  129. data/spec/bigcommerce/unit/resources/payments/payment_method_spec.rb +0 -23
  130. data/spec/bigcommerce/unit/resources/products/brand_spec.rb +0 -12
  131. data/spec/bigcommerce/unit/resources/products/bulk_pricing_rule_spec.rb +0 -21
  132. data/spec/bigcommerce/unit/resources/products/category_spec.rb +0 -12
  133. data/spec/bigcommerce/unit/resources/products/configurable_field_spec.rb +0 -21
  134. data/spec/bigcommerce/unit/resources/products/custom_field_spec.rb +0 -21
  135. data/spec/bigcommerce/unit/resources/products/google_product_search_mapping_spec.rb +0 -14
  136. data/spec/bigcommerce/unit/resources/products/option_set_spec.rb +0 -12
  137. data/spec/bigcommerce/unit/resources/products/option_spec.rb +0 -12
  138. data/spec/bigcommerce/unit/resources/products/product_image_spec.rb +0 -21
  139. data/spec/bigcommerce/unit/resources/products/product_review_spec.rb +0 -14
  140. data/spec/bigcommerce/unit/resources/products/product_rule_spec.rb +0 -21
  141. data/spec/bigcommerce/unit/resources/products/product_spec.rb +0 -13
  142. data/spec/bigcommerce/unit/resources/products/product_video_spec.rb +0 -21
  143. data/spec/bigcommerce/unit/resources/products/sku_spec.rb +0 -21
  144. data/spec/bigcommerce/unit/resources/resource_spec.rb +0 -4
  145. data/spec/bigcommerce/unit/resources/store_info/store_information_spec.rb +0 -12
  146. data/spec/bigcommerce/unit/resources/system/time_spec.rb +0 -12
  147. data/spec/bigcommerce/unit/version_spec.rb +0 -7
  148. data/spec/spec_helper.rb +0 -11
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::BlogPost do
4
- before(:each) { @blog_post = Bigcommerce::BlogPost }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@blog_post).to receive(:get).with('blog/posts/count')
9
- @blog_post.count
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::BlogTag do
4
- before(:each) { @blog_tag = Bigcommerce::BlogTag }
5
-
6
- describe '.all' do
7
- it 'should hit the correct path' do
8
- expect(@blog_tag).to receive(:get).with(@blog_tag.path.build)
9
- @blog_tag.all
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Redirect do
4
- before(:each) { @redirect = Bigcommerce::Redirect }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@redirect).to receive(:get).with('redirects/count')
9
- @redirect.count
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::CustomerAddress do
4
- before(:each) { @address = Bigcommerce::CustomerAddress }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@address).to receive(:get).with('customers/1/addresses/count')
11
- @address.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@address).to receive(:get).with('customers/addresses/count')
18
- @address.count_all
19
- end
20
- end
21
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::CustomerGroup do
4
- before(:each) { @group = Bigcommerce::CustomerGroup }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@group).to receive(:get).with('customer_groups/count')
9
- @group.count
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Customer do
4
- before(:each) { @customer = Bigcommerce::Customer }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@customer).to receive(:get).with('customers/count')
9
- @customer.count
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Country do
4
- before(:each) { @country = Bigcommerce::Country }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@country).to receive(:get).with('countries/count')
9
- @country.count
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::State do
4
- before(:each) { @state = Bigcommerce::State }
5
-
6
- let(:params) { 226 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@state).to receive(:get).with('countries/226/states/count')
11
- @state.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@state).to receive(:get).with('countries/states/count')
18
- @state.count_all
19
- end
20
- end
21
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Coupon do
4
- before(:each) { @coupon = Bigcommerce::Coupon }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@coupon).to receive(:get).with('coupons/count')
9
- @coupon.count
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::OrderProduct do
4
- before(:each) { @order_product = Bigcommerce::OrderProduct }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@order_product).to receive(:get).with('orders/1/products/count')
11
- @order_product.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@order_product).to receive(:get).with('orders/products/count')
18
- @order_product.count_all
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::OrderShippingAddress do
4
- before(:each) { @shipping_address = Bigcommerce::OrderShippingAddress }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@shipping_address).to receive(:get).with('orders/1/shipping_addresses/count')
11
- @shipping_address.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@shipping_address).to receive(:get).with('orders/shipping_addresses/count')
18
- @shipping_address.count_all
19
- end
20
- end
21
- end
@@ -1,13 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Order do
4
- before(:each) { @order = Bigcommerce::Order }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path and should allow params' do
8
- params = { page: 1 }
9
- expect(@order).to receive(:get).with('orders/count', params)
10
- @order.count params
11
- end
12
- end
13
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Shipment do
4
- before(:each) { @shipment = Bigcommerce::Shipment }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'hit the correct path' do
10
- expect(@shipment).to receive(:get).with('orders/1/shipments/count')
11
- @shipment.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'hit the correct path' do
17
- expect(@shipment).to receive(:get).with('orders/shipments/count')
18
- @shipment.count_all
19
- end
20
- end
21
- end
@@ -1,23 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::PaymentMethod do
4
- before(:each) { @payment_method = Bigcommerce::PaymentMethod }
5
-
6
- let(:params) do
7
- {
8
- page: 1
9
- }
10
- end
11
-
12
- describe '.all' do
13
- it 'should hit the correct path without params' do
14
- expect(@payment_method).to receive(:get).with('payments/methods', {})
15
- @payment_method.all
16
- end
17
-
18
- it 'should hit the correct path with params' do
19
- expect(@payment_method).to receive(:get).with('payments/methods', params)
20
- @payment_method.all params
21
- end
22
- end
23
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Brand do
4
- before(:each) { @brand = Bigcommerce::Brand }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@brand).to receive(:get).with('brands/count')
9
- @brand.count
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::BulkPricingRule do
4
- before(:each) { @bulk_pricing_rule = Bigcommerce::BulkPricingRule }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@bulk_pricing_rule).to receive(:get).with('products/1/discount_rules/count')
11
- @bulk_pricing_rule.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@bulk_pricing_rule).to receive(:get).with('products/discount_rules/count')
18
- @bulk_pricing_rule.count_all
19
- end
20
- end
21
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Category do
4
- before(:each) { @category = Bigcommerce::Category }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@category).to receive(:get).with('categories/count')
9
- @category.count
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::ConfigurableField do
4
- before(:each) { @configurable_field = Bigcommerce::ConfigurableField }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@configurable_field).to receive(:get).with('products/1/configurable_fields/count')
11
- @configurable_field.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@configurable_field).to receive(:get).with('products/configurable_fields/count')
18
- @configurable_field.count_all
19
- end
20
- end
21
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::CustomField do
4
- before(:each) { @custom_field = Bigcommerce::CustomField }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@custom_field).to receive(:get).with('products/1/custom_fields/count')
11
- @custom_field.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@custom_field).to receive(:get).with('products/custom_fields/count')
18
- @custom_field.count_all
19
- end
20
- end
21
- end
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::GoogleProductSearchMapping do
4
- before(:each) { @mapping = Bigcommerce::GoogleProductSearchMapping }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.all' do
9
- it 'should hit the correct path' do
10
- expect(@mapping).to receive(:get).with('products/1/googleproductsearch')
11
- @mapping.all params
12
- end
13
- end
14
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::OptionSet do
4
- before(:each) { @option_set = Bigcommerce::OptionSet }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@option_set).to receive(:get).with('option_sets/count')
9
- @option_set.count
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::Option do
4
- before(:each) { @option = Bigcommerce::Option }
5
-
6
- describe '.count' do
7
- it 'should hit the correct path' do
8
- expect(@option).to receive(:get).with('options/count')
9
- @option.count
10
- end
11
- end
12
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::ProductImage do
4
- before(:each) { @image = Bigcommerce::ProductImage }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@image).to receive(:get).with('products/1/images/count')
11
- @image.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@image).to receive(:get).with('products/images/count')
18
- @image.count_all
19
- end
20
- end
21
- end
@@ -1,14 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::ProductReview do
4
- before(:each) { @product_review = Bigcommerce::ProductReview }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.all' do
9
- it 'should hit the correct path' do
10
- expect(@product_review).to receive(:get).with('products/1/reviews')
11
- @product_review.all params
12
- end
13
- end
14
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bigcommerce::ProductRule do
4
- before(:each) { @rule = Bigcommerce::ProductRule }
5
-
6
- let(:params) { 1 }
7
-
8
- describe '.count' do
9
- it 'should hit the correct path' do
10
- expect(@rule).to receive(:get).with('products/1/rules/count')
11
- @rule.count params
12
- end
13
- end
14
-
15
- describe '.count_all' do
16
- it 'should hit the correct path' do
17
- expect(@rule).to receive(:get).with('products/rules/count')
18
- @rule.count_all
19
- end
20
- end
21
- end