late-sdk 0.0.68 → 0.0.69
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/README.md +62 -0
- data/docs/AddBroadcastRecipientsRequest.md +20 -0
- data/docs/BroadcastsApi.md +699 -0
- data/docs/BulkCreateContactsRequest.md +24 -0
- data/docs/BulkCreateContactsRequestContactsInner.md +28 -0
- data/docs/CommentAutomationsApi.md +428 -0
- data/docs/ContactsApi.md +500 -0
- data/docs/CreateBroadcastRequest.md +32 -0
- data/docs/CreateBroadcastRequestMessage.md +20 -0
- data/docs/CreateBroadcastRequestMessageAttachmentsInner.md +22 -0
- data/docs/CreateBroadcastRequestSegmentFilters.md +20 -0
- data/docs/CreateBroadcastRequestTemplate.md +22 -0
- data/docs/CreateCommentAutomationRequest.md +36 -0
- data/docs/CreateContactRequest.md +38 -0
- data/docs/CreateCustomFieldRequest.md +26 -0
- data/docs/CreateSequenceRequest.md +32 -0
- data/docs/CreateSequenceRequestStepsInner.md +24 -0
- data/docs/CreateSequenceRequestStepsInnerMessage.md +18 -0
- data/docs/CustomFieldsApi.md +419 -0
- data/docs/EnrollContactsRequest.md +20 -0
- data/docs/ListCommentAutomations200Response.md +20 -0
- data/docs/ListCommentAutomations200ResponseAutomationsInner.md +42 -0
- data/docs/ListCommentAutomations200ResponseAutomationsInnerStats.md +24 -0
- data/docs/ScheduleBroadcastRequest.md +18 -0
- data/docs/SequencesApi.md +697 -0
- data/docs/SetContactFieldValueRequest.md +18 -0
- data/docs/UpdateCommentAutomationRequest.md +28 -0
- data/docs/UpdateContactRequest.md +32 -0
- data/docs/UpdateCustomFieldRequest.md +20 -0
- data/docs/WhatsAppApi.md +25 -25
- data/lib/late-sdk/api/broadcasts_api.rb +689 -0
- data/lib/late-sdk/api/comment_automations_api.rb +420 -0
- data/lib/late-sdk/api/contacts_api.rb +503 -0
- data/lib/late-sdk/api/custom_fields_api.rb +424 -0
- data/lib/late-sdk/api/sequences_api.rb +681 -0
- data/lib/late-sdk/api/whats_app_api.rb +50 -50
- data/lib/late-sdk/models/add_broadcast_recipients_request.rb +160 -0
- data/lib/late-sdk/models/bulk_create_contacts_request.rb +253 -0
- data/lib/late-sdk/models/bulk_create_contacts_request_contacts_inner.rb +228 -0
- data/lib/late-sdk/models/create_broadcast_request.rb +302 -0
- data/lib/late-sdk/models/create_broadcast_request_message.rb +158 -0
- data/lib/late-sdk/models/create_broadcast_request_message_attachments_inner.rb +165 -0
- data/lib/late-sdk/models/create_broadcast_request_segment_filters.rb +158 -0
- data/lib/late-sdk/models/create_broadcast_request_template.rb +168 -0
- data/lib/late-sdk/models/create_comment_automation_request.rb +359 -0
- data/lib/late-sdk/models/create_contact_request.rb +276 -0
- data/lib/late-sdk/models/create_custom_field_request.rb +262 -0
- data/lib/late-sdk/models/create_sequence_request.rb +308 -0
- data/lib/late-sdk/models/create_sequence_request_steps_inner.rb +208 -0
- data/lib/late-sdk/models/create_sequence_request_steps_inner_message.rb +147 -0
- data/lib/late-sdk/models/enroll_contacts_request.rb +178 -0
- data/lib/late-sdk/models/list_comment_automations200_response.rb +158 -0
- data/lib/late-sdk/models/list_comment_automations200_response_automations_inner.rb +303 -0
- data/lib/late-sdk/models/list_comment_automations200_response_automations_inner_stats.rb +174 -0
- data/lib/late-sdk/models/schedule_broadcast_request.rb +164 -0
- data/lib/late-sdk/models/set_contact_field_value_request.rb +150 -0
- data/lib/late-sdk/models/update_comment_automation_request.rb +228 -0
- data/lib/late-sdk/models/update_contact_request.rb +212 -0
- data/lib/late-sdk/models/update_custom_field_request.rb +158 -0
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +28 -0
- data/openapi.yaml +809 -13
- data/spec/api/broadcasts_api_spec.rb +154 -0
- data/spec/api/comment_automations_api_spec.rb +108 -0
- data/spec/api/contacts_api_spec.rb +122 -0
- data/spec/api/custom_fields_api_spec.rb +105 -0
- data/spec/api/sequences_api_spec.rb +153 -0
- data/spec/api/whats_app_api_spec.rb +25 -25
- data/spec/models/add_broadcast_recipients_request_spec.rb +42 -0
- data/spec/models/bulk_create_contacts_request_contacts_inner_spec.rb +66 -0
- data/spec/models/bulk_create_contacts_request_spec.rb +54 -0
- data/spec/models/create_broadcast_request_message_attachments_inner_spec.rb +48 -0
- data/spec/models/create_broadcast_request_message_spec.rb +42 -0
- data/spec/models/create_broadcast_request_segment_filters_spec.rb +42 -0
- data/spec/models/create_broadcast_request_spec.rb +82 -0
- data/spec/models/create_broadcast_request_template_spec.rb +48 -0
- data/spec/models/create_comment_automation_request_spec.rb +94 -0
- data/spec/models/create_contact_request_spec.rb +96 -0
- data/spec/models/create_custom_field_request_spec.rb +64 -0
- data/spec/models/create_sequence_request_spec.rb +82 -0
- data/spec/models/create_sequence_request_steps_inner_message_spec.rb +36 -0
- data/spec/models/create_sequence_request_steps_inner_spec.rb +54 -0
- data/spec/models/enroll_contacts_request_spec.rb +42 -0
- data/spec/models/list_comment_automations200_response_automations_inner_spec.rb +116 -0
- data/spec/models/list_comment_automations200_response_automations_inner_stats_spec.rb +54 -0
- data/spec/models/list_comment_automations200_response_spec.rb +42 -0
- data/spec/models/schedule_broadcast_request_spec.rb +36 -0
- data/spec/models/set_contact_field_value_request_spec.rb +36 -0
- data/spec/models/update_comment_automation_request_spec.rb +70 -0
- data/spec/models/update_contact_request_spec.rb +78 -0
- data/spec/models/update_custom_field_request_spec.rb +42 -0
- data/zernio-sdk-0.0.69.gem +0 -0
- metadata +114 -2
- data/zernio-sdk-0.0.68.gem +0 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Late
|
|
16
|
+
class ContactsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Bulk create contacts
|
|
23
|
+
# Import up to 1000 contacts at a time. Skips duplicates.
|
|
24
|
+
# @param bulk_create_contacts_request [BulkCreateContactsRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [nil]
|
|
27
|
+
def bulk_create_contacts(bulk_create_contacts_request, opts = {})
|
|
28
|
+
bulk_create_contacts_with_http_info(bulk_create_contacts_request, opts)
|
|
29
|
+
nil
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Bulk create contacts
|
|
33
|
+
# Import up to 1000 contacts at a time. Skips duplicates.
|
|
34
|
+
# @param bulk_create_contacts_request [BulkCreateContactsRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
37
|
+
def bulk_create_contacts_with_http_info(bulk_create_contacts_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.bulk_create_contacts ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'bulk_create_contacts_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && bulk_create_contacts_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'bulk_create_contacts_request' when calling ContactsApi.bulk_create_contacts"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/contacts/bulk'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(bulk_create_contacts_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type]
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"ContactsApi.bulk_create_contacts",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: ContactsApi#bulk_create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Create a contact
|
|
91
|
+
# Create a new contact. Optionally create a platform channel in the same request by providing accountId, platform, and platformIdentifier.
|
|
92
|
+
# @param create_contact_request [CreateContactRequest]
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [nil]
|
|
95
|
+
def create_contact(create_contact_request, opts = {})
|
|
96
|
+
create_contact_with_http_info(create_contact_request, opts)
|
|
97
|
+
nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Create a contact
|
|
101
|
+
# Create a new contact. Optionally create a platform channel in the same request by providing accountId, platform, and platformIdentifier.
|
|
102
|
+
# @param create_contact_request [CreateContactRequest]
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
105
|
+
def create_contact_with_http_info(create_contact_request, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.create_contact ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'create_contact_request' is set
|
|
110
|
+
if @api_client.config.client_side_validation && create_contact_request.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'create_contact_request' when calling ContactsApi.create_contact"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/contacts'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_contact_request)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type]
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"ContactsApi.create_contact",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Delete a contact
|
|
159
|
+
# @param contact_id [String]
|
|
160
|
+
# @param [Hash] opts the optional parameters
|
|
161
|
+
# @return [nil]
|
|
162
|
+
def delete_contact(contact_id, opts = {})
|
|
163
|
+
delete_contact_with_http_info(contact_id, opts)
|
|
164
|
+
nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Delete a contact
|
|
168
|
+
# @param contact_id [String]
|
|
169
|
+
# @param [Hash] opts the optional parameters
|
|
170
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
171
|
+
def delete_contact_with_http_info(contact_id, opts = {})
|
|
172
|
+
if @api_client.config.debugging
|
|
173
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.delete_contact ...'
|
|
174
|
+
end
|
|
175
|
+
# verify the required parameter 'contact_id' is set
|
|
176
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
177
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.delete_contact"
|
|
178
|
+
end
|
|
179
|
+
# resource path
|
|
180
|
+
local_var_path = '/v1/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))
|
|
181
|
+
|
|
182
|
+
# query parameters
|
|
183
|
+
query_params = opts[:query_params] || {}
|
|
184
|
+
|
|
185
|
+
# header parameters
|
|
186
|
+
header_params = opts[:header_params] || {}
|
|
187
|
+
# HTTP header 'Accept' (if needed)
|
|
188
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
189
|
+
|
|
190
|
+
# form parameters
|
|
191
|
+
form_params = opts[:form_params] || {}
|
|
192
|
+
|
|
193
|
+
# http body (model)
|
|
194
|
+
post_body = opts[:debug_body]
|
|
195
|
+
|
|
196
|
+
# return_type
|
|
197
|
+
return_type = opts[:debug_return_type]
|
|
198
|
+
|
|
199
|
+
# auth_names
|
|
200
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
201
|
+
|
|
202
|
+
new_options = opts.merge(
|
|
203
|
+
:operation => :"ContactsApi.delete_contact",
|
|
204
|
+
:header_params => header_params,
|
|
205
|
+
:query_params => query_params,
|
|
206
|
+
:form_params => form_params,
|
|
207
|
+
:body => post_body,
|
|
208
|
+
:auth_names => auth_names,
|
|
209
|
+
:return_type => return_type
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
213
|
+
if @api_client.config.debugging
|
|
214
|
+
@api_client.config.logger.debug "API called: ContactsApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
215
|
+
end
|
|
216
|
+
return data, status_code, headers
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Get contact with channels
|
|
220
|
+
# @param contact_id [String]
|
|
221
|
+
# @param [Hash] opts the optional parameters
|
|
222
|
+
# @return [nil]
|
|
223
|
+
def get_contact(contact_id, opts = {})
|
|
224
|
+
get_contact_with_http_info(contact_id, opts)
|
|
225
|
+
nil
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Get contact with channels
|
|
229
|
+
# @param contact_id [String]
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
232
|
+
def get_contact_with_http_info(contact_id, opts = {})
|
|
233
|
+
if @api_client.config.debugging
|
|
234
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.get_contact ...'
|
|
235
|
+
end
|
|
236
|
+
# verify the required parameter 'contact_id' is set
|
|
237
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
238
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.get_contact"
|
|
239
|
+
end
|
|
240
|
+
# resource path
|
|
241
|
+
local_var_path = '/v1/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))
|
|
242
|
+
|
|
243
|
+
# query parameters
|
|
244
|
+
query_params = opts[:query_params] || {}
|
|
245
|
+
|
|
246
|
+
# header parameters
|
|
247
|
+
header_params = opts[:header_params] || {}
|
|
248
|
+
# HTTP header 'Accept' (if needed)
|
|
249
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
250
|
+
|
|
251
|
+
# form parameters
|
|
252
|
+
form_params = opts[:form_params] || {}
|
|
253
|
+
|
|
254
|
+
# http body (model)
|
|
255
|
+
post_body = opts[:debug_body]
|
|
256
|
+
|
|
257
|
+
# return_type
|
|
258
|
+
return_type = opts[:debug_return_type]
|
|
259
|
+
|
|
260
|
+
# auth_names
|
|
261
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
262
|
+
|
|
263
|
+
new_options = opts.merge(
|
|
264
|
+
:operation => :"ContactsApi.get_contact",
|
|
265
|
+
:header_params => header_params,
|
|
266
|
+
:query_params => query_params,
|
|
267
|
+
:form_params => form_params,
|
|
268
|
+
:body => post_body,
|
|
269
|
+
:auth_names => auth_names,
|
|
270
|
+
:return_type => return_type
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
274
|
+
if @api_client.config.debugging
|
|
275
|
+
@api_client.config.logger.debug "API called: ContactsApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
276
|
+
end
|
|
277
|
+
return data, status_code, headers
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# List channels for a contact
|
|
281
|
+
# @param contact_id [String]
|
|
282
|
+
# @param [Hash] opts the optional parameters
|
|
283
|
+
# @return [nil]
|
|
284
|
+
def get_contact_channels(contact_id, opts = {})
|
|
285
|
+
get_contact_channels_with_http_info(contact_id, opts)
|
|
286
|
+
nil
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# List channels for a contact
|
|
290
|
+
# @param contact_id [String]
|
|
291
|
+
# @param [Hash] opts the optional parameters
|
|
292
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
293
|
+
def get_contact_channels_with_http_info(contact_id, opts = {})
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_channels ...'
|
|
296
|
+
end
|
|
297
|
+
# verify the required parameter 'contact_id' is set
|
|
298
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
299
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.get_contact_channels"
|
|
300
|
+
end
|
|
301
|
+
# resource path
|
|
302
|
+
local_var_path = '/v1/contacts/{contactId}/channels'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))
|
|
303
|
+
|
|
304
|
+
# query parameters
|
|
305
|
+
query_params = opts[:query_params] || {}
|
|
306
|
+
|
|
307
|
+
# header parameters
|
|
308
|
+
header_params = opts[:header_params] || {}
|
|
309
|
+
# HTTP header 'Accept' (if needed)
|
|
310
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
311
|
+
|
|
312
|
+
# form parameters
|
|
313
|
+
form_params = opts[:form_params] || {}
|
|
314
|
+
|
|
315
|
+
# http body (model)
|
|
316
|
+
post_body = opts[:debug_body]
|
|
317
|
+
|
|
318
|
+
# return_type
|
|
319
|
+
return_type = opts[:debug_return_type]
|
|
320
|
+
|
|
321
|
+
# auth_names
|
|
322
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
323
|
+
|
|
324
|
+
new_options = opts.merge(
|
|
325
|
+
:operation => :"ContactsApi.get_contact_channels",
|
|
326
|
+
:header_params => header_params,
|
|
327
|
+
:query_params => query_params,
|
|
328
|
+
:form_params => form_params,
|
|
329
|
+
:body => post_body,
|
|
330
|
+
:auth_names => auth_names,
|
|
331
|
+
:return_type => return_type
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
335
|
+
if @api_client.config.debugging
|
|
336
|
+
@api_client.config.logger.debug "API called: ContactsApi#get_contact_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
337
|
+
end
|
|
338
|
+
return data, status_code, headers
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# List contacts
|
|
342
|
+
# List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search.
|
|
343
|
+
# @param profile_id [String]
|
|
344
|
+
# @param [Hash] opts the optional parameters
|
|
345
|
+
# @option opts [String] :search
|
|
346
|
+
# @option opts [String] :tag
|
|
347
|
+
# @option opts [String] :platform
|
|
348
|
+
# @option opts [String] :is_subscribed
|
|
349
|
+
# @option opts [Integer] :limit (default to 50)
|
|
350
|
+
# @option opts [Integer] :skip (default to 0)
|
|
351
|
+
# @return [nil]
|
|
352
|
+
def list_contacts(profile_id, opts = {})
|
|
353
|
+
list_contacts_with_http_info(profile_id, opts)
|
|
354
|
+
nil
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# List contacts
|
|
358
|
+
# List and search contacts for a profile. Supports filtering by tags, platform, subscription status, and full-text search.
|
|
359
|
+
# @param profile_id [String]
|
|
360
|
+
# @param [Hash] opts the optional parameters
|
|
361
|
+
# @option opts [String] :search
|
|
362
|
+
# @option opts [String] :tag
|
|
363
|
+
# @option opts [String] :platform
|
|
364
|
+
# @option opts [String] :is_subscribed
|
|
365
|
+
# @option opts [Integer] :limit (default to 50)
|
|
366
|
+
# @option opts [Integer] :skip (default to 0)
|
|
367
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
368
|
+
def list_contacts_with_http_info(profile_id, opts = {})
|
|
369
|
+
if @api_client.config.debugging
|
|
370
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.list_contacts ...'
|
|
371
|
+
end
|
|
372
|
+
# verify the required parameter 'profile_id' is set
|
|
373
|
+
if @api_client.config.client_side_validation && profile_id.nil?
|
|
374
|
+
fail ArgumentError, "Missing the required parameter 'profile_id' when calling ContactsApi.list_contacts"
|
|
375
|
+
end
|
|
376
|
+
allowable_values = ["instagram", "facebook", "telegram", "twitter", "bluesky", "reddit", "whatsapp"]
|
|
377
|
+
if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
|
|
378
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
|
|
379
|
+
end
|
|
380
|
+
allowable_values = ["true", "false"]
|
|
381
|
+
if @api_client.config.client_side_validation && opts[:'is_subscribed'] && !allowable_values.include?(opts[:'is_subscribed'])
|
|
382
|
+
fail ArgumentError, "invalid value for \"is_subscribed\", must be one of #{allowable_values}"
|
|
383
|
+
end
|
|
384
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
|
|
385
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.list_contacts, must be smaller than or equal to 200.'
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
# resource path
|
|
389
|
+
local_var_path = '/v1/contacts'
|
|
390
|
+
|
|
391
|
+
# query parameters
|
|
392
|
+
query_params = opts[:query_params] || {}
|
|
393
|
+
query_params[:'profileId'] = profile_id
|
|
394
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
395
|
+
query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
|
|
396
|
+
query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
|
|
397
|
+
query_params[:'isSubscribed'] = opts[:'is_subscribed'] if !opts[:'is_subscribed'].nil?
|
|
398
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
399
|
+
query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
|
|
400
|
+
|
|
401
|
+
# header parameters
|
|
402
|
+
header_params = opts[:header_params] || {}
|
|
403
|
+
# HTTP header 'Accept' (if needed)
|
|
404
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
405
|
+
|
|
406
|
+
# form parameters
|
|
407
|
+
form_params = opts[:form_params] || {}
|
|
408
|
+
|
|
409
|
+
# http body (model)
|
|
410
|
+
post_body = opts[:debug_body]
|
|
411
|
+
|
|
412
|
+
# return_type
|
|
413
|
+
return_type = opts[:debug_return_type]
|
|
414
|
+
|
|
415
|
+
# auth_names
|
|
416
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
417
|
+
|
|
418
|
+
new_options = opts.merge(
|
|
419
|
+
:operation => :"ContactsApi.list_contacts",
|
|
420
|
+
:header_params => header_params,
|
|
421
|
+
:query_params => query_params,
|
|
422
|
+
:form_params => form_params,
|
|
423
|
+
:body => post_body,
|
|
424
|
+
:auth_names => auth_names,
|
|
425
|
+
:return_type => return_type
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
429
|
+
if @api_client.config.debugging
|
|
430
|
+
@api_client.config.logger.debug "API called: ContactsApi#list_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
431
|
+
end
|
|
432
|
+
return data, status_code, headers
|
|
433
|
+
end
|
|
434
|
+
|
|
435
|
+
# Update a contact
|
|
436
|
+
# @param contact_id [String]
|
|
437
|
+
# @param [Hash] opts the optional parameters
|
|
438
|
+
# @option opts [UpdateContactRequest] :update_contact_request
|
|
439
|
+
# @return [nil]
|
|
440
|
+
def update_contact(contact_id, opts = {})
|
|
441
|
+
update_contact_with_http_info(contact_id, opts)
|
|
442
|
+
nil
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
# Update a contact
|
|
446
|
+
# @param contact_id [String]
|
|
447
|
+
# @param [Hash] opts the optional parameters
|
|
448
|
+
# @option opts [UpdateContactRequest] :update_contact_request
|
|
449
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
450
|
+
def update_contact_with_http_info(contact_id, opts = {})
|
|
451
|
+
if @api_client.config.debugging
|
|
452
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.update_contact ...'
|
|
453
|
+
end
|
|
454
|
+
# verify the required parameter 'contact_id' is set
|
|
455
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
456
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactsApi.update_contact"
|
|
457
|
+
end
|
|
458
|
+
# resource path
|
|
459
|
+
local_var_path = '/v1/contacts/{contactId}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s))
|
|
460
|
+
|
|
461
|
+
# query parameters
|
|
462
|
+
query_params = opts[:query_params] || {}
|
|
463
|
+
|
|
464
|
+
# header parameters
|
|
465
|
+
header_params = opts[:header_params] || {}
|
|
466
|
+
# HTTP header 'Accept' (if needed)
|
|
467
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
468
|
+
# HTTP header 'Content-Type'
|
|
469
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
470
|
+
if !content_type.nil?
|
|
471
|
+
header_params['Content-Type'] = content_type
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
# form parameters
|
|
475
|
+
form_params = opts[:form_params] || {}
|
|
476
|
+
|
|
477
|
+
# http body (model)
|
|
478
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_contact_request'])
|
|
479
|
+
|
|
480
|
+
# return_type
|
|
481
|
+
return_type = opts[:debug_return_type]
|
|
482
|
+
|
|
483
|
+
# auth_names
|
|
484
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
485
|
+
|
|
486
|
+
new_options = opts.merge(
|
|
487
|
+
:operation => :"ContactsApi.update_contact",
|
|
488
|
+
:header_params => header_params,
|
|
489
|
+
:query_params => query_params,
|
|
490
|
+
:form_params => form_params,
|
|
491
|
+
:body => post_body,
|
|
492
|
+
:auth_names => auth_names,
|
|
493
|
+
:return_type => return_type
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
497
|
+
if @api_client.config.debugging
|
|
498
|
+
@api_client.config.logger.debug "API called: ContactsApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
499
|
+
end
|
|
500
|
+
return data, status_code, headers
|
|
501
|
+
end
|
|
502
|
+
end
|
|
503
|
+
end
|