cxf 0.0.4 → 0.0.5
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 +11 -11
- data/lib/client.rb +2 -2
- data/lib/contact/content/content.rb +4 -4
- data/lib/contact/ecommerce/ecommerce.rb +4 -4
- data/lib/pub/config/config.rb +6 -6
- data/lib/pub/ecommerce/ecommerce.rb +6 -6
- data/lib/user/config/config.rb +10 -0
- data/lib/user/config/docs.rb +11 -0
- data/lib/user/config/exports.rb +43 -0
- data/lib/user/config/logs.rb +85 -0
- data/lib/user/config/password.rb +7 -0
- data/lib/user/config/relationships.rb +17 -31
- data/lib/user/config/seeds.rb +4 -48
- data/lib/user/config/system_settings.rb +5 -5
- data/lib/user/config/views.rb +24 -0
- data/lib/user/content/assets.rb +27 -221
- data/lib/user/content/bundles.rb +96 -0
- data/lib/user/content/content.rb +6 -0
- data/lib/user/content/instances.rb +37 -0
- data/lib/user/content/message_templates.rb +114 -0
- data/lib/user/content/print_versions.rb +18 -0
- data/lib/user/content/prints.rb +96 -0
- data/lib/user/content/templates.rb +28 -0
- data/lib/user/{crm → customer-data}/companies.rb +6 -6
- data/lib/user/{crm → customer-data}/contacts.rb +43 -18
- data/lib/user/customer-data/customer_data.rb +17 -0
- data/lib/user/customer-data/profiles.rb +93 -0
- data/lib/user/customer-data/segments.rb +93 -0
- data/lib/user/customer-data/workflow_steps.rb +127 -0
- data/lib/user/customer-data/workflows.rb +115 -0
- data/lib/user/ecommerce/ecommerce.rb +6 -22
- data/lib/user/ecommerce/item_codes.rb +89 -0
- data/lib/user/ecommerce/order_templates.rb +89 -0
- data/lib/user/ecommerce/orders.rb +205 -0
- data/lib/user/helpers/helpers.rb +0 -96
- data/lib/user.rb +2 -3
- metadata +18 -19
- data/lib/user/contacts/contacts.rb +0 -22
- data/lib/user/crm/crm.rb +0 -9
- data/lib/user/ecommerce/item_prices.rb +0 -89
- data/lib/user/ecommerce/price_lists.rb +0 -75
- data/lib/user/ecommerce/product_templates.rb +0 -106
- data/lib/user/ecommerce/product_variations.rb +0 -133
- data/lib/user/ecommerce/product_versions.rb +0 -107
- data/lib/user/ecommerce/products.rb +0 -156
- data/lib/user/ecommerce/skus.rb +0 -90
- data/lib/user/ecommerce/taxes.rb +0 -84
- data/lib/user/ecommerce/variant_options.rb +0 -71
- data/lib/user/ecommerce/variant_values.rb +0 -74
- data/lib/user/ecommerce/vouchers.rb +0 -90
- data/lib/user/helpers/object_activities.rb +0 -85
- data/lib/user/helpers/object_folders.rb +0 -84
- data/lib/user/helpers/user_folders.rb +0 -85
@@ -54,6 +54,34 @@ module Templates
|
|
54
54
|
@client.raw('post', '/content/templates', options, data_transform(data))
|
55
55
|
end
|
56
56
|
|
57
|
+
# === Create variant option for template.
|
58
|
+
# Create a variant option for a template with data.
|
59
|
+
#
|
60
|
+
# ==== Parameters
|
61
|
+
# id:: (Integer) -- template id.
|
62
|
+
# data:: (Hash) -- Data to be submitted.
|
63
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
64
|
+
#
|
65
|
+
# ==== Example
|
66
|
+
# data = {
|
67
|
+
# variant_option_id: 1
|
68
|
+
# }
|
69
|
+
# @data = @cxf_user.create_template_variant_option(1, data)
|
70
|
+
def create_template_variant_option(id, data, options = nil)
|
71
|
+
@client.raw('post', "/content/templates/#{id}/variant-option", options, data_transform(data))
|
72
|
+
end
|
73
|
+
|
74
|
+
# === Delete variant option from template.
|
75
|
+
# Delete a variant option from a template.
|
76
|
+
#
|
77
|
+
# ==== Parameters
|
78
|
+
# id:: (Integer) -- template id.
|
79
|
+
# data:: (Hash) -- Data to be submitted.
|
80
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
81
|
+
def delete_template_variant_option(id, data, options = nil)
|
82
|
+
@client.raw('delete', "/content/templates/#{id}/variant-option", options, data_transform(data))
|
83
|
+
end
|
84
|
+
|
57
85
|
# === Update template.
|
58
86
|
# Update a template info.
|
59
87
|
#
|
@@ -12,7 +12,7 @@ module Companies
|
|
12
12
|
# ==== Example
|
13
13
|
# @data = @cxf_user.get_companies_support_data
|
14
14
|
def get_companies_support_data
|
15
|
-
@client.raw('get', '/
|
15
|
+
@client.raw('get', '/customer-data/companies/support-data')
|
16
16
|
end
|
17
17
|
|
18
18
|
# === Get companies.
|
@@ -33,7 +33,7 @@ module Companies
|
|
33
33
|
# options = { fields: 'id, title', sort: '-id' }
|
34
34
|
# @data = @cxf_user.get_companies(options, false)
|
35
35
|
def get_companies(options = nil, use_post = true)
|
36
|
-
get_query_results('/
|
36
|
+
get_query_results('/customer-data/companies', options, use_post)
|
37
37
|
end
|
38
38
|
|
39
39
|
# === Get company.
|
@@ -50,7 +50,7 @@ module Companies
|
|
50
50
|
# options = { fields: 'id, title' }
|
51
51
|
# @data = @cxf_user.get_company(21, options)
|
52
52
|
def get_company(id, options = nil)
|
53
|
-
@client.raw('get', "/
|
53
|
+
@client.raw('get', "/customer-data/companies/#{id}", options)
|
54
54
|
end
|
55
55
|
|
56
56
|
# === Create company.
|
@@ -73,7 +73,7 @@ module Companies
|
|
73
73
|
# }
|
74
74
|
# @data = @cxf_user.create_company(data)
|
75
75
|
def create_company(data, options = nil)
|
76
|
-
@client.raw('post', '/
|
76
|
+
@client.raw('post', '/customer-data/companies/', options, data_transform(data))
|
77
77
|
end
|
78
78
|
|
79
79
|
# === Update company.
|
@@ -89,7 +89,7 @@ module Companies
|
|
89
89
|
# }
|
90
90
|
# @data = @cxf_user.update_company(23, data)
|
91
91
|
def update_company(id, data, options = nil)
|
92
|
-
@client.raw('put', "/
|
92
|
+
@client.raw('put', "/customer-data/companies/#{id}", options, data_transform(data))
|
93
93
|
end
|
94
94
|
|
95
95
|
##
|
@@ -106,6 +106,6 @@ module Companies
|
|
106
106
|
# data = { ids: %w[21 22] }
|
107
107
|
# @data = @cxf_user.delete_companies(data)
|
108
108
|
def delete_companies(data)
|
109
|
-
@client.raw('delete', '/
|
109
|
+
@client.raw('delete', '/customer-data/companies/delete', nil, data_transform(data))
|
110
110
|
end
|
111
111
|
end
|
@@ -11,7 +11,7 @@ module Contacts
|
|
11
11
|
# ==== Example
|
12
12
|
# @data = @cxf_user.get_contacts_support_data
|
13
13
|
def get_contacts_support_data
|
14
|
-
@client.raw('get', '/
|
14
|
+
@client.raw('get', '/customer-data/contacts/support-data')
|
15
15
|
end
|
16
16
|
|
17
17
|
##
|
@@ -24,7 +24,7 @@ module Contacts
|
|
24
24
|
# ==== Example
|
25
25
|
# @data = @cxf_user.get_online_activity(5)
|
26
26
|
def get_online_activity(id)
|
27
|
-
@client.raw('get', "/
|
27
|
+
@client.raw('get', "/customer-data/contacts/#{id}/online-activity")
|
28
28
|
end
|
29
29
|
|
30
30
|
##
|
@@ -52,7 +52,7 @@ module Contacts
|
|
52
52
|
# }
|
53
53
|
# @data = @cxf_user.get_contacts(options, true)
|
54
54
|
def get_contacts(options = nil, use_post = true)
|
55
|
-
get_query_results('/
|
55
|
+
get_query_results('/customer-data/contacts', options, use_post)
|
56
56
|
end
|
57
57
|
|
58
58
|
##
|
@@ -73,7 +73,7 @@ module Contacts
|
|
73
73
|
# }
|
74
74
|
# @data = @cxf_user.get_contact(5, options)
|
75
75
|
def get_contact(id, options = nil)
|
76
|
-
@client.raw('get', "/
|
76
|
+
@client.raw('get', "/customer-data/contacts/#{id}", options)
|
77
77
|
end
|
78
78
|
|
79
79
|
##
|
@@ -92,7 +92,32 @@ module Contacts
|
|
92
92
|
# }
|
93
93
|
# @data = @cxf_user.create_contact(data)
|
94
94
|
def create_contact(data, options = nil)
|
95
|
-
@client.raw('post', '/
|
95
|
+
@client.raw('post', '/customer-data/contacts', options, data_transform(data))
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# === Add contact profile.
|
100
|
+
# Add a profile to a contact.
|
101
|
+
#
|
102
|
+
# ==== Parameters
|
103
|
+
# contact_id:: (Integer) -- Contact id.
|
104
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
105
|
+
def add_contact_profile(contact_id, data, options = nil)
|
106
|
+
@client.raw('post', "/customer-data/contacts/#{contact_id}/add-profiles", options, data)
|
107
|
+
end
|
108
|
+
|
109
|
+
##
|
110
|
+
# === Remove contact profile.
|
111
|
+
# Remove a profile from a contact.
|
112
|
+
#
|
113
|
+
# ==== Parameters
|
114
|
+
# contact_id:: (Integer) -- Contact id.
|
115
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
116
|
+
#
|
117
|
+
# ==== Example
|
118
|
+
# @data = @cxf_user.remove_contact_profile(4)
|
119
|
+
def remove_contact_profile(contact_id, options = nil)
|
120
|
+
@client.raw('post', "/customer-data/contacts/#{contact_id}/remove-profiles", options)
|
96
121
|
end
|
97
122
|
|
98
123
|
##
|
@@ -110,7 +135,7 @@ module Contacts
|
|
110
135
|
# }
|
111
136
|
# @data = @cxf_user.update_contact(65, data)
|
112
137
|
def update_contact(id, data, options = nil)
|
113
|
-
@client.raw('put', "/
|
138
|
+
@client.raw('put', "/customer-data/contacts/#{id}", options, data_transform(data))
|
114
139
|
end
|
115
140
|
|
116
141
|
##
|
@@ -123,7 +148,7 @@ module Contacts
|
|
123
148
|
# ==== Example
|
124
149
|
# @data = @cxf_user.get_contact_deal(5)
|
125
150
|
def get_contact_deal(contact_id)
|
126
|
-
@client.raw('get', "/
|
151
|
+
@client.raw('get', "/customer-data/contacts/#{contact_id}/deals")
|
127
152
|
end
|
128
153
|
|
129
154
|
##
|
@@ -138,7 +163,7 @@ module Contacts
|
|
138
163
|
# data = { deal_id: 6 }
|
139
164
|
# @data = @cxf_user.create_contact_deal(5, data.to_json)
|
140
165
|
def create_contact_deal(contact_id, data)
|
141
|
-
@client.raw('post', "/
|
166
|
+
@client.raw('post', "/customer-data/contacts/#{contact_id}/deals", nil, data)
|
142
167
|
end
|
143
168
|
|
144
169
|
##
|
@@ -152,7 +177,7 @@ module Contacts
|
|
152
177
|
# ==== Example
|
153
178
|
# @data = @cxf_user.delete_contact_deal(5, 100)
|
154
179
|
def delete_contact_deal(contact_id, deal_id)
|
155
|
-
@client.raw('delete', "/
|
180
|
+
@client.raw('delete', "/customer-data/contacts/#{contact_id}/deals/#{deal_id}")
|
156
181
|
end
|
157
182
|
|
158
183
|
##
|
@@ -167,7 +192,7 @@ module Contacts
|
|
167
192
|
# ==== Example
|
168
193
|
# @data = @cxf_user.get_contact_user(66)
|
169
194
|
def get_contact_user(contact_id)
|
170
|
-
@client.raw('get', "/
|
195
|
+
@client.raw('get', "/customer-data/contacts/#{contact_id}/users")
|
171
196
|
end
|
172
197
|
|
173
198
|
##
|
@@ -182,7 +207,7 @@ module Contacts
|
|
182
207
|
# data = { user_id: 9 }
|
183
208
|
# @data = @cxf_user.create_contact_user(66, data.to_json)
|
184
209
|
def create_contact_user(contact_id, data)
|
185
|
-
@client.raw('post', "/
|
210
|
+
@client.raw('post', "/customer-data/contacts/#{contact_id}/users", nil, data)
|
186
211
|
end
|
187
212
|
|
188
213
|
##
|
@@ -196,7 +221,7 @@ module Contacts
|
|
196
221
|
# ==== Example
|
197
222
|
# @data = @cxf_user.delete_contact_user(153, 9)
|
198
223
|
def delete_contact_user(contact_id, id)
|
199
|
-
@client.raw('delete', "/
|
224
|
+
@client.raw('delete', "/customer-data/contacts/#{contact_id}/users/#{id}")
|
200
225
|
end
|
201
226
|
|
202
227
|
##
|
@@ -209,7 +234,7 @@ module Contacts
|
|
209
234
|
# ==== Example
|
210
235
|
# @data = @cxf_user.get_contact_segments(1)
|
211
236
|
def get_contact_segments(contact_id)
|
212
|
-
@client.raw('get', "/
|
237
|
+
@client.raw('get', "/customer-data/contacts/#{contact_id}/segments")
|
213
238
|
end
|
214
239
|
|
215
240
|
##
|
@@ -222,7 +247,7 @@ module Contacts
|
|
222
247
|
# ==== Example
|
223
248
|
# @data = @cxf_user.get_contact_submissions(146)
|
224
249
|
def get_contact_submissions(contact_id)
|
225
|
-
@client.raw('get', "/
|
250
|
+
@client.raw('get', "/customer-data/contacts/#{contact_id}/submissions")
|
226
251
|
end
|
227
252
|
|
228
253
|
##
|
@@ -235,7 +260,7 @@ module Contacts
|
|
235
260
|
# ==== Example
|
236
261
|
# @data = @cxf_user.get_contact_tags(1)
|
237
262
|
def get_contact_tags(contact_id)
|
238
|
-
@client.raw('get', "/
|
263
|
+
@client.raw('get', "/customer-data/contacts/#{contact_id}/tags")
|
239
264
|
end
|
240
265
|
|
241
266
|
##
|
@@ -250,7 +275,7 @@ module Contacts
|
|
250
275
|
# data = { mergeContactIds: [152] }
|
251
276
|
# @data = @cxf_user.merge_contacts(151, data)
|
252
277
|
def merge_contacts(id, data)
|
253
|
-
@client.raw('post', "/
|
278
|
+
@client.raw('post', "/customer-data/contacts/#{id}/merge", nil, data_transform(data))
|
254
279
|
end
|
255
280
|
|
256
281
|
##
|
@@ -270,7 +295,7 @@ module Contacts
|
|
270
295
|
# }
|
271
296
|
# @data = @cxf_user.send_magic_links(data)
|
272
297
|
def send_magic_links(data)
|
273
|
-
@client.raw('post', '/
|
298
|
+
@client.raw('post', '/customer-data/contacts/send-magic-link', nil, data_transform(data))
|
274
299
|
end
|
275
300
|
|
276
301
|
##
|
@@ -289,6 +314,6 @@ module Contacts
|
|
289
314
|
# @data = @cxf_user.delete_contacts(data)
|
290
315
|
def delete_contacts(data)
|
291
316
|
# TODO: ContactController.delete need a success output
|
292
|
-
@client.raw('delete', '/
|
317
|
+
@client.raw('delete', '/customer-data/contacts/delete', nil, data_transform(data))
|
293
318
|
end
|
294
319
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative './companies'
|
4
|
+
require_relative './contacts'
|
5
|
+
require_relative './profiles'
|
6
|
+
require_relative './segments'
|
7
|
+
require_relative './workflows'
|
8
|
+
require_relative './workflow_steps'
|
9
|
+
|
10
|
+
module CustomerData
|
11
|
+
include Companies
|
12
|
+
include Contacts
|
13
|
+
include Profiles
|
14
|
+
include Segments
|
15
|
+
include Workflows
|
16
|
+
include WorkflowSteps
|
17
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Profiles
|
4
|
+
##
|
5
|
+
# == Profiles
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get profiles.
|
9
|
+
# Get a collection of profiles.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
13
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
14
|
+
#
|
15
|
+
# ==== First Example
|
16
|
+
# @data = @cxf_user.get_profiles
|
17
|
+
#
|
18
|
+
# ==== Second Example
|
19
|
+
# options = { fields: 'id, title', sort: '-id' }
|
20
|
+
# @data = @cxf_user.get_profiles(options)
|
21
|
+
#
|
22
|
+
# ==== Third Example
|
23
|
+
# options = { fields: 'id, title', sort: '-id' }
|
24
|
+
# @data = @cxf_user.get_profiles(options, false)
|
25
|
+
def get_profiles(options = nil, use_post = true)
|
26
|
+
get_query_results('/customer-data/profiles', options, use_post)
|
27
|
+
end
|
28
|
+
|
29
|
+
# === Get profile.
|
30
|
+
# Get a profile info.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# id:: (Integer) -- Company id.
|
34
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
35
|
+
#
|
36
|
+
# ==== First Example
|
37
|
+
# @data = @cxf_user.get_profile(21)
|
38
|
+
#
|
39
|
+
# ==== Second Example
|
40
|
+
# options = { fields: 'id, title' }
|
41
|
+
# @data = @cxf_user.get_profile(21, options)
|
42
|
+
def get_profile(id, options = nil)
|
43
|
+
@client.raw('get', "/customer-data/profiles/#{id}", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
# === Create profile.
|
47
|
+
# Create a profile with data.
|
48
|
+
#
|
49
|
+
# ==== Parameters
|
50
|
+
# data:: (Hash) -- Data to be submitted.
|
51
|
+
#
|
52
|
+
# ==== Example
|
53
|
+
# data = {
|
54
|
+
# example_field: 'example_value'
|
55
|
+
# }
|
56
|
+
# @data = @cxf_user.create_profile(data)
|
57
|
+
def create_profile(data, options = nil)
|
58
|
+
@client.raw('post', '/customer-data/profiles/', options, data_transform(data))
|
59
|
+
end
|
60
|
+
|
61
|
+
# === Update profile.
|
62
|
+
# Update a profile info.
|
63
|
+
#
|
64
|
+
# ==== Parameters
|
65
|
+
# id:: (Integer) -- Company id.
|
66
|
+
# data:: (Hash) -- Data to be submitted.
|
67
|
+
#
|
68
|
+
# ==== Example
|
69
|
+
# data = {
|
70
|
+
# example_field: 'example_value_modified'
|
71
|
+
# }
|
72
|
+
# @data = @cxf_user.update_profile(23, data)
|
73
|
+
def update_profile(id, data, options = nil)
|
74
|
+
@client.raw('put', "/customer-data/profiles/#{id}", options, data_transform(data))
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# == Profiles Bulk Actions
|
79
|
+
#
|
80
|
+
|
81
|
+
# === Delete Profiles.
|
82
|
+
# Delete a group of profiles.
|
83
|
+
#
|
84
|
+
# ==== Parameters
|
85
|
+
# data:: (Hash) -- Data to be submitted.
|
86
|
+
#
|
87
|
+
# ==== Example
|
88
|
+
# data = { ids: %w[21 22] }
|
89
|
+
# @data = @cxf_user.delete_profiles(data)
|
90
|
+
def delete_profiles(data)
|
91
|
+
@client.raw('delete', '/customer-data/profiles/delete', nil, data_transform(data))
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Segments
|
4
|
+
##
|
5
|
+
# == Segments
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get segments.
|
9
|
+
# Get a collection of segments.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
13
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
14
|
+
#
|
15
|
+
# ==== First Example
|
16
|
+
# @data = @cxf_user.get_segments
|
17
|
+
#
|
18
|
+
# ==== Second Example
|
19
|
+
# options = { fields: 'id, title', sort: '-id' }
|
20
|
+
# @data = @cxf_user.get_segments(options)
|
21
|
+
#
|
22
|
+
# ==== Third Example
|
23
|
+
# options = { fields: 'id, title', sort: '-id' }
|
24
|
+
# @data = @cxf_user.get_segments(options, false)
|
25
|
+
def get_segments(options = nil, use_post = true)
|
26
|
+
get_query_results('/customer-data/segments', options, use_post)
|
27
|
+
end
|
28
|
+
|
29
|
+
# === Get segment.
|
30
|
+
# Get a segment info.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# id:: (Integer) -- Company id.
|
34
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
35
|
+
#
|
36
|
+
# ==== First Example
|
37
|
+
# @data = @cxf_user.get_segment(21)
|
38
|
+
#
|
39
|
+
# ==== Second Example
|
40
|
+
# options = { fields: 'id, title' }
|
41
|
+
# @data = @cxf_user.get_segment(21, options)
|
42
|
+
def get_segment(id, options = nil)
|
43
|
+
@client.raw('get', "/customer-data/segments/#{id}", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
# === Create segment.
|
47
|
+
# Create a segment with data.
|
48
|
+
#
|
49
|
+
# ==== Parameters
|
50
|
+
# data:: (Hash) -- Data to be submitted.
|
51
|
+
#
|
52
|
+
# ==== Example
|
53
|
+
# data = {
|
54
|
+
# example_field: 'example_value'
|
55
|
+
# }
|
56
|
+
# @data = @cxf_user.create_segment(data)
|
57
|
+
def create_segment(data, options = nil)
|
58
|
+
@client.raw('post', '/customer-data/segments/', options, data_transform(data))
|
59
|
+
end
|
60
|
+
|
61
|
+
# === Update segment.
|
62
|
+
# Update a segment info.
|
63
|
+
#
|
64
|
+
# ==== Parameters
|
65
|
+
# id:: (Integer) -- Company id.
|
66
|
+
# data:: (Hash) -- Data to be submitted.
|
67
|
+
#
|
68
|
+
# ==== Example
|
69
|
+
# data = {
|
70
|
+
# example_field: 'example_value_modified'
|
71
|
+
# }
|
72
|
+
# @data = @cxf_user.update_segment(23, data)
|
73
|
+
def update_segment(id, data, options = nil)
|
74
|
+
@client.raw('put', "/customer-data/segments/#{id}", options, data_transform(data))
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# == Segments Bulk Actions
|
79
|
+
#
|
80
|
+
|
81
|
+
# === Delete Segments.
|
82
|
+
# Delete a group of segments.
|
83
|
+
#
|
84
|
+
# ==== Parameters
|
85
|
+
# data:: (Hash) -- Data to be submitted.
|
86
|
+
#
|
87
|
+
# ==== Example
|
88
|
+
# data = { ids: %w[21 22] }
|
89
|
+
# @data = @cxf_user.delete_segments(data)
|
90
|
+
def delete_segments(data)
|
91
|
+
@client.raw('delete', '/customer-data/segments/delete', nil, data_transform(data))
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WorkflowSteps
|
4
|
+
##
|
5
|
+
# == WorkflowsSteps
|
6
|
+
#
|
7
|
+
|
8
|
+
# === Get workflows_steps.
|
9
|
+
# Get a collection of workflows_steps.
|
10
|
+
#
|
11
|
+
# ==== Parameters
|
12
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
13
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
14
|
+
#
|
15
|
+
# ==== First Example
|
16
|
+
# @data = @cxf_user.get_workflows_steps
|
17
|
+
#
|
18
|
+
# ==== Second Example
|
19
|
+
# options = { fields: 'id, title', sort: '-id' }
|
20
|
+
# @data = @cxf_user.get_workflows_steps(options)
|
21
|
+
#
|
22
|
+
# ==== Third Example
|
23
|
+
# options = { fields: 'id, title', sort: '-id' }
|
24
|
+
# @data = @cxf_user.get_workflows_steps(options, false)
|
25
|
+
def get_workflow_steps(options = nil, use_post = true)
|
26
|
+
get_query_results('/customer-data/workflows-steps', options, use_post)
|
27
|
+
end
|
28
|
+
|
29
|
+
# === Get workflow_steps.
|
30
|
+
# Get a workflow_steps info.
|
31
|
+
#
|
32
|
+
# ==== Parameters
|
33
|
+
# id:: (Integer) -- Workflow id.
|
34
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
35
|
+
#
|
36
|
+
# ==== First Example
|
37
|
+
# @data = @cxf_user.get_workflow_steps(21)
|
38
|
+
#
|
39
|
+
# ==== Second Example
|
40
|
+
# options = { fields: 'id, title' }
|
41
|
+
# @data = @cxf_user.get_workflow_steps(21, options)
|
42
|
+
def get_workflow_step(id, options = nil)
|
43
|
+
@client.raw('get', "/customer-data/workflows-steps/#{id}", options)
|
44
|
+
end
|
45
|
+
|
46
|
+
# === Create workflow_steps.
|
47
|
+
# Create a workflow_steps with data.
|
48
|
+
#
|
49
|
+
# ==== Parameters
|
50
|
+
# data:: (Hash) -- Data to be submitted.
|
51
|
+
#
|
52
|
+
# ==== Example
|
53
|
+
# data = {
|
54
|
+
# example_field: 'example_value'
|
55
|
+
# }
|
56
|
+
# @data = @cxf_user.create_workflow_steps(data)
|
57
|
+
def create_workflow_step(data, options = nil)
|
58
|
+
@client.raw('post', '/customer-data/workflows-steps/', options, data_transform(data))
|
59
|
+
end
|
60
|
+
|
61
|
+
# === Attach workflow_steps.
|
62
|
+
# Attach a workflow_steps.
|
63
|
+
#
|
64
|
+
# ==== Parameters
|
65
|
+
# id:: (Integer) -- Workflow id.
|
66
|
+
# data:: (Hash) -- Data to be submitted.
|
67
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
68
|
+
#
|
69
|
+
# ==== Example
|
70
|
+
# data = {
|
71
|
+
# example_field: 'example_value'
|
72
|
+
# }
|
73
|
+
# @data = @cxf_user.attach_workflow_step(21, data)
|
74
|
+
def attach_workflow_step(id, data, options = nil)
|
75
|
+
@client.raw('put', "/customer-data/workflows-steps/#{id}/attach-item", options, data_transform(data))
|
76
|
+
end
|
77
|
+
|
78
|
+
# === Detach workflow_steps.
|
79
|
+
# Detach a workflow_steps.
|
80
|
+
#
|
81
|
+
# ==== Parameters
|
82
|
+
# id:: (Integer) -- Workflow id.
|
83
|
+
# data:: (Hash) -- Data to be submitted.
|
84
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
85
|
+
#
|
86
|
+
# ==== Example
|
87
|
+
# data = {
|
88
|
+
# example_field: 'example_value'
|
89
|
+
# }
|
90
|
+
# @data = @cxf_user.detach_workflow_step(21, data)
|
91
|
+
def detach_workflow_step(id, data, options = nil)
|
92
|
+
@client.raw('put', "/customer-data/workflows-steps/#{id}/detach-item", options, data_transform(data))
|
93
|
+
end
|
94
|
+
|
95
|
+
# === Update workflow_steps.
|
96
|
+
# Update a workflow_steps info.
|
97
|
+
#
|
98
|
+
# ==== Parameters
|
99
|
+
# id:: (Integer) -- Workflow id.
|
100
|
+
# data:: (Hash) -- Data to be submitted.
|
101
|
+
#
|
102
|
+
# ==== Example
|
103
|
+
# data = {
|
104
|
+
# example_field: 'example_value_modified'
|
105
|
+
# }
|
106
|
+
# @data = @cxf_user.update_workflow_steps(23, data)
|
107
|
+
def update_workflow_step(id, data, options = nil)
|
108
|
+
@client.raw('put', "/customer-data/workflows-steps/#{id}", options, data_transform(data))
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# == WorkflowsSteps Bulk Actions
|
113
|
+
#
|
114
|
+
|
115
|
+
# === Delete workflow_steps.
|
116
|
+
# Delete a group of workflows.
|
117
|
+
#
|
118
|
+
# ==== Parameters
|
119
|
+
# data:: (Hash) -- Data to be submitted.
|
120
|
+
#
|
121
|
+
# ==== Example
|
122
|
+
# data = { ids: %w[21 22] }
|
123
|
+
# @data = @cxf_user.delete_workflow_steps(data)
|
124
|
+
def delete_workflow_steps(data)
|
125
|
+
@client.raw('delete', '/customer-data/workflows-steps/delete', nil, data_transform(data))
|
126
|
+
end
|
127
|
+
end
|