mints 0.0.24 → 0.0.25
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/contact.rb +35 -31
- data/lib/mints_helper.rb +2 -2
- data/lib/pub.rb +82 -44
- data/lib/user/config/api_keys.rb +1 -1
- data/lib/user/config/appointments.rb +10 -10
- data/lib/user/config/attribute_groups.rb +2 -2
- data/lib/user/config/attributes.rb +2 -2
- data/lib/user/config/calendars.rb +2 -2
- data/lib/user/config/importers.rb +5 -5
- data/lib/user/config/public_folders.rb +5 -5
- data/lib/user/config/relationships.rb +7 -7
- data/lib/user/config/roles.rb +3 -3
- data/lib/user/config/seeds.rb +42 -2
- data/lib/user/config/system_settings.rb +1 -1
- data/lib/user/config/tags.rb +2 -2
- data/lib/user/config/taxonomies.rb +7 -7
- data/lib/user/config/teams.rb +2 -2
- data/lib/user/config/users.rb +2 -2
- data/lib/user/contacts/contacts.rb +1 -1
- data/lib/user/content/assets.rb +97 -58
- data/lib/user/content/content.rb +8 -6
- data/lib/user/content/content_instances.rb +5 -5
- data/lib/user/content/content_templates.rb +2 -2
- data/lib/user/content/conversations.rb +43 -11
- data/lib/user/content/dam.rb +3 -3
- data/lib/user/content/forms.rb +70 -4
- data/lib/user/content/message_templates.rb +5 -5
- data/lib/user/content/messages.rb +2 -2
- data/lib/user/content/pages.rb +13 -4
- data/lib/user/content/stories.rb +9 -66
- data/lib/user/content/story_templates.rb +2 -2
- data/lib/user/content/story_versions.rb +124 -0
- data/lib/user/crm/companies.rb +7 -7
- data/lib/user/crm/contacts.rb +11 -11
- data/lib/user/crm/deals.rb +6 -6
- data/lib/user/crm/segments.rb +3 -3
- data/lib/user/crm/workflow_step_objects.rb +2 -2
- data/lib/user/crm/workflow_steps.rb +2 -2
- data/lib/user/crm/workflows.rb +2 -2
- data/lib/user/ecommerce/item_prices.rb +2 -2
- data/lib/user/ecommerce/locations.rb +15 -12
- data/lib/user/ecommerce/order_items_groups.rb +2 -2
- data/lib/user/ecommerce/orders.rb +10 -10
- data/lib/user/ecommerce/price_lists.rb +2 -2
- data/lib/user/ecommerce/product_templates.rb +2 -2
- data/lib/user/ecommerce/product_variations.rb +4 -4
- data/lib/user/ecommerce/products.rb +9 -9
- data/lib/user/ecommerce/skus.rb +2 -2
- data/lib/user/ecommerce/taxes.rb +2 -2
- data/lib/user/ecommerce/variant_options.rb +2 -2
- data/lib/user/ecommerce/variant_values.rb +2 -2
- data/lib/user/helpers/helpers.rb +1 -1
- data/lib/user/helpers/object_activities.rb +2 -2
- data/lib/user/helpers/object_folders.rb +2 -2
- data/lib/user/helpers/user_folders.rb +2 -2
- data/lib/user/marketing/marketing.rb +3 -3
- data/lib/user/profile/profile.rb +5 -5
- metadata +20 -19
@@ -41,15 +41,15 @@ module Conversations
|
|
41
41
|
# Create a conversation with data.
|
42
42
|
#
|
43
43
|
# ==== Parameters
|
44
|
-
# data:: (Hash) -- Data to be
|
44
|
+
# data:: (Hash) -- Data to be submitted.
|
45
45
|
#
|
46
46
|
# ==== Example
|
47
47
|
# data = {
|
48
48
|
# "title": "New Conversation"
|
49
49
|
# }
|
50
50
|
# @data = @mints_user.create_conversation(data)
|
51
|
-
def create_conversation(data)
|
52
|
-
return @client.raw("post", "/content/conversations",
|
51
|
+
def create_conversation(data, options = nil)
|
52
|
+
return @client.raw("post", "/content/conversations", options, data_transform(data))
|
53
53
|
end
|
54
54
|
|
55
55
|
# === Update conversation.
|
@@ -57,15 +57,15 @@ module Conversations
|
|
57
57
|
#
|
58
58
|
# ==== Parameters
|
59
59
|
# id:: (Integer) -- Conversation id.
|
60
|
-
# data:: (Hash) -- Data to be
|
60
|
+
# data:: (Hash) -- Data to be submitted.
|
61
61
|
#
|
62
62
|
# ==== Example
|
63
63
|
# data = {
|
64
64
|
# "title": "New Conversation Modified"
|
65
65
|
# }
|
66
66
|
# @data = @mints_user.update_conversation(13, data)
|
67
|
-
def update_conversation(id, data)
|
68
|
-
return @client.raw("put", "/content/conversations/#{id}",
|
67
|
+
def update_conversation(id, data, options = nil)
|
68
|
+
return @client.raw("put", "/content/conversations/#{id}", options, data_transform(data))
|
69
69
|
end
|
70
70
|
|
71
71
|
# === Delete conversation.
|
@@ -85,7 +85,7 @@ module Conversations
|
|
85
85
|
#
|
86
86
|
# ==== Parameters
|
87
87
|
# id:: (Integer) -- Conversation id.
|
88
|
-
# data:: (Hash) -- Data to be
|
88
|
+
# data:: (Hash) -- Data to be submitted.
|
89
89
|
#
|
90
90
|
# ==== Example
|
91
91
|
# data = {
|
@@ -113,7 +113,7 @@ module Conversations
|
|
113
113
|
#
|
114
114
|
# ==== Parameters
|
115
115
|
# id:: (Integer) -- Conversation id.
|
116
|
-
# data:: (Hash) -- Data to be
|
116
|
+
# data:: (Hash) -- Data to be submitted.
|
117
117
|
#
|
118
118
|
# ==== Example
|
119
119
|
# data = {
|
@@ -129,7 +129,7 @@ module Conversations
|
|
129
129
|
#
|
130
130
|
# ==== Parameters
|
131
131
|
# id:: (Integer) -- Conversation id.
|
132
|
-
# data:: (Hash) -- Data to be
|
132
|
+
# data:: (Hash) -- Data to be submitted.
|
133
133
|
#
|
134
134
|
# ==== Example
|
135
135
|
# data = {
|
@@ -145,7 +145,7 @@ module Conversations
|
|
145
145
|
#
|
146
146
|
# ==== Parameters
|
147
147
|
# id:: (Integer) -- Conversation id.
|
148
|
-
# data:: (Hash) -- Data to be
|
148
|
+
# data:: (Hash) -- Data to be submitted.
|
149
149
|
#
|
150
150
|
# ==== Example
|
151
151
|
# data = {
|
@@ -161,7 +161,7 @@ module Conversations
|
|
161
161
|
#
|
162
162
|
# ==== Parameters
|
163
163
|
# id:: (Integer) -- Contact id.
|
164
|
-
# data:: (Hash) -- Data to be
|
164
|
+
# data:: (Hash) -- Data to be submitted.
|
165
165
|
#
|
166
166
|
# ==== Example
|
167
167
|
# data = {
|
@@ -171,4 +171,36 @@ module Conversations
|
|
171
171
|
def detach_contact_in_conversation(id, data)
|
172
172
|
return @client.raw("post", "/content/conversations/#{id}/detach-contact", nil, data_transform(data))
|
173
173
|
end
|
174
|
+
|
175
|
+
# === Attach form in conversation.
|
176
|
+
# Attach a form in a conversation.
|
177
|
+
#
|
178
|
+
# ==== Parameters
|
179
|
+
# id:: (Integer) -- Conversation id.
|
180
|
+
# data:: (Hash) -- Data to be submitted.
|
181
|
+
#
|
182
|
+
# ==== Example
|
183
|
+
# data = {
|
184
|
+
# "form_id": 2
|
185
|
+
# }
|
186
|
+
# @data = @mints_user.attach_form_in_conversation(1, data)
|
187
|
+
def attach_form_in_conversation(id, data)
|
188
|
+
return @client.raw("post", "/content/conversations/#{id}/attach-form", nil, data_transform(data))
|
189
|
+
end
|
190
|
+
|
191
|
+
# === Detach form in conversation.
|
192
|
+
# Detach a form in a conversation.
|
193
|
+
#
|
194
|
+
# ==== Parameters
|
195
|
+
# id:: (Integer) -- Contact id.
|
196
|
+
# data:: (Hash) -- Data to be submitted.
|
197
|
+
#
|
198
|
+
# ==== Example
|
199
|
+
# data = {
|
200
|
+
# "form_id": 2
|
201
|
+
# }
|
202
|
+
# @data = @mints_user.detach_form_in_conversation(1, data)
|
203
|
+
def detach_form_in_conversation(id, data)
|
204
|
+
return @client.raw("post", "/content/conversations/#{id}/detach-form", nil, data_transform(data))
|
205
|
+
end
|
174
206
|
end
|
data/lib/user/content/dam.rb
CHANGED
@@ -32,7 +32,7 @@ module DAM
|
|
32
32
|
# Rename folder or asset in dam.
|
33
33
|
#
|
34
34
|
# ==== Parameters
|
35
|
-
# data:: (Hash) -- Data to be
|
35
|
+
# data:: (Hash) -- Data to be submitted.
|
36
36
|
#
|
37
37
|
# ==== Example
|
38
38
|
# data = {
|
@@ -51,7 +51,7 @@ module DAM
|
|
51
51
|
# Search folder or asset in dam.
|
52
52
|
#
|
53
53
|
# ==== Parameters
|
54
|
-
# data:: (Hash) -- Data to be
|
54
|
+
# data:: (Hash) -- Data to be submitted.
|
55
55
|
#
|
56
56
|
# ==== Example
|
57
57
|
# data = {
|
@@ -74,7 +74,7 @@ module DAM
|
|
74
74
|
# Create a folder in dam.
|
75
75
|
#
|
76
76
|
# ==== Parameters
|
77
|
-
# data:: (Hash) -- Data to be
|
77
|
+
# data:: (Hash) -- Data to be submitted.
|
78
78
|
#
|
79
79
|
# ==== Example
|
80
80
|
# data = {
|
data/lib/user/content/forms.rb
CHANGED
@@ -24,7 +24,7 @@ module Forms
|
|
24
24
|
#
|
25
25
|
# ==== Parameters
|
26
26
|
# id:: (Integer) -- Form id.
|
27
|
-
# data:: (Hash) -- Data to be
|
27
|
+
# data:: (Hash) -- Data to be submitted.
|
28
28
|
#
|
29
29
|
# ==== Example
|
30
30
|
# data = {
|
@@ -42,7 +42,7 @@ module Forms
|
|
42
42
|
#
|
43
43
|
# ==== Parameters
|
44
44
|
# id:: (Integer) -- Form id.
|
45
|
-
# data:: (Hash) -- Data to be
|
45
|
+
# data:: (Hash) -- Data to be submitted.
|
46
46
|
#
|
47
47
|
# ==== Example
|
48
48
|
# data = {
|
@@ -79,6 +79,18 @@ module Forms
|
|
79
79
|
return @client.raw("post", "/content/forms/#{id}/duplicate")
|
80
80
|
end
|
81
81
|
|
82
|
+
# === Get activation words form.
|
83
|
+
# Get activation words a form.
|
84
|
+
#
|
85
|
+
# ==== Parameters
|
86
|
+
# id:: (Integer) -- Form id.
|
87
|
+
#
|
88
|
+
# ==== Example
|
89
|
+
# @data = @mints_user.get_form_activation_words(3)
|
90
|
+
def get_form_activation_words(id)
|
91
|
+
return @client.raw("post", "/content/forms/#{id}/activation-words")
|
92
|
+
end
|
93
|
+
|
82
94
|
# === Get form support data.
|
83
95
|
# Get form support data.
|
84
96
|
#
|
@@ -104,6 +116,34 @@ module Forms
|
|
104
116
|
return @client.raw("get", "/content/forms/submissions", options)
|
105
117
|
end
|
106
118
|
|
119
|
+
# === Get form submission.
|
120
|
+
# Get form submission.
|
121
|
+
#
|
122
|
+
# ==== Parameters
|
123
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
124
|
+
#
|
125
|
+
# ==== First Example
|
126
|
+
# @data = @mints_user.get_form_submissions
|
127
|
+
#
|
128
|
+
# ==== Second Example
|
129
|
+
# options = { "fields": "id" }
|
130
|
+
# @data = @mints_user.get_form_submissions(options)
|
131
|
+
def get_form_submission(id, options)
|
132
|
+
return @client.raw("get", "/content/forms/submissions/#{id}", options)
|
133
|
+
end
|
134
|
+
|
135
|
+
# === Delete form submission.
|
136
|
+
# Delete a form submission.
|
137
|
+
#
|
138
|
+
# ==== Parameters
|
139
|
+
# id:: (Integer) -- Form submission id.
|
140
|
+
#
|
141
|
+
# ==== Example
|
142
|
+
# @data = @mints_user.delete_form_submission(1)
|
143
|
+
def delete_form_submission(id)
|
144
|
+
return @client.raw("delete", "/content/forms/submissions/#{id}")
|
145
|
+
end
|
146
|
+
|
107
147
|
# === Get form.
|
108
148
|
# Get a form info.
|
109
149
|
#
|
@@ -125,7 +165,7 @@ module Forms
|
|
125
165
|
# Create a form with data.
|
126
166
|
#
|
127
167
|
# ==== Parameters
|
128
|
-
# data:: (Hash) -- Data to be
|
168
|
+
# data:: (Hash) -- Data to be submitted.
|
129
169
|
#
|
130
170
|
# ==== Example
|
131
171
|
# data = {
|
@@ -142,7 +182,7 @@ module Forms
|
|
142
182
|
#
|
143
183
|
# ==== Parameters
|
144
184
|
# id:: (Integer) -- Form id.
|
145
|
-
# data:: (Hash) -- Data to be
|
185
|
+
# data:: (Hash) -- Data to be submitted.
|
146
186
|
#
|
147
187
|
# ==== Example
|
148
188
|
# data = {
|
@@ -165,4 +205,30 @@ module Forms
|
|
165
205
|
def delete_form(id)
|
166
206
|
return @client.raw("delete", "/content/forms/#{id}")
|
167
207
|
end
|
208
|
+
|
209
|
+
# === Get form aggregates.
|
210
|
+
# Get a form aggregates info.
|
211
|
+
#
|
212
|
+
# ==== Parameters
|
213
|
+
# id:: (Integer) -- Form id.
|
214
|
+
# object_id:: (Integer) -- Object id.
|
215
|
+
# ==== First Example
|
216
|
+
# @data = @mints_user.get_form_aggregates(1)
|
217
|
+
def get_form_aggregates(id, object_id)
|
218
|
+
return @client.raw("get", "/content/forms/#{id}/aggregates?object_id=#{object_id}", options)
|
219
|
+
end
|
220
|
+
|
221
|
+
# === Reset aggregates.
|
222
|
+
#
|
223
|
+
# ==== Parameters
|
224
|
+
# data:: (Hash) -- Data to be submitted.
|
225
|
+
#
|
226
|
+
# ==== Example
|
227
|
+
# data = {
|
228
|
+
# "object_id": 1
|
229
|
+
# }
|
230
|
+
# @data = @mints_user.reset_form_aggregates(data)
|
231
|
+
def reset_form_aggregates(data)
|
232
|
+
return @client.raw("post", "/content/forms/#{id}/aggregates", nil, data_transform(data))
|
233
|
+
end
|
168
234
|
end
|
@@ -37,7 +37,7 @@ module MessageTemplates
|
|
37
37
|
# Preview an message template based in data.
|
38
38
|
#
|
39
39
|
# ==== Parameters
|
40
|
-
# data:: (Hash) -- Data to be
|
40
|
+
# data:: (Hash) -- Data to be submitted.
|
41
41
|
#
|
42
42
|
# ==== Example
|
43
43
|
# variables = {
|
@@ -57,7 +57,7 @@ module MessageTemplates
|
|
57
57
|
# Send an message template to different contacts.
|
58
58
|
#
|
59
59
|
# ==== Parameters
|
60
|
-
# data:: (Hash) -- Data to be
|
60
|
+
# data:: (Hash) -- Data to be submitted.
|
61
61
|
#
|
62
62
|
# ==== Example
|
63
63
|
# data = {
|
@@ -77,7 +77,7 @@ module MessageTemplates
|
|
77
77
|
#
|
78
78
|
# ==== Parameters
|
79
79
|
# id:: (Integer) -- Message template id.
|
80
|
-
# data:: (Hash) -- Data to be
|
80
|
+
# data:: (Hash) -- Data to be submitted.
|
81
81
|
#
|
82
82
|
def duplicate_message_template(id, data) #FIXME: Error in duplicating
|
83
83
|
return @client.raw("post", "/content/message-templates/#{id}/duplicate", nil, data_transform(data))
|
@@ -120,7 +120,7 @@ module MessageTemplates
|
|
120
120
|
# Create an message template with data.
|
121
121
|
#
|
122
122
|
# ==== Parameters
|
123
|
-
# data:: (Hash) -- Data to be
|
123
|
+
# data:: (Hash) -- Data to be submitted.
|
124
124
|
#
|
125
125
|
# ==== Example
|
126
126
|
# data = {
|
@@ -137,7 +137,7 @@ module MessageTemplates
|
|
137
137
|
#
|
138
138
|
# ==== Parameters
|
139
139
|
# id:: (Integer) -- Message template id.
|
140
|
-
# data:: (Hash) -- Data to be
|
140
|
+
# data:: (Hash) -- Data to be submitted.
|
141
141
|
#
|
142
142
|
# ==== Example
|
143
143
|
# data = {
|
@@ -41,7 +41,7 @@ module Messages
|
|
41
41
|
# Create a message with data.
|
42
42
|
#
|
43
43
|
# ==== Parameters
|
44
|
-
# data:: (Hash) -- Data to be
|
44
|
+
# data:: (Hash) -- Data to be submitted.
|
45
45
|
#
|
46
46
|
# ==== Example
|
47
47
|
# data = {
|
@@ -63,7 +63,7 @@ module Messages
|
|
63
63
|
#
|
64
64
|
# ==== Parameters
|
65
65
|
# id:: (Integer) -- Message id.
|
66
|
-
# data:: (Hash) -- Data to be
|
66
|
+
# data:: (Hash) -- Data to be submitted.
|
67
67
|
#
|
68
68
|
# ==== Example
|
69
69
|
# data = {
|
data/lib/user/content/pages.rb
CHANGED
@@ -18,8 +18,17 @@ module Pages
|
|
18
18
|
#
|
19
19
|
# ==== Example
|
20
20
|
# @data = @mints_user.get_pages
|
21
|
-
def get_pages
|
22
|
-
return @client.raw("get", "/content/pages")
|
21
|
+
def get_pages(options = nil)
|
22
|
+
return @client.raw("get", "/content/pages", options)
|
23
|
+
end
|
24
|
+
|
25
|
+
# === Get bundles.
|
26
|
+
# Get a collection of content pages.
|
27
|
+
#
|
28
|
+
# ==== Example
|
29
|
+
# @data = @mints_user.get_pages
|
30
|
+
def get_bundles(options = nil)
|
31
|
+
return @client.raw("get", "/content/pages", options)
|
23
32
|
end
|
24
33
|
|
25
34
|
# === Get page.
|
@@ -38,7 +47,7 @@ module Pages
|
|
38
47
|
# Create a content page with data.
|
39
48
|
#
|
40
49
|
# ==== Parameters
|
41
|
-
# data:: (Hash) -- Data to be
|
50
|
+
# data:: (Hash) -- Data to be submitted.
|
42
51
|
#
|
43
52
|
# ==== Example
|
44
53
|
# data = {
|
@@ -56,7 +65,7 @@ module Pages
|
|
56
65
|
#
|
57
66
|
# ==== Parameters
|
58
67
|
# id:: (Integer) -- Page id.
|
59
|
-
# data:: (Hash) -- Data to be
|
68
|
+
# data:: (Hash) -- Data to be submitted.
|
60
69
|
#
|
61
70
|
# ==== Example
|
62
71
|
# data = {
|
data/lib/user/content/stories.rb
CHANGED
@@ -1,67 +1,10 @@
|
|
1
1
|
module Stories
|
2
|
-
##
|
3
|
-
# == Story
|
4
|
-
#
|
5
|
-
|
6
|
-
# === Publish story.
|
7
|
-
# Publish a story.
|
8
|
-
#
|
9
|
-
# ==== Parameters
|
10
|
-
# id:: (Integer) -- Story id.
|
11
|
-
# data:: (Hash) -- Data to be submited.
|
12
|
-
#
|
13
|
-
# ==== Example
|
14
|
-
# data = {
|
15
|
-
# "scheduled_at": "2021-09-06T20:29:16+00:00"
|
16
|
-
# }
|
17
|
-
# @data = @mints_user.publish_story(2, data)
|
18
|
-
def publish_story(id, data)
|
19
|
-
return @client.raw("put", "/content/stories/#{id}/publish", nil, data_transform(data))
|
20
|
-
end
|
21
|
-
|
22
|
-
# === Schedule story.
|
23
|
-
# Schedule a story in a specified date.
|
24
|
-
#
|
25
|
-
# ==== Parameters
|
26
|
-
# id:: (Integer) -- Story id.
|
27
|
-
# data:: (Hash) -- Data to be submited.
|
28
|
-
#
|
29
|
-
# ==== Example
|
30
|
-
# data = {
|
31
|
-
# "scheduled_at": "2021-09-06T20:29:16+00:00"
|
32
|
-
# }
|
33
|
-
# @data = @mints_user.schedule_story(1, data)
|
34
|
-
def schedule_story(id, data)
|
35
|
-
return @client.raw("put", "/content/stories/#{id}/schedule", nil, data_transform(data))
|
36
|
-
end
|
37
|
-
|
38
|
-
# === Revert published story.
|
39
|
-
# Revert a published story.
|
40
|
-
#
|
41
|
-
# ==== Parameters
|
42
|
-
# id:: (Integer) -- Story id.
|
43
|
-
#
|
44
|
-
# ==== Example
|
45
|
-
# @data = @mints_user.revert_published_story(1)
|
46
|
-
def revert_published_story(id)
|
47
|
-
return @client.raw("get", "/content/stories/#{id}/revert-published-data")
|
48
|
-
end
|
49
|
-
|
50
|
-
# === Get stories support data.
|
51
|
-
# Get support data used in stories.
|
52
|
-
#
|
53
|
-
# ==== Example
|
54
|
-
# @data = @mints_user.get_stories_support_data
|
55
|
-
def get_stories_support_data
|
56
|
-
return @client.raw("get", "/content/stories/support-data")
|
57
|
-
end
|
58
|
-
|
59
2
|
# === Duplicate story.
|
60
3
|
# Duplicate a story.
|
61
4
|
#
|
62
5
|
# ==== Parameters
|
63
6
|
# id:: (Integer) -- Story id.
|
64
|
-
# data:: (Hash) -- Data to be
|
7
|
+
# data:: (Hash) -- Data to be submitted.
|
65
8
|
#
|
66
9
|
# ==== Example
|
67
10
|
# data = {
|
@@ -84,13 +27,13 @@ module Stories
|
|
84
27
|
#
|
85
28
|
# ==== Second Example
|
86
29
|
# options = {
|
87
|
-
# "fields": "id,
|
30
|
+
# "fields": "id, slug"
|
88
31
|
# }
|
89
32
|
# @data = @mints_user.get_stories(options)
|
90
33
|
#
|
91
34
|
# ==== Third Example
|
92
35
|
# options = {
|
93
|
-
# "fields": "id,
|
36
|
+
# "fields": "id, slug"
|
94
37
|
# }
|
95
38
|
# @data = @mints_user.get_stories(options, true)
|
96
39
|
def get_stories(options = nil, use_post = true)
|
@@ -109,7 +52,7 @@ module Stories
|
|
109
52
|
#
|
110
53
|
# ==== Second Example
|
111
54
|
# options = {
|
112
|
-
# "fields": "id,
|
55
|
+
# "fields": "id, slug"
|
113
56
|
# }
|
114
57
|
# @data = @mints_user.get_story(1, options)
|
115
58
|
def get_story(id, options = nil)
|
@@ -120,13 +63,13 @@ module Stories
|
|
120
63
|
# Create a story with data.
|
121
64
|
#
|
122
65
|
# ==== Parameters
|
123
|
-
# data:: (Hash) -- Data to be
|
66
|
+
# data:: (Hash) -- Data to be submitted.
|
124
67
|
#
|
125
68
|
# ==== Example
|
126
69
|
# data = {
|
127
|
-
# "
|
70
|
+
# "user_id": 1,
|
128
71
|
# "slug": "new-story",
|
129
|
-
# "
|
72
|
+
# "story_template_id": 1
|
130
73
|
# }
|
131
74
|
# @data = @mints_user.create_story(data)
|
132
75
|
def create_story(data)
|
@@ -138,11 +81,11 @@ module Stories
|
|
138
81
|
#
|
139
82
|
# ==== Parameters
|
140
83
|
# id:: (Integer) -- Story id.
|
141
|
-
# data:: (Hash) -- Data to be
|
84
|
+
# data:: (Hash) -- Data to be submitted.
|
142
85
|
#
|
143
86
|
# ==== Example
|
144
87
|
# data = {
|
145
|
-
# "
|
88
|
+
# "user_id": 1,
|
146
89
|
# "slug": "new-story"
|
147
90
|
# }
|
148
91
|
# @data = @mints_user.update_story(5, data)
|
@@ -65,7 +65,7 @@ module StoryTemplates
|
|
65
65
|
# Create a story template with data.
|
66
66
|
#
|
67
67
|
# ==== Parameters
|
68
|
-
# data:: (Hash) -- Data to be
|
68
|
+
# data:: (Hash) -- Data to be submitted.
|
69
69
|
#
|
70
70
|
# ==== Example
|
71
71
|
# data = {
|
@@ -82,7 +82,7 @@ module StoryTemplates
|
|
82
82
|
#
|
83
83
|
# ==== Parameters
|
84
84
|
# id:: (Integer) -- Story template id.
|
85
|
-
# data:: (Hash) -- Data to be
|
85
|
+
# data:: (Hash) -- Data to be submitted.
|
86
86
|
#
|
87
87
|
# ==== Example
|
88
88
|
# data = {
|
@@ -0,0 +1,124 @@
|
|
1
|
+
module StoryVersions
|
2
|
+
# === Get story versions.
|
3
|
+
# Get a collection of story versions.
|
4
|
+
#
|
5
|
+
# ==== Parameters
|
6
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
7
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
8
|
+
#
|
9
|
+
# ==== First Example
|
10
|
+
# @data = @mints_user.get_story_versions
|
11
|
+
#
|
12
|
+
# ==== Second Example
|
13
|
+
# options = {
|
14
|
+
# "fields": "id, title"
|
15
|
+
# }
|
16
|
+
# @data = @mints_user.get_story_versions(options)
|
17
|
+
#
|
18
|
+
# ==== Third Example
|
19
|
+
# options = {
|
20
|
+
# "fields": "id, title"
|
21
|
+
# }
|
22
|
+
# @data = @mints_user.get_story_versions(options, true)
|
23
|
+
def get_story_versions(options = nil, use_post = true)
|
24
|
+
return get_query_results("/content/story-versions", options, use_post)
|
25
|
+
end
|
26
|
+
|
27
|
+
# === Get story version.
|
28
|
+
# Get a story version info.
|
29
|
+
#
|
30
|
+
# ==== Parameters
|
31
|
+
# id:: (Integer) -- Story version id.
|
32
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
33
|
+
#
|
34
|
+
# ==== First Example
|
35
|
+
# @data = @mints_user.get_story_version(1)
|
36
|
+
#
|
37
|
+
# ==== Second Example
|
38
|
+
# options = {
|
39
|
+
# "fields": "id, title"
|
40
|
+
# }
|
41
|
+
# @data = @mints_user.get_story_version(1, options)
|
42
|
+
def get_story_version(id, options = nil)
|
43
|
+
return @client.raw("get", "/content/story-versions/#{id}", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
# === Create story version.
|
47
|
+
# Create a story version with data.
|
48
|
+
#
|
49
|
+
# ==== Parameters
|
50
|
+
# data:: (Hash) -- Data to be submitted.
|
51
|
+
#
|
52
|
+
# ==== Example
|
53
|
+
# data = {
|
54
|
+
# "title": "New Story",
|
55
|
+
# "slug": "new-story",
|
56
|
+
# "social_metadata": "social metadata"
|
57
|
+
# }
|
58
|
+
# @data = @mints_user.create_story_version(data)
|
59
|
+
def create_story_version(data, options = nil)
|
60
|
+
return @client.raw("post", "/content/story-versions", options, data_transform(data))
|
61
|
+
end
|
62
|
+
|
63
|
+
# === Update story version.
|
64
|
+
# Update a story version info.
|
65
|
+
#
|
66
|
+
# ==== Parameters
|
67
|
+
# id:: (Integer) -- Story version id.
|
68
|
+
# data:: (Hash) -- Data to be submitted.
|
69
|
+
#
|
70
|
+
# ==== Example
|
71
|
+
# data = {
|
72
|
+
# "title": "New Story Modified",
|
73
|
+
# "slug": "new-story"
|
74
|
+
# }
|
75
|
+
# @data = @mints_user.update_story_version(5, data)
|
76
|
+
def update_story_version(id, data, options = nil)
|
77
|
+
return @client.raw("put", "/content/story-versions/#{id}", options, data_transform(data))
|
78
|
+
end
|
79
|
+
|
80
|
+
# === Delete story version.
|
81
|
+
# Delete a story version.
|
82
|
+
#
|
83
|
+
# ==== Parameters
|
84
|
+
# id:: (Integer) -- Story version id.
|
85
|
+
#
|
86
|
+
# ==== Example
|
87
|
+
# @data = @mints_user.delete_story_version(6)
|
88
|
+
def delete_story_version(id)
|
89
|
+
return @client.raw("delete", "/content/story-versions/#{id}")
|
90
|
+
end
|
91
|
+
|
92
|
+
# === Duplicate story version.
|
93
|
+
# Duplicate a story version.
|
94
|
+
#
|
95
|
+
# ==== Parameters
|
96
|
+
# id:: (Integer) -- Story version id.
|
97
|
+
# data:: (Hash) -- Data to be submitted.
|
98
|
+
#
|
99
|
+
# ==== Example
|
100
|
+
# data = {
|
101
|
+
# "options": []
|
102
|
+
# }
|
103
|
+
# @data = @mints_user.duplicate_story_version(1, data.to_json)
|
104
|
+
def duplicate_story_version(id, data)
|
105
|
+
return @client.raw("post", "/content/story-versions/#{id}/duplicate", nil, data)
|
106
|
+
end
|
107
|
+
|
108
|
+
# === Publish story version.
|
109
|
+
# Publish a story version.
|
110
|
+
#
|
111
|
+
# ==== Parameters
|
112
|
+
# id:: (Integer) -- Story version id.
|
113
|
+
# data:: (Hash) -- Data to be submitted.
|
114
|
+
#
|
115
|
+
# ==== Example
|
116
|
+
# data = {
|
117
|
+
# "title": "New Story Modified",
|
118
|
+
# "slug": "new-story"
|
119
|
+
# }
|
120
|
+
# @data = @mints_user.publish_story_version(1, data.to_json)
|
121
|
+
def publish_story_version(id, data)
|
122
|
+
return @client.raw("post", "/content/story-versions/#{id}/publish", nil, data)
|
123
|
+
end
|
124
|
+
end
|
data/lib/user/crm/companies.rb
CHANGED
@@ -55,7 +55,7 @@ module Companies
|
|
55
55
|
# Create a company with data.
|
56
56
|
#
|
57
57
|
# ==== Parameters
|
58
|
-
# data:: (Hash) -- Data to be
|
58
|
+
# data:: (Hash) -- Data to be submitted.
|
59
59
|
#
|
60
60
|
# ==== Example
|
61
61
|
# data = {
|
@@ -70,8 +70,8 @@ module Companies
|
|
70
70
|
# "tax_identifier": nil
|
71
71
|
# }
|
72
72
|
# @data = @mints_user.create_company(data)
|
73
|
-
def create_company(data)
|
74
|
-
return @client.raw("post", "/crm/companies/",
|
73
|
+
def create_company(data, options = nil)
|
74
|
+
return @client.raw("post", "/crm/companies/", options, data_transform(data))
|
75
75
|
end
|
76
76
|
|
77
77
|
# === Update company.
|
@@ -79,15 +79,15 @@ module Companies
|
|
79
79
|
#
|
80
80
|
# ==== Parameters
|
81
81
|
# id:: (Integer) -- Company id.
|
82
|
-
# data:: (Hash) -- Data to be
|
82
|
+
# data:: (Hash) -- Data to be submitted.
|
83
83
|
#
|
84
84
|
# ==== Example
|
85
85
|
# data = {
|
86
86
|
# "title": "Company Title Modified"
|
87
87
|
# }
|
88
88
|
# @data = @mints_user.update_company(23, data)
|
89
|
-
def update_company(id, data)
|
90
|
-
return @client.raw("put", "/crm/companies/#{id}",
|
89
|
+
def update_company(id, data, options = nil)
|
90
|
+
return @client.raw("put", "/crm/companies/#{id}", options, data_transform(data))
|
91
91
|
end
|
92
92
|
|
93
93
|
##
|
@@ -98,7 +98,7 @@ module Companies
|
|
98
98
|
# Delete a group of companies.
|
99
99
|
#
|
100
100
|
# ==== Parameters
|
101
|
-
# data:: (Hash) -- Data to be
|
101
|
+
# data:: (Hash) -- Data to be submitted.
|
102
102
|
#
|
103
103
|
# ==== Example
|
104
104
|
# data = {
|