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.
- checksums.yaml +4 -4
- data/lib/client.rb +97 -38
- data/lib/contact.rb +124 -21
- data/lib/mints/controllers/admin_base_controller.rb +2 -2
- data/lib/mints/controllers/base_api_controller.rb +12 -11
- data/lib/mints/controllers/base_controller.rb +38 -9
- data/lib/mints_helper.rb +47 -0
- data/lib/pub.rb +147 -61
- data/lib/user/config/api_keys.rb +65 -0
- data/lib/user/config/appointments.rb +221 -0
- data/lib/user/config/attribute_groups.rb +77 -0
- data/lib/user/config/attributes.rb +86 -0
- data/lib/user/config/calendars.rb +89 -0
- data/lib/user/config/config.rb +65 -0
- data/lib/user/config/importers.rb +184 -0
- data/lib/user/config/public_folders.rb +108 -0
- data/lib/user/config/relationships.rb +138 -0
- data/lib/user/config/roles.rb +84 -0
- data/lib/user/config/seeds.rb +14 -0
- data/lib/user/config/system_settings.rb +53 -0
- data/lib/user/config/tags.rb +63 -0
- data/lib/user/config/taxonomies.rb +124 -0
- data/lib/user/config/teams.rb +70 -0
- data/lib/user/config/users.rb +76 -0
- data/lib/user/contacts/contacts.rb +21 -0
- data/lib/user/content/assets.rb +98 -0
- data/lib/user/content/content.rb +235 -0
- data/lib/user/content/content_instances.rb +147 -0
- data/lib/user/content/content_templates.rb +111 -0
- data/lib/user/content/conversations.rb +174 -0
- data/lib/user/content/dam.rb +88 -0
- data/lib/user/content/forms.rb +168 -0
- data/lib/user/content/message_templates.rb +162 -0
- data/lib/user/content/messages.rb +90 -0
- data/lib/user/content/pages.rb +81 -0
- data/lib/user/content/stories.rb +164 -0
- data/lib/user/content/story_templates.rb +95 -0
- data/lib/user/crm/companies.rb +111 -0
- data/lib/user/crm/contacts.rb +312 -0
- data/lib/user/crm/crm.rb +21 -0
- data/lib/user/crm/deals.rb +111 -0
- data/lib/user/crm/favorites.rb +17 -0
- data/lib/user/crm/segments.rb +132 -0
- data/lib/user/crm/users.rb +22 -0
- data/lib/user/crm/workflow_step_objects.rb +89 -0
- data/lib/user/crm/workflow_steps.rb +49 -0
- data/lib/user/crm/workflows.rb +70 -0
- data/lib/user/ecommerce/ecommerce.rb +29 -0
- data/lib/user/ecommerce/item_prices.rb +86 -0
- data/lib/user/ecommerce/locations.rb +166 -0
- data/lib/user/ecommerce/order_items_groups.rb +109 -0
- data/lib/user/ecommerce/order_statuses.rb +26 -0
- data/lib/user/ecommerce/orders.rb +258 -0
- data/lib/user/ecommerce/price_lists.rb +73 -0
- data/lib/user/ecommerce/product_templates.rb +104 -0
- data/lib/user/ecommerce/product_variations.rb +129 -0
- data/lib/user/ecommerce/products.rb +169 -0
- data/lib/user/ecommerce/skus.rb +88 -0
- data/lib/user/ecommerce/taxes.rb +82 -0
- data/lib/user/ecommerce/variant_options.rb +69 -0
- data/lib/user/ecommerce/variant_values.rb +72 -0
- data/lib/user/helpers/helpers.rb +113 -0
- data/lib/user/helpers/object_activities.rb +83 -0
- data/lib/user/helpers/object_folders.rb +82 -0
- data/lib/user/helpers/user_folders.rb +83 -0
- data/lib/user/marketing/marketing.rb +120 -0
- data/lib/user/profile/profile.rb +111 -0
- data/lib/user.rb +24 -368
- metadata +63 -3
@@ -0,0 +1,82 @@
|
|
1
|
+
module ObjectFolders
|
2
|
+
##
|
3
|
+
# == Object Folders
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get object folders.
|
7
|
+
# Get a collection of object folders.
|
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_folders
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# options = { "fields": "id" }
|
17
|
+
# @data = @mints_user.get_object_folders(options)
|
18
|
+
def get_object_folders(options = nil)
|
19
|
+
return @client.raw("get", "/helpers/object-folders", options)
|
20
|
+
end
|
21
|
+
|
22
|
+
# === Get object folder.
|
23
|
+
# Get an object folder info.
|
24
|
+
#
|
25
|
+
# ==== Parameters
|
26
|
+
# id:: (Integer) -- Object folders 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_folder(1)
|
31
|
+
#
|
32
|
+
# ==== Second Example
|
33
|
+
# options = { "fields": "id" }
|
34
|
+
# @data = @mints_user.get_object_folder(1, options)
|
35
|
+
def get_object_folder(id, options = nil)
|
36
|
+
return @client.raw("get", "/helpers/object-folders/#{id}", options)
|
37
|
+
end
|
38
|
+
|
39
|
+
# === Create object folder.
|
40
|
+
# Create an object folder with data.
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# data:: (Hash) -- Data to be submited.
|
44
|
+
#
|
45
|
+
# ==== Example
|
46
|
+
# data = {
|
47
|
+
# "folder_id": 1,
|
48
|
+
# "object_id": 1
|
49
|
+
# }
|
50
|
+
# @data = @mints_user.create_object_folder(data)
|
51
|
+
def create_object_folder(data)
|
52
|
+
return @client.raw("post", "/helpers/object-folders", nil, data_transform(data))
|
53
|
+
end
|
54
|
+
|
55
|
+
# === Update object folder.
|
56
|
+
# Update an object folder info.
|
57
|
+
#
|
58
|
+
# ==== Parameters
|
59
|
+
# id:: (Integer) -- Object folder id.
|
60
|
+
# data:: (Hash) -- Data to be submited.
|
61
|
+
#
|
62
|
+
# ==== Example
|
63
|
+
# data = {
|
64
|
+
# "folder_id": 2
|
65
|
+
# }
|
66
|
+
# @data = @mints_user.update_object_folder(1, data)
|
67
|
+
def update_object_folder(id, data)
|
68
|
+
return @client.raw("put", "/helpers/object-folders/#{id}", nil, data_transform(data))
|
69
|
+
end
|
70
|
+
|
71
|
+
# === Delete object folder.
|
72
|
+
# Delete an object folder.
|
73
|
+
#
|
74
|
+
# ==== Parameters
|
75
|
+
# id:: (Integer) -- Object folder id.
|
76
|
+
#
|
77
|
+
# ==== Example
|
78
|
+
# @data = @mints_user.delete_object_folder(2)
|
79
|
+
def delete_object_folder(id)
|
80
|
+
return @client.raw("delete", "/helpers/object-folders/#{id}")
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
module UserFolders
|
2
|
+
##
|
3
|
+
# == User Folders
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get user folders.
|
7
|
+
# Get a collection of user folders.
|
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_user_folders
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# options = { "fields": "folder" }
|
17
|
+
# @data = @mints_user.get_user_folders(options)
|
18
|
+
def get_user_folders(options = nil)
|
19
|
+
return @client.raw("get", "/helpers/folders", options)
|
20
|
+
end
|
21
|
+
|
22
|
+
# === Get user folder.
|
23
|
+
# Get an user folder info.
|
24
|
+
#
|
25
|
+
# ==== Parameters
|
26
|
+
# id:: (Integer) -- User folder 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_user_folder(1)
|
31
|
+
#
|
32
|
+
# ==== Second Example
|
33
|
+
# options = { "fields": "user_id, folder" }
|
34
|
+
# @data = @mints_user.get_user_folder(1, options)
|
35
|
+
def get_user_folder(id, options = nil)
|
36
|
+
return @client.raw("get", "/helpers/folders/#{id}", options)
|
37
|
+
end
|
38
|
+
|
39
|
+
# === Create user folder.
|
40
|
+
# Create an user folder with data.
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# data:: (Hash) -- Data to be submited.
|
44
|
+
#
|
45
|
+
# ==== Example
|
46
|
+
# data = {
|
47
|
+
# "folder": "new-user-folder",
|
48
|
+
# "object_type": "contacts"
|
49
|
+
# }
|
50
|
+
# @data = @mints_user.create_user_folder(data)
|
51
|
+
def create_user_folder(data)
|
52
|
+
return @client.raw("post", "/helpers/folders", nil, data_transform(data))
|
53
|
+
end
|
54
|
+
|
55
|
+
# === Update user folder.
|
56
|
+
# Update an user folder info.
|
57
|
+
#
|
58
|
+
# ==== Parameters
|
59
|
+
# id:: (Integer) -- User folder id.
|
60
|
+
# data:: (Hash) -- Data to be submited.
|
61
|
+
#
|
62
|
+
# ==== Example
|
63
|
+
# data = {
|
64
|
+
# "folder": "new-user-folder-modified",
|
65
|
+
# "object_type": "contacts"
|
66
|
+
# }
|
67
|
+
# @data = @mints_user.update_user_folder(289, data)
|
68
|
+
def update_user_folder(id, data)
|
69
|
+
return @client.raw("put", "/helpers/folders/#{id}", nil, data_transform(data))
|
70
|
+
end
|
71
|
+
|
72
|
+
# === Delete user folder.
|
73
|
+
# Delete an user folder.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
# id:: (Integer) -- User folder id.
|
77
|
+
#
|
78
|
+
# ==== Example
|
79
|
+
# @data = @mints_user.delete_user_folder(289)
|
80
|
+
def delete_user_folder(id)
|
81
|
+
return @client.raw("delete", "/helpers/folders/#{id}")
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module Marketing
|
2
|
+
##
|
3
|
+
# == Automation
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get automations.
|
7
|
+
# Get a collection of automations.
|
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_automations
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# options = {
|
17
|
+
# "fields": "title"
|
18
|
+
# }
|
19
|
+
# @data = @mints_user.get_automations(options)
|
20
|
+
def get_automations(options = nil)
|
21
|
+
return @client.raw("get", "/marketing/automation", options)
|
22
|
+
end
|
23
|
+
|
24
|
+
# === Get automation.
|
25
|
+
# Get an automation info.
|
26
|
+
#
|
27
|
+
# ==== Parameters
|
28
|
+
# id:: (Integer) -- Automation 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_automation(1)
|
33
|
+
#
|
34
|
+
# ==== Second Example
|
35
|
+
# options = {
|
36
|
+
# "fields": "title, id"
|
37
|
+
# }
|
38
|
+
# @data = @mints_user.get_automation(1, options)
|
39
|
+
def get_automation(id, options = nil)
|
40
|
+
return @client.raw("get", "/marketing/automation/#{id}", options)
|
41
|
+
end
|
42
|
+
|
43
|
+
# === Create automation.
|
44
|
+
# Create an automation with data.
|
45
|
+
#
|
46
|
+
# ==== Parameters
|
47
|
+
# data:: (Hash) -- Data to be submited.
|
48
|
+
#
|
49
|
+
# ==== Example
|
50
|
+
# data = {
|
51
|
+
# "title": "New Automation"
|
52
|
+
# }
|
53
|
+
# @data = @mints_user.create_automation(data)
|
54
|
+
def create_automation(data)
|
55
|
+
return @client.raw("post", "/marketing/automation/", nil, data_transform(data))
|
56
|
+
end
|
57
|
+
|
58
|
+
# === Update automation.
|
59
|
+
# Update an automation info.
|
60
|
+
#
|
61
|
+
# ==== Parameters
|
62
|
+
# id:: (Integer) -- Automation id.
|
63
|
+
# data:: (Hash) -- Data to be submited.
|
64
|
+
#
|
65
|
+
def update_automation(id, data) #FIXME: Method doesn't work.
|
66
|
+
return @client.raw("put", "/marketing/automation/#{id}", nil, data_transform(data))
|
67
|
+
end
|
68
|
+
|
69
|
+
# === Delete automation.
|
70
|
+
# Delete an automation.
|
71
|
+
#
|
72
|
+
# ==== Parameters
|
73
|
+
# id:: (Integer) -- Automation id.
|
74
|
+
#
|
75
|
+
# ==== Example
|
76
|
+
# @data = @mints_user.delete_automation(5)
|
77
|
+
def delete_automation(id)
|
78
|
+
return @client.raw("delete", "/marketing/automation/#{id}")
|
79
|
+
end
|
80
|
+
|
81
|
+
# === Get automation executions.
|
82
|
+
# Get executions of an automation.
|
83
|
+
#
|
84
|
+
# ==== Parameters
|
85
|
+
# id:: (Integer) -- Automation id.
|
86
|
+
#
|
87
|
+
# ==== Example
|
88
|
+
# @data = @mints_user.get_automation_executions(1)
|
89
|
+
def get_automation_executions(id)
|
90
|
+
return @client.raw("get", "/marketing/automation/#{id}/executions")
|
91
|
+
end
|
92
|
+
|
93
|
+
# === Reset automation.
|
94
|
+
# Reset an automation.
|
95
|
+
#
|
96
|
+
# ==== Parameters
|
97
|
+
# id:: (Integer) -- Automation id.
|
98
|
+
#
|
99
|
+
# ==== Example
|
100
|
+
# @data = @mints_user.reset_automation(1)
|
101
|
+
def reset_automation(id)
|
102
|
+
return @client.raw("post", "/marketing/automation/#{id}/reset")
|
103
|
+
end
|
104
|
+
|
105
|
+
# === Duplicate automation.
|
106
|
+
# Duplicate an automation.
|
107
|
+
#
|
108
|
+
# ==== Parameters
|
109
|
+
# id:: (Integer) -- Automation id.
|
110
|
+
# data:: (Hash) -- Data to be submited.
|
111
|
+
#
|
112
|
+
# ==== Example
|
113
|
+
# data = {
|
114
|
+
# "options": []
|
115
|
+
# }
|
116
|
+
# @data = @mints_user.duplicate_automation(1, data.to_json)
|
117
|
+
def duplicate_automation(id, data)
|
118
|
+
return @client.raw("post", "/marketing/automation/#{id}/duplicate", nil, data)
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
module Profile
|
2
|
+
##
|
3
|
+
# === Me.
|
4
|
+
# Get contact logged info.
|
5
|
+
#
|
6
|
+
# ==== Example
|
7
|
+
# @data = @mints_user.me
|
8
|
+
def me
|
9
|
+
return @client.raw("get", "/profile/me")
|
10
|
+
end
|
11
|
+
|
12
|
+
##
|
13
|
+
# == User Preferences
|
14
|
+
#
|
15
|
+
|
16
|
+
##
|
17
|
+
# === Get preferences.
|
18
|
+
# Get preferences of current user logged.
|
19
|
+
#
|
20
|
+
# ==== Example
|
21
|
+
# @data = @mints_user.get_preferences
|
22
|
+
def get_preferences
|
23
|
+
return @client.raw("get", "/profile/preferences")
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# === Create preferences.
|
28
|
+
# Create preferences of current user logged with data.
|
29
|
+
#
|
30
|
+
# ==== Parameters
|
31
|
+
# data:: (Hash) -- Data to be submited.
|
32
|
+
#
|
33
|
+
# ==== Example
|
34
|
+
# data = {
|
35
|
+
# "time_zone": "GMT-5"
|
36
|
+
# }
|
37
|
+
# @data = @mints_user.create_preferences(data)
|
38
|
+
def create_preferences(data)
|
39
|
+
return @client.raw("post", "/profile/preferences", nil, data_transform(data))
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# === Get preferences by setting key.
|
44
|
+
# Get preferences using a setting key.
|
45
|
+
#
|
46
|
+
# ==== Parameters
|
47
|
+
# setting_key:: (String) -- Setting key.
|
48
|
+
#
|
49
|
+
# ==== Example
|
50
|
+
# @data = @mints_user.get_preferences_by_setting_key("time_zone")
|
51
|
+
def get_preferences_by_setting_key(setting_key)
|
52
|
+
return @client.raw("get", "/profile/preferences/#{setting_key}")
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# == Notifications
|
57
|
+
#
|
58
|
+
|
59
|
+
# === Get notifications.
|
60
|
+
# Get a collection of notifications.
|
61
|
+
#
|
62
|
+
# ==== Example
|
63
|
+
# @data = @mints_user.get_notifications
|
64
|
+
def get_notifications
|
65
|
+
return @client.raw("get", "/profile/notifications")
|
66
|
+
end
|
67
|
+
|
68
|
+
# === Get paginated notifications.
|
69
|
+
# Get a collection of paginated notifications.
|
70
|
+
#
|
71
|
+
# ==== Example
|
72
|
+
# @data = @mints_user.get_paginated_notifications
|
73
|
+
def get_paginated_notifications
|
74
|
+
return @client.raw("get", "/profile/notificationsp")
|
75
|
+
end
|
76
|
+
|
77
|
+
# === Read notifications.
|
78
|
+
# Read notifications by data.
|
79
|
+
#
|
80
|
+
# ==== Parameters
|
81
|
+
# data:: (Hash) -- Data to be submited.
|
82
|
+
#
|
83
|
+
# ==== Example
|
84
|
+
# data = {
|
85
|
+
# "ids": ["406e9b74-4a9d-42f2-afc6-1587bad6147c", "a2d9f582-1bdb-4e55-8af0-cd1962eaa88c"],
|
86
|
+
# "read": true
|
87
|
+
# }
|
88
|
+
# @data = @mints_user.read_notifications(data)
|
89
|
+
def read_notifications(data)
|
90
|
+
#TODO: Inform NotificationController.read method has been modified
|
91
|
+
#TODO: Method in controller didnt return data
|
92
|
+
return @client.raw("post", "/profile/notifications/read", nil, data_transform(data))
|
93
|
+
end
|
94
|
+
|
95
|
+
# === Delete notifications.
|
96
|
+
# Delete notifications by data.
|
97
|
+
#
|
98
|
+
# ==== Parameters
|
99
|
+
# data:: (Hash) -- Data to be submited.
|
100
|
+
#
|
101
|
+
# ==== Example
|
102
|
+
# data = {
|
103
|
+
# "ids": ["179083e3-3678-4cf6-b75e-5a8b9761245e"]
|
104
|
+
# }
|
105
|
+
# @data = @mints_user.delete_notifications(data)
|
106
|
+
def delete_notifications(data)
|
107
|
+
#TODO: Inform NotificationController.delete method has been modified
|
108
|
+
#TODO: Method in controller didnt return data
|
109
|
+
return @client.raw("post", "/profile/notifications/delete", nil, data_transform(data))
|
110
|
+
end
|
111
|
+
end
|