mints 0.0.17 → 0.0.21
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/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,88 @@
|
|
1
|
+
module DAM
|
2
|
+
##
|
3
|
+
# == dam
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get dam loadtree.
|
7
|
+
# Get dam loadtree.
|
8
|
+
#
|
9
|
+
# ==== Example
|
10
|
+
# @data = @mints_user.get_dam_loadtree
|
11
|
+
def get_dam_loadtree
|
12
|
+
return @client.raw("get", "/content/dam/loadtree")
|
13
|
+
end
|
14
|
+
|
15
|
+
# === Get dam asset locations.
|
16
|
+
# Get an asset locations in dam.
|
17
|
+
#
|
18
|
+
# ==== Parameters
|
19
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
20
|
+
#
|
21
|
+
# ==== Example
|
22
|
+
# @data = @mints_user.get_dam_asset_locations(options)
|
23
|
+
def get_dam_asset_locations(options)
|
24
|
+
return @client.raw("get", "/content/dam/asset-locations", options)
|
25
|
+
end
|
26
|
+
|
27
|
+
def paste_dam(data) #FIXME: Controller detect object array like a single array.
|
28
|
+
return @client.raw("post", "/content/dam/paste", nil, data)
|
29
|
+
end
|
30
|
+
|
31
|
+
# === Rename dam.
|
32
|
+
# Rename folder or asset in dam.
|
33
|
+
#
|
34
|
+
# ==== Parameters
|
35
|
+
# data:: (Hash) -- Data to be submited.
|
36
|
+
#
|
37
|
+
# ==== Example
|
38
|
+
# data = {
|
39
|
+
# "itemType": "asset",
|
40
|
+
# "id": 21,
|
41
|
+
# "title": "accusantium",
|
42
|
+
# "description": "Ea cupiditate",
|
43
|
+
# "slug": "accusantium"
|
44
|
+
# }
|
45
|
+
# @data = @mints_user.rename_dam(data.to_json)
|
46
|
+
def rename_dam(data)
|
47
|
+
return @client.raw("post", "/content/dam/rename", nil, data)
|
48
|
+
end
|
49
|
+
|
50
|
+
# === Search dam.
|
51
|
+
# Search folder or asset in dam.
|
52
|
+
#
|
53
|
+
# ==== Parameters
|
54
|
+
# data:: (Hash) -- Data to be submited.
|
55
|
+
#
|
56
|
+
# ==== Example
|
57
|
+
# data = {
|
58
|
+
# "searchFor": "accusantium"
|
59
|
+
# }
|
60
|
+
# @data = @mints_user.search_dam(data.to_json)
|
61
|
+
def search_dam(data)
|
62
|
+
return @client.raw("post", "/content/dam/search", nil, data)
|
63
|
+
end
|
64
|
+
|
65
|
+
def send_to_trash_dam(data) #FIXME: Invalid argument supplied for foreach()
|
66
|
+
return @client.raw("post", "/content/dam/sendToTrash", nil, data)
|
67
|
+
end
|
68
|
+
|
69
|
+
def delete_dam(data) #FIXME: Invalid argument supplied for foreach()
|
70
|
+
return @client.raw("post", "/content/dam/delete", nil, data)
|
71
|
+
end
|
72
|
+
|
73
|
+
# === Create dam folder.
|
74
|
+
# Create a folder in dam.
|
75
|
+
#
|
76
|
+
# ==== Parameters
|
77
|
+
# data:: (Hash) -- Data to be submited.
|
78
|
+
#
|
79
|
+
# ==== Example
|
80
|
+
# data = {
|
81
|
+
# "folder_name": "New Dam Folder",
|
82
|
+
# "slug": "new-dam-folder"
|
83
|
+
# }
|
84
|
+
# @data = @mints_user.create_dam_folder(data.to_json)
|
85
|
+
def create_dam_folder(data)
|
86
|
+
return @client.raw("post", "/content/folders/create", nil, data)
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
module Forms
|
2
|
+
##
|
3
|
+
# == Forms
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get forms.
|
7
|
+
# Get a collection of forms.
|
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_forms
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# options = { "sort": "id", "fields": "title" }
|
17
|
+
# @data = @mints_user.get_forms(options)
|
18
|
+
def get_forms(options = nil)
|
19
|
+
return @client.raw("get", "/content/forms", options)
|
20
|
+
end
|
21
|
+
|
22
|
+
# === Publish form.
|
23
|
+
# Publish a form.
|
24
|
+
#
|
25
|
+
# ==== Parameters
|
26
|
+
# id:: (Integer) -- Form id.
|
27
|
+
# data:: (Hash) -- Data to be submited.
|
28
|
+
#
|
29
|
+
# ==== Example
|
30
|
+
# data = {
|
31
|
+
# "data": {
|
32
|
+
# "slug": "new-publish"
|
33
|
+
# }
|
34
|
+
# }
|
35
|
+
# @data = @mints_user.publish_form(1, data.to_json)
|
36
|
+
def publish_form(id, data) #FIXME: Output cannot be processed. response cannot be converted to json.
|
37
|
+
return @client.raw("put", "/content/forms/#{id}/publish", nil, data)
|
38
|
+
end
|
39
|
+
|
40
|
+
# === Schedule form.
|
41
|
+
# Schedule a form in a specified date.
|
42
|
+
#
|
43
|
+
# ==== Parameters
|
44
|
+
# id:: (Integer) -- Form id.
|
45
|
+
# data:: (Hash) -- Data to be submited.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# "data": {
|
50
|
+
# "scheduled_at": "2021-09-06T20:29:16+00:00"
|
51
|
+
# }
|
52
|
+
# }
|
53
|
+
# @data = @mints_user.schedule_form(1, data.to_json)
|
54
|
+
def schedule_form(id, data) #FIXME: Output cannot be processed. response cannot be converted to json.
|
55
|
+
return @client.raw("put", "/content/forms/#{id}/schedule", nil, data)
|
56
|
+
end
|
57
|
+
|
58
|
+
# === Revert published form.
|
59
|
+
# Revert a published form.
|
60
|
+
#
|
61
|
+
# ==== Parameters
|
62
|
+
# id:: (Integer) -- Form id.
|
63
|
+
#
|
64
|
+
# ==== Example
|
65
|
+
# @data = @mints_user.revert_published_form(1)
|
66
|
+
def revert_published_form(id)
|
67
|
+
return @client.raw("get", "/content/forms/#{id}/revert-published-data")
|
68
|
+
end
|
69
|
+
|
70
|
+
# === Duplicate form.
|
71
|
+
# Duplicate a form.
|
72
|
+
#
|
73
|
+
# ==== Parameters
|
74
|
+
# id:: (Integer) -- Form id.
|
75
|
+
#
|
76
|
+
# ==== Example
|
77
|
+
# @data = @mints_user.duplicate_form(3)
|
78
|
+
def duplicate_form(id)
|
79
|
+
return @client.raw("post", "/content/forms/#{id}/duplicate")
|
80
|
+
end
|
81
|
+
|
82
|
+
# === Get form support data.
|
83
|
+
# Get form support data.
|
84
|
+
#
|
85
|
+
# ==== Example
|
86
|
+
# @data = @mints_user.get_form_support_data
|
87
|
+
def get_form_support_data
|
88
|
+
return @client.raw("get", "/content/forms/support-data")
|
89
|
+
end
|
90
|
+
|
91
|
+
# === Get form submissions.
|
92
|
+
# Get form submissions.
|
93
|
+
#
|
94
|
+
# ==== Parameters
|
95
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
96
|
+
#
|
97
|
+
# ==== First Example
|
98
|
+
# @data = @mints_user.get_form_submissions
|
99
|
+
#
|
100
|
+
# ==== Second Example
|
101
|
+
# options = { "fields": "id" }
|
102
|
+
# @data = @mints_user.get_form_submissions(options)
|
103
|
+
def get_form_submissions(options = nil)
|
104
|
+
return @client.raw("get", "/content/forms/submissions", options)
|
105
|
+
end
|
106
|
+
|
107
|
+
# === Get form.
|
108
|
+
# Get a form info.
|
109
|
+
#
|
110
|
+
# ==== Parameters
|
111
|
+
# id:: (Integer) -- Form id.
|
112
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
113
|
+
#
|
114
|
+
# ==== First Example
|
115
|
+
# @data = @mints_user.get_form(9)
|
116
|
+
#
|
117
|
+
# ==== Second Example
|
118
|
+
# options = { "sort": "id", "fields": "title" }
|
119
|
+
# @data = @mints_user.get_form(2, options)
|
120
|
+
def get_form(id, options = nil)
|
121
|
+
return @client.raw("get", "/content/forms/#{id}", options)
|
122
|
+
end
|
123
|
+
|
124
|
+
# === Create form.
|
125
|
+
# Create a form with data.
|
126
|
+
#
|
127
|
+
# ==== Parameters
|
128
|
+
# data:: (Hash) -- Data to be submited.
|
129
|
+
#
|
130
|
+
# ==== Example
|
131
|
+
# data = {
|
132
|
+
# "title": "New Form",
|
133
|
+
# "slug": "new-form-slug"
|
134
|
+
# }
|
135
|
+
# @data = @mints_user.create_form(data)
|
136
|
+
def create_form(data)
|
137
|
+
return @client.raw("post", "/content/forms", nil, data_transform(data))
|
138
|
+
end
|
139
|
+
|
140
|
+
# === Update form.
|
141
|
+
# Update a form info.
|
142
|
+
#
|
143
|
+
# ==== Parameters
|
144
|
+
# id:: (Integer) -- Form id.
|
145
|
+
# data:: (Hash) -- Data to be submited.
|
146
|
+
#
|
147
|
+
# ==== Example
|
148
|
+
# data = {
|
149
|
+
# "title": "New Form Modified",
|
150
|
+
# "slug": "new-form-slug"
|
151
|
+
# }
|
152
|
+
# @data = @mints_user.update_form(3, data)
|
153
|
+
def update_form(id, data)
|
154
|
+
return @client.raw("put", "/content/forms/#{id}", nil, data_transform(data))
|
155
|
+
end
|
156
|
+
|
157
|
+
# === Delete form.
|
158
|
+
# Delete a form.
|
159
|
+
#
|
160
|
+
# ==== Parameters
|
161
|
+
# id:: (Integer) -- Form id.
|
162
|
+
#
|
163
|
+
# ==== Example
|
164
|
+
# @data = @mints_user.delete_form(9)
|
165
|
+
def delete_form(id)
|
166
|
+
return @client.raw("delete", "/content/forms/#{id}")
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
module MessageTemplates
|
2
|
+
##
|
3
|
+
# == Message Template
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get variables of content page from message template.
|
7
|
+
# Get variables used in a specified content page located in message templates.
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# id:: (Integer) -- Content page id.
|
11
|
+
#
|
12
|
+
# ==== Example
|
13
|
+
# @data = @mints_user.get_variables_of_content_page_from_message_templates(2)
|
14
|
+
def get_variables_of_content_page_from_message_templates(id)
|
15
|
+
return @client.raw("get", "/content/message-templates/content-pages/#{id}/variables")
|
16
|
+
end
|
17
|
+
|
18
|
+
# === Get recipient variables.
|
19
|
+
# Get recipient variables in message templates.
|
20
|
+
#
|
21
|
+
# ==== Example
|
22
|
+
# @data = @mints_user.get_recipient_variables
|
23
|
+
def get_recipient_variables
|
24
|
+
return @client.raw("get", "/content/message-templates/recipient-variables")
|
25
|
+
end
|
26
|
+
|
27
|
+
# === Get driver templates.
|
28
|
+
# Get driver templates in message templates.
|
29
|
+
#
|
30
|
+
# ==== Example
|
31
|
+
# @data = @mints_user.get_driver_templates
|
32
|
+
def get_driver_templates
|
33
|
+
return @client.raw("get", "/content/email-templates/driver/templates")
|
34
|
+
end
|
35
|
+
|
36
|
+
# === Preview message template.
|
37
|
+
# Preview an message template based in data.
|
38
|
+
#
|
39
|
+
# ==== Parameters
|
40
|
+
# data:: (Hash) -- Data to be submited.
|
41
|
+
#
|
42
|
+
# ==== Example
|
43
|
+
# variables = {
|
44
|
+
# "variable_1": 1,
|
45
|
+
# "variable_2": "City"
|
46
|
+
# }
|
47
|
+
# data = {
|
48
|
+
# "body": "Message Template {{ variable_2 }}",
|
49
|
+
# "variables": variables.to_json
|
50
|
+
# }
|
51
|
+
# @data = @mints_user.preview_message_template(data)
|
52
|
+
def preview_message_template(data)
|
53
|
+
return @client.raw("post", "/content/message-templates/preview", nil, data_transform(data))
|
54
|
+
end
|
55
|
+
|
56
|
+
# === Send Message Template.
|
57
|
+
# Send an message template to different contacts.
|
58
|
+
#
|
59
|
+
# ==== Parameters
|
60
|
+
# data:: (Hash) -- Data to be submited.
|
61
|
+
#
|
62
|
+
# ==== Example
|
63
|
+
# data = {
|
64
|
+
# "contacts": [
|
65
|
+
# { "id": 10 }
|
66
|
+
# ],
|
67
|
+
# "emailTemplateId": 1,
|
68
|
+
# "resend": false
|
69
|
+
# }
|
70
|
+
# @data = @mints_user.send_message_template(data)
|
71
|
+
def send_message_template(data)
|
72
|
+
return @client.raw("post", "/content/message-templates/send", nil, data_transform(data))
|
73
|
+
end
|
74
|
+
|
75
|
+
# === Duplicate Message Template.
|
76
|
+
# Duplicate an message template.
|
77
|
+
#
|
78
|
+
# ==== Parameters
|
79
|
+
# id:: (Integer) -- Message template id.
|
80
|
+
# data:: (Hash) -- Data to be submited.
|
81
|
+
#
|
82
|
+
def duplicate_message_template(id, data) #FIXME: Error in duplicating
|
83
|
+
return @client.raw("post", "/content/message-templates/#{id}/duplicate", nil, data_transform(data))
|
84
|
+
end
|
85
|
+
|
86
|
+
# === Get message templates.
|
87
|
+
# Get a collection of message templates.
|
88
|
+
#
|
89
|
+
# ==== Parameters
|
90
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
91
|
+
#
|
92
|
+
# ==== First Example
|
93
|
+
# @data = @mints_user.get_message_templates
|
94
|
+
#
|
95
|
+
# ==== Second Example
|
96
|
+
# options = { "fields": "id" }
|
97
|
+
# @data = @mints_user.get_message_templates(options)
|
98
|
+
def get_message_templates(options = nil)
|
99
|
+
return @client.raw("get", "/content/message-templates", options)
|
100
|
+
end
|
101
|
+
|
102
|
+
# === Get message template.
|
103
|
+
# Get an message template info.
|
104
|
+
#
|
105
|
+
# ==== Parameters
|
106
|
+
# id:: (Integer) -- Message template id.
|
107
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
108
|
+
#
|
109
|
+
# ==== First Example
|
110
|
+
# @data = @mints_user.get_message_template(1)
|
111
|
+
#
|
112
|
+
# ==== Second Example
|
113
|
+
# options = { "fields": "id" }
|
114
|
+
# @data = @mints_user.get_message_template(1, options)
|
115
|
+
def get_message_template(id, options = nil)
|
116
|
+
return @client.raw("get", "/content/message-templates/#{id}", options)
|
117
|
+
end
|
118
|
+
|
119
|
+
# === Create message template.
|
120
|
+
# Create an message template with data.
|
121
|
+
#
|
122
|
+
# ==== Parameters
|
123
|
+
# data:: (Hash) -- Data to be submited.
|
124
|
+
#
|
125
|
+
# ==== Example
|
126
|
+
# data = {
|
127
|
+
# "title": "New Message Template",
|
128
|
+
# "slug": "new-message-template"
|
129
|
+
# }
|
130
|
+
# @data = @mints_user.create_message_template(data)
|
131
|
+
def create_message_template(data)
|
132
|
+
return @client.raw("post", "/content/message-templates", nil, data_transform(data))
|
133
|
+
end
|
134
|
+
|
135
|
+
# === Update message template.
|
136
|
+
# Update an message template info.
|
137
|
+
#
|
138
|
+
# ==== Parameters
|
139
|
+
# id:: (Integer) -- Message template id.
|
140
|
+
# data:: (Hash) -- Data to be submited.
|
141
|
+
#
|
142
|
+
# ==== Example
|
143
|
+
# data = {
|
144
|
+
# "title": "New Message Template Modified"
|
145
|
+
# }
|
146
|
+
# @data = @mints_user.update_message_template(5, data)
|
147
|
+
def update_message_template(id, data)
|
148
|
+
return @client.raw("put", "/content/message-templates/#{id}", nil, data_transform(data))
|
149
|
+
end
|
150
|
+
|
151
|
+
# === Delete message template.
|
152
|
+
# Delete an message template.
|
153
|
+
#
|
154
|
+
# ==== Parameters
|
155
|
+
# id:: (Integer) -- Message template id.
|
156
|
+
#
|
157
|
+
# ==== Example
|
158
|
+
# @data = @mints_user.delete_message_template(2)
|
159
|
+
def delete_message_template(id)
|
160
|
+
return @client.raw("delete", "/content/message-templates/#{id}")
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
module Messages
|
2
|
+
##
|
3
|
+
# == Messages
|
4
|
+
#
|
5
|
+
|
6
|
+
###
|
7
|
+
# === Get messages.
|
8
|
+
# Get a collection of messages.
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
12
|
+
#
|
13
|
+
# ==== First Example
|
14
|
+
# @data = @mints_user.get_messages
|
15
|
+
#
|
16
|
+
# ==== Second Example
|
17
|
+
# options = { "fields": "value" }
|
18
|
+
# @data = @mints_user.get_messages(options)
|
19
|
+
def get_messages(options = nil)
|
20
|
+
return @client.raw("get", "/content/messages", options)
|
21
|
+
end
|
22
|
+
|
23
|
+
# === Get message.
|
24
|
+
# Get a message info.
|
25
|
+
#
|
26
|
+
# ==== Parameters
|
27
|
+
# id:: (Integer) -- Message id.
|
28
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
29
|
+
#
|
30
|
+
# ==== First Example
|
31
|
+
# @data = @mints_user.get_message(1)
|
32
|
+
#
|
33
|
+
# ==== Second Example
|
34
|
+
# options = { "fields": "value" }
|
35
|
+
# @data = @mints_user.get_message(1, options)
|
36
|
+
def get_message(id, options = nil)
|
37
|
+
return @client.raw("get", "/content/messages/#{id}", options)
|
38
|
+
end
|
39
|
+
|
40
|
+
# === Create message.
|
41
|
+
# Create a message with data.
|
42
|
+
#
|
43
|
+
# ==== Parameters
|
44
|
+
# data:: (Hash) -- Data to be submited.
|
45
|
+
#
|
46
|
+
# ==== Example
|
47
|
+
# data = {
|
48
|
+
# "type": "text",
|
49
|
+
# "conversation_id": 1,
|
50
|
+
# "sender_type": "User",
|
51
|
+
# "sender_id": 1,
|
52
|
+
# "value": {
|
53
|
+
# "text": "Hello"
|
54
|
+
# }
|
55
|
+
# }
|
56
|
+
# @data = @mints_user.create_message(data)
|
57
|
+
def create_message(data)
|
58
|
+
return @client.raw("post", "/content/messages", nil, data_transform(data))
|
59
|
+
end
|
60
|
+
|
61
|
+
# === Update message.
|
62
|
+
# Update a message info.
|
63
|
+
#
|
64
|
+
# ==== Parameters
|
65
|
+
# id:: (Integer) -- Message id.
|
66
|
+
# data:: (Hash) -- Data to be submited.
|
67
|
+
#
|
68
|
+
# ==== Example
|
69
|
+
# data = {
|
70
|
+
# "value": {
|
71
|
+
# "text": "Hello World!"
|
72
|
+
# }
|
73
|
+
# }
|
74
|
+
# @data = @mints_user.update_message(102, data)
|
75
|
+
def update_message(id, data)
|
76
|
+
return @client.raw("put", "/content/messages/#{id}", nil, data_transform(data))
|
77
|
+
end
|
78
|
+
|
79
|
+
# === Delete message.
|
80
|
+
# Delete a message.
|
81
|
+
#
|
82
|
+
# ==== Parameters
|
83
|
+
# id:: (Integer) -- Message id.
|
84
|
+
#
|
85
|
+
# ==== Example
|
86
|
+
# @data = @mints_user.delete_message(101)
|
87
|
+
def delete_message(id)
|
88
|
+
return @client.raw("delete", "/content/messages/#{id}")
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
module Pages
|
2
|
+
##
|
3
|
+
# == Content Pages
|
4
|
+
#
|
5
|
+
|
6
|
+
###
|
7
|
+
# === Get page groups.
|
8
|
+
# Get content page groups.
|
9
|
+
#
|
10
|
+
# ==== Example
|
11
|
+
# @data = @mints_user.get_page_groups
|
12
|
+
def get_page_groups
|
13
|
+
return @client.raw("get", "/content/pages/groups")
|
14
|
+
end
|
15
|
+
|
16
|
+
# === Get pages.
|
17
|
+
# Get a collection of content pages.
|
18
|
+
#
|
19
|
+
# ==== Example
|
20
|
+
# @data = @mints_user.get_pages
|
21
|
+
def get_pages
|
22
|
+
return @client.raw("get", "/content/pages")
|
23
|
+
end
|
24
|
+
|
25
|
+
# === Get page.
|
26
|
+
# Get a content page.
|
27
|
+
#
|
28
|
+
# ==== Parameters
|
29
|
+
# id:: (Integer) -- Page id.
|
30
|
+
#
|
31
|
+
# ==== Example
|
32
|
+
# @data = @mints_user.get_page(1)
|
33
|
+
def get_page(id)
|
34
|
+
return @client.raw("get", "/content/pages/#{id}")
|
35
|
+
end
|
36
|
+
|
37
|
+
# === Create page.
|
38
|
+
# Create a content page with data.
|
39
|
+
#
|
40
|
+
# ==== Parameters
|
41
|
+
# data:: (Hash) -- Data to be submited.
|
42
|
+
#
|
43
|
+
# ==== Example
|
44
|
+
# data = {
|
45
|
+
# "title": "New Page",
|
46
|
+
# "slug": "new-page-slug",
|
47
|
+
# "description": "New page description"
|
48
|
+
# }
|
49
|
+
# @data = @mints_user.create_page(data)
|
50
|
+
def create_page(data)
|
51
|
+
return @client.raw("post", "/content/pages", nil, data_transform(data))
|
52
|
+
end
|
53
|
+
|
54
|
+
# === Update page.
|
55
|
+
# Update a content page info.
|
56
|
+
#
|
57
|
+
# ==== Parameters
|
58
|
+
# id:: (Integer) -- Page id.
|
59
|
+
# data:: (Hash) -- Data to be submited.
|
60
|
+
#
|
61
|
+
# ==== Example
|
62
|
+
# data = {
|
63
|
+
# "title": "New Page Modified"
|
64
|
+
# }
|
65
|
+
# @data = @mints_user.update_page(5, data.to_json)
|
66
|
+
def update_page(id, data)
|
67
|
+
return @client.raw("put", "/content/pages/#{id}", nil, data)
|
68
|
+
end
|
69
|
+
|
70
|
+
# === Delete page.
|
71
|
+
# Delete a content page.
|
72
|
+
#
|
73
|
+
# ==== Parameters
|
74
|
+
# id:: (Integer) -- Page id.
|
75
|
+
#
|
76
|
+
# ==== Example
|
77
|
+
# @mints_user.@mints_user.delete_page(3)
|
78
|
+
def delete_page(id)
|
79
|
+
return @client.raw("delete", "/content/pages/#{id}")
|
80
|
+
end
|
81
|
+
end
|