mints 0.0.17 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/lib/client.rb +96 -37
- data/lib/contact.rb +659 -94
- data/lib/generators/mints_files_generator.rb +6 -0
- data/lib/generators/mints_link.rb +61 -0
- data/lib/generators/short_link_controller.rb +41 -0
- 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 +258 -139
- 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 +260 -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 +64 -2
@@ -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
|
@@ -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
|