sib-api-v3-sdk 2.1.3 → 2.1.4
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 +9 -5
- data/docs/AttributesApi.md +78 -12
- data/docs/ContactsApi.md +78 -12
- data/docs/CreateAttribute.md +3 -5
- data/docs/CreateAttributeEnumeration.md +9 -0
- data/docs/GetAttributesAttributes.md +0 -1
- data/docs/SendSms.md +1 -0
- data/docs/UpdateAttribute.md +9 -0
- data/docs/{CreateAttributeEnumemaration.md → UpdateAttributeEnumeration.md} +1 -1
- data/lib/sib-api-v3-sdk.rb +3 -1
- data/lib/sib-api-v3-sdk/api/attributes_api.rb +115 -20
- data/lib/sib-api-v3-sdk/api/contacts_api.rb +115 -20
- data/lib/sib-api-v3-sdk/models/create_attribute.rb +12 -59
- data/lib/sib-api-v3-sdk/models/create_attribute_enumeration.rb +209 -0
- data/lib/sib-api-v3-sdk/models/error_model.rb +2 -2
- data/lib/sib-api-v3-sdk/models/get_attributes_attributes.rb +1 -16
- data/lib/sib-api-v3-sdk/models/send_sms.rb +18 -4
- data/lib/sib-api-v3-sdk/models/update_attribute.rb +201 -0
- data/lib/sib-api-v3-sdk/models/{create_attribute_enumemaration.rb → update_attribute_enumeration.rb} +1 -1
- data/lib/sib-api-v3-sdk/version.rb +1 -1
- data/spec/api/attributes_api_spec.rb +20 -3
- data/spec/api/contacts_api_spec.rb +20 -3
- data/spec/models/{create_attribute_enumemaration_spec.rb → create_attribute_enumeration_spec.rb} +7 -7
- data/spec/models/create_attribute_spec.rb +2 -18
- data/spec/models/error_model_spec.rb +1 -1
- data/spec/models/get_attributes_attributes_spec.rb +0 -6
- data/spec/models/send_sms_spec.rb +6 -0
- data/spec/models/update_attribute_enumeration_spec.rb +48 -0
- data/spec/models/update_attribute_spec.rb +48 -0
- metadata +14 -6
@@ -20,31 +20,47 @@ module SibApiV3Sdk
|
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
22
|
|
23
|
-
# Creates contact
|
23
|
+
# Creates contact attribute
|
24
24
|
#
|
25
|
+
# @param attribute_category Category of the attribute
|
26
|
+
# @param attribute_name Name of the attribute
|
25
27
|
# @param create_attribute Values to create an attribute
|
26
28
|
# @param [Hash] opts the optional parameters
|
27
|
-
# @return [
|
28
|
-
def create_attribute(create_attribute, opts = {})
|
29
|
-
|
30
|
-
return
|
29
|
+
# @return [nil]
|
30
|
+
def create_attribute(attribute_category, attribute_name, create_attribute, opts = {})
|
31
|
+
create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts)
|
32
|
+
return nil
|
31
33
|
end
|
32
34
|
|
33
|
-
# Creates contact
|
35
|
+
# Creates contact attribute
|
34
36
|
#
|
37
|
+
# @param attribute_category Category of the attribute
|
38
|
+
# @param attribute_name Name of the attribute
|
35
39
|
# @param create_attribute Values to create an attribute
|
36
40
|
# @param [Hash] opts the optional parameters
|
37
|
-
# @return [Array<(
|
38
|
-
def create_attribute_with_http_info(create_attribute, opts = {})
|
41
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
42
|
+
def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {})
|
39
43
|
if @api_client.config.debugging
|
40
44
|
@api_client.config.logger.debug "Calling API: AttributesApi.create_attribute ..."
|
41
45
|
end
|
46
|
+
# verify the required parameter 'attribute_category' is set
|
47
|
+
if @api_client.config.client_side_validation && attribute_category.nil?
|
48
|
+
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.create_attribute"
|
49
|
+
end
|
50
|
+
# verify enum value
|
51
|
+
if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
|
52
|
+
fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
|
53
|
+
end
|
54
|
+
# verify the required parameter 'attribute_name' is set
|
55
|
+
if @api_client.config.client_side_validation && attribute_name.nil?
|
56
|
+
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.create_attribute"
|
57
|
+
end
|
42
58
|
# verify the required parameter 'create_attribute' is set
|
43
59
|
if @api_client.config.client_side_validation && create_attribute.nil?
|
44
60
|
fail ArgumentError, "Missing the required parameter 'create_attribute' when calling AttributesApi.create_attribute"
|
45
61
|
end
|
46
62
|
# resource path
|
47
|
-
local_var_path = "/contacts/attributes"
|
63
|
+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
48
64
|
|
49
65
|
# query parameters
|
50
66
|
query_params = {}
|
@@ -67,8 +83,7 @@ module SibApiV3Sdk
|
|
67
83
|
:query_params => query_params,
|
68
84
|
:form_params => form_params,
|
69
85
|
:body => post_body,
|
70
|
-
:auth_names => auth_names
|
71
|
-
:return_type => 'CreateModel')
|
86
|
+
:auth_names => auth_names)
|
72
87
|
if @api_client.config.debugging
|
73
88
|
@api_client.config.logger.debug "API called: AttributesApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
74
89
|
end
|
@@ -77,29 +92,39 @@ module SibApiV3Sdk
|
|
77
92
|
|
78
93
|
# Deletes an attribute
|
79
94
|
#
|
80
|
-
# @param
|
95
|
+
# @param attribute_category Category of the attribute
|
96
|
+
# @param attribute_name Name of the existing attribute
|
81
97
|
# @param [Hash] opts the optional parameters
|
82
98
|
# @return [nil]
|
83
|
-
def delete_attribute(
|
84
|
-
delete_attribute_with_http_info(
|
99
|
+
def delete_attribute(attribute_category, attribute_name, opts = {})
|
100
|
+
delete_attribute_with_http_info(attribute_category, attribute_name, opts)
|
85
101
|
return nil
|
86
102
|
end
|
87
103
|
|
88
104
|
# Deletes an attribute
|
89
105
|
#
|
90
|
-
# @param
|
106
|
+
# @param attribute_category Category of the attribute
|
107
|
+
# @param attribute_name Name of the existing attribute
|
91
108
|
# @param [Hash] opts the optional parameters
|
92
109
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
93
|
-
def delete_attribute_with_http_info(
|
110
|
+
def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {})
|
94
111
|
if @api_client.config.debugging
|
95
112
|
@api_client.config.logger.debug "Calling API: AttributesApi.delete_attribute ..."
|
96
113
|
end
|
97
|
-
# verify the required parameter '
|
98
|
-
if @api_client.config.client_side_validation &&
|
99
|
-
fail ArgumentError, "Missing the required parameter '
|
114
|
+
# verify the required parameter 'attribute_category' is set
|
115
|
+
if @api_client.config.client_side_validation && attribute_category.nil?
|
116
|
+
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.delete_attribute"
|
117
|
+
end
|
118
|
+
# verify enum value
|
119
|
+
if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
|
120
|
+
fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
|
121
|
+
end
|
122
|
+
# verify the required parameter 'attribute_name' is set
|
123
|
+
if @api_client.config.client_side_validation && attribute_name.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.delete_attribute"
|
100
125
|
end
|
101
126
|
# resource path
|
102
|
-
local_var_path = "/contacts/attributes/{
|
127
|
+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
103
128
|
|
104
129
|
# query parameters
|
105
130
|
query_params = {}
|
@@ -177,5 +202,75 @@ module SibApiV3Sdk
|
|
177
202
|
end
|
178
203
|
return data, status_code, headers
|
179
204
|
end
|
205
|
+
|
206
|
+
# Updates contact attribute
|
207
|
+
#
|
208
|
+
# @param attribute_category Category of the attribute
|
209
|
+
# @param attribute_name Name of the existing attribute
|
210
|
+
# @param update_attribute Values to update an attribute
|
211
|
+
# @param [Hash] opts the optional parameters
|
212
|
+
# @return [nil]
|
213
|
+
def update_attribute(attribute_category, attribute_name, update_attribute, opts = {})
|
214
|
+
update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts)
|
215
|
+
return nil
|
216
|
+
end
|
217
|
+
|
218
|
+
# Updates contact attribute
|
219
|
+
#
|
220
|
+
# @param attribute_category Category of the attribute
|
221
|
+
# @param attribute_name Name of the existing attribute
|
222
|
+
# @param update_attribute Values to update an attribute
|
223
|
+
# @param [Hash] opts the optional parameters
|
224
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
225
|
+
def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {})
|
226
|
+
if @api_client.config.debugging
|
227
|
+
@api_client.config.logger.debug "Calling API: AttributesApi.update_attribute ..."
|
228
|
+
end
|
229
|
+
# verify the required parameter 'attribute_category' is set
|
230
|
+
if @api_client.config.client_side_validation && attribute_category.nil?
|
231
|
+
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.update_attribute"
|
232
|
+
end
|
233
|
+
# verify enum value
|
234
|
+
if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category)
|
235
|
+
fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global"
|
236
|
+
end
|
237
|
+
# verify the required parameter 'attribute_name' is set
|
238
|
+
if @api_client.config.client_side_validation && attribute_name.nil?
|
239
|
+
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.update_attribute"
|
240
|
+
end
|
241
|
+
# verify the required parameter 'update_attribute' is set
|
242
|
+
if @api_client.config.client_side_validation && update_attribute.nil?
|
243
|
+
fail ArgumentError, "Missing the required parameter 'update_attribute' when calling AttributesApi.update_attribute"
|
244
|
+
end
|
245
|
+
# resource path
|
246
|
+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
247
|
+
|
248
|
+
# query parameters
|
249
|
+
query_params = {}
|
250
|
+
|
251
|
+
# header parameters
|
252
|
+
header_params = {}
|
253
|
+
# HTTP header 'Accept' (if needed)
|
254
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
255
|
+
# HTTP header 'Content-Type'
|
256
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
257
|
+
|
258
|
+
# form parameters
|
259
|
+
form_params = {}
|
260
|
+
|
261
|
+
# http body (model)
|
262
|
+
post_body = @api_client.object_to_http_body(update_attribute)
|
263
|
+
auth_names = ['api-key']
|
264
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
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
|
+
if @api_client.config.debugging
|
271
|
+
@api_client.config.logger.debug "API called: AttributesApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
272
|
+
end
|
273
|
+
return data, status_code, headers
|
274
|
+
end
|
180
275
|
end
|
181
276
|
end
|
@@ -81,31 +81,47 @@ module SibApiV3Sdk
|
|
81
81
|
return data, status_code, headers
|
82
82
|
end
|
83
83
|
|
84
|
-
# Creates contact
|
84
|
+
# Creates contact attribute
|
85
85
|
#
|
86
|
+
# @param attribute_category Category of the attribute
|
87
|
+
# @param attribute_name Name of the attribute
|
86
88
|
# @param create_attribute Values to create an attribute
|
87
89
|
# @param [Hash] opts the optional parameters
|
88
|
-
# @return [
|
89
|
-
def create_attribute(create_attribute, opts = {})
|
90
|
-
|
91
|
-
return
|
90
|
+
# @return [nil]
|
91
|
+
def create_attribute(attribute_category, attribute_name, create_attribute, opts = {})
|
92
|
+
create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts)
|
93
|
+
return nil
|
92
94
|
end
|
93
95
|
|
94
|
-
# Creates contact
|
96
|
+
# Creates contact attribute
|
95
97
|
#
|
98
|
+
# @param attribute_category Category of the attribute
|
99
|
+
# @param attribute_name Name of the attribute
|
96
100
|
# @param create_attribute Values to create an attribute
|
97
101
|
# @param [Hash] opts the optional parameters
|
98
|
-
# @return [Array<(
|
99
|
-
def create_attribute_with_http_info(create_attribute, opts = {})
|
102
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
103
|
+
def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {})
|
100
104
|
if @api_client.config.debugging
|
101
105
|
@api_client.config.logger.debug "Calling API: ContactsApi.create_attribute ..."
|
102
106
|
end
|
107
|
+
# verify the required parameter 'attribute_category' is set
|
108
|
+
if @api_client.config.client_side_validation && attribute_category.nil?
|
109
|
+
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.create_attribute"
|
110
|
+
end
|
111
|
+
# verify enum value
|
112
|
+
if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
|
113
|
+
fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
|
114
|
+
end
|
115
|
+
# verify the required parameter 'attribute_name' is set
|
116
|
+
if @api_client.config.client_side_validation && attribute_name.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.create_attribute"
|
118
|
+
end
|
103
119
|
# verify the required parameter 'create_attribute' is set
|
104
120
|
if @api_client.config.client_side_validation && create_attribute.nil?
|
105
121
|
fail ArgumentError, "Missing the required parameter 'create_attribute' when calling ContactsApi.create_attribute"
|
106
122
|
end
|
107
123
|
# resource path
|
108
|
-
local_var_path = "/contacts/attributes"
|
124
|
+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
109
125
|
|
110
126
|
# query parameters
|
111
127
|
query_params = {}
|
@@ -128,8 +144,7 @@ module SibApiV3Sdk
|
|
128
144
|
:query_params => query_params,
|
129
145
|
:form_params => form_params,
|
130
146
|
:body => post_body,
|
131
|
-
:auth_names => auth_names
|
132
|
-
:return_type => 'CreateModel')
|
147
|
+
:auth_names => auth_names)
|
133
148
|
if @api_client.config.debugging
|
134
149
|
@api_client.config.logger.debug "API called: ContactsApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
135
150
|
end
|
@@ -303,29 +318,39 @@ module SibApiV3Sdk
|
|
303
318
|
|
304
319
|
# Deletes an attribute
|
305
320
|
#
|
306
|
-
# @param
|
321
|
+
# @param attribute_category Category of the attribute
|
322
|
+
# @param attribute_name Name of the existing attribute
|
307
323
|
# @param [Hash] opts the optional parameters
|
308
324
|
# @return [nil]
|
309
|
-
def delete_attribute(
|
310
|
-
delete_attribute_with_http_info(
|
325
|
+
def delete_attribute(attribute_category, attribute_name, opts = {})
|
326
|
+
delete_attribute_with_http_info(attribute_category, attribute_name, opts)
|
311
327
|
return nil
|
312
328
|
end
|
313
329
|
|
314
330
|
# Deletes an attribute
|
315
331
|
#
|
316
|
-
# @param
|
332
|
+
# @param attribute_category Category of the attribute
|
333
|
+
# @param attribute_name Name of the existing attribute
|
317
334
|
# @param [Hash] opts the optional parameters
|
318
335
|
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
319
|
-
def delete_attribute_with_http_info(
|
336
|
+
def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {})
|
320
337
|
if @api_client.config.debugging
|
321
338
|
@api_client.config.logger.debug "Calling API: ContactsApi.delete_attribute ..."
|
322
339
|
end
|
323
|
-
# verify the required parameter '
|
324
|
-
if @api_client.config.client_side_validation &&
|
325
|
-
fail ArgumentError, "Missing the required parameter '
|
340
|
+
# verify the required parameter 'attribute_category' is set
|
341
|
+
if @api_client.config.client_side_validation && attribute_category.nil?
|
342
|
+
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.delete_attribute"
|
343
|
+
end
|
344
|
+
# verify enum value
|
345
|
+
if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category)
|
346
|
+
fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global"
|
347
|
+
end
|
348
|
+
# verify the required parameter 'attribute_name' is set
|
349
|
+
if @api_client.config.client_side_validation && attribute_name.nil?
|
350
|
+
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.delete_attribute"
|
326
351
|
end
|
327
352
|
# resource path
|
328
|
-
local_var_path = "/contacts/attributes/{
|
353
|
+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
329
354
|
|
330
355
|
# query parameters
|
331
356
|
query_params = {}
|
@@ -1224,6 +1249,76 @@ module SibApiV3Sdk
|
|
1224
1249
|
return data, status_code, headers
|
1225
1250
|
end
|
1226
1251
|
|
1252
|
+
# Updates contact attribute
|
1253
|
+
#
|
1254
|
+
# @param attribute_category Category of the attribute
|
1255
|
+
# @param attribute_name Name of the existing attribute
|
1256
|
+
# @param update_attribute Values to update an attribute
|
1257
|
+
# @param [Hash] opts the optional parameters
|
1258
|
+
# @return [nil]
|
1259
|
+
def update_attribute(attribute_category, attribute_name, update_attribute, opts = {})
|
1260
|
+
update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts)
|
1261
|
+
return nil
|
1262
|
+
end
|
1263
|
+
|
1264
|
+
# Updates contact attribute
|
1265
|
+
#
|
1266
|
+
# @param attribute_category Category of the attribute
|
1267
|
+
# @param attribute_name Name of the existing attribute
|
1268
|
+
# @param update_attribute Values to update an attribute
|
1269
|
+
# @param [Hash] opts the optional parameters
|
1270
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
1271
|
+
def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {})
|
1272
|
+
if @api_client.config.debugging
|
1273
|
+
@api_client.config.logger.debug "Calling API: ContactsApi.update_attribute ..."
|
1274
|
+
end
|
1275
|
+
# verify the required parameter 'attribute_category' is set
|
1276
|
+
if @api_client.config.client_side_validation && attribute_category.nil?
|
1277
|
+
fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.update_attribute"
|
1278
|
+
end
|
1279
|
+
# verify enum value
|
1280
|
+
if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category)
|
1281
|
+
fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global"
|
1282
|
+
end
|
1283
|
+
# verify the required parameter 'attribute_name' is set
|
1284
|
+
if @api_client.config.client_side_validation && attribute_name.nil?
|
1285
|
+
fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.update_attribute"
|
1286
|
+
end
|
1287
|
+
# verify the required parameter 'update_attribute' is set
|
1288
|
+
if @api_client.config.client_side_validation && update_attribute.nil?
|
1289
|
+
fail ArgumentError, "Missing the required parameter 'update_attribute' when calling ContactsApi.update_attribute"
|
1290
|
+
end
|
1291
|
+
# resource path
|
1292
|
+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
|
1293
|
+
|
1294
|
+
# query parameters
|
1295
|
+
query_params = {}
|
1296
|
+
|
1297
|
+
# header parameters
|
1298
|
+
header_params = {}
|
1299
|
+
# HTTP header 'Accept' (if needed)
|
1300
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1301
|
+
# HTTP header 'Content-Type'
|
1302
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1303
|
+
|
1304
|
+
# form parameters
|
1305
|
+
form_params = {}
|
1306
|
+
|
1307
|
+
# http body (model)
|
1308
|
+
post_body = @api_client.object_to_http_body(update_attribute)
|
1309
|
+
auth_names = ['api-key']
|
1310
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1311
|
+
:header_params => header_params,
|
1312
|
+
:query_params => query_params,
|
1313
|
+
:form_params => form_params,
|
1314
|
+
:body => post_body,
|
1315
|
+
:auth_names => auth_names)
|
1316
|
+
if @api_client.config.debugging
|
1317
|
+
@api_client.config.logger.debug "API called: ContactsApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1318
|
+
end
|
1319
|
+
return data, status_code, headers
|
1320
|
+
end
|
1321
|
+
|
1227
1322
|
# Updates a contact
|
1228
1323
|
#
|
1229
1324
|
# @param email Email (urlencoded) of the contact
|
@@ -15,19 +15,13 @@ require 'date'
|
|
15
15
|
module SibApiV3Sdk
|
16
16
|
|
17
17
|
class CreateAttribute
|
18
|
-
#
|
19
|
-
attr_accessor :category
|
20
|
-
|
21
|
-
# Name of the attribute
|
22
|
-
attr_accessor :name
|
23
|
-
|
24
|
-
# Value of the attribute
|
18
|
+
# Value of the attribute. Use only if the attribute's category is calculated or global
|
25
19
|
attr_accessor :value
|
26
20
|
|
27
21
|
# Values that the attribute can take. Use only if the attribute's category is category
|
28
|
-
attr_accessor :
|
22
|
+
attr_accessor :enumeration
|
29
23
|
|
30
|
-
# Type of the attribute
|
24
|
+
# Type of the attribute. Use only if the attribute's category is normal, category or transactional ( type 'id' only available if the category is 'transactional' attribute & type 'category' only available if the category is 'category' attribute )
|
31
25
|
attr_accessor :type
|
32
26
|
|
33
27
|
class EnumAttributeValidator
|
@@ -55,10 +49,8 @@ module SibApiV3Sdk
|
|
55
49
|
# Attribute mapping from ruby-style variable name to JSON key.
|
56
50
|
def self.attribute_map
|
57
51
|
{
|
58
|
-
:'category' => :'category',
|
59
|
-
:'name' => :'name',
|
60
52
|
:'value' => :'value',
|
61
|
-
:'
|
53
|
+
:'enumeration' => :'enumeration',
|
62
54
|
:'type' => :'type'
|
63
55
|
}
|
64
56
|
end
|
@@ -66,10 +58,8 @@ module SibApiV3Sdk
|
|
66
58
|
# Attribute type mapping.
|
67
59
|
def self.swagger_types
|
68
60
|
{
|
69
|
-
:'category' => :'String',
|
70
|
-
:'name' => :'String',
|
71
61
|
:'value' => :'String',
|
72
|
-
:'
|
62
|
+
:'enumeration' => :'Array<CreateAttributeEnumeration>',
|
73
63
|
:'type' => :'String'
|
74
64
|
}
|
75
65
|
end
|
@@ -82,21 +72,13 @@ module SibApiV3Sdk
|
|
82
72
|
# convert string to symbol for hash key
|
83
73
|
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
84
74
|
|
85
|
-
if attributes.has_key?(:'category')
|
86
|
-
self.category = attributes[:'category']
|
87
|
-
end
|
88
|
-
|
89
|
-
if attributes.has_key?(:'name')
|
90
|
-
self.name = attributes[:'name']
|
91
|
-
end
|
92
|
-
|
93
75
|
if attributes.has_key?(:'value')
|
94
76
|
self.value = attributes[:'value']
|
95
77
|
end
|
96
78
|
|
97
|
-
if attributes.has_key?(:'
|
98
|
-
if (value = attributes[:'
|
99
|
-
self.
|
79
|
+
if attributes.has_key?(:'enumeration')
|
80
|
+
if (value = attributes[:'enumeration']).is_a?(Array)
|
81
|
+
self.enumeration = value
|
100
82
|
end
|
101
83
|
end
|
102
84
|
|
@@ -110,48 +92,21 @@ module SibApiV3Sdk
|
|
110
92
|
# @return Array for valid properies with the reasons
|
111
93
|
def list_invalid_properties
|
112
94
|
invalid_properties = Array.new
|
113
|
-
if @category.nil?
|
114
|
-
invalid_properties.push("invalid value for 'category', category cannot be nil.")
|
115
|
-
end
|
116
|
-
|
117
|
-
if @name.nil?
|
118
|
-
invalid_properties.push("invalid value for 'name', name cannot be nil.")
|
119
|
-
end
|
120
|
-
|
121
|
-
if @value.nil?
|
122
|
-
invalid_properties.push("invalid value for 'value', value cannot be nil.")
|
123
|
-
end
|
124
|
-
|
125
95
|
return invalid_properties
|
126
96
|
end
|
127
97
|
|
128
98
|
# Check to see if the all the properties in the model are valid
|
129
99
|
# @return true if the model is valid
|
130
100
|
def valid?
|
131
|
-
|
132
|
-
category_validator = EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"])
|
133
|
-
return false unless category_validator.valid?(@category)
|
134
|
-
return false if @name.nil?
|
135
|
-
return false if @value.nil?
|
136
|
-
type_validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id"])
|
101
|
+
type_validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
|
137
102
|
return false unless type_validator.valid?(@type)
|
138
103
|
return true
|
139
104
|
end
|
140
105
|
|
141
|
-
# Custom attribute writer method checking allowed values (enum).
|
142
|
-
# @param [Object] category Object to be assigned
|
143
|
-
def category=(category)
|
144
|
-
validator = EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"])
|
145
|
-
unless validator.valid?(category)
|
146
|
-
fail ArgumentError, "invalid value for 'category', must be one of #{validator.allowable_values}."
|
147
|
-
end
|
148
|
-
@category = category
|
149
|
-
end
|
150
|
-
|
151
106
|
# Custom attribute writer method checking allowed values (enum).
|
152
107
|
# @param [Object] type Object to be assigned
|
153
108
|
def type=(type)
|
154
|
-
validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id"])
|
109
|
+
validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
|
155
110
|
unless validator.valid?(type)
|
156
111
|
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
157
112
|
end
|
@@ -163,10 +118,8 @@ module SibApiV3Sdk
|
|
163
118
|
def ==(o)
|
164
119
|
return true if self.equal?(o)
|
165
120
|
self.class == o.class &&
|
166
|
-
category == o.category &&
|
167
|
-
name == o.name &&
|
168
121
|
value == o.value &&
|
169
|
-
|
122
|
+
enumeration == o.enumeration &&
|
170
123
|
type == o.type
|
171
124
|
end
|
172
125
|
|
@@ -179,7 +132,7 @@ module SibApiV3Sdk
|
|
179
132
|
# Calculates hash code according to all attributes.
|
180
133
|
# @return [Fixnum] Hash code
|
181
134
|
def hash
|
182
|
-
[
|
135
|
+
[value, enumeration, type].hash
|
183
136
|
end
|
184
137
|
|
185
138
|
# Builds the object from hash
|