falsify 0.1.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 (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rubocop.yml +123 -0
  4. data/.travis.yml +7 -0
  5. data/.yardopts +2 -0
  6. data/CHANGELOG.md +31 -0
  7. data/Gemfile +4 -0
  8. data/Gemfile.lock +75 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +44 -0
  11. data/Rakefile +10 -0
  12. data/bin/console +10 -0
  13. data/bin/docs +3 -0
  14. data/bin/setup +8 -0
  15. data/falsify.gemspec +39 -0
  16. data/lib/falsify.rb +4 -0
  17. data/lib/falsify/error.rb +5 -0
  18. data/lib/falsify/models/address.rb +54 -0
  19. data/lib/falsify/models/customer/customer.rb +114 -0
  20. data/lib/falsify/models/customer/metafield.rb +36 -0
  21. data/lib/falsify/models/fulfillment/fulfillment.rb +96 -0
  22. data/lib/falsify/models/fulfillment/fulfillment_event.rb +75 -0
  23. data/lib/falsify/models/fulfillment/fulfillment_line_item.rb +75 -0
  24. data/lib/falsify/models/fulfillment/supported_tracking_companies.rb +51 -0
  25. data/lib/falsify/models/order/client_details.rb +36 -0
  26. data/lib/falsify/models/order/discount_allocation.rb +15 -0
  27. data/lib/falsify/models/order/discount_application.rb +62 -0
  28. data/lib/falsify/models/order/discount_code.rb +26 -0
  29. data/lib/falsify/models/order/order.rb +248 -0
  30. data/lib/falsify/models/order/order_line_item.rb +102 -0
  31. data/lib/falsify/models/order/price_set.rb +52 -0
  32. data/lib/falsify/models/order/refund/refund.rb +72 -0
  33. data/lib/falsify/models/order/refund/refund_line_item.rb +0 -0
  34. data/lib/falsify/models/order/shipping_line.rb +39 -0
  35. data/lib/falsify/models/order/tax_line.rb +14 -0
  36. data/lib/falsify/models/product/collection/collect.rb +29 -0
  37. data/lib/falsify/models/product/collection/custom_collection.rb +72 -0
  38. data/lib/falsify/models/product/collection/smart_collection.rb +181 -0
  39. data/lib/falsify/models/product/product.rb +83 -0
  40. data/lib/falsify/models/product/product_image.rb +39 -0
  41. data/lib/falsify/models/product/product_variant.rb +111 -0
  42. data/lib/falsify/version.rb +3 -0
  43. metadata +214 -0
@@ -0,0 +1,83 @@
1
+ require "enumerize"
2
+
3
+ module Falsify
4
+ # The Product resource lets you update and create products in a merchant's store.
5
+ # See the [API documentation](https://help.shopify.com/en/api/reference/products/product).
6
+ #
7
+ # Required Fields:
8
+ # - title
9
+ class Product
10
+ extend Enumerize
11
+ # A description of the product. Supports HTML formatting.
12
+ # @return [String]
13
+ attr_accessor :body_html
14
+ # The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the product was created.
15
+ # @return [String]
16
+ attr_reader :created_at
17
+ # A unique human-friendly string for the product.
18
+ # Automatically generated from the product's `title`.
19
+ # Used by the Liquid templating language to refer to objects.
20
+ # @return [String]
21
+ attr_accessor :handle
22
+ # An unsigned 64-bit integer that's used as a unique identifier for the product.
23
+ # Each `id` is unique across the Shopify system.
24
+ # No two products will have the same `id`, even if they're from different shops.
25
+ # @return [String]
26
+ attr_reader :id
27
+ # A list of [product image](https://help.shopify.com/en/api/reference/products/product-image) objects, each one representing an image associated with the product.
28
+ # @return [String]
29
+ attr_accessor :images
30
+ # The custom product property names like `Size`, `Color`, and `Material`.
31
+ # You can add up to 3 options of up to 255 characters each.
32
+ # @return [String]
33
+ attr_accessor :options
34
+ # A categorization for the product used for filtering and searching products.
35
+ # @return [String]
36
+ attr_accessor :product_type
37
+ # The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the product was published.
38
+ # Can be set to `null` to unpublish the product from the Online Store channel.
39
+ # @return [String]
40
+ attr_accessor :published_at
41
+ # @!attribute published_scope [rw]
42
+ # Whether the product is published to the Point of Sale channel.
43
+ # Valid values:
44
+ # - `web`: The product is published to the Online Store channel but not published to the Point of Sale channel.
45
+ # - `global`: The product is published to both the Online Store channel and the Point of Sale channel.
46
+ # @return [:web, :global]
47
+ enumerize :published_scope, in: [:web, :global]
48
+ # A string of comma-separated tags that are used for filtering and search.
49
+ # A product can have up to 250 tags.
50
+ # Each tag can have up to 255 characters.
51
+ # @return [String]
52
+ attr_accessor :tags
53
+ # The suffix of the Liquid template used for the product page.
54
+ # If this property is specified, then the product page uses a template called "product.suffix.liquid", where "suffix" is the value of this property.
55
+ # If this property is `""` or `null`, then the product page uses the default template "product.liquid".
56
+ # (default: `null`)
57
+ # @return [String,nil]
58
+ attr_accessor :template_suffix
59
+ # The name of the product.
60
+ # @return [String]
61
+ attr_accessor :title
62
+ # The name of the product used for [SEO purposes](https://help.shopify.com/en/manual/promoting-marketing/seo#page-title).
63
+ # Generally added to the `<meta name='title'>` tag.
64
+ # @return [String]
65
+ attr_accessor :metafields_global_title_tag
66
+ # A description of the product used for [SEO purposes](https://help.shopify.com/en/manual/promoting-marketing/seo#meta-description).
67
+ # Generally added to the `<meta name='description'>` tag.
68
+ # @return [String]
69
+ attr_accessor :metafields_global_description_tag
70
+ # The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the product was last modified.
71
+ # @return [String]
72
+ attr_reader :updated_at
73
+ # A list of [product variants](/en/api/reference/products/product-variant), each representing a different version of the product.
74
+ # The `position` property is read-only.
75
+ # The position of variants is indicated by the order in which they are listed.
76
+ # To retrieve the `presentment_prices` property on a variant, include the request header `'X-Shopify-Api-Features': 'include-presentment-prices'`.
77
+ # @return [Array<ProductVariant>]
78
+ attr_accessor :variants
79
+ # The name of the product's vendor.
80
+ # @return [String]
81
+ attr_accessor :vendor
82
+ end
83
+ end
@@ -0,0 +1,39 @@
1
+ module Falsify
2
+ # See the [API documentation](https://help.shopify.com/en/api/reference/products/product-image).
3
+ # Any product may have up to 250 images, and images can be in .png, .gif or .jpg format.
4
+ class ProductImage
5
+ # The date and time when the product image was created.
6
+ # The API returns this value in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
7
+ # @return [String]
8
+ attr_accessor :created_at
9
+ # A unique numeric identifier for the product image.
10
+ # @return [String]
11
+ attr_accessor :id
12
+ # The order of the product image in the list.
13
+ # The first product image is at position 1 and is the "main" image for the product.
14
+ # @return [Integer]
15
+ attr_accessor :position
16
+ # The id of the product associated with the image.
17
+ # @return [String]
18
+ attr_accessor :product_id
19
+ # An array of variant ids associated with the image.
20
+ # @return [Array<String>]
21
+ attr_accessor :variant_ids
22
+ # Specifies the location of the product image.
23
+ # This parameter supports [URL filters](https://help.shopify.com/themes/liquid/filters/url-filters#img_url) that you can use to retrieve modified copies of the image.
24
+ # For example, add `_small`, to the filename to retrieve a scaled copy of the image at 100 x 100 px (for example, `ipod-nano_small.png`),
25
+ # or add `_2048x2048` to retrieve a copy of the image constrained at 2048 x 2048 px resolution (for example, `ipod-nano_2048x2048.png`).
26
+ # @return [String]
27
+ attr_accessor :src
28
+ # Width dimension of the image which is determined on upload.
29
+ # @return [Integer]
30
+ attr_accessor :width
31
+ # Height dimension of the image which is determined on upload.
32
+ # @return [Integer]
33
+ attr_accessor :height
34
+ # The date and time when the product image was last modified.
35
+ # The API returns this value in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
36
+ # @return [String]
37
+ attr_accessor :updated_at
38
+ end
39
+ end
@@ -0,0 +1,111 @@
1
+ require "enumerize"
2
+
3
+ module Falsify
4
+ # A variant can be added to a Product resource to represent one version of a product with several options.
5
+ #
6
+ # See the [API documentation](https://help.shopify.com/en/api/reference/products/product-variant).
7
+ class ProductVariant
8
+ extend Enumerize
9
+ # The barcode, UPC, or ISBN number for the product.
10
+ # @return [String]
11
+ attr_accessor :barcode
12
+ # The original price of the item before an adjustment or a sale.
13
+ # @return [String]
14
+ attr_accessor :compare_at_price
15
+ # The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the product variant was created.
16
+ # @return [String]
17
+ attr_accessor :created_at
18
+ # The fulfillment service associated with the product variant.
19
+ # Valid values: `manual` or the handle of a [fulfillment service](https://help.shopify.com/en/api/reference/shipping-and-fulfillment/fulfillmentservice).
20
+ # @return [String]
21
+ attr_accessor :fulfillment_service
22
+ # The weight of the product variant in grams.
23
+ # @return [String]
24
+ attr_accessor :grams
25
+ # The unique numeric identifier for the product variant.
26
+ # @return [String]
27
+ attr_accessor :id
28
+ # The unique numeric identifier for a product's image.
29
+ # The image must be associated to the same product as the variant.
30
+ # @return [String]
31
+ attr_accessor :image_id
32
+ # The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.
33
+ # @return [String]
34
+ attr_accessor :inventory_item_id
35
+ # The fulfillment service that tracks the number of items in stock for the product variant.
36
+ # If you track the inventory yourself using the admin, then set the value to "shopify".
37
+ # Valid values: `shopify` or the handle of a [fulfillment service](https://help.shopify.com/en/api/reference/shipping-and-fulfillment/fulfillmentservice) that has inventory management enabled.
38
+ # Must be the same fulfillment service referenced by the `fulfillment_service` property.
39
+ # @return [String]
40
+ attr_accessor :inventory_management
41
+ # @!attribute inventory_policy [rw]
42
+ # Whether customers are allowed to place an order for the product variant when it's out of stock.
43
+ # Valid values:
44
+ # - `deny` - Customers are not allowed to place orders for the product variant if it's out of stock.
45
+ # - `continue` - Customers are allowed to place orders for the product variant if it's out of stock.
46
+ # @return [:deny, :continue]
47
+ enumerize :inventory_policy, in: [:deny, :continue]
48
+ # An aggregate of inventory across all locations.
49
+ # To adjust inventory at a specific location, use the [InventoryLevel](https://help.shopify.com/en/api/reference/inventory/inventorylevel) resource.
50
+ # @return [String]
51
+ attr_reader :inventory_quantity
52
+ # @deprecated Use the [InventoryLevel](https://help.shopify.com/en/api/reference/inventory/inventorylevel) resource instead.
53
+ # @return [Integer]
54
+ attr_accessor :old_inventory_quantity
55
+ # @deprecated Use the [InventoryLevel](https://help.shopify.com/en/api/reference/inventory/inventorylevel) resource instead.
56
+ # @return [Integer]
57
+ attr_accessor :inventory_quantity_adjustment
58
+ # The custom properties that a shop owner uses to define product variants.
59
+ # You can define three options for a product: `option1`, `option2`, `option3`.
60
+ # Default value: `Default Title`.
61
+ # @return [String]
62
+ attr_accessor :option
63
+ # A list of the variant's presentment prices and compare-at prices in each of the shop's enabled presentment currencies.
64
+ # Each price object has the following properties:
65
+ # - `currency_code`: The three-letter code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format) for one of the shop's enabled presentment currencies.
66
+ # - `amount`: The variant's price or compare-at price in the presentment currency.
67
+ # @return [Array<String>]
68
+ attr_accessor :presentment_prices
69
+ # The order of the product variant in the list of product variants.
70
+ # The first position in the list is `1`.
71
+ # The position of variants is indicated by the order in which they are listed.
72
+ # @return [Integer]
73
+ attr_reader :position
74
+ # The price of the product variant.
75
+ # @return [String]
76
+ attr_accessor :price
77
+ # The unique numeric identifier for the product.
78
+ # @return [String]
79
+ attr_accessor :product_id
80
+ # Whether a customer needs to provide a shipping address when placing an order for the product variant.
81
+ # @return [Boolean]
82
+ attr_accessor :requires_shipping
83
+ # A unique identifier for the product variant in the shop.
84
+ # Required in order to connect to a [FulfillmentService](https://help.shopify.com/api/reference/fulfillmentservice).
85
+ # @return [Boolean]
86
+ attr_accessor :sku
87
+ # Whether a tax is charged when the product variant is sold.
88
+ # @return [Boolean]
89
+ attr_accessor :taxable
90
+ # This parameter applies only to the stores that have the [Avalara AvaTax](https://help.shopify.com/en/manual/taxes/tax-services/taxation) app installed.
91
+ # Specifies the Avalara tax code for the product variant.
92
+ # @return [String]
93
+ attr_accessor :tax_code
94
+ # The title of the product variant.
95
+ # @return [String]
96
+ attr_accessor :title
97
+ # The date and time when the product variant was last modified.
98
+ # Gets returned in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
99
+ # @return [String]
100
+ attr_accessor :updated_at
101
+ # The weight of the product variant in the unit system specified with `weight_unit`.
102
+ # @return [String]
103
+ attr_accessor :weight
104
+ # @!attribute weight_unit [rw]
105
+ # The unit of measurement that applies to the product variant's weight.
106
+ # If you don't specify a value for `weight_unit`, then the shop's default unit of measurement is applied.
107
+ # Valid values: `g`, `kg`, `oz`, and `lb`.
108
+ # @return [:g, :kg, :oz, :lb]
109
+ enumerize :weight_unit, in: [:g, :kg, :oz, :lb]
110
+ end
111
+ end
@@ -0,0 +1,3 @@
1
+ module Falsify
2
+ VERSION = "0.1.0".freeze
3
+ end
metadata ADDED
@@ -0,0 +1,214 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: falsify
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Clay Dunston
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-11-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: coveralls
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.23
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.8.23
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-focus
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest-reporters
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.4'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.12.2
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.12.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '10.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '10.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: enumerize
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 2.2.2
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 2.2.2
139
+ description: Shopify resources (WIP)
140
+ email:
141
+ - dunstontc@gmail.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".gitignore"
147
+ - ".rubocop.yml"
148
+ - ".travis.yml"
149
+ - ".yardopts"
150
+ - CHANGELOG.md
151
+ - Gemfile
152
+ - Gemfile.lock
153
+ - LICENSE.txt
154
+ - README.md
155
+ - Rakefile
156
+ - bin/console
157
+ - bin/docs
158
+ - bin/setup
159
+ - falsify.gemspec
160
+ - lib/falsify.rb
161
+ - lib/falsify/error.rb
162
+ - lib/falsify/models/address.rb
163
+ - lib/falsify/models/customer/customer.rb
164
+ - lib/falsify/models/customer/metafield.rb
165
+ - lib/falsify/models/fulfillment/fulfillment.rb
166
+ - lib/falsify/models/fulfillment/fulfillment_event.rb
167
+ - lib/falsify/models/fulfillment/fulfillment_line_item.rb
168
+ - lib/falsify/models/fulfillment/supported_tracking_companies.rb
169
+ - lib/falsify/models/order/client_details.rb
170
+ - lib/falsify/models/order/discount_allocation.rb
171
+ - lib/falsify/models/order/discount_application.rb
172
+ - lib/falsify/models/order/discount_code.rb
173
+ - lib/falsify/models/order/order.rb
174
+ - lib/falsify/models/order/order_line_item.rb
175
+ - lib/falsify/models/order/price_set.rb
176
+ - lib/falsify/models/order/refund/refund.rb
177
+ - lib/falsify/models/order/refund/refund_line_item.rb
178
+ - lib/falsify/models/order/shipping_line.rb
179
+ - lib/falsify/models/order/tax_line.rb
180
+ - lib/falsify/models/product/collection/collect.rb
181
+ - lib/falsify/models/product/collection/custom_collection.rb
182
+ - lib/falsify/models/product/collection/smart_collection.rb
183
+ - lib/falsify/models/product/product.rb
184
+ - lib/falsify/models/product/product_image.rb
185
+ - lib/falsify/models/product/product_variant.rb
186
+ - lib/falsify/version.rb
187
+ homepage: https://github.com/tcd/falsify
188
+ licenses:
189
+ - MIT
190
+ metadata:
191
+ homepage_uri: https://github.com/tcd/falsify
192
+ source_code_uri: https://github.com/tcd/falsify
193
+ changelog_uri: https://github.com/tcd/falsify/blob/master/CHANGELOG.md
194
+ yard.run: yri
195
+ post_install_message:
196
+ rdoc_options: []
197
+ require_paths:
198
+ - lib
199
+ required_ruby_version: !ruby/object:Gem::Requirement
200
+ requirements:
201
+ - - ">="
202
+ - !ruby/object:Gem::Version
203
+ version: '0'
204
+ required_rubygems_version: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ requirements: []
210
+ rubygems_version: 3.0.3
211
+ signing_key:
212
+ specification_version: 4
213
+ summary: Shopify resources (WIP)
214
+ test_files: []