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,312 @@
|
|
1
|
+
module Contacts
|
2
|
+
##
|
3
|
+
# == Contacts
|
4
|
+
#
|
5
|
+
|
6
|
+
##
|
7
|
+
# === Get contacts support data.
|
8
|
+
#
|
9
|
+
# ==== Example
|
10
|
+
# @data = @mints_user.get_contacts_support_data
|
11
|
+
def get_contacts_support_data
|
12
|
+
return @client.raw("get", "/crm/contacts/support-data")
|
13
|
+
end
|
14
|
+
|
15
|
+
##
|
16
|
+
# === Get online activity.
|
17
|
+
# Get online activity of a contact.
|
18
|
+
#
|
19
|
+
# ==== Parameters
|
20
|
+
# id:: (Integer) -- Contact id.
|
21
|
+
#
|
22
|
+
# ==== Example
|
23
|
+
# @data = @mints_user.get_online_activity(5)
|
24
|
+
def get_online_activity(id)
|
25
|
+
return @client.raw("get", "/crm/contacts/#{id}/online-activity")
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# === Get contacts.
|
30
|
+
# Get a collection of contacts.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
34
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
35
|
+
#
|
36
|
+
# ==== First Example
|
37
|
+
# @data = @mints_user.get_contacts
|
38
|
+
#
|
39
|
+
# ==== Second Example
|
40
|
+
# options = {
|
41
|
+
# "sort": "id",
|
42
|
+
# "fields[contacts]": "id, email"
|
43
|
+
# }
|
44
|
+
# @data = @mints_user.get_contacts(options)
|
45
|
+
#
|
46
|
+
# ==== Third Example
|
47
|
+
# options = {
|
48
|
+
# "sort": "id",
|
49
|
+
# "fields[contacts]": "id, email"
|
50
|
+
# }
|
51
|
+
# @data = @mints_user.get_contacts(options, true)
|
52
|
+
def get_contacts(options = nil, use_post = true)
|
53
|
+
return get_query_results("/crm/contacts", options, use_post)
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# === Get contact.
|
58
|
+
# Get a contact data.
|
59
|
+
#
|
60
|
+
# ==== Parameters
|
61
|
+
# id:: (Integer) -- Contact id.
|
62
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
63
|
+
#
|
64
|
+
# ==== First Example
|
65
|
+
# @data = @mints_user.get_contact(5)
|
66
|
+
#
|
67
|
+
# ==== Second Example
|
68
|
+
# options = {
|
69
|
+
# "sort": "id",
|
70
|
+
# "fields[contacts]": "id, email"
|
71
|
+
# }
|
72
|
+
# @data = @mints_user.get_contact(5, options)
|
73
|
+
def get_contact(id, options = nil)
|
74
|
+
return @client.raw("get", "/crm/contacts/#{id}", options)
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# === Create contact.
|
79
|
+
# Create a contact with data.
|
80
|
+
#
|
81
|
+
# ==== Parameters
|
82
|
+
# data:: (Hash) -- Data to be submited.
|
83
|
+
#
|
84
|
+
# ==== Example
|
85
|
+
# data = {
|
86
|
+
# "email": "email@example.com",
|
87
|
+
# "given_name": "Given_Name",
|
88
|
+
# "last_name": "Last_Name",
|
89
|
+
# "password": "123456"
|
90
|
+
# }
|
91
|
+
# @data = @mints_user.create_contact(data)
|
92
|
+
def create_contact(data)
|
93
|
+
return @client.raw("post", "/crm/contacts", nil, data_transform(data))
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# === Update contact.
|
98
|
+
# Update contact data.
|
99
|
+
#
|
100
|
+
# ==== Parameters
|
101
|
+
# id:: (Integer) -- Contact id.
|
102
|
+
# data:: (Hash) -- Data to be submited.
|
103
|
+
#
|
104
|
+
# ==== Example
|
105
|
+
# data = {
|
106
|
+
# "email": "email_modified@example.com",
|
107
|
+
# "company_id": 3
|
108
|
+
# }
|
109
|
+
# @data = @mints_user.update_contact(65, data)
|
110
|
+
def update_contact(id, data)
|
111
|
+
return @client.raw("put", "/crm/contacts/#{id}", nil, data_transform(data))
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# === Get contact deals.
|
116
|
+
# Get a collection of deals of a contact.
|
117
|
+
#
|
118
|
+
# ==== Parameters
|
119
|
+
# contact_id:: (Integer) -- Contact id.
|
120
|
+
#
|
121
|
+
# ==== Example
|
122
|
+
# @data = @mints_user.get_contact_deal(5)
|
123
|
+
def get_contact_deal(contact_id)
|
124
|
+
return @client.raw("get", "/crm/contacts/#{contact_id}/deals")
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# === Create contact deal.
|
129
|
+
# Create a contact deal with data.
|
130
|
+
#
|
131
|
+
# ==== Parameters
|
132
|
+
# contact_id:: (Integer) -- Contact id.
|
133
|
+
# data:: (Hash) -- Data to be submited.
|
134
|
+
#
|
135
|
+
# ==== Example
|
136
|
+
# data = {
|
137
|
+
# "deal_id": 6
|
138
|
+
# }
|
139
|
+
# @data = @mints_user.create_contact_deal(5, data.to_json)
|
140
|
+
def create_contact_deal(contact_id, data)
|
141
|
+
return @client.raw("post", "/crm/contacts/#{contact_id}/deals", nil, data)
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# === Delete contact deal.
|
146
|
+
# Delete a contact deal with data.
|
147
|
+
#
|
148
|
+
# ==== Parameters
|
149
|
+
# contact_id:: (Integer) -- Contact id.
|
150
|
+
# deal_id:: (Integer) -- Deal id.
|
151
|
+
#
|
152
|
+
# ==== Example
|
153
|
+
# @data = @mints_user.delete_contact_deal(5, 100)
|
154
|
+
def delete_contact_deal(contact_id, deal_id)
|
155
|
+
return @client.raw("delete", "/crm/contacts/#{contact_id}/deals/#{deal_id}")
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# === Get contact user.
|
160
|
+
# Get user data of a contact.
|
161
|
+
#
|
162
|
+
# ==== Parameters
|
163
|
+
# contact_id:: (Integer) -- Contact id.
|
164
|
+
#TODO: Replace Resource collection options url
|
165
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
166
|
+
#
|
167
|
+
# ==== Example
|
168
|
+
# @data = @mints_user.get_contact_user(66)
|
169
|
+
def get_contact_user(contact_id)
|
170
|
+
return @client.raw("get", "/crm/contacts/#{contact_id}/users")
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# === Create contact user.
|
175
|
+
# Relate a contact with an user.
|
176
|
+
#
|
177
|
+
# ==== Parameters
|
178
|
+
# contact_id:: (Integer) -- Contact id.
|
179
|
+
# data:: (Hash) -- Data to be submited.
|
180
|
+
#
|
181
|
+
# ==== Example
|
182
|
+
# data = {
|
183
|
+
# "user_id": 9
|
184
|
+
# }
|
185
|
+
# @data = @mints_user.create_contact_user(66, data.to_json)
|
186
|
+
def create_contact_user(contact_id, data)
|
187
|
+
return @client.raw("post", "/crm/contacts/#{contact_id}/users", nil, data)
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# === Delete contact user.
|
192
|
+
# Delete a relationship between a contact and an user.
|
193
|
+
#
|
194
|
+
# ==== Parameters
|
195
|
+
# contact_id:: (Integer) -- Contact id.
|
196
|
+
# id:: (Integer) -- User id.
|
197
|
+
#
|
198
|
+
# ==== Example
|
199
|
+
# @data = @mints_user.delete_contact_user(153, 9)
|
200
|
+
def delete_contact_user(contact_id, id)
|
201
|
+
return @client.raw("delete", "/crm/contacts/#{contact_id}/users/#{id}")
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# === Get contact segments.
|
206
|
+
# Get segments of a contact.
|
207
|
+
#
|
208
|
+
# ==== Parameters
|
209
|
+
# contact_id:: (Integer) -- Contact id.
|
210
|
+
#
|
211
|
+
# ==== Example
|
212
|
+
# @data = @mints_user.get_contact_segments(1)
|
213
|
+
def get_contact_segments(contact_id)
|
214
|
+
return @client.raw("get", "/crm/contacts/#{contact_id}/segments")
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# === Get contact submissions.
|
219
|
+
# Get submissions of a contact.
|
220
|
+
#
|
221
|
+
# ==== Parameters
|
222
|
+
# contact_id:: (Integer) -- Contact id.
|
223
|
+
#
|
224
|
+
# ==== Example
|
225
|
+
# @data = @mints_user.get_contact_submissions(146)
|
226
|
+
def get_contact_submissions(contact_id)
|
227
|
+
return @client.raw("get", "/crm/contacts/#{contact_id}/submissions")
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# === Get contact tags.
|
232
|
+
# Get tags of a contact.
|
233
|
+
#
|
234
|
+
# ==== Parameters
|
235
|
+
# contact_id:: (Integer) -- Contact id.
|
236
|
+
#
|
237
|
+
# ==== Example
|
238
|
+
# @data = @mints_user.get_contact_tags(1)
|
239
|
+
def get_contact_tags(contact_id)
|
240
|
+
return @client.raw("get", "/crm/contacts/#{contact_id}/tags")
|
241
|
+
end
|
242
|
+
|
243
|
+
##
|
244
|
+
# === Get contact magic links.
|
245
|
+
# Get magic links of a contact.
|
246
|
+
#
|
247
|
+
# ==== Parameters
|
248
|
+
# contact_id:: (Integer) -- Contact id.
|
249
|
+
#
|
250
|
+
# ==== Example
|
251
|
+
# @data = @mints_user.get_contact_magic_links(150)
|
252
|
+
def get_contact_magic_links(contact_id)
|
253
|
+
return @client.raw("get", "/crm/contacts/#{contact_id}/magic-links")
|
254
|
+
end
|
255
|
+
|
256
|
+
##
|
257
|
+
# === Create contact merge.
|
258
|
+
# Merge contacts.
|
259
|
+
#
|
260
|
+
# ==== Parameters
|
261
|
+
# id:: (Integer) -- Contact id.
|
262
|
+
# data:: (Hash) -- Data to be submited. It contains ids to be merged.
|
263
|
+
#
|
264
|
+
# ==== Example
|
265
|
+
# data = {
|
266
|
+
# "mergeContactIds": [152]
|
267
|
+
# }
|
268
|
+
# @data = @mints_user.merge_contacts(151, data)
|
269
|
+
def merge_contacts(id, data)
|
270
|
+
return @client.raw("post", "/crm/contacts/#{id}/merge", nil, data_transform(data))
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# === Send magic links.
|
275
|
+
# Send magic links to contacts.
|
276
|
+
#
|
277
|
+
# ==== Parameters
|
278
|
+
# data:: (Hash) -- Data to be submited.
|
279
|
+
#
|
280
|
+
# ==== Example
|
281
|
+
# data = {
|
282
|
+
# "contacts": ["email_1@example.com", "email_2@example.com", "email_3@example.com"],
|
283
|
+
# "templateId": 2,
|
284
|
+
# "redirectUrl": "",
|
285
|
+
# "lifeTime": 1440,
|
286
|
+
# "maxVisits": 3
|
287
|
+
# }
|
288
|
+
# @data = @mints_user.send_magic_links(data)
|
289
|
+
def send_magic_links(data)
|
290
|
+
return @client.raw("post", "/crm/contacts/send-magic-link", nil, data_transform(data))
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# == Contacts Bulk Actions
|
295
|
+
#
|
296
|
+
|
297
|
+
##
|
298
|
+
# === Delete contacts.
|
299
|
+
# Delete different contacts.
|
300
|
+
#
|
301
|
+
# ==== Parameters
|
302
|
+
# data:: (Hash) -- Data to be submited.
|
303
|
+
#
|
304
|
+
# ==== Example
|
305
|
+
# data = {
|
306
|
+
# "ids": [ 67, 68, 69 ]
|
307
|
+
# }
|
308
|
+
# @data = @mints_user.delete_contacts(data)
|
309
|
+
def delete_contacts(data) #TODO: ContactController.delete need a success output
|
310
|
+
return @client.raw("delete", "/crm/contacts/delete", nil, data_transform(data))
|
311
|
+
end
|
312
|
+
end
|
data/lib/user/crm/crm.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative './companies.rb'
|
2
|
+
require_relative './contacts.rb'
|
3
|
+
require_relative './deals.rb'
|
4
|
+
require_relative './favorites.rb'
|
5
|
+
require_relative './segments.rb'
|
6
|
+
require_relative './users.rb'
|
7
|
+
require_relative './workflow_step_objects.rb'
|
8
|
+
require_relative './workflow_steps.rb'
|
9
|
+
require_relative './workflows.rb'
|
10
|
+
|
11
|
+
module CRM
|
12
|
+
include Companies
|
13
|
+
include Contacts
|
14
|
+
include Deals
|
15
|
+
include Favorites
|
16
|
+
include Segments
|
17
|
+
include Users
|
18
|
+
include WorkflowStepObjects
|
19
|
+
include WorkFlowSteps
|
20
|
+
include Workflows
|
21
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
module Deals
|
2
|
+
##
|
3
|
+
# == Deals
|
4
|
+
#
|
5
|
+
|
6
|
+
##
|
7
|
+
# === Get deal permits.
|
8
|
+
# Get permits of a deal.
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# id:: (Integer) -- Deal id.
|
12
|
+
#
|
13
|
+
# ==== Example
|
14
|
+
# @data = @mints_user.get_deal_permits(7)
|
15
|
+
def get_deal_permits(id)
|
16
|
+
return @client.raw("get", "/crm/deals/#{id}/permits")
|
17
|
+
end
|
18
|
+
|
19
|
+
##
|
20
|
+
# === Get deal support data.
|
21
|
+
# Get support data of deals.
|
22
|
+
#
|
23
|
+
# ==== Example
|
24
|
+
# @data = @mints_user.get_deal_support_data
|
25
|
+
def get_deal_support_data
|
26
|
+
return @client.raw("get", "/crm/deals/support-data")
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# === Get deal currencies.
|
31
|
+
# Get currencies of deals.
|
32
|
+
#
|
33
|
+
# ==== Example
|
34
|
+
# @data = @mints_user.get_deal_currencies
|
35
|
+
def get_deal_currencies
|
36
|
+
return @client.raw("get", "/crm/deal/currencies")
|
37
|
+
end
|
38
|
+
|
39
|
+
# === Get deals.
|
40
|
+
# Get a collection of deals.
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
44
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
45
|
+
#
|
46
|
+
# ==== First Example
|
47
|
+
# @data = @mints_user.get_deals
|
48
|
+
#
|
49
|
+
# ==== Second Example
|
50
|
+
# options = { "fields": "id, title" }
|
51
|
+
# @data = @mints_user.get_deals(options)
|
52
|
+
#
|
53
|
+
# ==== Third Example
|
54
|
+
# options = { "fields": "id, title" }
|
55
|
+
# @data = @mints_user.get_deals(options, false)
|
56
|
+
def get_deals(options = nil, use_post = true)
|
57
|
+
return get_query_results("/crm/deals", options, use_post)
|
58
|
+
end
|
59
|
+
|
60
|
+
# === Get deal.
|
61
|
+
# Get a deal info.
|
62
|
+
#
|
63
|
+
# ==== Parameters
|
64
|
+
# id:: (Integer) -- Deal id.
|
65
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
66
|
+
#
|
67
|
+
# ==== First Example
|
68
|
+
# @data = @mints_user.get_deal(1)
|
69
|
+
#
|
70
|
+
# ==== Second Example
|
71
|
+
# options = { "fields": "id, title" }
|
72
|
+
# @data = @mints_user.get_deal(1, options)
|
73
|
+
def get_deal(id, options = nil)
|
74
|
+
return @client.raw("get", "/crm/deals/#{id}", options)
|
75
|
+
end
|
76
|
+
|
77
|
+
# === Create deal.
|
78
|
+
# Create a deal with data.
|
79
|
+
#
|
80
|
+
# ==== Parameters
|
81
|
+
# data:: (Hash) -- Data to be submited.
|
82
|
+
#
|
83
|
+
# ==== Example
|
84
|
+
# data = {
|
85
|
+
# "dealData": {
|
86
|
+
# "title": "New deal",
|
87
|
+
# "stepId": 1,
|
88
|
+
# "value": 10500
|
89
|
+
# }
|
90
|
+
# }
|
91
|
+
# @data = @mints_user.create_deal(data.to_json)
|
92
|
+
def create_deal(data)
|
93
|
+
return @client.raw("post", "/crm/deals", nil, data)
|
94
|
+
end
|
95
|
+
|
96
|
+
# === Update deal.
|
97
|
+
# Update a deal data.
|
98
|
+
#
|
99
|
+
# ==== Parameters
|
100
|
+
# id:: (Integer) -- Deal id.
|
101
|
+
# data:: (Hash) -- Data to be submited.
|
102
|
+
#
|
103
|
+
# ==== Example
|
104
|
+
# data = {
|
105
|
+
# "title": "New Deal Modified"
|
106
|
+
# }
|
107
|
+
# @data = @mints_user.update_deal(102, data.to_json)
|
108
|
+
def update_deal(id, data)
|
109
|
+
return @client.raw("put", "/crm/deals/#{id}", nil, data)
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Favorites
|
2
|
+
##
|
3
|
+
# == Favorites #TODO: NOT CHECKED, NO DATA IN DB
|
4
|
+
#
|
5
|
+
|
6
|
+
def update_multiple_favorites(data)
|
7
|
+
return @client.raw("put", "/crm/favorites", nil, data)
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_favorites(options = nil)
|
11
|
+
return @client.raw("get", "/crm/favorites", options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_favorites(id, data)
|
15
|
+
return @client.raw("put", "/crm/favorites/#{id}", nil, data)
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
module Segments
|
2
|
+
##
|
3
|
+
# == Segments
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get segments support data.
|
7
|
+
# Get segments support data.
|
8
|
+
#
|
9
|
+
# ==== Example
|
10
|
+
# @data = @mints_user.get_segments_support_data
|
11
|
+
def get_segments_support_data
|
12
|
+
return @client.raw("get", "/crm/segments/support-data")
|
13
|
+
end
|
14
|
+
|
15
|
+
# === Get segments attributes.
|
16
|
+
# Get segments attributes.
|
17
|
+
#
|
18
|
+
# ==== Parameters
|
19
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
20
|
+
#
|
21
|
+
# ==== Example
|
22
|
+
# options = { "object_type": "contacts" }
|
23
|
+
# @data = @mints_user.get_segments_attributes(options)
|
24
|
+
def get_segments_attributes(options = nil)
|
25
|
+
return @client.raw("get", "/crm/segments/attributes", options)
|
26
|
+
end
|
27
|
+
|
28
|
+
# === Get segment group.
|
29
|
+
# Get segment group.
|
30
|
+
#
|
31
|
+
# ==== Parameters
|
32
|
+
# groupId:: (String) -- Group's name.
|
33
|
+
#
|
34
|
+
# ==== Example
|
35
|
+
# @data = @mints_user.get_segment_group("users")
|
36
|
+
def get_segment_group(groupId)
|
37
|
+
return @client.raw("get", "/crm/segments/groups/#{groupId}")
|
38
|
+
end
|
39
|
+
|
40
|
+
# === Duplicate segment.
|
41
|
+
# Duplicate a segment.
|
42
|
+
#
|
43
|
+
# ==== Parameters
|
44
|
+
# id:: (Integer) -- Segment id.
|
45
|
+
# data:: (Hash) -- Data to be submited.
|
46
|
+
#
|
47
|
+
# ==== Example
|
48
|
+
# data = {
|
49
|
+
# "options": []
|
50
|
+
# }
|
51
|
+
# @data = @mints_user.duplicate_segment(107, data)
|
52
|
+
def duplicate_segment(id, data)
|
53
|
+
return @client.raw("post", "/crm/segments/#{id}/duplicate", nil, data)
|
54
|
+
end
|
55
|
+
|
56
|
+
# === Get segments.
|
57
|
+
# Get a collection of segments.
|
58
|
+
#
|
59
|
+
# ==== Parameters
|
60
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
61
|
+
#
|
62
|
+
# ==== First Example
|
63
|
+
# @data = @mints_user.get_segments
|
64
|
+
#
|
65
|
+
# ==== Second Example
|
66
|
+
# options = { "fields": "id", "sort": "-id" }
|
67
|
+
# @data = @mints_user.get_segments(options)
|
68
|
+
def get_segments(options = nil)
|
69
|
+
return @client.raw("get", "/crm/segments", options)
|
70
|
+
end
|
71
|
+
|
72
|
+
# === Get segment.
|
73
|
+
# Get a segment info.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
# id:: (Integer) -- Segment id.
|
77
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
78
|
+
#
|
79
|
+
# ==== First Example
|
80
|
+
# @data = @mints_user.get_segment(1)
|
81
|
+
#
|
82
|
+
# ==== Second Example
|
83
|
+
# options = { "fields": "id, title" }
|
84
|
+
# @data = @mints_user.get_segment(1, options)
|
85
|
+
def get_segment(id, options = nil)
|
86
|
+
return @client.raw("get", "/crm/segments/#{id}", options)
|
87
|
+
end
|
88
|
+
|
89
|
+
# === Create segment.
|
90
|
+
# Create a segment with data.
|
91
|
+
#
|
92
|
+
# ==== Parameters
|
93
|
+
# data:: (Hash) -- Data to be submited.
|
94
|
+
#
|
95
|
+
# ==== Example
|
96
|
+
# data = {
|
97
|
+
# "title": "New Segment",
|
98
|
+
# "object_type": "deals"
|
99
|
+
# }
|
100
|
+
# @data = @mints_user.create_segment(data)
|
101
|
+
def create_segment(data)
|
102
|
+
return @client.raw("post", "/crm/segments", nil, data_transform(data))
|
103
|
+
end
|
104
|
+
|
105
|
+
# === Update segment.
|
106
|
+
# Update a segment info.
|
107
|
+
#
|
108
|
+
# ==== Parameters
|
109
|
+
# id:: (Integer) -- Segment id.
|
110
|
+
# data:: (Hash) -- Data to be submited.
|
111
|
+
#
|
112
|
+
# ==== Example
|
113
|
+
# data = {
|
114
|
+
# "title": "New Segment Modified"
|
115
|
+
# }
|
116
|
+
# @data = @mints_user.update_segment(118, data)
|
117
|
+
def update_segment(id, data)
|
118
|
+
return @client.raw("put", "/crm/segments/#{id}", nil, data_transform(data))
|
119
|
+
end
|
120
|
+
|
121
|
+
# === Delete segment.
|
122
|
+
# Delete a segment.
|
123
|
+
#
|
124
|
+
# ==== Parameters
|
125
|
+
# id:: (Integer) -- Segment id.
|
126
|
+
#
|
127
|
+
# ==== Example
|
128
|
+
# @mints_user.delete_segment(113)
|
129
|
+
def delete_segment(id)
|
130
|
+
return @client.raw("delete", "/crm/segments/#{id}")
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Users
|
2
|
+
##
|
3
|
+
# == Users
|
4
|
+
#
|
5
|
+
|
6
|
+
###
|
7
|
+
# === Get crm users.
|
8
|
+
# Get users info in crm.
|
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_crm_users
|
15
|
+
#
|
16
|
+
# ==== Second Example
|
17
|
+
# options = { "sort": "id", "fields": "id, email" }
|
18
|
+
# @data = @mints_user.get_crm_users(options)
|
19
|
+
def get_crm_users(options = nil)
|
20
|
+
return @client.raw("get", "/crm/users", options)
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module WorkflowStepObjects
|
2
|
+
##
|
3
|
+
# == Workflow Step Objects
|
4
|
+
#
|
5
|
+
|
6
|
+
# === Get workflow step objects.
|
7
|
+
# Get a collection of workflow step objects.
|
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_step_objects
|
14
|
+
#
|
15
|
+
# ==== Second Example
|
16
|
+
# options = { "fields": "id" }
|
17
|
+
# @data = @mints_user.get_step_objects(options)
|
18
|
+
def get_step_objects(options = nil)
|
19
|
+
return @client.raw("get", "/crm/step-objects", options)
|
20
|
+
end
|
21
|
+
|
22
|
+
# === Get workflow step object.
|
23
|
+
# Get a workflow step object info.
|
24
|
+
#
|
25
|
+
# ==== Parameters
|
26
|
+
# id:: (Integer) -- Workflow step object 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_step_object(1)
|
31
|
+
#
|
32
|
+
# ==== Second Example
|
33
|
+
# options = { "fields": "id, step_id" }
|
34
|
+
# @data = @mints_user.get_step_object(1, options)
|
35
|
+
def get_step_object(id, options = nil)
|
36
|
+
return @client.raw("get", "/crm/step-objects/#{id}", options)
|
37
|
+
end
|
38
|
+
|
39
|
+
# === Create workflow step object.
|
40
|
+
# Create a workflow step object with data.
|
41
|
+
#
|
42
|
+
# ==== Parameters
|
43
|
+
# data:: (Hash) -- Data to be submited.
|
44
|
+
#
|
45
|
+
# ==== Example
|
46
|
+
# data = {
|
47
|
+
# "objectType": "deals",
|
48
|
+
# "stepId": 9,
|
49
|
+
# "objectId": 1
|
50
|
+
# }
|
51
|
+
# @data = @mints_user.create_step_object(data)
|
52
|
+
def create_step_object(data)
|
53
|
+
return @client.raw("post", "/crm/step-objects/", nil, data_transform(data))
|
54
|
+
end
|
55
|
+
|
56
|
+
# === Update workflow step object.
|
57
|
+
# Update a workflow step object info.
|
58
|
+
#
|
59
|
+
# ==== Parameters
|
60
|
+
# id:: (Integer) -- Workflow step object id.
|
61
|
+
# data:: (Hash) -- Data to be submited.
|
62
|
+
#
|
63
|
+
# ==== Example
|
64
|
+
# data = {
|
65
|
+
# "stepId": 10
|
66
|
+
# }
|
67
|
+
# @data = @mints_user.update_step_object(128, data.to_json)
|
68
|
+
def update_step_object(id, data)
|
69
|
+
return @client.raw("put", "/crm/step-objects/#{id}", nil, data)
|
70
|
+
end
|
71
|
+
|
72
|
+
# === Get workflow step object by object type.
|
73
|
+
# Get a workflow step object info by an object type.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
# objectType:: (String) -- Object type.
|
77
|
+
# objectId:: (Integer) -- Workflow step object id.
|
78
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
79
|
+
#
|
80
|
+
# ==== First Example
|
81
|
+
# @data = @mints_user.get_step_object_by_object_type("deals", 1)
|
82
|
+
#
|
83
|
+
# ==== Second Example
|
84
|
+
# options = { "fields": "id, object_id" }
|
85
|
+
# @data = @mints_user.get_step_object_by_object_type("deals", 1, options)
|
86
|
+
def get_step_object_by_object_type(objectType, objectId, options = nil)
|
87
|
+
return @client.raw("get", "/crm/step-objects/#{objectType}/#{objectId}", options)
|
88
|
+
end
|
89
|
+
end
|