mints 0.0.27 → 0.0.29

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/lib/client.rb +287 -385
  4. data/lib/contact/config/appointments.rb +201 -0
  5. data/lib/contact/config/config.rb +7 -0
  6. data/lib/contact/content/content.rb +7 -0
  7. data/lib/contact/content/conversations.rb +121 -0
  8. data/lib/contact/ecommerce/ecommerce.rb +12 -0
  9. data/lib/contact/ecommerce/order_items.rb +19 -0
  10. data/lib/contact/ecommerce/order_items_groups.rb +95 -0
  11. data/lib/contact/ecommerce/orders.rb +133 -0
  12. data/lib/contact.rb +57 -607
  13. data/lib/errors.rb +4 -2
  14. data/lib/generators/mints_assets_controller.rb +4 -1
  15. data/lib/generators/mints_config.yml.erb +0 -2
  16. data/lib/generators/mints_contact_controller.rb +4 -1
  17. data/lib/generators/mints_files_generator.rb +16 -13
  18. data/lib/generators/mints_link.rb +9 -6
  19. data/lib/generators/mints_public_controller.rb +4 -1
  20. data/lib/generators/mints_user_controller.rb +3 -0
  21. data/lib/generators/short_link_controller.rb +4 -1
  22. data/lib/mints/controllers/admin_base_controller.rb +5 -3
  23. data/lib/mints/controllers/base_api_controller.rb +6 -4
  24. data/lib/mints/controllers/base_controller.rb +5 -3
  25. data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
  26. data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
  27. data/lib/mints/controllers/contact_api_controller.rb +12 -10
  28. data/lib/mints/controllers/public_api_controller.rb +10 -8
  29. data/lib/mints/controllers/user_api_controller.rb +11 -9
  30. data/lib/mints/helpers/contact_auth_helper.rb +3 -1
  31. data/lib/mints/helpers/mints_helper.rb +39 -38
  32. data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
  33. data/lib/mints/helpers/user_auth_helper.rb +5 -3
  34. data/lib/mints.rb +12 -10
  35. data/lib/pub.rb +75 -93
  36. data/lib/user/config/api_keys.rb +63 -61
  37. data/lib/user/config/appointments.rb +217 -215
  38. data/lib/user/config/attribute_groups.rb +74 -72
  39. data/lib/user/config/attributes.rb +83 -81
  40. data/lib/user/config/calendars.rb +88 -86
  41. data/lib/user/config/config.rb +31 -63
  42. data/lib/user/config/public_folders.rb +105 -104
  43. data/lib/user/config/relationships.rb +135 -132
  44. data/lib/user/config/roles.rb +76 -79
  45. data/lib/user/config/seeds.rb +52 -51
  46. data/lib/user/config/system_settings.rb +50 -49
  47. data/lib/user/config/tags.rb +57 -59
  48. data/lib/user/config/taxonomies.rb +115 -119
  49. data/lib/user/config/teams.rb +69 -68
  50. data/lib/user/config/users.rb +72 -71
  51. data/lib/user/contacts/contacts.rb +21 -20
  52. data/lib/user/content/assets.rb +275 -280
  53. data/lib/user/content/content.rb +236 -235
  54. data/lib/user/content/content_instances.rb +138 -138
  55. data/lib/user/content/content_templates.rb +105 -103
  56. data/lib/user/content/conversations.rb +195 -193
  57. data/lib/user/content/dam.rb +85 -80
  58. data/lib/user/content/forms.rb +231 -233
  59. data/lib/user/content/message_templates.rb +154 -151
  60. data/lib/user/content/messages.rb +89 -87
  61. data/lib/user/content/pages.rb +84 -82
  62. data/lib/user/content/stories.rb +101 -101
  63. data/lib/user/content/story_templates.rb +90 -88
  64. data/lib/user/content/story_versions.rb +117 -117
  65. data/lib/user/crm/companies.rb +106 -106
  66. data/lib/user/crm/contacts.rb +287 -292
  67. data/lib/user/crm/crm.rb +21 -19
  68. data/lib/user/crm/deals.rb +105 -103
  69. data/lib/user/crm/favorites.rb +16 -13
  70. data/lib/user/crm/segments.rb +123 -123
  71. data/lib/user/crm/users.rb +22 -20
  72. data/lib/user/crm/workflow_step_objects.rb +86 -84
  73. data/lib/user/crm/workflow_steps.rb +47 -45
  74. data/lib/user/crm/workflows.rb +67 -65
  75. data/lib/user/ecommerce/ecommerce.rb +29 -27
  76. data/lib/user/ecommerce/item_prices.rb +84 -81
  77. data/lib/user/ecommerce/locations.rb +162 -160
  78. data/lib/user/ecommerce/order_items_groups.rb +110 -106
  79. data/lib/user/ecommerce/order_statuses.rb +26 -24
  80. data/lib/user/ecommerce/orders.rb +253 -246
  81. data/lib/user/ecommerce/price_lists.rb +70 -68
  82. data/lib/user/ecommerce/product_templates.rb +101 -99
  83. data/lib/user/ecommerce/product_variations.rb +124 -120
  84. data/lib/user/ecommerce/products.rb +162 -159
  85. data/lib/user/ecommerce/skus.rb +87 -85
  86. data/lib/user/ecommerce/taxes.rb +81 -79
  87. data/lib/user/ecommerce/variant_options.rb +68 -66
  88. data/lib/user/ecommerce/variant_values.rb +71 -69
  89. data/lib/user/helpers/helpers.rb +104 -101
  90. data/lib/user/helpers/object_activities.rb +80 -78
  91. data/lib/user/helpers/object_folders.rb +78 -76
  92. data/lib/user/helpers/user_folders.rb +79 -77
  93. data/lib/user/marketing/marketing.rb +116 -113
  94. data/lib/user/profile/profile.rb +96 -103
  95. data/lib/user.rb +32 -41
  96. metadata +50 -43
  97. data/lib/user/config/importers.rb +0 -184
@@ -1,89 +1,91 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WorkflowStepObjects
2
- ##
3
- # == Workflow Step Objects
4
- #
5
-
6
- # === Get workflow step objects.
7
- # Get a collection of workflow step objects.
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_step_objects
14
- #
15
- # ==== Second Example
16
- # options = { "fields": "id" }
17
- # @data = @mints_user.get_step_objects(options)
18
- def get_step_objects(options = nil)
19
- @client.raw("get", "/crm/step-objects", options)
20
- end
4
+ ##
5
+ # == Workflow Step Objects
6
+ #
7
+
8
+ # === Get workflow step objects.
9
+ # Get a collection of workflow step objects.
10
+ #
11
+ # ==== Parameters
12
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
13
+ #
14
+ # ==== First Example
15
+ # @data = @mints_user.get_step_objects
16
+ #
17
+ # ==== Second Example
18
+ # options = { fields: 'id' }
19
+ # @data = @mints_user.get_step_objects(options)
20
+ def get_step_objects(options = nil)
21
+ @client.raw('get', '/crm/step-objects', options)
22
+ end
21
23
 
22
- # === Get workflow step object.
23
- # Get a workflow step object info.
24
- #
25
- # ==== Parameters
26
- # id:: (Integer) -- Workflow step object 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_step_object(1)
31
- #
32
- # ==== Second Example
33
- # options = { "fields": "id, step_id" }
34
- # @data = @mints_user.get_step_object(1, options)
35
- def get_step_object(id, options = nil)
36
- @client.raw("get", "/crm/step-objects/#{id}", options)
37
- end
24
+ # === Get workflow step object.
25
+ # Get a workflow step object info.
26
+ #
27
+ # ==== Parameters
28
+ # id:: (Integer) -- Workflow step object 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_step_object(1)
33
+ #
34
+ # ==== Second Example
35
+ # options = { fields: 'id, step_id' }
36
+ # @data = @mints_user.get_step_object(1, options)
37
+ def get_step_object(id, options = nil)
38
+ @client.raw('get', "/crm/step-objects/#{id}", options)
39
+ end
38
40
 
39
- # === Create workflow step object.
40
- # Create a workflow step object with data.
41
- #
42
- # ==== Parameters
43
- # data:: (Hash) -- Data to be submitted.
44
- #
45
- # ==== Example
46
- # data = {
47
- # "objectType": "deals",
48
- # "stepId": 9,
49
- # "objectId": 1
50
- # }
51
- # @data = @mints_user.create_step_object(data)
52
- def create_step_object(data)
53
- @client.raw("post", "/crm/step-objects/", nil, data_transform(data))
54
- end
41
+ # === Create workflow step object.
42
+ # Create a workflow step object with data.
43
+ #
44
+ # ==== Parameters
45
+ # data:: (Hash) -- Data to be submitted.
46
+ #
47
+ # ==== Example
48
+ # data = {
49
+ # objectType: 'deals',
50
+ # stepId: 9,
51
+ # objectId: 1
52
+ # }
53
+ # @data = @mints_user.create_step_object(data)
54
+ def create_step_object(data)
55
+ @client.raw('post', '/crm/step-objects/', nil, data_transform(data))
56
+ end
55
57
 
56
- # === Update workflow step object.
57
- # Update a workflow step object info.
58
- #
59
- # ==== Parameters
60
- # id:: (Integer) -- Workflow step object id.
61
- # data:: (Hash) -- Data to be submitted.
62
- #
63
- # ==== Example
64
- # data = {
65
- # "stepId": 10
66
- # }
67
- # @data = @mints_user.update_step_object(128, data.to_json)
68
- def update_step_object(id, data)
69
- @client.raw("put", "/crm/step-objects/#{id}", nil, data)
70
- end
58
+ # === Update workflow step object.
59
+ # Update a workflow step object info.
60
+ #
61
+ # ==== Parameters
62
+ # id:: (Integer) -- Workflow step object id.
63
+ # data:: (Hash) -- Data to be submitted.
64
+ #
65
+ # ==== Example
66
+ # data = {
67
+ # stepId: 10
68
+ # }
69
+ # @data = @mints_user.update_step_object(128, data.to_json)
70
+ def update_step_object(id, data)
71
+ @client.raw('put', "/crm/step-objects/#{id}", nil, data)
72
+ end
71
73
 
72
- # === Get workflow step object by object type.
73
- # Get a workflow step object info by an object type.
74
- #
75
- # ==== Parameters
76
- # objectType:: (String) -- Object type.
77
- # objectId:: (Integer) -- Workflow step object id.
78
- # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
79
- #
80
- # ==== First Example
81
- # @data = @mints_user.get_step_object_by_object_type("deals", 1)
82
- #
83
- # ==== Second Example
84
- # options = { "fields": "id, object_id" }
85
- # @data = @mints_user.get_step_object_by_object_type("deals", 1, options)
86
- def get_step_object_by_object_type(objectType, objectId, options = nil)
87
- @client.raw("get", "/crm/step-objects/#{objectType}/#{objectId}", options)
88
- end
89
- end
74
+ # === Get workflow step object by object type.
75
+ # Get a workflow step object info by an object type.
76
+ #
77
+ # ==== Parameters
78
+ # object_type:: (String) -- Object type.
79
+ # object_id:: (Integer) -- Workflow step object id.
80
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
81
+ #
82
+ # ==== First Example
83
+ # @data = @mints_user.get_step_object_by_object_type("deals", 1)
84
+ #
85
+ # ==== Second Example
86
+ # options = { fields: 'id, object_id' }
87
+ # @data = @mints_user.get_step_object_by_object_type('deals', 1, options)
88
+ def get_step_object_by_object_type(object_type, object_id, options = nil)
89
+ @client.raw('get', "/crm/step-objects/#{object_type}/#{object_id}", options)
90
+ end
91
+ end
@@ -1,49 +1,51 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module WorkFlowSteps
2
- ##
3
- # == Workflow Steps
4
- #
4
+ ##
5
+ # == Workflow Steps
6
+ #
5
7
 
6
- # === Create workflow step.
7
- # Create a workflow step with data.
8
- #
9
- # ==== Parameters
10
- # data:: (Hash) -- Data to be submitted.
11
- #
12
- # ==== Example
13
- # data = {
14
- # "stepTitle": "Step Title",
15
- # "workflowId": 1
16
- # }
17
- # @data = @mints_user.create_workflow_step(data.to_json)
18
- def create_workflow_step(data)
19
- @client.raw("post", "/crm/steps", nil, data)
20
- end
8
+ # === Create workflow step.
9
+ # Create a workflow step with data.
10
+ #
11
+ # ==== Parameters
12
+ # data:: (Hash) -- Data to be submitted.
13
+ #
14
+ # ==== Example
15
+ # data = {
16
+ # stepTitle: 'Step Title',
17
+ # workflowId: 1
18
+ # }
19
+ # @data = @mints_user.create_workflow_step(data.to_json)
20
+ def create_workflow_step(data)
21
+ @client.raw('post', '/crm/steps', nil, data)
22
+ end
21
23
 
22
- # === Update workflow step.
23
- # Update a workflow step info.
24
- #
25
- # ==== Parameters
26
- # id:: (Integer) -- Workflow step id.
27
- # data:: (Hash) -- Data to be submitted.
28
- #
29
- # ==== Example
30
- # data = {
31
- # "stepTitle": "Step Title Modified"
32
- # }
33
- # @data = @mints_user.update_workflow_step(23, data)
34
- def update_workflow_step(id, data)
35
- @client.raw("put", "/crm/steps/#{id}", nil, data)
36
- end
24
+ # === Update workflow step.
25
+ # Update a workflow step info.
26
+ #
27
+ # ==== Parameters
28
+ # id:: (Integer) -- Workflow step id.
29
+ # data:: (Hash) -- Data to be submitted.
30
+ #
31
+ # ==== Example
32
+ # data = {
33
+ # stepTitle: 'Step Title Modified'
34
+ # }
35
+ # @data = @mints_user.update_workflow_step(23, data)
36
+ def update_workflow_step(id, data)
37
+ @client.raw('put', "/crm/steps/#{id}", nil, data)
38
+ end
37
39
 
38
- # === Delete workflow step.
39
- # Delete a workflow step.
40
- #
41
- # ==== Parameters
42
- # id:: (Integer) -- Workflow step id.
43
- #
44
- # ==== Example
45
- # @data = @mints_user.delete_workflow_step(51)
46
- def delete_workflow_step(id)
47
- @client.raw("delete", "/crm/steps/#{id}")
48
- end
49
- end
40
+ # === Delete workflow step.
41
+ # Delete a workflow step.
42
+ #
43
+ # ==== Parameters
44
+ # id:: (Integer) -- Workflow step id.
45
+ #
46
+ # ==== Example
47
+ # @data = @mints_user.delete_workflow_step(51)
48
+ def delete_workflow_step(id)
49
+ @client.raw('delete', "/crm/steps/#{id}")
50
+ end
51
+ end
@@ -1,70 +1,72 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Workflows
2
- ##
3
- # == Workflows
4
- #
4
+ ##
5
+ # == Workflows
6
+ #
5
7
 
6
- # === Get workflows.
7
- # Get a collection of workflows.
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_workflows
14
- #
15
- # ==== Second Example
16
- # options = { "sort": "title", "fields": "title" }
17
- # @data = @mints_user.get_workflows(options)
18
- def get_workflows(options = nil)
19
- @client.raw("get", "/crm/workflows", options)
20
- end
8
+ # === Get workflows.
9
+ # Get a collection of workflows.
10
+ #
11
+ # ==== Parameters
12
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
13
+ #
14
+ # ==== First Example
15
+ # @data = @mints_user.get_workflows
16
+ #
17
+ # ==== Second Example
18
+ # options = { sort: 'title', fields: 'title' }
19
+ # @data = @mints_user.get_workflows(options)
20
+ def get_workflows(options = nil)
21
+ @client.raw('get', '/crm/workflows', options)
22
+ end
21
23
 
22
- # === Get workflow.
23
- # Get a workflow.
24
- #
25
- # ==== Parameters
26
- # id:: (Integer) -- Workflow 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_workflow(1)
31
- #
32
- # ==== Second Example
33
- # options = { "fields": "id, title" }
34
- # @data = @mints_user.get_workflow(1, options)
35
- def get_workflow(id, options = nil)
36
- @client.raw("get", "/crm/workflows/#{id}", options)
37
- end
24
+ # === Get workflow.
25
+ # Get a workflow.
26
+ #
27
+ # ==== Parameters
28
+ # id:: (Integer) -- Workflow 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_workflow(1)
33
+ #
34
+ # ==== Second Example
35
+ # options = { fields: 'id, title' }
36
+ # @data = @mints_user.get_workflow(1, options)
37
+ def get_workflow(id, options = nil)
38
+ @client.raw('get', "/crm/workflows/#{id}", options)
39
+ end
38
40
 
39
- # === Create workflow.
40
- # Create a workflow with data.
41
- #
42
- # ==== Parameters
43
- # data:: (Hash) -- Data to be submitted.
44
- #
45
- # ==== Example
46
- # data = {
47
- # "title": "New Workflow",
48
- # "object_type": "deals"
49
- # }
50
- # @data = @mints_user.create_workflow(data.to_json)
51
- def create_workflow(data)
52
- @client.raw("post", "/crm/workflows/", nil, data)
53
- end
41
+ # === Create workflow.
42
+ # Create a workflow with data.
43
+ #
44
+ # ==== Parameters
45
+ # data:: (Hash) -- Data to be submitted.
46
+ #
47
+ # ==== Example
48
+ # data = {
49
+ # title: 'New Workflow',
50
+ # object_type: 'deals'
51
+ # }
52
+ # @data = @mints_user.create_workflow(data.to_json)
53
+ def create_workflow(data)
54
+ @client.raw('post', '/crm/workflows/', nil, data)
55
+ end
54
56
 
55
- # === Update workflow.
56
- # Update a workflow info.
57
- #
58
- # ==== Parameters
59
- # id:: (Integer) -- Workflow id.
60
- # data:: (Hash) -- Data to be submitted.
61
- #
62
- # ==== Example
63
- # data = {
64
- # "title": "New Workflow Modified"
65
- # }
66
- # @data = @mints_user.update_workflow(7, data)
67
- def update_workflow(id, data)
68
- @client.raw("put", "/crm/workflows/#{id}", nil, correct_json(data))
69
- end
70
- end
57
+ # === Update workflow.
58
+ # Update a workflow info.
59
+ #
60
+ # ==== Parameters
61
+ # id:: (Integer) -- Workflow id.
62
+ # data:: (Hash) -- Data to be submitted.
63
+ #
64
+ # ==== Example
65
+ # data = {
66
+ # title: 'New Workflow Modified'
67
+ # }
68
+ # @data = @mints_user.update_workflow(7, data)
69
+ def update_workflow(id, data)
70
+ @client.raw('put', "/crm/workflows/#{id}", nil, correct_json(data))
71
+ end
72
+ end
@@ -1,29 +1,31 @@
1
- require_relative './item_prices.rb'
2
- require_relative './locations.rb'
3
- require_relative './order_items_groups.rb'
4
- require_relative './order_statuses.rb'
5
- require_relative './orders.rb'
6
- require_relative './price_lists.rb'
7
- require_relative './product_templates.rb'
8
- require_relative './product_variations.rb'
9
- require_relative './products.rb'
10
- require_relative './skus.rb'
11
- require_relative './taxes.rb'
12
- require_relative './variant_options.rb'
13
- require_relative './variant_values.rb'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative './item_prices'
4
+ require_relative './locations'
5
+ require_relative './order_items_groups'
6
+ require_relative './order_statuses'
7
+ require_relative './orders'
8
+ require_relative './price_lists'
9
+ require_relative './product_templates'
10
+ require_relative './product_variations'
11
+ require_relative './products'
12
+ require_relative './skus'
13
+ require_relative './taxes'
14
+ require_relative './variant_options'
15
+ require_relative './variant_values'
14
16
 
15
17
  module Ecommerce
16
- include ItemPrices
17
- include Locations
18
- include OrderItemsGroups
19
- include OrderStatuses
20
- include Orders
21
- include PriceList
22
- include ProductTemplates
23
- include ProductVariations
24
- include Products
25
- include Skus
26
- include Taxes
27
- include VariantOptions
28
- include VariantValues
29
- end
18
+ include ItemPrices
19
+ include Locations
20
+ include OrderItemsGroups
21
+ include OrderStatuses
22
+ include Orders
23
+ include PriceList
24
+ include ProductTemplates
25
+ include ProductVariations
26
+ include Products
27
+ include Skus
28
+ include Taxes
29
+ include VariantOptions
30
+ include VariantValues
31
+ end
@@ -1,86 +1,89 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ItemPrices
2
- ##
3
- # == Item Prices
4
- #
4
+ ##
5
+ # == Item Prices
6
+ #
7
+
8
+ # === Get item prices.
9
+ # Get a collection of item prices.
10
+ #
11
+ # ==== Parameters
12
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
13
+ #
14
+ # ==== First Example
15
+ # @data = @mints_user.get_item_prices
16
+ #
17
+ # ==== Second Example
18
+ # options = { fields: 'price_cents' }
19
+ # @data = @mints_user.get_item_prices(options)
20
+ def get_item_prices(options = nil)
21
+ @client.raw('get', '/ecommerce/item-prices', options)
22
+ end
5
23
 
6
- # === Get item prices.
7
- # Get a collection of item prices.
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_item_prices
14
- #
15
- # ==== Second Example
16
- # options = { "fields": "price_cents" }
17
- # @data = @mints_user.get_item_prices(options)
18
- def get_item_prices(options = nil)
19
- @client.raw("get", "/ecommerce/item-prices", options)
20
- end
24
+ # === Get item price.
25
+ # Get a item price info.
26
+ #
27
+ # ==== Parameters
28
+ # id:: (Integer) -- Item price 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_item_price(1)
33
+ #
34
+ # ==== Second Example
35
+ # options = { fields: 'price_cents' }
36
+ # @data = @mints_user.get_item_price(1, options)
37
+ def get_item_price(id, options = nil)
38
+ @client.raw('get', "/ecommerce/item-prices/#{id}", options)
39
+ end
21
40
 
22
- # === Get item price.
23
- # Get a item price info.
24
- #
25
- # ==== Parameters
26
- # id:: (Integer) -- Item price 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_item_price(1)
31
- #
32
- # ==== Second Example
33
- # options = { "fields": "price_cents" }
34
- # @data = @mints_user.get_item_price(1, options)
35
- def get_item_price(id, options = nil)
36
- @client.raw("get", "/ecommerce/item-prices/#{id}", options)
37
- end
41
+ # === Create item price.
42
+ # Create a item price with data.
43
+ #
44
+ # ==== Parameters
45
+ # data:: (Hash) -- Data to be submitted.
46
+ #
47
+ # ==== Example
48
+ # data = {
49
+ # price_list: [
50
+ # { id: 1 },
51
+ # { id: 2 }
52
+ # ],
53
+ # price_list_id: 1,
54
+ # title: 'New Item Price'
55
+ # }
56
+ # @data = @mints_user.create_item_price(data)
57
+ def create_item_price(data)
58
+ # FIXME: Api send sku_id as null and DB doesnt allow that.
59
+ @client.raw('post', '/ecommerce/item-prices', nil, data_transform(data))
60
+ end
38
61
 
39
- # === Create item price.
40
- # Create a item price with data.
41
- #
42
- # ==== Parameters
43
- # data:: (Hash) -- Data to be submitted.
44
- #
45
- # ==== Example
46
- # data = {
47
- # "price_list": [
48
- # { "id": 1 },
49
- # { "id": 2 }
50
- # ],
51
- # "price_list_id": 1,
52
- # "title": "New Item Price"
53
- # }
54
- # @data = @mints_user.create_item_price(data)
55
- def create_item_price(data) #FIXME: Api send sku_id as null and DB doesnt allow that.
56
- @client.raw("post", "/ecommerce/item-prices", nil, data_transform(data))
57
- end
62
+ # === Update item price.
63
+ # Update a item price info.
64
+ #
65
+ # ==== Parameters
66
+ # id:: (Integer) -- Order item price id.
67
+ # data:: (Hash) -- Data to be submitted.
68
+ #
69
+ # ==== Example
70
+ # data = {
71
+ # price: 12345
72
+ # }
73
+ # @data = @mints_user.update_item_price(1, data)
74
+ def update_item_price(id, data)
75
+ @client.raw('put', "/ecommerce/item-prices/#{id}", nil, data_transform(data))
76
+ end
58
77
 
59
- # === Update item price.
60
- # Update a item price info.
61
- #
62
- # ==== Parameters
63
- # id:: (Integer) -- Order item price id.
64
- # data:: (Hash) -- Data to be submitted.
65
- #
66
- # ==== Example
67
- # data = {
68
- # "price": 12345
69
- # }
70
- # @data = @mints_user.update_item_price(1, data)
71
- def update_item_price(id, data)
72
- @client.raw("put", "/ecommerce/item-prices/#{id}", nil, data_transform(data))
73
- end
74
-
75
- # === Delete item price.
76
- # Delete a item price.
77
- #
78
- # ==== Parameters
79
- # id:: (Integer) -- Item price id.
80
- #
81
- # ==== Example
82
- # @data = @mints_user.delete_item_price(803)
83
- def delete_item_price(id)
84
- @client.raw("delete", "/ecommerce/item-prices/#{id}")
85
- end
86
- end
78
+ # === Delete item price.
79
+ # Delete a item price.
80
+ #
81
+ # ==== Parameters
82
+ # id:: (Integer) -- Item price id.
83
+ #
84
+ # ==== Example
85
+ # @data = @mints_user.delete_item_price(803)
86
+ def delete_item_price(id)
87
+ @client.raw('delete', "/ecommerce/item-prices/#{id}")
88
+ end
89
+ end