late-sdk 0.0.67 → 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 +63 -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/TwitterPlatformData.md +3 -1
- data/docs/TwitterPlatformDataPoll.md +20 -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/twitter_platform_data.rb +13 -4
- data/lib/late-sdk/models/twitter_platform_data_poll.rb +231 -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 +29 -0
- data/openapi.yaml +830 -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/twitter_platform_data_poll_spec.rb +42 -0
- data/spec/models/twitter_platform_data_spec.rb +6 -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 +118 -2
- data/zernio-sdk-0.0.67.gem +0 -0
|
@@ -0,0 +1,424 @@
|
|
|
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 CustomFieldsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Clear a custom field value
|
|
23
|
+
# @param contact_id [String]
|
|
24
|
+
# @param slug [String]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [nil]
|
|
27
|
+
def clear_contact_field_value(contact_id, slug, opts = {})
|
|
28
|
+
clear_contact_field_value_with_http_info(contact_id, slug, opts)
|
|
29
|
+
nil
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Clear a custom field value
|
|
33
|
+
# @param contact_id [String]
|
|
34
|
+
# @param slug [String]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
37
|
+
def clear_contact_field_value_with_http_info(contact_id, slug, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: CustomFieldsApi.clear_contact_field_value ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'contact_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling CustomFieldsApi.clear_contact_field_value"
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'slug' is set
|
|
46
|
+
if @api_client.config.client_side_validation && slug.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'slug' when calling CustomFieldsApi.clear_contact_field_value"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/v1/contacts/{contactId}/fields/{slug}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s)).sub('{' + 'slug' + '}', CGI.escape(slug.to_s))
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
|
|
55
|
+
# header parameters
|
|
56
|
+
header_params = opts[:header_params] || {}
|
|
57
|
+
# HTTP header 'Accept' (if needed)
|
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
59
|
+
|
|
60
|
+
# form parameters
|
|
61
|
+
form_params = opts[:form_params] || {}
|
|
62
|
+
|
|
63
|
+
# http body (model)
|
|
64
|
+
post_body = opts[:debug_body]
|
|
65
|
+
|
|
66
|
+
# return_type
|
|
67
|
+
return_type = opts[:debug_return_type]
|
|
68
|
+
|
|
69
|
+
# auth_names
|
|
70
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
71
|
+
|
|
72
|
+
new_options = opts.merge(
|
|
73
|
+
:operation => :"CustomFieldsApi.clear_contact_field_value",
|
|
74
|
+
:header_params => header_params,
|
|
75
|
+
:query_params => query_params,
|
|
76
|
+
:form_params => form_params,
|
|
77
|
+
:body => post_body,
|
|
78
|
+
:auth_names => auth_names,
|
|
79
|
+
:return_type => return_type
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
83
|
+
if @api_client.config.debugging
|
|
84
|
+
@api_client.config.logger.debug "API called: CustomFieldsApi#clear_contact_field_value\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
85
|
+
end
|
|
86
|
+
return data, status_code, headers
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Create a custom field definition
|
|
90
|
+
# @param create_custom_field_request [CreateCustomFieldRequest]
|
|
91
|
+
# @param [Hash] opts the optional parameters
|
|
92
|
+
# @return [nil]
|
|
93
|
+
def create_custom_field(create_custom_field_request, opts = {})
|
|
94
|
+
create_custom_field_with_http_info(create_custom_field_request, opts)
|
|
95
|
+
nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Create a custom field definition
|
|
99
|
+
# @param create_custom_field_request [CreateCustomFieldRequest]
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
102
|
+
def create_custom_field_with_http_info(create_custom_field_request, opts = {})
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug 'Calling API: CustomFieldsApi.create_custom_field ...'
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'create_custom_field_request' is set
|
|
107
|
+
if @api_client.config.client_side_validation && create_custom_field_request.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'create_custom_field_request' when calling CustomFieldsApi.create_custom_field"
|
|
109
|
+
end
|
|
110
|
+
# resource path
|
|
111
|
+
local_var_path = '/v1/custom-fields'
|
|
112
|
+
|
|
113
|
+
# query parameters
|
|
114
|
+
query_params = opts[:query_params] || {}
|
|
115
|
+
|
|
116
|
+
# header parameters
|
|
117
|
+
header_params = opts[:header_params] || {}
|
|
118
|
+
# HTTP header 'Accept' (if needed)
|
|
119
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
120
|
+
# HTTP header 'Content-Type'
|
|
121
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
122
|
+
if !content_type.nil?
|
|
123
|
+
header_params['Content-Type'] = content_type
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# form parameters
|
|
127
|
+
form_params = opts[:form_params] || {}
|
|
128
|
+
|
|
129
|
+
# http body (model)
|
|
130
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_custom_field_request)
|
|
131
|
+
|
|
132
|
+
# return_type
|
|
133
|
+
return_type = opts[:debug_return_type]
|
|
134
|
+
|
|
135
|
+
# auth_names
|
|
136
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
137
|
+
|
|
138
|
+
new_options = opts.merge(
|
|
139
|
+
:operation => :"CustomFieldsApi.create_custom_field",
|
|
140
|
+
:header_params => header_params,
|
|
141
|
+
:query_params => query_params,
|
|
142
|
+
:form_params => form_params,
|
|
143
|
+
:body => post_body,
|
|
144
|
+
:auth_names => auth_names,
|
|
145
|
+
:return_type => return_type
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
149
|
+
if @api_client.config.debugging
|
|
150
|
+
@api_client.config.logger.debug "API called: CustomFieldsApi#create_custom_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
151
|
+
end
|
|
152
|
+
return data, status_code, headers
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Delete a custom field definition
|
|
156
|
+
# @param field_id [String]
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @return [nil]
|
|
159
|
+
def delete_custom_field(field_id, opts = {})
|
|
160
|
+
delete_custom_field_with_http_info(field_id, opts)
|
|
161
|
+
nil
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Delete a custom field definition
|
|
165
|
+
# @param field_id [String]
|
|
166
|
+
# @param [Hash] opts the optional parameters
|
|
167
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
168
|
+
def delete_custom_field_with_http_info(field_id, opts = {})
|
|
169
|
+
if @api_client.config.debugging
|
|
170
|
+
@api_client.config.logger.debug 'Calling API: CustomFieldsApi.delete_custom_field ...'
|
|
171
|
+
end
|
|
172
|
+
# verify the required parameter 'field_id' is set
|
|
173
|
+
if @api_client.config.client_side_validation && field_id.nil?
|
|
174
|
+
fail ArgumentError, "Missing the required parameter 'field_id' when calling CustomFieldsApi.delete_custom_field"
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = '/v1/custom-fields/{fieldId}'.sub('{' + 'fieldId' + '}', CGI.escape(field_id.to_s))
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = opts[:query_params] || {}
|
|
181
|
+
|
|
182
|
+
# header parameters
|
|
183
|
+
header_params = opts[:header_params] || {}
|
|
184
|
+
# HTTP header 'Accept' (if needed)
|
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
186
|
+
|
|
187
|
+
# form parameters
|
|
188
|
+
form_params = opts[:form_params] || {}
|
|
189
|
+
|
|
190
|
+
# http body (model)
|
|
191
|
+
post_body = opts[:debug_body]
|
|
192
|
+
|
|
193
|
+
# return_type
|
|
194
|
+
return_type = opts[:debug_return_type]
|
|
195
|
+
|
|
196
|
+
# auth_names
|
|
197
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
198
|
+
|
|
199
|
+
new_options = opts.merge(
|
|
200
|
+
:operation => :"CustomFieldsApi.delete_custom_field",
|
|
201
|
+
:header_params => header_params,
|
|
202
|
+
:query_params => query_params,
|
|
203
|
+
:form_params => form_params,
|
|
204
|
+
:body => post_body,
|
|
205
|
+
:auth_names => auth_names,
|
|
206
|
+
:return_type => return_type
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
210
|
+
if @api_client.config.debugging
|
|
211
|
+
@api_client.config.logger.debug "API called: CustomFieldsApi#delete_custom_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
212
|
+
end
|
|
213
|
+
return data, status_code, headers
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# List custom field definitions
|
|
217
|
+
# @param profile_id [String]
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @return [nil]
|
|
220
|
+
def list_custom_fields(profile_id, opts = {})
|
|
221
|
+
list_custom_fields_with_http_info(profile_id, opts)
|
|
222
|
+
nil
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# List custom field definitions
|
|
226
|
+
# @param profile_id [String]
|
|
227
|
+
# @param [Hash] opts the optional parameters
|
|
228
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
229
|
+
def list_custom_fields_with_http_info(profile_id, opts = {})
|
|
230
|
+
if @api_client.config.debugging
|
|
231
|
+
@api_client.config.logger.debug 'Calling API: CustomFieldsApi.list_custom_fields ...'
|
|
232
|
+
end
|
|
233
|
+
# verify the required parameter 'profile_id' is set
|
|
234
|
+
if @api_client.config.client_side_validation && profile_id.nil?
|
|
235
|
+
fail ArgumentError, "Missing the required parameter 'profile_id' when calling CustomFieldsApi.list_custom_fields"
|
|
236
|
+
end
|
|
237
|
+
# resource path
|
|
238
|
+
local_var_path = '/v1/custom-fields'
|
|
239
|
+
|
|
240
|
+
# query parameters
|
|
241
|
+
query_params = opts[:query_params] || {}
|
|
242
|
+
query_params[:'profileId'] = profile_id
|
|
243
|
+
|
|
244
|
+
# header parameters
|
|
245
|
+
header_params = opts[:header_params] || {}
|
|
246
|
+
# HTTP header 'Accept' (if needed)
|
|
247
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
248
|
+
|
|
249
|
+
# form parameters
|
|
250
|
+
form_params = opts[:form_params] || {}
|
|
251
|
+
|
|
252
|
+
# http body (model)
|
|
253
|
+
post_body = opts[:debug_body]
|
|
254
|
+
|
|
255
|
+
# return_type
|
|
256
|
+
return_type = opts[:debug_return_type]
|
|
257
|
+
|
|
258
|
+
# auth_names
|
|
259
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
260
|
+
|
|
261
|
+
new_options = opts.merge(
|
|
262
|
+
:operation => :"CustomFieldsApi.list_custom_fields",
|
|
263
|
+
:header_params => header_params,
|
|
264
|
+
:query_params => query_params,
|
|
265
|
+
:form_params => form_params,
|
|
266
|
+
:body => post_body,
|
|
267
|
+
:auth_names => auth_names,
|
|
268
|
+
:return_type => return_type
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
272
|
+
if @api_client.config.debugging
|
|
273
|
+
@api_client.config.logger.debug "API called: CustomFieldsApi#list_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
274
|
+
end
|
|
275
|
+
return data, status_code, headers
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Set a custom field value
|
|
279
|
+
# @param contact_id [String]
|
|
280
|
+
# @param slug [String]
|
|
281
|
+
# @param set_contact_field_value_request [SetContactFieldValueRequest]
|
|
282
|
+
# @param [Hash] opts the optional parameters
|
|
283
|
+
# @return [nil]
|
|
284
|
+
def set_contact_field_value(contact_id, slug, set_contact_field_value_request, opts = {})
|
|
285
|
+
set_contact_field_value_with_http_info(contact_id, slug, set_contact_field_value_request, opts)
|
|
286
|
+
nil
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Set a custom field value
|
|
290
|
+
# @param contact_id [String]
|
|
291
|
+
# @param slug [String]
|
|
292
|
+
# @param set_contact_field_value_request [SetContactFieldValueRequest]
|
|
293
|
+
# @param [Hash] opts the optional parameters
|
|
294
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
295
|
+
def set_contact_field_value_with_http_info(contact_id, slug, set_contact_field_value_request, opts = {})
|
|
296
|
+
if @api_client.config.debugging
|
|
297
|
+
@api_client.config.logger.debug 'Calling API: CustomFieldsApi.set_contact_field_value ...'
|
|
298
|
+
end
|
|
299
|
+
# verify the required parameter 'contact_id' is set
|
|
300
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
301
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling CustomFieldsApi.set_contact_field_value"
|
|
302
|
+
end
|
|
303
|
+
# verify the required parameter 'slug' is set
|
|
304
|
+
if @api_client.config.client_side_validation && slug.nil?
|
|
305
|
+
fail ArgumentError, "Missing the required parameter 'slug' when calling CustomFieldsApi.set_contact_field_value"
|
|
306
|
+
end
|
|
307
|
+
# verify the required parameter 'set_contact_field_value_request' is set
|
|
308
|
+
if @api_client.config.client_side_validation && set_contact_field_value_request.nil?
|
|
309
|
+
fail ArgumentError, "Missing the required parameter 'set_contact_field_value_request' when calling CustomFieldsApi.set_contact_field_value"
|
|
310
|
+
end
|
|
311
|
+
# resource path
|
|
312
|
+
local_var_path = '/v1/contacts/{contactId}/fields/{slug}'.sub('{' + 'contactId' + '}', CGI.escape(contact_id.to_s)).sub('{' + 'slug' + '}', CGI.escape(slug.to_s))
|
|
313
|
+
|
|
314
|
+
# query parameters
|
|
315
|
+
query_params = opts[:query_params] || {}
|
|
316
|
+
|
|
317
|
+
# header parameters
|
|
318
|
+
header_params = opts[:header_params] || {}
|
|
319
|
+
# HTTP header 'Accept' (if needed)
|
|
320
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
321
|
+
# HTTP header 'Content-Type'
|
|
322
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
323
|
+
if !content_type.nil?
|
|
324
|
+
header_params['Content-Type'] = content_type
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# form parameters
|
|
328
|
+
form_params = opts[:form_params] || {}
|
|
329
|
+
|
|
330
|
+
# http body (model)
|
|
331
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_contact_field_value_request)
|
|
332
|
+
|
|
333
|
+
# return_type
|
|
334
|
+
return_type = opts[:debug_return_type]
|
|
335
|
+
|
|
336
|
+
# auth_names
|
|
337
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
338
|
+
|
|
339
|
+
new_options = opts.merge(
|
|
340
|
+
:operation => :"CustomFieldsApi.set_contact_field_value",
|
|
341
|
+
:header_params => header_params,
|
|
342
|
+
:query_params => query_params,
|
|
343
|
+
:form_params => form_params,
|
|
344
|
+
:body => post_body,
|
|
345
|
+
:auth_names => auth_names,
|
|
346
|
+
:return_type => return_type
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
350
|
+
if @api_client.config.debugging
|
|
351
|
+
@api_client.config.logger.debug "API called: CustomFieldsApi#set_contact_field_value\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
352
|
+
end
|
|
353
|
+
return data, status_code, headers
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Update a custom field definition
|
|
357
|
+
# @param field_id [String]
|
|
358
|
+
# @param [Hash] opts the optional parameters
|
|
359
|
+
# @option opts [UpdateCustomFieldRequest] :update_custom_field_request
|
|
360
|
+
# @return [nil]
|
|
361
|
+
def update_custom_field(field_id, opts = {})
|
|
362
|
+
update_custom_field_with_http_info(field_id, opts)
|
|
363
|
+
nil
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Update a custom field definition
|
|
367
|
+
# @param field_id [String]
|
|
368
|
+
# @param [Hash] opts the optional parameters
|
|
369
|
+
# @option opts [UpdateCustomFieldRequest] :update_custom_field_request
|
|
370
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
371
|
+
def update_custom_field_with_http_info(field_id, opts = {})
|
|
372
|
+
if @api_client.config.debugging
|
|
373
|
+
@api_client.config.logger.debug 'Calling API: CustomFieldsApi.update_custom_field ...'
|
|
374
|
+
end
|
|
375
|
+
# verify the required parameter 'field_id' is set
|
|
376
|
+
if @api_client.config.client_side_validation && field_id.nil?
|
|
377
|
+
fail ArgumentError, "Missing the required parameter 'field_id' when calling CustomFieldsApi.update_custom_field"
|
|
378
|
+
end
|
|
379
|
+
# resource path
|
|
380
|
+
local_var_path = '/v1/custom-fields/{fieldId}'.sub('{' + 'fieldId' + '}', CGI.escape(field_id.to_s))
|
|
381
|
+
|
|
382
|
+
# query parameters
|
|
383
|
+
query_params = opts[:query_params] || {}
|
|
384
|
+
|
|
385
|
+
# header parameters
|
|
386
|
+
header_params = opts[:header_params] || {}
|
|
387
|
+
# HTTP header 'Accept' (if needed)
|
|
388
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
389
|
+
# HTTP header 'Content-Type'
|
|
390
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
391
|
+
if !content_type.nil?
|
|
392
|
+
header_params['Content-Type'] = content_type
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
# form parameters
|
|
396
|
+
form_params = opts[:form_params] || {}
|
|
397
|
+
|
|
398
|
+
# http body (model)
|
|
399
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_custom_field_request'])
|
|
400
|
+
|
|
401
|
+
# return_type
|
|
402
|
+
return_type = opts[:debug_return_type]
|
|
403
|
+
|
|
404
|
+
# auth_names
|
|
405
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
406
|
+
|
|
407
|
+
new_options = opts.merge(
|
|
408
|
+
:operation => :"CustomFieldsApi.update_custom_field",
|
|
409
|
+
:header_params => header_params,
|
|
410
|
+
:query_params => query_params,
|
|
411
|
+
:form_params => form_params,
|
|
412
|
+
:body => post_body,
|
|
413
|
+
:auth_names => auth_names,
|
|
414
|
+
:return_type => return_type
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
418
|
+
if @api_client.config.debugging
|
|
419
|
+
@api_client.config.logger.debug "API called: CustomFieldsApi#update_custom_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
420
|
+
end
|
|
421
|
+
return data, status_code, headers
|
|
422
|
+
end
|
|
423
|
+
end
|
|
424
|
+
end
|