mints 0.0.16 → 0.0.20

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +97 -38
  3. data/lib/contact.rb +124 -21
  4. data/lib/mints/controllers/admin_base_controller.rb +2 -2
  5. data/lib/mints/controllers/base_api_controller.rb +12 -11
  6. data/lib/mints/controllers/base_controller.rb +38 -9
  7. data/lib/mints_helper.rb +47 -0
  8. data/lib/pub.rb +147 -61
  9. data/lib/user/config/api_keys.rb +65 -0
  10. data/lib/user/config/appointments.rb +221 -0
  11. data/lib/user/config/attribute_groups.rb +77 -0
  12. data/lib/user/config/attributes.rb +86 -0
  13. data/lib/user/config/calendars.rb +89 -0
  14. data/lib/user/config/config.rb +65 -0
  15. data/lib/user/config/importers.rb +184 -0
  16. data/lib/user/config/public_folders.rb +108 -0
  17. data/lib/user/config/relationships.rb +138 -0
  18. data/lib/user/config/roles.rb +84 -0
  19. data/lib/user/config/seeds.rb +14 -0
  20. data/lib/user/config/system_settings.rb +53 -0
  21. data/lib/user/config/tags.rb +63 -0
  22. data/lib/user/config/taxonomies.rb +124 -0
  23. data/lib/user/config/teams.rb +70 -0
  24. data/lib/user/config/users.rb +76 -0
  25. data/lib/user/contacts/contacts.rb +21 -0
  26. data/lib/user/content/assets.rb +98 -0
  27. data/lib/user/content/content.rb +235 -0
  28. data/lib/user/content/content_instances.rb +147 -0
  29. data/lib/user/content/content_templates.rb +111 -0
  30. data/lib/user/content/conversations.rb +174 -0
  31. data/lib/user/content/dam.rb +88 -0
  32. data/lib/user/content/forms.rb +168 -0
  33. data/lib/user/content/message_templates.rb +162 -0
  34. data/lib/user/content/messages.rb +90 -0
  35. data/lib/user/content/pages.rb +81 -0
  36. data/lib/user/content/stories.rb +164 -0
  37. data/lib/user/content/story_templates.rb +95 -0
  38. data/lib/user/crm/companies.rb +111 -0
  39. data/lib/user/crm/contacts.rb +312 -0
  40. data/lib/user/crm/crm.rb +21 -0
  41. data/lib/user/crm/deals.rb +111 -0
  42. data/lib/user/crm/favorites.rb +17 -0
  43. data/lib/user/crm/segments.rb +132 -0
  44. data/lib/user/crm/users.rb +22 -0
  45. data/lib/user/crm/workflow_step_objects.rb +89 -0
  46. data/lib/user/crm/workflow_steps.rb +49 -0
  47. data/lib/user/crm/workflows.rb +70 -0
  48. data/lib/user/ecommerce/ecommerce.rb +29 -0
  49. data/lib/user/ecommerce/item_prices.rb +86 -0
  50. data/lib/user/ecommerce/locations.rb +166 -0
  51. data/lib/user/ecommerce/order_items_groups.rb +109 -0
  52. data/lib/user/ecommerce/order_statuses.rb +26 -0
  53. data/lib/user/ecommerce/orders.rb +258 -0
  54. data/lib/user/ecommerce/price_lists.rb +73 -0
  55. data/lib/user/ecommerce/product_templates.rb +104 -0
  56. data/lib/user/ecommerce/product_variations.rb +129 -0
  57. data/lib/user/ecommerce/products.rb +169 -0
  58. data/lib/user/ecommerce/skus.rb +88 -0
  59. data/lib/user/ecommerce/taxes.rb +82 -0
  60. data/lib/user/ecommerce/variant_options.rb +69 -0
  61. data/lib/user/ecommerce/variant_values.rb +72 -0
  62. data/lib/user/helpers/helpers.rb +113 -0
  63. data/lib/user/helpers/object_activities.rb +83 -0
  64. data/lib/user/helpers/object_folders.rb +82 -0
  65. data/lib/user/helpers/user_folders.rb +83 -0
  66. data/lib/user/marketing/marketing.rb +120 -0
  67. data/lib/user/profile/profile.rb +111 -0
  68. data/lib/user.rb +24 -368
  69. metadata +63 -3
@@ -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
@@ -0,0 +1,72 @@
1
+ module VariantValues
2
+ ##
3
+ # == Variant Values
4
+ #
5
+
6
+ # === Get variant values.
7
+ # Get a collection of variant values.
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_values
14
+ #
15
+ # ==== Second Example
16
+ # options = { "sort": "-id"}
17
+ # @data = @mints_user.get_variant_values(options)
18
+ def get_variant_values(options = nil)
19
+ return @client.raw("get", "/ecommerce/variant-values", options)
20
+ end
21
+
22
+ # === Get variant value.
23
+ # Get a variant value info.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Variant value 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_value(5)
31
+ #
32
+ # ==== Second Example
33
+ # options = { "fields": "id"}
34
+ # @data = @mints_user.get_variant_value(5, options)
35
+ def get_variant_value(id, options = nil)
36
+ return @client.raw("get", "/ecommerce/variant-values/#{id}", options)
37
+ end
38
+
39
+ # === Create variant value.
40
+ # Create a variant value with data.
41
+ #
42
+ # ==== Parameters
43
+ # data:: (Hash) -- Data to be submited.
44
+ #
45
+ # ==== Example
46
+ # data = {
47
+ # "value": "New Variant Value",
48
+ # "variant_option_id": 1,
49
+ # "display_order": 1,
50
+ # "sku_code": "new-variant-value-sku"
51
+ # }
52
+ # @data = @mints_user.create_variant_value(data)
53
+ def create_variant_value(data)
54
+ return @client.raw("post", "/ecommerce/variant-values", nil, data_transform(data))
55
+ end
56
+
57
+ # === Update variant value.
58
+ # Update a variant value info.
59
+ #
60
+ # ==== Parameters
61
+ # id:: (Integer) -- Variant value id.
62
+ # data:: (Hash) -- Data to be submited.
63
+ #
64
+ # ==== Example
65
+ # data = {
66
+ # "value": "New Variant Value Modified"
67
+ # }
68
+ # @data = @mints_user.update_variant_value(22, data)
69
+ def update_variant_value(id, data)
70
+ return @client.raw("put", "/ecommerce/variant-values/#{id}", nil, data_transform(data))
71
+ end
72
+ end
@@ -0,0 +1,113 @@
1
+ require_relative './object_activities.rb'
2
+ require_relative './object_folders.rb'
3
+ require_relative './user_folders.rb'
4
+
5
+ module Helpers
6
+
7
+ include ObjectActivities
8
+ include ObjectFolders
9
+ include UserFolders
10
+
11
+ ##
12
+ # == Helpers
13
+ #
14
+
15
+ # === Slugify.
16
+ # Slugify a text using an object type.
17
+ #
18
+ # ==== Parameters
19
+ # data:: (Hash) -- Data to be submited.
20
+ #
21
+ # ==== Example
22
+ #
23
+ def slugify(data) #TODO: Research use of variable polymorphicObjectType
24
+ return @client.raw("post", "/helpers/slugify", nil, data_transform(data))
25
+ end
26
+
27
+ # === Get available types from usage.
28
+ # Get available types by usage.
29
+ #
30
+ # ==== Parameters
31
+ # usage:: () -- ...
32
+ #
33
+ def get_available_types_from_usage(usage) #TODO: Research use
34
+ return @client.raw("get", "/helpers/available-types/#{usage}")
35
+ end
36
+
37
+ # === Get magic link config.
38
+ # Get config used in magic links.
39
+ #
40
+ # ==== Example
41
+ # @data = @mints_user.get_magic_link_config
42
+ def get_magic_link_config
43
+ return @client.raw("get", "/helpers/magic-link-config")
44
+ end
45
+
46
+ ##
47
+ # == Activities
48
+ #
49
+
50
+ # === Get activities by object type and id.
51
+ # Get activities using an object type and object type id.
52
+ #
53
+ # ==== Parameters
54
+ # object_type:: (String) -- Object type.
55
+ # id:: (Integer) -- Object type id.
56
+ #
57
+ # ==== Example
58
+ # @data = @mints_user.get_activities_by_object_type_and_id("contacts", 1)
59
+ def get_activities_by_object_type_and_id(object_type, id)
60
+ return @client.raw("get", "/helpers/activities/#{object_type}/#{id}")
61
+ end
62
+
63
+ ##
64
+ # == Dice Coefficient
65
+ #
66
+
67
+ # === Get dice coefficient.
68
+ # Get dice coefficient.
69
+ #
70
+ # ==== Parameters
71
+ # options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
72
+ #
73
+ # ==== Example
74
+ # options = {
75
+ # "table": "contacts",
76
+ # "field": "id",
77
+ # "word": "1"
78
+ # }
79
+ # @data = @mints_user.get_dice_coefficient(options)
80
+ def get_dice_coefficient(options)
81
+ return @client.raw("get", "/helpers/dice-coefficient", options)
82
+ end
83
+
84
+ ##
85
+ # == Permission
86
+ #
87
+
88
+ # === Get permission menu.
89
+ # Get permission menu.
90
+ #
91
+ # ==== Example
92
+ # @data = @mints_user.get_permission_menu
93
+ def get_permission_menu
94
+ return @client.raw("get", "/helpers/menu")
95
+ end
96
+
97
+ ##
98
+ # == Seed
99
+ #
100
+
101
+ # === Generate seed.
102
+ # Generate seed using object type and object type id.
103
+ #
104
+ # ==== Parameters
105
+ # objectType:: (String) -- Object type.
106
+ # id:: (Integer) -- Object type id.
107
+ #
108
+ # ==== Example
109
+ # @data = @mints_user.generate_seed("contacts", 1)
110
+ def generate_seed(objectType, id)
111
+ return @client.raw("get", "/helpers/seeds/#{objectType}/#{id}")
112
+ end
113
+ end
@@ -0,0 +1,83 @@
1
+ module ObjectActivities
2
+ ##
3
+ # == Object Activities
4
+ #
5
+
6
+ # === Get object activities.
7
+ # Get a collection of object activities.
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_object_activities
14
+ #
15
+ # ==== Second Example
16
+ # options = { "fields": "object_type" }
17
+ # @data = @mints_user.get_object_activities(options)
18
+ def get_object_activities(options = nil)
19
+ return @client.raw("get", "/helpers/object-activities", options)
20
+ end
21
+
22
+ # === Get object activity.
23
+ # Get an object activity.
24
+ #
25
+ # ==== Parameters
26
+ # id:: (Integer) -- Object activity 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_object_activity(1)
31
+ #
32
+ # ==== Second Example
33
+ # options = { "fields": "activity_type" }
34
+ # @data = @mints_user.get_object_activity(1, options)
35
+ def get_object_activity(id, options = nil)
36
+ return @client.raw("get", "/helpers/object-activities/#{id}", options)
37
+ end
38
+
39
+ # === Create object activity.
40
+ # Create an object activity with data.
41
+ #
42
+ # ==== Parameters
43
+ # data:: (Hash) -- Data to be submited.
44
+ #
45
+ # ==== Example
46
+ # data = {
47
+ # "activity_type": "note",
48
+ # "object_type": "contacts",
49
+ # "object_id": 1
50
+ # }
51
+ # @data = @mints_user.create_object_activity(data)
52
+ def create_object_activity(data)
53
+ return @client.raw("post", "/helpers/object-activities", nil, data_transform(data))
54
+ end
55
+
56
+ # === Update object activity.
57
+ # Update an object activity info.
58
+ #
59
+ # ==== Parameters
60
+ # id:: (Integer) -- Object activity id.
61
+ # data:: (Hash) -- Data to be submited.
62
+ #
63
+ # ==== Example
64
+ # data = {
65
+ # "activity_type": "ticket"
66
+ # }
67
+ # @data = @mints_user.update_object_activity(573, data)
68
+ def update_object_activity(id, data)
69
+ return @client.raw("put", "/helpers/object-activities/#{id}", nil, data_transform(data))
70
+ end
71
+
72
+ # === Delete object activity.
73
+ # Delete an object activity.
74
+ #
75
+ # ==== Parameters
76
+ # id:: (Integer) -- Object activity id.
77
+ #
78
+ # ==== Example
79
+ # @data = @mints_user.delete_object_activity(573)
80
+ def delete_object_activity(id)
81
+ return @client.raw("delete", "/helpers/object-activities/#{id}")
82
+ end
83
+ end