mints 0.0.17 → 0.0.21

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +96 -37
  4. data/lib/contact.rb +659 -94
  5. data/lib/generators/mints_files_generator.rb +6 -0
  6. data/lib/generators/mints_link.rb +61 -0
  7. data/lib/generators/short_link_controller.rb +41 -0
  8. data/lib/mints/controllers/admin_base_controller.rb +2 -2
  9. data/lib/mints/controllers/base_api_controller.rb +12 -11
  10. data/lib/mints/controllers/base_controller.rb +38 -9
  11. data/lib/mints_helper.rb +47 -0
  12. data/lib/pub.rb +258 -139
  13. data/lib/user/config/api_keys.rb +65 -0
  14. data/lib/user/config/appointments.rb +221 -0
  15. data/lib/user/config/attribute_groups.rb +77 -0
  16. data/lib/user/config/attributes.rb +86 -0
  17. data/lib/user/config/calendars.rb +89 -0
  18. data/lib/user/config/config.rb +65 -0
  19. data/lib/user/config/importers.rb +184 -0
  20. data/lib/user/config/public_folders.rb +108 -0
  21. data/lib/user/config/relationships.rb +138 -0
  22. data/lib/user/config/roles.rb +84 -0
  23. data/lib/user/config/seeds.rb +14 -0
  24. data/lib/user/config/system_settings.rb +53 -0
  25. data/lib/user/config/tags.rb +63 -0
  26. data/lib/user/config/taxonomies.rb +124 -0
  27. data/lib/user/config/teams.rb +70 -0
  28. data/lib/user/config/users.rb +76 -0
  29. data/lib/user/contacts/contacts.rb +21 -0
  30. data/lib/user/content/assets.rb +260 -0
  31. data/lib/user/content/content.rb +235 -0
  32. data/lib/user/content/content_instances.rb +147 -0
  33. data/lib/user/content/content_templates.rb +111 -0
  34. data/lib/user/content/conversations.rb +174 -0
  35. data/lib/user/content/dam.rb +88 -0
  36. data/lib/user/content/forms.rb +168 -0
  37. data/lib/user/content/message_templates.rb +162 -0
  38. data/lib/user/content/messages.rb +90 -0
  39. data/lib/user/content/pages.rb +81 -0
  40. data/lib/user/content/stories.rb +164 -0
  41. data/lib/user/content/story_templates.rb +95 -0
  42. data/lib/user/crm/companies.rb +111 -0
  43. data/lib/user/crm/contacts.rb +312 -0
  44. data/lib/user/crm/crm.rb +21 -0
  45. data/lib/user/crm/deals.rb +111 -0
  46. data/lib/user/crm/favorites.rb +17 -0
  47. data/lib/user/crm/segments.rb +132 -0
  48. data/lib/user/crm/users.rb +22 -0
  49. data/lib/user/crm/workflow_step_objects.rb +89 -0
  50. data/lib/user/crm/workflow_steps.rb +49 -0
  51. data/lib/user/crm/workflows.rb +70 -0
  52. data/lib/user/ecommerce/ecommerce.rb +29 -0
  53. data/lib/user/ecommerce/item_prices.rb +86 -0
  54. data/lib/user/ecommerce/locations.rb +166 -0
  55. data/lib/user/ecommerce/order_items_groups.rb +109 -0
  56. data/lib/user/ecommerce/order_statuses.rb +26 -0
  57. data/lib/user/ecommerce/orders.rb +258 -0
  58. data/lib/user/ecommerce/price_lists.rb +73 -0
  59. data/lib/user/ecommerce/product_templates.rb +104 -0
  60. data/lib/user/ecommerce/product_variations.rb +129 -0
  61. data/lib/user/ecommerce/products.rb +169 -0
  62. data/lib/user/ecommerce/skus.rb +88 -0
  63. data/lib/user/ecommerce/taxes.rb +82 -0
  64. data/lib/user/ecommerce/variant_options.rb +69 -0
  65. data/lib/user/ecommerce/variant_values.rb +72 -0
  66. data/lib/user/helpers/helpers.rb +113 -0
  67. data/lib/user/helpers/object_activities.rb +83 -0
  68. data/lib/user/helpers/object_folders.rb +82 -0
  69. data/lib/user/helpers/user_folders.rb +83 -0
  70. data/lib/user/marketing/marketing.rb +120 -0
  71. data/lib/user/profile/profile.rb +111 -0
  72. data/lib/user.rb +24 -368
  73. metadata +64 -2
@@ -0,0 +1,104 @@
1
+ module ProductTemplates
2
+ ##
3
+ # == Product Templates
4
+ #
5
+
6
+ # === Get product templates support data from product.
7
+ # Get product templates support data from a product.
8
+ #
9
+ # ==== Parameters
10
+ # id:: (Integer) -- Product id.
11
+ #
12
+ # ==== Example
13
+ # @data = @mints_user.get_product_templates_support_data_from_product(1)
14
+ def get_product_templates_support_data_from_product(id)
15
+ return @client.raw("get", "/ecommerce/product-templates/support-data/products/#{id}")
16
+ end
17
+
18
+ # === Get product templates support data from order items group.
19
+ # Get product templates support data from a order items group.
20
+ #
21
+ # ==== Parameters
22
+ # id:: (Integer) -- Order items group id.
23
+ #
24
+ # ==== Example
25
+ # @data = @mints_user.get_product_templates_support_data_from_order_items_group(1)
26
+ def get_product_templates_support_data_from_order_items_group(id)
27
+ return @client.raw("get", "/ecommerce/product-templates/support-data/order-items-groups/#{id}")
28
+ end
29
+
30
+ # === Get product templates support data.
31
+ # Get support data used in product templates.
32
+ #
33
+ # ==== Example
34
+ # @data = @mints_user.get_product_templates_support_data
35
+ def get_product_templates_support_data
36
+ return @client.raw("get", "/ecommerce/product-templates/support-data")
37
+ end
38
+
39
+ # === Get product templates.
40
+ # Get a collection of product templates.
41
+ #
42
+ # ==== Parameters
43
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
44
+ #
45
+ # ==== First Example
46
+ # @data = @mints_user.get_product_templates
47
+ #
48
+ # ==== Second Example
49
+ # options = { "fields": "title" }
50
+ # @data = @mints_user.get_product_templates(options)
51
+ def get_product_templates(options = nil)
52
+ return @client.raw("get", "/ecommerce/product-templates", options)
53
+ end
54
+
55
+ # === Get product template.
56
+ # Get a product template info.
57
+ #
58
+ # ==== Parameters
59
+ # id:: (Integer) -- Product template id.
60
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
61
+ #
62
+ # ==== First Example
63
+ # @data = @mints_user.get_product_template(1)
64
+ #
65
+ # ==== Second Example
66
+ # options = { "fields": "title" }
67
+ # @data = @mints_user.get_product_template(1, options)
68
+ def get_product_template(id, options = nil)
69
+ return @client.raw("get", "/ecommerce/product-templates/#{id}", options)
70
+ end
71
+
72
+ # === Create product template.
73
+ # Create a product template with data.
74
+ #
75
+ # ==== Parameters
76
+ # data:: (Hash) -- Data to be submited.
77
+ #
78
+ # ==== Example
79
+ # data = {
80
+ # "title": "New Product Template",
81
+ # "slug": "new-product-template"
82
+ # }
83
+ # @data = @mints_user.create_product_template(data)
84
+ def create_product_template(data)
85
+ return @client.raw("post", "/ecommerce/product-templates/", nil, data_transform(data))
86
+ end
87
+
88
+ # === Update product template.
89
+ # Update a product template info.
90
+ #
91
+ # ==== Parameters
92
+ # id:: (Integer) -- Product template id.
93
+ # data:: (Hash) -- Data to be submited.
94
+ #
95
+ # ==== Example
96
+ # data = {
97
+ # "title": "New Product Template Modified",
98
+ # "slug": "new-product-template"
99
+ # }
100
+ # @data = @mints_user.update_product_template(3, data)
101
+ def update_product_template(id, data)
102
+ return @client.raw("put", "/ecommerce/product-templates/#{id}", nil, data_transform(data))
103
+ end
104
+ end
@@ -0,0 +1,129 @@
1
+ module ProductVariations
2
+ ##
3
+ # == Product Variation
4
+ #
5
+
6
+ # === Generate product variation.
7
+ # Generate a product variation.
8
+ #
9
+ # ==== Parameters
10
+ # productId:: (Integer) -- Product id.
11
+ # data:: (Hash) -- Data to be submited.
12
+ #
13
+ def generate_product_variation(productId, data) #TODO: Research use
14
+ #TODO: Notify line 247 had a '/' before Exception
15
+ return @client.raw("post", "/ecommerce/product-variations/generate/#{productId}", nil, data_transform(data))
16
+ end
17
+
18
+ # === Set prices to product variations.
19
+ # Set prices to product variations.
20
+ #
21
+ # ==== Parameters
22
+ # data:: (Hash) -- Data to be submited.
23
+ #
24
+ # ==== Example
25
+ # skus = [
26
+ # { "id": 100 }
27
+ # ]
28
+ # prices = [
29
+ # { "id": 1, "value": 1259 },
30
+ # { "id": 2, "value": 1260 }
31
+ # ]
32
+ # data = {
33
+ # "skus": skus.to_json,
34
+ # "prices": prices.to_json
35
+ # }
36
+ # @data = @mints_user.set_prices_to_product_variations(data)
37
+ def set_prices_to_product_variations(data)
38
+ return @client.raw("post", "/ecommerce/product-variations/set-prices", nil, data_transform(data))
39
+ end
40
+
41
+ # === Get product from product variation.
42
+ # Get a product from a product variation.
43
+ #
44
+ # ==== Parameters
45
+ # productId:: (Integer) -- Product id.
46
+ #
47
+ # ==== Example
48
+ # @data = @mints_user.get_product_from_product_variation(1)
49
+ def get_product_from_product_variation(productId)
50
+ return @client.raw("get", "/ecommerce/product-variations/product/#{productId}")
51
+ end
52
+
53
+ # === Get product variations.
54
+ # Get a collection of product variations.
55
+ #
56
+ # ==== Parameters
57
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
58
+ #
59
+ # ==== Example
60
+ # @data = @mints_user.get_product_variations
61
+ def get_product_variations
62
+ return @client.raw("get", "/ecommerce/product-variations")
63
+ end
64
+
65
+ # === Get product variation.
66
+ # Get a product variation info.
67
+ #
68
+ # ==== Parameters
69
+ # id:: (Integer) -- Product variation id.
70
+ #
71
+ # ==== Example
72
+ # @data = @mints_user.get_product_variation(100)
73
+ def get_product_variation(id)
74
+ return @client.raw("get", "/ecommerce/product-variations/#{id}")
75
+ end
76
+
77
+ # === Create product variation.
78
+ # Create a product variation with data.
79
+ #
80
+ # ==== Parameters
81
+ # data:: (Hash) -- Data to be submited.
82
+ #
83
+ # ==== Example
84
+ # data = {
85
+ # "title": "New Product Variation",
86
+ # "sku": "NEW-PRODUCT-VARIATION-SKU",
87
+ # "product_id": 5,
88
+ # "supplier": 36,
89
+ # "prices": [
90
+ # { "id": 1, "value": 300 }
91
+ # ]
92
+ # }
93
+ # @data = @mints_user.create_product_variation(data)
94
+ def create_product_variation(data)
95
+ return @client.raw("post", "/ecommerce/product-variations", nil, data_transform(data))
96
+ end
97
+
98
+ # === Update product variation.
99
+ # Update a product variation info.
100
+ #
101
+ # ==== Parameters
102
+ # id:: (Integer) -- Product variation id.
103
+ # data:: (Hash) -- Data to be submited.
104
+ #
105
+ # ==== Example
106
+ # data = {
107
+ # "title": "New Product Variation Modified",
108
+ # "cost": 123,
109
+ # "prices": [
110
+ # { "id": 1, "value": 400 }
111
+ # ]
112
+ # }
113
+ # @data = @mints_user.update_product_variation(528, data)
114
+ def update_product_variation(id, data)
115
+ return @client.raw("put", "/ecommerce/product-variations/#{id}", nil, data_transform(data))
116
+ end
117
+
118
+ # === Delete product variation.
119
+ # Delete a product variation.
120
+ #
121
+ # ==== Parameters
122
+ # id:: (Integer) -- Product variation id.
123
+ #
124
+ # ==== Example
125
+ # @data = @mints_user.delete_product_variation(528)
126
+ def delete_product_variation(id)
127
+ return @client.raw("delete", "/ecommerce/product-variations/#{id}")
128
+ end
129
+ end
@@ -0,0 +1,169 @@
1
+ module Products
2
+ ##
3
+ # == Product
4
+ #
5
+
6
+ # === Update product variations config.
7
+ # Update config of product variations of a product.
8
+ #
9
+ # ==== Parameters
10
+ # productId:: (Integer) -- Product id.
11
+ # data:: (Hash) -- Data to be submited.
12
+ #
13
+ def update_product_variations_config(productId, data) #TODO: Method doesnt work, research use
14
+ return @client.raw("post", "/ecommerce/products/update-variations-config/#{productId}", nil, data_transform(data))
15
+ end
16
+
17
+ # === Get product support data.
18
+ # Get support data used in products.
19
+ #
20
+ # ==== Example
21
+ # @data = @mints_user.get_products_support_data
22
+ def get_products_support_data
23
+ return @client.raw("get", "/ecommerce/products/support-data")
24
+ end
25
+
26
+ # === Delete product.
27
+ # Delete a product.
28
+ #
29
+ # ==== Parameters
30
+ # id:: (Integer) -- Product id.
31
+ #
32
+ def delete_product(id)
33
+ return @client.raw("delete", "/ecommerce/products/#{id}")
34
+ end
35
+
36
+ # === Publish product.
37
+ # Publish a product.
38
+ #
39
+ # ==== Parameters
40
+ # id:: (Integer) -- Product id.
41
+ # data:: (Hash) -- Data to be submited.
42
+ #
43
+ # ==== Example
44
+ # data = {
45
+ # "title": "New Publish"
46
+ # }
47
+ # @data = @mints_user.publish_product(2, data)
48
+ def publish_product(id, data)
49
+ return @client.raw("put", "/ecommerce/products/#{id}/publish", nil, data_transform(data))
50
+ end
51
+
52
+ # === Schedule product.
53
+ # Schedule a product.
54
+ #
55
+ # ==== Parameters
56
+ # id:: (Integer) -- Product id.
57
+ # data:: (Hash) -- Data to be submited.
58
+ #
59
+ # ==== Example
60
+ # data = {
61
+ # "scheduled_at": "1970-01-01 00:00:00"
62
+ # }
63
+ # @data = @mints_user.schedule_product(2, data)
64
+ def schedule_product(id, data)
65
+ return @client.raw("put", "/ecommerce/products/#{id}/schedule", nil, data_transform(data))
66
+ end
67
+
68
+ # === Get product variant options config.
69
+ # Get variant options config used in a product.
70
+ #
71
+ # ==== Parameters
72
+ # id:: (Integer) -- Product id.
73
+ #
74
+ # ==== Example
75
+ # @data = @mints_user.get_product_variant_options_config(1)
76
+ def get_product_variant_options_config(id)
77
+ return @client.raw("get", "/ecommerce/products/#{id}/variant-options-config")
78
+ end
79
+
80
+ # === Revert published product.
81
+ # Revert a published product.
82
+ #
83
+ # ==== Parameters
84
+ # id:: (Integer) -- Product id.
85
+ #
86
+ # ==== Example
87
+ # @data = @mints_user.revert_published_product(2)
88
+ def revert_published_product(id)
89
+ return @client.raw("get", "/ecommerce/products/#{id}/revert-published-data")
90
+ end
91
+
92
+ # === Get products.
93
+ # Get a collection of products.
94
+ #
95
+ # ==== Parameters
96
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
97
+ # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
98
+ #
99
+ # ==== First Example
100
+ # @data = @mints_user.get_products
101
+ #
102
+ # ==== Second Example
103
+ # options = {
104
+ # "fields": "id"
105
+ # }
106
+ # @data = @mints_user.get_products(options)
107
+ #
108
+ # ==== Third Example
109
+ # options = {
110
+ # "fields": "id"
111
+ # }
112
+ # @data = @mints_user.get_products(options, false)
113
+ def get_products(options = nil, use_post = true)
114
+ return get_query_results("/ecommerce/products", options, use_post)
115
+ end
116
+
117
+ # === Get product.
118
+ # Get a product info.
119
+ #
120
+ # ==== Parameters
121
+ # id:: (Integer) -- Product id.
122
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
123
+ #
124
+ # ==== First Example
125
+ # @data = @mints_user.get_product(3)
126
+ #
127
+ # ==== Second Example
128
+ # options = {
129
+ # "fields": "slug"
130
+ # }
131
+ # @data = @mints_user.get_product(3, options)
132
+ def get_product(id, options = nil)
133
+ return @client.raw("get", "/ecommerce/products/#{id}", options)
134
+ end
135
+
136
+ # === Create product.
137
+ # Create a product with data.
138
+ #
139
+ # ==== Parameters
140
+ # data:: (Hash) -- Data to be submited.
141
+ #
142
+ # ==== Example
143
+ # data = {
144
+ # "title": "New Product",
145
+ # "slug": "new-product",
146
+ # "sku_prefix": "sku_prefix"
147
+ # }
148
+ # @data = @mints_user.create_product(data)
149
+ def create_product(data)
150
+ return @client.raw("post", "/ecommerce/products/", nil, data_transform(data))
151
+ end
152
+
153
+ # === Update product.
154
+ # Update a product info.
155
+ #
156
+ # ==== Parameters
157
+ # id:: (Integer) -- Product id.
158
+ # data:: (Hash) -- Data to be submited.
159
+ #
160
+ # ==== Example
161
+ # data = {
162
+ # "title": "New Product Modified",
163
+ # "slug": "new-product"
164
+ # }
165
+ # @data = @mints_user.update_product(9, data)
166
+ def update_product(id, data)
167
+ return @client.raw("put", "/ecommerce/products/#{id}", nil, data_transform(data))
168
+ end
169
+ end
@@ -0,0 +1,88 @@
1
+ module Skus
2
+ ##
3
+ # == Sku
4
+ #
5
+
6
+ # === Get skus.
7
+ # Get a collection of skus.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== First Example
13
+ # @data = @mints_user.get_skus
14
+ #
15
+ # ==== Second Example
16
+ # options = {
17
+ # "fields": "sku"
18
+ # }
19
+ # @data = @mints_user.get_skus(options)
20
+ def get_skus(options = nil)
21
+ return @client.raw("get", "/ecommerce/skus", options)
22
+ end
23
+
24
+ # === Get sku.
25
+ # Get a sku info.
26
+ #
27
+ # ==== Parameters
28
+ # id:: (Integer) -- Sku id.
29
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
30
+ #
31
+ # ==== First Example
32
+ # @data = @mints_user.get_sku(1)
33
+ #
34
+ # ==== Second Example
35
+ # options = {
36
+ # "fields": "title, sku"
37
+ # }
38
+ # @data = @mints_user.get_sku(1, options)
39
+ def get_sku(id, options = nil)
40
+ return @client.raw("get", "/ecommerce/skus/#{id}", options)
41
+ end
42
+
43
+ # === Create sku.
44
+ # Create a sku with data.
45
+ #
46
+ # ==== Parameters
47
+ # data:: (Hash) -- Data to be submited.
48
+ #
49
+ # ==== Example
50
+ # data = {
51
+ # "sku": "NEW-SKU-XXXXXX",
52
+ # "title": "New Sku",
53
+ # "slug": "new-sku",
54
+ # "product_id": 1
55
+ # }
56
+ # @data = @mints_user.create_sku(data)
57
+ def create_sku(data)
58
+ return @client.raw("post", "/ecommerce/skus", nil, data_transform(data))
59
+ end
60
+
61
+ # === Update sku.
62
+ # Update a sku info.
63
+ #
64
+ # ==== Parameters
65
+ # id:: (Integer) -- Sku id.
66
+ # data:: (Hash) -- Data to be submited.
67
+ #
68
+ # ==== Example
69
+ # data = {
70
+ # "sku": "NEW-SKU-XXXXXY"
71
+ # }
72
+ # @data = @mints_user.update_sku(531, data)
73
+ def update_sku(id, data)
74
+ return @client.raw("put", "/ecommerce/skus/#{id}", nil, data_transform(data))
75
+ end
76
+
77
+ # === Delete sku.
78
+ # Delete a sku.
79
+ #
80
+ # ==== Parameters
81
+ # id:: (Integer) -- Sku id.
82
+ #
83
+ # ==== Example
84
+ # @data = @mints_user.delete_sku(531)
85
+ def delete_sku(id)
86
+ return @client.raw("delete", "/ecommerce/skus/#{id}")
87
+ end
88
+ end
@@ -0,0 +1,82 @@
1
+ module Taxes
2
+ ##
3
+ # == Taxes
4
+ #
5
+
6
+ # === Get taxes.
7
+ # Get a collection of taxes.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== First Example
13
+ # @data = @mints_user.get_taxes
14
+ #
15
+ # ==== Second Example
16
+ # options = { "fields": "title" }
17
+ # @data = @mints_user.get_taxes(options)
18
+ def get_taxes(options = nil)
19
+ return @client.raw("get", "/ecommerce/taxes", options)
20
+ end
21
+
22
+ # === Get tax.
23
+ # Get a tax info.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Tax id.
27
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
28
+ #
29
+ # ==== First Example
30
+ # @data = @mints_user.get_tax(1)
31
+ #
32
+ # ==== Second Example
33
+ # options = { "fields": "title" }
34
+ # @data = @mints_user.get_tax(1, options)
35
+ def get_tax(id, options = nil)
36
+ return @client.raw("get", "/ecommerce/taxes/#{id}", options)
37
+ end
38
+
39
+ # === Create tax.
40
+ # Create a tax with data.
41
+ #
42
+ # ==== Parameters
43
+ # data:: (Hash) -- Data to be submited.
44
+ #
45
+ # ==== Example
46
+ # data = {
47
+ # "title": "New Tax",
48
+ # "tax_percentage": 100
49
+ # }
50
+ # @data = @mints_user.create_tax(data)
51
+ def create_tax(data)
52
+ return @client.raw("post", "/ecommerce/taxes", nil, data_transform(data))
53
+ end
54
+
55
+ # === Update tax.
56
+ # Update a tax info.
57
+ #
58
+ # ==== Parameters
59
+ # id:: (Integer) -- Tax id.
60
+ # data:: (Hash) -- Data to be submited.
61
+ #
62
+ # ==== Example
63
+ # data = {
64
+ # "tax_percentage": 10
65
+ # }
66
+ # @data = @mints_user.update_tax(11, data)
67
+ def update_tax(id, data)
68
+ return @client.raw("put", "/ecommerce/taxes/#{id}", nil, data_transform(data))
69
+ end
70
+
71
+ # === Delete tax.
72
+ # Delete a tax.
73
+ #
74
+ # ==== Parameters
75
+ # id:: (Integer) -- Tax id.
76
+ #
77
+ # ==== Example
78
+ # @data = @mints_user.delete_tax(11)
79
+ def delete_tax(id)
80
+ return @client.raw("delete", "/ecommerce/taxes/#{id}")
81
+ end
82
+ end
@@ -0,0 +1,69 @@
1
+ module VariantOptions
2
+ ##
3
+ # == Variant Options
4
+ #
5
+
6
+ # === Get variant options.
7
+ # Get a collection of variant options.
8
+ #
9
+ # ==== Parameters
10
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
11
+ #
12
+ # ==== First Example
13
+ # @data = @mints_user.get_variant_options
14
+ #
15
+ # ==== Second Example
16
+ # options = { "fields": "id, title" }
17
+ # @data = @mints_user.get_variant_options(options)
18
+ def get_variant_options(options = nil)
19
+ return @client.raw("get", "/ecommerce/variant-options", options)
20
+ end
21
+
22
+ # === Get variant option.
23
+ # Get a variant options info.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Variant option id.
27
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
28
+ #
29
+ # ==== First Example
30
+ # @data = @mints_user.get_variant_option(1)
31
+ #
32
+ # ==== Second Example
33
+ # options = { "fields": "id, title" }
34
+ # @data = @mints_user.get_variant_option(1, options)
35
+ def get_variant_option(id, options = nil)
36
+ return @client.raw("get", "/ecommerce/variant-options/#{id}", options)
37
+ end
38
+
39
+ # === Create variant option.
40
+ # Create a variant option with data.
41
+ #
42
+ # ==== Parameters
43
+ # data:: (Hash) -- Data to be submited.
44
+ #
45
+ # ==== Example
46
+ # data = {
47
+ # "title": "New Variant Option"
48
+ # }
49
+ # @data = @mints_user.create_variant_option(data)
50
+ def create_variant_option(data)
51
+ return @client.raw("post", "/ecommerce/variant-options", nil, data_transform(data))
52
+ end
53
+
54
+ # === Update variant option.
55
+ # Update a variant option info.
56
+ #
57
+ # ==== Parameters
58
+ # id:: (Integer) -- Variant option id.
59
+ # data:: (Hash) -- Data to be submited.
60
+ #
61
+ # ==== Example
62
+ # data = {
63
+ # "title": "New Variant Option Modified"
64
+ # }
65
+ # @data = @mints_user.update_variant_option(6, data)
66
+ def update_variant_option(id, data)
67
+ return @client.raw("put", "/ecommerce/variant-options/#{id}", nil, data_transform(data))
68
+ end
69
+ end