mints 0.0.27 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +4 -4
  4. data/lib/contact.rb +60 -61
  5. data/lib/errors.rb +1 -1
  6. data/lib/generators/mints_config.yml.erb +0 -2
  7. data/lib/generators/mints_link.rb +3 -3
  8. data/lib/mints/helpers/mints_helper.rb +2 -2
  9. data/lib/pub.rb +55 -55
  10. data/lib/user/config/api_keys.rb +7 -7
  11. data/lib/user/config/appointments.rb +16 -16
  12. data/lib/user/config/attribute_groups.rb +10 -10
  13. data/lib/user/config/attributes.rb +10 -10
  14. data/lib/user/config/calendars.rb +9 -9
  15. data/lib/user/config/config.rb +7 -7
  16. data/lib/user/config/importers.rb +15 -15
  17. data/lib/user/config/public_folders.rb +11 -11
  18. data/lib/user/config/relationships.rb +11 -11
  19. data/lib/user/config/roles.rb +9 -9
  20. data/lib/user/config/seeds.rb +5 -5
  21. data/lib/user/config/system_settings.rb +5 -5
  22. data/lib/user/config/tags.rb +5 -5
  23. data/lib/user/config/taxonomies.rb +15 -15
  24. data/lib/user/config/teams.rb +67 -68
  25. data/lib/user/config/users.rb +70 -71
  26. data/lib/user/contacts/contacts.rb +19 -20
  27. data/lib/user/content/assets.rb +273 -278
  28. data/lib/user/content/content.rb +48 -48
  29. data/lib/user/content/content_instances.rb +136 -138
  30. data/lib/user/content/content_templates.rb +103 -103
  31. data/lib/user/content/conversations.rb +193 -193
  32. data/lib/user/content/dam.rb +83 -80
  33. data/lib/user/content/forms.rb +229 -233
  34. data/lib/user/content/message_templates.rb +152 -151
  35. data/lib/user/content/messages.rb +87 -87
  36. data/lib/user/content/pages.rb +82 -82
  37. data/lib/user/content/stories.rb +101 -101
  38. data/lib/user/content/story_templates.rb +88 -88
  39. data/lib/user/content/story_versions.rb +115 -117
  40. data/lib/user/crm/companies.rb +103 -105
  41. data/lib/user/crm/contacts.rb +285 -292
  42. data/lib/user/crm/crm.rb +19 -19
  43. data/lib/user/crm/deals.rb +103 -103
  44. data/lib/user/crm/favorites.rb +14 -13
  45. data/lib/user/crm/segments.rb +121 -123
  46. data/lib/user/crm/users.rb +20 -20
  47. data/lib/user/crm/workflow_step_objects.rb +84 -84
  48. data/lib/user/crm/workflow_steps.rb +45 -45
  49. data/lib/user/crm/workflows.rb +65 -65
  50. data/lib/user/ecommerce/ecommerce.rb +27 -27
  51. data/lib/user/ecommerce/item_prices.rb +82 -81
  52. data/lib/user/ecommerce/locations.rb +160 -160
  53. data/lib/user/ecommerce/order_items_groups.rb +107 -106
  54. data/lib/user/ecommerce/order_statuses.rb +24 -24
  55. data/lib/user/ecommerce/orders.rb +250 -246
  56. data/lib/user/ecommerce/price_lists.rb +68 -68
  57. data/lib/user/ecommerce/product_templates.rb +99 -99
  58. data/lib/user/ecommerce/product_variations.rb +122 -120
  59. data/lib/user/ecommerce/products.rb +160 -159
  60. data/lib/user/ecommerce/skus.rb +85 -85
  61. data/lib/user/ecommerce/taxes.rb +79 -79
  62. data/lib/user/ecommerce/variant_options.rb +66 -66
  63. data/lib/user/ecommerce/variant_values.rb +69 -69
  64. data/lib/user/helpers/helpers.rb +102 -101
  65. data/lib/user/helpers/object_activities.rb +78 -78
  66. data/lib/user/helpers/object_folders.rb +76 -76
  67. data/lib/user/helpers/user_folders.rb +77 -77
  68. data/lib/user/marketing/marketing.rb +114 -113
  69. data/lib/user/profile/profile.rb +94 -103
  70. data/lib/user.rb +3 -3
  71. metadata +33 -33
@@ -1,169 +1,170 @@
1
1
  module Products
2
- ##
3
- # == Product
4
- #
2
+ ##
3
+ # == Product
4
+ #
5
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 submitted.
12
- #
13
- def update_product_variations_config(productId, data) #TODO: Method doesnt work, research use
14
- @client.raw("post", "/ecommerce/products/update-variations-config/#{productId}", nil, data_transform(data))
15
- end
6
+ # === Update product variations config.
7
+ # Update config of product variations of a product.
8
+ #
9
+ # ==== Parameters
10
+ # product_id:: (Integer) -- Product id.
11
+ # data:: (Hash) -- Data to be submitted.
12
+ #
13
+ def update_product_variations_config(product_id, data)
14
+ # TODO: Method doesnt work, research use
15
+ @client.raw('post', "/ecommerce/products/update-variations-config/#{product_id}", nil, data_transform(data))
16
+ end
16
17
 
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
- @client.raw("get", "/ecommerce/products/support-data")
24
- end
18
+ # === Get product support data.
19
+ # Get support data used in products.
20
+ #
21
+ # ==== Example
22
+ # @data = @mints_user.get_products_support_data
23
+ def get_products_support_data
24
+ @client.raw('get', '/ecommerce/products/support-data')
25
+ end
25
26
 
26
- # === Delete product.
27
- # Delete a product.
28
- #
29
- # ==== Parameters
30
- # id:: (Integer) -- Product id.
31
- #
32
- def delete_product(id)
33
- @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 submitted.
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
- @client.raw("put", "/ecommerce/products/#{id}/publish", nil, data_transform(data))
50
- end
27
+ # === Delete product.
28
+ # Delete a product.
29
+ #
30
+ # ==== Parameters
31
+ # id:: (Integer) -- Product id.
32
+ #
33
+ def delete_product(id)
34
+ @client.raw('delete', "/ecommerce/products/#{id}")
35
+ end
51
36
 
52
- # === Schedule product.
53
- # Schedule a product.
54
- #
55
- # ==== Parameters
56
- # id:: (Integer) -- Product id.
57
- # data:: (Hash) -- Data to be submitted.
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
- @client.raw("put", "/ecommerce/products/#{id}/schedule", nil, data_transform(data))
66
- end
37
+ # === Publish product.
38
+ # Publish a product.
39
+ #
40
+ # ==== Parameters
41
+ # id:: (Integer) -- Product id.
42
+ # data:: (Hash) -- Data to be submitted.
43
+ #
44
+ # ==== Example
45
+ # data = {
46
+ # title: 'New Publish'
47
+ # }
48
+ # @data = @mints_user.publish_product(2, data)
49
+ def publish_product(id, data)
50
+ @client.raw('put', "/ecommerce/products/#{id}/publish", nil, data_transform(data))
51
+ end
67
52
 
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
- @client.raw("get", "/ecommerce/products/#{id}/variant-options-config")
78
- end
53
+ # === Schedule product.
54
+ # Schedule a product.
55
+ #
56
+ # ==== Parameters
57
+ # id:: (Integer) -- Product id.
58
+ # data:: (Hash) -- Data to be submitted.
59
+ #
60
+ # ==== Example
61
+ # data = {
62
+ # scheduled_at: '1970-01-01 00:00:00'
63
+ # }
64
+ # @data = @mints_user.schedule_product(2, data)
65
+ def schedule_product(id, data)
66
+ @client.raw('put', "/ecommerce/products/#{id}/schedule", nil, data_transform(data))
67
+ end
79
68
 
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
- @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
69
+ # === Get product variant options config.
70
+ # Get variant options config used in a product.
71
+ #
72
+ # ==== Parameters
73
+ # id:: (Integer) -- Product id.
74
+ #
75
+ # ==== Example
76
+ # @data = @mints_user.get_product_variant_options_config(1)
77
+ def get_product_variant_options_config(id)
78
+ @client.raw('get', "/ecommerce/products/#{id}/variant-options-config")
79
+ end
116
80
 
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
- @client.raw("get", "/ecommerce/products/#{id}", options)
134
- end
81
+ # === Revert published product.
82
+ # Revert a published product.
83
+ #
84
+ # ==== Parameters
85
+ # id:: (Integer) -- Product id.
86
+ #
87
+ # ==== Example
88
+ # @data = @mints_user.revert_published_product(2)
89
+ def revert_published_product(id)
90
+ @client.raw('get', "/ecommerce/products/#{id}/revert-published-data")
91
+ end
135
92
 
136
- # === Create product.
137
- # Create a product with data.
138
- #
139
- # ==== Parameters
140
- # data:: (Hash) -- Data to be submitted.
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, options = nil)
150
- @client.raw("post", "/ecommerce/products/", options, data_transform(data))
151
- end
93
+ # === Get products.
94
+ # Get a collection of products.
95
+ #
96
+ # ==== Parameters
97
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
98
+ # use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
99
+ #
100
+ # ==== First Example
101
+ # @data = @mints_user.get_products
102
+ #
103
+ # ==== Second Example
104
+ # options = {
105
+ # fields: 'id'
106
+ # }
107
+ # @data = @mints_user.get_products(options)
108
+ #
109
+ # ==== Third Example
110
+ # options = {
111
+ # fields: 'id'
112
+ # }
113
+ # @data = @mints_user.get_products(options, false)
114
+ def get_products(options = nil, use_post = true)
115
+ get_query_results("/ecommerce/products", options, use_post)
116
+ end
152
117
 
153
- # === Update product.
154
- # Update a product info.
155
- #
156
- # ==== Parameters
157
- # id:: (Integer) -- Product id.
158
- # data:: (Hash) -- Data to be submitted.
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, options = nil)
167
- @client.raw("put", "/ecommerce/products/#{id}", options, data_transform(data))
168
- end
169
- end
118
+ # === Get product.
119
+ # Get a product info.
120
+ #
121
+ # ==== Parameters
122
+ # id:: (Integer) -- Product id.
123
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
124
+ #
125
+ # ==== First Example
126
+ # @data = @mints_user.get_product(3)
127
+ #
128
+ # ==== Second Example
129
+ # options = {
130
+ # fields: "slug"
131
+ # }
132
+ # @data = @mints_user.get_product(3, options)
133
+ def get_product(id, options = nil)
134
+ @client.raw('get', "/ecommerce/products/#{id}", options)
135
+ end
136
+
137
+ # === Create product.
138
+ # Create a product with data.
139
+ #
140
+ # ==== Parameters
141
+ # data:: (Hash) -- Data to be submitted.
142
+ #
143
+ # ==== Example
144
+ # data = {
145
+ # title: 'New Product',
146
+ # slug: 'new-product',
147
+ # sku_prefix: 'sku_prefix'
148
+ # }
149
+ # @data = @mints_user.create_product(data)
150
+ def create_product(data, options = nil)
151
+ @client.raw('post', '/ecommerce/products/', options, data_transform(data))
152
+ end
153
+
154
+ # === Update product.
155
+ # Update a product info.
156
+ #
157
+ # ==== Parameters
158
+ # id:: (Integer) -- Product id.
159
+ # data:: (Hash) -- Data to be submitted.
160
+ #
161
+ # ==== Example
162
+ # data = {
163
+ # title: 'New Product Modified',
164
+ # slug: 'new-product'
165
+ # }
166
+ # @data = @mints_user.update_product(9, data)
167
+ def update_product(id, data, options = nil)
168
+ @client.raw('put', "/ecommerce/products/#{id}", options, data_transform(data))
169
+ end
170
+ end
@@ -1,88 +1,88 @@
1
1
  module Skus
2
- ##
3
- # == Sku
4
- #
2
+ ##
3
+ # == Sku
4
+ #
5
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
- @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
- @client.raw("get", "/ecommerce/skus/#{id}", options)
41
- end
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
+ @client.raw('get', '/ecommerce/skus', options)
22
+ end
42
23
 
43
- # === Create sku.
44
- # Create a sku with data.
45
- #
46
- # ==== Parameters
47
- # data:: (Hash) -- Data to be submitted.
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
- @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 submitted.
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
- @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
- @client.raw("delete", "/ecommerce/skus/#{id}")
87
- end
88
- end
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
+ @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 submitted.
48
+ #
49
+ # ==== Example
50
+ # data = {
51
+ # sku: 'NEW-SKU',
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
+ @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 submitted.
67
+ #
68
+ # ==== Example
69
+ # data = {
70
+ # sku: 'NEW-SKU-XXXIX'
71
+ # }
72
+ # @data = @mints_user.update_sku(531, data)
73
+ def update_sku(id, data)
74
+ @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
+ @client.raw('delete', "/ecommerce/skus/#{id}")
87
+ end
88
+ end
@@ -1,82 +1,82 @@
1
1
  module Taxes
2
- ##
3
- # == Taxes
4
- #
2
+ ##
3
+ # == Taxes
4
+ #
5
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
- @client.raw("get", "/ecommerce/taxes", options)
20
- end
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
+ @client.raw('get', '/ecommerce/taxes', options)
20
+ end
21
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
- @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 submitted.
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
- @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 submitted.
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
- @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
- @client.raw("delete", "/ecommerce/taxes/#{id}")
81
- end
82
- end
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
+ @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 submitted.
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
+ @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 submitted.
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
+ @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
+ @client.raw('delete', "/ecommerce/taxes/#{id}")
81
+ end
82
+ end