Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0512b09

Browse files
authoredDec 13, 2017
Merge pull request #10 from sendinblue/feature_updated_swagger_sync
Swagger sync: contact attribute api added
2 parents dc89982 + f0abf51 commit 0512b09

23 files changed

+485
-445
lines changed
 

‎README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ All URIs are relative to *https://api.sendinblue.com/v3*
8080
Class | Method | HTTP request | Description
8181
------------ | ------------- | ------------- | -------------
8282
*SibApiV3Sdk::AccountApi* | [**get_account**](docs/AccountApi.md#get_account) | **GET** /account | Get your account informations, plans and credits details
83-
*SibApiV3Sdk::AttributesApi* | [**create_attribute**](docs/AttributesApi.md#create_attribute) | **POST** /contacts/attributes | Creates contact attributes
84-
*SibApiV3Sdk::AttributesApi* | [**delete_attribute**](docs/AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeId} | Deletes an attribute
83+
*SibApiV3Sdk::AttributesApi* | [**create_attribute**](docs/AttributesApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute
84+
*SibApiV3Sdk::AttributesApi* | [**delete_attribute**](docs/AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
8585
*SibApiV3Sdk::AttributesApi* | [**get_attributes**](docs/AttributesApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
86+
*SibApiV3Sdk::AttributesApi* | [**update_attribute**](docs/AttributesApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute
8687
*SibApiV3Sdk::ContactsApi* | [**add_contact_to_list**](docs/ContactsApi.md#add_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
87-
*SibApiV3Sdk::ContactsApi* | [**create_attribute**](docs/ContactsApi.md#create_attribute) | **POST** /contacts/attributes | Creates contact attributes
88+
*SibApiV3Sdk::ContactsApi* | [**create_attribute**](docs/ContactsApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute
8889
*SibApiV3Sdk::ContactsApi* | [**create_contact**](docs/ContactsApi.md#create_contact) | **POST** /contacts | Create a contact
8990
*SibApiV3Sdk::ContactsApi* | [**create_folder**](docs/ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder
9091
*SibApiV3Sdk::ContactsApi* | [**create_list**](docs/ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list
91-
*SibApiV3Sdk::ContactsApi* | [**delete_attribute**](docs/ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeId} | Deletes an attribute
92+
*SibApiV3Sdk::ContactsApi* | [**delete_attribute**](docs/ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
9293
*SibApiV3Sdk::ContactsApi* | [**delete_folder**](docs/ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
9394
*SibApiV3Sdk::ContactsApi* | [**delete_list**](docs/ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list
9495
*SibApiV3Sdk::ContactsApi* | [**get_attributes**](docs/ContactsApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
@@ -104,6 +105,7 @@ Class | Method | HTTP request | Description
104105
*SibApiV3Sdk::ContactsApi* | [**import_contacts**](docs/ContactsApi.md#import_contacts) | **POST** /contacts/import | Import contacts
105106
*SibApiV3Sdk::ContactsApi* | [**remove_contact_to_list**](docs/ContactsApi.md#remove_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list
106107
*SibApiV3Sdk::ContactsApi* | [**request_contact_export**](docs/ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts
108+
*SibApiV3Sdk::ContactsApi* | [**update_attribute**](docs/ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute
107109
*SibApiV3Sdk::ContactsApi* | [**update_contact**](docs/ContactsApi.md#update_contact) | **PUT** /contacts/{email} | Updates a contact
108110
*SibApiV3Sdk::ContactsApi* | [**update_folder**](docs/ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a contact folder
109111
*SibApiV3Sdk::ContactsApi* | [**update_list**](docs/ContactsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list
@@ -187,7 +189,7 @@ Class | Method | HTTP request | Description
187189
- [SibApiV3Sdk::AddCredits](docs/AddCredits.md)
188190
- [SibApiV3Sdk::AddRemoveContactToList](docs/AddRemoveContactToList.md)
189191
- [SibApiV3Sdk::CreateAttribute](docs/CreateAttribute.md)
190-
- [SibApiV3Sdk::CreateAttributeEnumemaration](docs/CreateAttributeEnumemaration.md)
192+
- [SibApiV3Sdk::CreateAttributeEnumeration](docs/CreateAttributeEnumeration.md)
191193
- [SibApiV3Sdk::CreateChild](docs/CreateChild.md)
192194
- [SibApiV3Sdk::CreateContact](docs/CreateContact.md)
193195
- [SibApiV3Sdk::CreateEmailCampaign](docs/CreateEmailCampaign.md)
@@ -310,6 +312,8 @@ Class | Method | HTTP request | Description
310312
- [SibApiV3Sdk::SendTestEmail](docs/SendTestEmail.md)
311313
- [SibApiV3Sdk::SendTestSms](docs/SendTestSms.md)
312314
- [SibApiV3Sdk::SendTransacSms](docs/SendTransacSms.md)
315+
- [SibApiV3Sdk::UpdateAttribute](docs/UpdateAttribute.md)
316+
- [SibApiV3Sdk::UpdateAttributeEnumeration](docs/UpdateAttributeEnumeration.md)
313317
- [SibApiV3Sdk::UpdateCampaignStatus](docs/UpdateCampaignStatus.md)
314318
- [SibApiV3Sdk::UpdateChild](docs/UpdateChild.md)
315319
- [SibApiV3Sdk::UpdateContact](docs/UpdateContact.md)

‎docs/AttributesApi.md

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ All URIs are relative to *https://api.sendinblue.com/v3*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**create_attribute**](AttributesApi.md#create_attribute) | **POST** /contacts/attributes | Creates contact attributes
8-
[**delete_attribute**](AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeId} | Deletes an attribute
7+
[**create_attribute**](AttributesApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute
8+
[**delete_attribute**](AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
99
[**get_attributes**](AttributesApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
10+
[**update_attribute**](AttributesApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute
1011

1112

1213
# **create_attribute**
13-
> CreateModel create_attribute(create_attribute)
14+
> create_attribute(attribute_category, attribute_name, create_attribute)
1415
15-
Creates contact attributes
16+
Creates contact attribute
1617

1718
### Example
1819
```ruby
@@ -28,13 +29,16 @@ end
2829

2930
api_instance = SibApiV3Sdk::AttributesApi.new
3031

32+
attribute_category = "attribute_category_example" # String | Category of the attribute
33+
34+
attribute_name = "attribute_name_example" # String | Name of the attribute
35+
3136
create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute
3237

3338

3439
begin
35-
#Creates contact attributes
36-
result = api_instance.create_attribute(create_attribute)
37-
p result
40+
#Creates contact attribute
41+
api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
3842
rescue SibApiV3Sdk::ApiError => e
3943
puts "Exception when calling AttributesApi->create_attribute: #{e}"
4044
end
@@ -44,11 +48,13 @@ end
4448

4549
Name | Type | Description | Notes
4650
------------- | ------------- | ------------- | -------------
51+
**attribute_category** | **String**| Category of the attribute |
52+
**attribute_name** | **String**| Name of the attribute |
4753
**create_attribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute |
4854

4955
### Return type
5056

51-
[**CreateModel**](CreateModel.md)
57+
nil (empty response body)
5258

5359
### Authorization
5460

@@ -62,7 +68,7 @@ Name | Type | Description | Notes
6268

6369

6470
# **delete_attribute**
65-
> delete_attribute(attribute_id)
71+
> delete_attribute(attribute_category, attribute_name)
6672
6773
Deletes an attribute
6874

@@ -80,12 +86,14 @@ end
8086

8187
api_instance = SibApiV3Sdk::AttributesApi.new
8288

83-
attribute_id = 789 # Integer | id of the attribute
89+
attribute_category = "attribute_category_example" # String | Category of the attribute
90+
91+
attribute_name = "attribute_name_example" # String | Name of the existing attribute
8492

8593

8694
begin
8795
#Deletes an attribute
88-
api_instance.delete_attribute(attribute_id)
96+
api_instance.delete_attribute(attribute_category, attribute_name)
8997
rescue SibApiV3Sdk::ApiError => e
9098
puts "Exception when calling AttributesApi->delete_attribute: #{e}"
9199
end
@@ -95,7 +103,8 @@ end
95103

96104
Name | Type | Description | Notes
97105
------------- | ------------- | ------------- | -------------
98-
**attribute_id** | **Integer**| id of the attribute |
106+
**attribute_category** | **String**| Category of the attribute |
107+
**attribute_name** | **String**| Name of the existing attribute |
99108

100109
### Return type
101110

@@ -158,3 +167,60 @@ This endpoint does not need any parameter.
158167

159168

160169

170+
# **update_attribute**
171+
> update_attribute(attribute_category, attribute_name, update_attribute)
172+
173+
Updates contact attribute
174+
175+
### Example
176+
```ruby
177+
# load the gem
178+
require 'sib-api-v3-sdk'
179+
# setup authorization
180+
SibApiV3Sdk.configure do |config|
181+
# Configure API key authorization: api-key
182+
config.api_key['api-key'] = 'YOUR API KEY'
183+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
184+
#config.api_key_prefix['api-key'] = 'Bearer'
185+
end
186+
187+
api_instance = SibApiV3Sdk::AttributesApi.new
188+
189+
attribute_category = "attribute_category_example" # String | Category of the attribute
190+
191+
attribute_name = "attribute_name_example" # String | Name of the existing attribute
192+
193+
update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute
194+
195+
196+
begin
197+
#Updates contact attribute
198+
api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
199+
rescue SibApiV3Sdk::ApiError => e
200+
puts "Exception when calling AttributesApi->update_attribute: #{e}"
201+
end
202+
```
203+
204+
### Parameters
205+
206+
Name | Type | Description | Notes
207+
------------- | ------------- | ------------- | -------------
208+
**attribute_category** | **String**| Category of the attribute |
209+
**attribute_name** | **String**| Name of the existing attribute |
210+
**update_attribute** | [**UpdateAttribute**](UpdateAttribute.md)| Values to update an attribute |
211+
212+
### Return type
213+
214+
nil (empty response body)
215+
216+
### Authorization
217+
218+
[api-key](../README.md#api-key)
219+
220+
### HTTP request headers
221+
222+
- **Content-Type**: application/json
223+
- **Accept**: application/json
224+
225+
226+

‎docs/ContactsApi.md

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ All URIs are relative to *https://api.sendinblue.com/v3*
55
Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**add_contact_to_list**](ContactsApi.md#add_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list
8-
[**create_attribute**](ContactsApi.md#create_attribute) | **POST** /contacts/attributes | Creates contact attributes
8+
[**create_attribute**](ContactsApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute
99
[**create_contact**](ContactsApi.md#create_contact) | **POST** /contacts | Create a contact
1010
[**create_folder**](ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder
1111
[**create_list**](ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list
12-
[**delete_attribute**](ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeId} | Deletes an attribute
12+
[**delete_attribute**](ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
1313
[**delete_folder**](ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
1414
[**delete_list**](ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list
1515
[**get_attributes**](ContactsApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
@@ -25,6 +25,7 @@ Method | HTTP request | Description
2525
[**import_contacts**](ContactsApi.md#import_contacts) | **POST** /contacts/import | Import contacts
2626
[**remove_contact_to_list**](ContactsApi.md#remove_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list
2727
[**request_contact_export**](ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts
28+
[**update_attribute**](ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute
2829
[**update_contact**](ContactsApi.md#update_contact) | **PUT** /contacts/{email} | Updates a contact
2930
[**update_folder**](ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a contact folder
3031
[**update_list**](ContactsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list
@@ -86,9 +87,9 @@ Name | Type | Description | Notes
8687

8788

8889
# **create_attribute**
89-
> CreateModel create_attribute(create_attribute)
90+
> create_attribute(attribute_category, attribute_name, create_attribute)
9091
91-
Creates contact attributes
92+
Creates contact attribute
9293

9394
### Example
9495
```ruby
@@ -104,13 +105,16 @@ end
104105

105106
api_instance = SibApiV3Sdk::ContactsApi.new
106107

108+
attribute_category = "attribute_category_example" # String | Category of the attribute
109+
110+
attribute_name = "attribute_name_example" # String | Name of the attribute
111+
107112
create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute
108113

109114

110115
begin
111-
#Creates contact attributes
112-
result = api_instance.create_attribute(create_attribute)
113-
p result
116+
#Creates contact attribute
117+
api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
114118
rescue SibApiV3Sdk::ApiError => e
115119
puts "Exception when calling ContactsApi->create_attribute: #{e}"
116120
end
@@ -120,11 +124,13 @@ end
120124

121125
Name | Type | Description | Notes
122126
------------- | ------------- | ------------- | -------------
127+
**attribute_category** | **String**| Category of the attribute |
128+
**attribute_name** | **String**| Name of the attribute |
123129
**create_attribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute |
124130

125131
### Return type
126132

127-
[**CreateModel**](CreateModel.md)
133+
nil (empty response body)
128134

129135
### Authorization
130136

@@ -294,7 +300,7 @@ Name | Type | Description | Notes
294300

295301

296302
# **delete_attribute**
297-
> delete_attribute(attribute_id)
303+
> delete_attribute(attribute_category, attribute_name)
298304
299305
Deletes an attribute
300306

@@ -312,12 +318,14 @@ end
312318

313319
api_instance = SibApiV3Sdk::ContactsApi.new
314320

315-
attribute_id = 789 # Integer | id of the attribute
321+
attribute_category = "attribute_category_example" # String | Category of the attribute
322+
323+
attribute_name = "attribute_name_example" # String | Name of the existing attribute
316324

317325

318326
begin
319327
#Deletes an attribute
320-
api_instance.delete_attribute(attribute_id)
328+
api_instance.delete_attribute(attribute_category, attribute_name)
321329
rescue SibApiV3Sdk::ApiError => e
322330
puts "Exception when calling ContactsApi->delete_attribute: #{e}"
323331
end
@@ -327,7 +335,8 @@ end
327335

328336
Name | Type | Description | Notes
329337
------------- | ------------- | ------------- | -------------
330-
**attribute_id** | **Integer**| id of the attribute |
338+
**attribute_category** | **String**| Category of the attribute |
339+
**attribute_name** | **String**| Name of the existing attribute |
331340

332341
### Return type
333342

@@ -1148,6 +1157,63 @@ Name | Type | Description | Notes
11481157

11491158

11501159

1160+
# **update_attribute**
1161+
> update_attribute(attribute_category, attribute_name, update_attribute)
1162+
1163+
Updates contact attribute
1164+
1165+
### Example
1166+
```ruby
1167+
# load the gem
1168+
require 'sib-api-v3-sdk'
1169+
# setup authorization
1170+
SibApiV3Sdk.configure do |config|
1171+
# Configure API key authorization: api-key
1172+
config.api_key['api-key'] = 'YOUR API KEY'
1173+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
1174+
#config.api_key_prefix['api-key'] = 'Bearer'
1175+
end
1176+
1177+
api_instance = SibApiV3Sdk::ContactsApi.new
1178+
1179+
attribute_category = "attribute_category_example" # String | Category of the attribute
1180+
1181+
attribute_name = "attribute_name_example" # String | Name of the existing attribute
1182+
1183+
update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute
1184+
1185+
1186+
begin
1187+
#Updates contact attribute
1188+
api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
1189+
rescue SibApiV3Sdk::ApiError => e
1190+
puts "Exception when calling ContactsApi->update_attribute: #{e}"
1191+
end
1192+
```
1193+
1194+
### Parameters
1195+
1196+
Name | Type | Description | Notes
1197+
------------- | ------------- | ------------- | -------------
1198+
**attribute_category** | **String**| Category of the attribute |
1199+
**attribute_name** | **String**| Name of the existing attribute |
1200+
**update_attribute** | [**UpdateAttribute**](UpdateAttribute.md)| Values to update an attribute |
1201+
1202+
### Return type
1203+
1204+
nil (empty response body)
1205+
1206+
### Authorization
1207+
1208+
[api-key](../README.md#api-key)
1209+
1210+
### HTTP request headers
1211+
1212+
- **Content-Type**: application/json
1213+
- **Accept**: application/json
1214+
1215+
1216+
11511217
# **update_contact**
11521218
> update_contact(email, update_contact)
11531219

‎docs/CreateAttribute.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**category** | **String** | Attribute categorisation. |
7-
**name** | **String** | Name of the attribute |
8-
**value** | **String** | Value of the attribute |
9-
**enumemaration** | [**Array<CreateAttributeEnumemaration>**](CreateAttributeEnumemaration.md) | Values that the attribute can take. Use only if the attribute's category is category | [optional]
10-
**type** | **String** | Type of the attribute | [optional]
6+
**value** | **String** | Value of the attribute. Use only if the attribute's category is calculated or global | [optional]
7+
**enumeration** | [**Array<CreateAttributeEnumeration>**](CreateAttributeEnumeration.md) | Values that the attribute can take. Use only if the attribute's category is category | [optional]
8+
**type** | **String** | 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 ) | [optional]
119

1210

‎docs/CreateAttributeEnumemaration.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎docs/GetAttributesAttributes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**id** | **Integer** | ID of the attribute |
76
**name** | **String** | Name of the attribute |
87
**category** | **String** | Category of the attribute |
98
**type** | **String** | Type of the attribute | [optional]

‎docs/SendSms.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**reference** | **String** | |
7+
**message_id** | **Integer** | |
78

89

‎lib/sib-api-v3-sdk.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
require 'sib-api-v3-sdk/models/add_credits'
2121
require 'sib-api-v3-sdk/models/add_remove_contact_to_list'
2222
require 'sib-api-v3-sdk/models/create_attribute'
23-
require 'sib-api-v3-sdk/models/create_attribute_enumemaration'
23+
require 'sib-api-v3-sdk/models/create_attribute_enumeration'
2424
require 'sib-api-v3-sdk/models/create_child'
2525
require 'sib-api-v3-sdk/models/create_contact'
2626
require 'sib-api-v3-sdk/models/create_email_campaign'
@@ -143,6 +143,8 @@
143143
require 'sib-api-v3-sdk/models/send_test_email'
144144
require 'sib-api-v3-sdk/models/send_test_sms'
145145
require 'sib-api-v3-sdk/models/send_transac_sms'
146+
require 'sib-api-v3-sdk/models/update_attribute'
147+
require 'sib-api-v3-sdk/models/update_attribute_enumeration'
146148
require 'sib-api-v3-sdk/models/update_campaign_status'
147149
require 'sib-api-v3-sdk/models/update_child'
148150
require 'sib-api-v3-sdk/models/update_contact'

‎lib/sib-api-v3-sdk/api/attributes_api.rb

Lines changed: 115 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,47 @@ def initialize(api_client = ApiClient.default)
2020
@api_client = api_client
2121
end
2222

23-
# Creates contact attributes
23+
# Creates contact attribute
2424
#
25+
# @param attribute_category Category of the attribute
26+
# @param attribute_name Name of the attribute
2527
# @param create_attribute Values to create an attribute
2628
# @param [Hash] opts the optional parameters
27-
# @return [CreateModel]
28-
def create_attribute(create_attribute, opts = {})
29-
data, _status_code, _headers = create_attribute_with_http_info(create_attribute, opts)
30-
return data
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
3133
end
3234

33-
# Creates contact attributes
35+
# Creates contact attribute
3436
#
37+
# @param attribute_category Category of the attribute
38+
# @param attribute_name Name of the attribute
3539
# @param create_attribute Values to create an attribute
3640
# @param [Hash] opts the optional parameters
37-
# @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers
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 = {})
3943
if @api_client.config.debugging
4044
@api_client.config.logger.debug "Calling API: AttributesApi.create_attribute ..."
4145
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
4258
# verify the required parameter 'create_attribute' is set
4359
if @api_client.config.client_side_validation && create_attribute.nil?
4460
fail ArgumentError, "Missing the required parameter 'create_attribute' when calling AttributesApi.create_attribute"
4561
end
4662
# 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)
4864

4965
# query parameters
5066
query_params = {}
@@ -67,8 +83,7 @@ def create_attribute_with_http_info(create_attribute, opts = {})
6783
:query_params => query_params,
6884
:form_params => form_params,
6985
:body => post_body,
70-
:auth_names => auth_names,
71-
:return_type => 'CreateModel')
86+
:auth_names => auth_names)
7287
if @api_client.config.debugging
7388
@api_client.config.logger.debug "API called: AttributesApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
7489
end
@@ -77,29 +92,39 @@ def create_attribute_with_http_info(create_attribute, opts = {})
7792

7893
# Deletes an attribute
7994
#
80-
# @param attribute_id id of the attribute
95+
# @param attribute_category Category of the attribute
96+
# @param attribute_name Name of the existing attribute
8197
# @param [Hash] opts the optional parameters
8298
# @return [nil]
83-
def delete_attribute(attribute_id, opts = {})
84-
delete_attribute_with_http_info(attribute_id, opts)
99+
def delete_attribute(attribute_category, attribute_name, opts = {})
100+
delete_attribute_with_http_info(attribute_category, attribute_name, opts)
85101
return nil
86102
end
87103

88104
# Deletes an attribute
89105
#
90-
# @param attribute_id id of the attribute
106+
# @param attribute_category Category of the attribute
107+
# @param attribute_name Name of the existing attribute
91108
# @param [Hash] opts the optional parameters
92109
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
93-
def delete_attribute_with_http_info(attribute_id, opts = {})
110+
def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {})
94111
if @api_client.config.debugging
95112
@api_client.config.logger.debug "Calling API: AttributesApi.delete_attribute ..."
96113
end
97-
# verify the required parameter 'attribute_id' is set
98-
if @api_client.config.client_side_validation && attribute_id.nil?
99-
fail ArgumentError, "Missing the required parameter 'attribute_id' when calling AttributesApi.delete_attribute"
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"
100125
end
101126
# resource path
102-
local_var_path = "/contacts/attributes/{attributeId}".sub('{' + 'attributeId' + '}', attribute_id.to_s)
127+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
103128

104129
# query parameters
105130
query_params = {}
@@ -177,5 +202,75 @@ def get_attributes_with_http_info(opts = {})
177202
end
178203
return data, status_code, headers
179204
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
180275
end
181276
end

‎lib/sib-api-v3-sdk/api/contacts_api.rb

Lines changed: 115 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,47 @@ def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {})
8181
return data, status_code, headers
8282
end
8383

84-
# Creates contact attributes
84+
# Creates contact attribute
8585
#
86+
# @param attribute_category Category of the attribute
87+
# @param attribute_name Name of the attribute
8688
# @param create_attribute Values to create an attribute
8789
# @param [Hash] opts the optional parameters
88-
# @return [CreateModel]
89-
def create_attribute(create_attribute, opts = {})
90-
data, _status_code, _headers = create_attribute_with_http_info(create_attribute, opts)
91-
return data
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
9294
end
9395

94-
# Creates contact attributes
96+
# Creates contact attribute
9597
#
98+
# @param attribute_category Category of the attribute
99+
# @param attribute_name Name of the attribute
96100
# @param create_attribute Values to create an attribute
97101
# @param [Hash] opts the optional parameters
98-
# @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers
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 = {})
100104
if @api_client.config.debugging
101105
@api_client.config.logger.debug "Calling API: ContactsApi.create_attribute ..."
102106
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
103119
# verify the required parameter 'create_attribute' is set
104120
if @api_client.config.client_side_validation && create_attribute.nil?
105121
fail ArgumentError, "Missing the required parameter 'create_attribute' when calling ContactsApi.create_attribute"
106122
end
107123
# 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)
109125

110126
# query parameters
111127
query_params = {}
@@ -128,8 +144,7 @@ def create_attribute_with_http_info(create_attribute, opts = {})
128144
:query_params => query_params,
129145
:form_params => form_params,
130146
:body => post_body,
131-
:auth_names => auth_names,
132-
:return_type => 'CreateModel')
147+
:auth_names => auth_names)
133148
if @api_client.config.debugging
134149
@api_client.config.logger.debug "API called: ContactsApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
135150
end
@@ -303,29 +318,39 @@ def create_list_with_http_info(create_list, opts = {})
303318

304319
# Deletes an attribute
305320
#
306-
# @param attribute_id id of the attribute
321+
# @param attribute_category Category of the attribute
322+
# @param attribute_name Name of the existing attribute
307323
# @param [Hash] opts the optional parameters
308324
# @return [nil]
309-
def delete_attribute(attribute_id, opts = {})
310-
delete_attribute_with_http_info(attribute_id, opts)
325+
def delete_attribute(attribute_category, attribute_name, opts = {})
326+
delete_attribute_with_http_info(attribute_category, attribute_name, opts)
311327
return nil
312328
end
313329

314330
# Deletes an attribute
315331
#
316-
# @param attribute_id id of the attribute
332+
# @param attribute_category Category of the attribute
333+
# @param attribute_name Name of the existing attribute
317334
# @param [Hash] opts the optional parameters
318335
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
319-
def delete_attribute_with_http_info(attribute_id, opts = {})
336+
def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {})
320337
if @api_client.config.debugging
321338
@api_client.config.logger.debug "Calling API: ContactsApi.delete_attribute ..."
322339
end
323-
# verify the required parameter 'attribute_id' is set
324-
if @api_client.config.client_side_validation && attribute_id.nil?
325-
fail ArgumentError, "Missing the required parameter 'attribute_id' when calling ContactsApi.delete_attribute"
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"
326351
end
327352
# resource path
328-
local_var_path = "/contacts/attributes/{attributeId}".sub('{' + 'attributeId' + '}', attribute_id.to_s)
353+
local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s)
329354

330355
# query parameters
331356
query_params = {}
@@ -1224,6 +1249,76 @@ def request_contact_export_with_http_info(request_contact_export, opts = {})
12241249
return data, status_code, headers
12251250
end
12261251

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+
12271322
# Updates a contact
12281323
#
12291324
# @param email Email (urlencoded) of the contact

‎lib/sib-api-v3-sdk/models/create_attribute.rb

Lines changed: 12 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@
1515
module SibApiV3Sdk
1616

1717
class CreateAttribute
18-
# Attribute categorisation.
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
2519
attr_accessor :value
2620

2721
# Values that the attribute can take. Use only if the attribute's category is category
28-
attr_accessor :enumemaration
22+
attr_accessor :enumeration
2923

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 )
3125
attr_accessor :type
3226

3327
class EnumAttributeValidator
@@ -55,21 +49,17 @@ def valid?(value)
5549
# Attribute mapping from ruby-style variable name to JSON key.
5650
def self.attribute_map
5751
{
58-
:'category' => :'category',
59-
:'name' => :'name',
6052
:'value' => :'value',
61-
:'enumemaration' => :'enumemaration',
53+
:'enumeration' => :'enumeration',
6254
:'type' => :'type'
6355
}
6456
end
6557

6658
# Attribute type mapping.
6759
def self.swagger_types
6860
{
69-
:'category' => :'String',
70-
:'name' => :'String',
7161
:'value' => :'String',
72-
:'enumemaration' => :'Array<CreateAttributeEnumemaration>',
62+
:'enumeration' => :'Array<CreateAttributeEnumeration>',
7363
:'type' => :'String'
7464
}
7565
end
@@ -82,21 +72,13 @@ def initialize(attributes = {})
8272
# convert string to symbol for hash key
8373
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
8474

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-
9375
if attributes.has_key?(:'value')
9476
self.value = attributes[:'value']
9577
end
9678

97-
if attributes.has_key?(:'enumemaration')
98-
if (value = attributes[:'enumemaration']).is_a?(Array)
99-
self.enumemaration = value
79+
if attributes.has_key?(:'enumeration')
80+
if (value = attributes[:'enumeration']).is_a?(Array)
81+
self.enumeration = value
10082
end
10183
end
10284

@@ -110,48 +92,21 @@ def initialize(attributes = {})
11092
# @return Array for valid properies with the reasons
11193
def list_invalid_properties
11294
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-
12595
return invalid_properties
12696
end
12797

12898
# Check to see if the all the properties in the model are valid
12999
# @return true if the model is valid
130100
def valid?
131-
return false if @category.nil?
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"])
137102
return false unless type_validator.valid?(@type)
138103
return true
139104
end
140105

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-
151106
# Custom attribute writer method checking allowed values (enum).
152107
# @param [Object] type Object to be assigned
153108
def type=(type)
154-
validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id"])
109+
validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
155110
unless validator.valid?(type)
156111
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
157112
end
@@ -163,10 +118,8 @@ def type=(type)
163118
def ==(o)
164119
return true if self.equal?(o)
165120
self.class == o.class &&
166-
category == o.category &&
167-
name == o.name &&
168121
value == o.value &&
169-
enumemaration == o.enumemaration &&
122+
enumeration == o.enumeration &&
170123
type == o.type
171124
end
172125

@@ -179,7 +132,7 @@ def eql?(o)
179132
# Calculates hash code according to all attributes.
180133
# @return [Fixnum] Hash code
181134
def hash
182-
[category, name, value, enumemaration, type].hash
135+
[value, enumeration, type].hash
183136
end
184137

185138
# Builds the object from hash

‎lib/sib-api-v3-sdk/models/create_attribute_enumemaration.rb

Lines changed: 0 additions & 199 deletions
This file was deleted.

‎lib/sib-api-v3-sdk/models/error_model.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def list_invalid_properties
9696
# @return true if the model is valid
9797
def valid?
9898
return false if @code.nil?
99-
code_validator = EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission", "not_enough_credits", "permission_denied", "duplicate_parameter", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"])
99+
code_validator = EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission", "not_enough_credits", "permission_denied", "duplicate_parameter", "duplicate_request", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"])
100100
return false unless code_validator.valid?(@code)
101101
return false if @message.nil?
102102
return true
@@ -105,7 +105,7 @@ def valid?
105105
# Custom attribute writer method checking allowed values (enum).
106106
# @param [Object] code Object to be assigned
107107
def code=(code)
108-
validator = EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission", "not_enough_credits", "permission_denied", "duplicate_parameter", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"])
108+
validator = EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission", "not_enough_credits", "permission_denied", "duplicate_parameter", "duplicate_request", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"])
109109
unless validator.valid?(code)
110110
fail ArgumentError, "invalid value for 'code', must be one of #{validator.allowable_values}."
111111
end

‎lib/sib-api-v3-sdk/models/get_attributes_attributes.rb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
module SibApiV3Sdk
1616

1717
class GetAttributesAttributes
18-
# ID of the attribute
19-
attr_accessor :id
20-
2118
# Name of the attribute
2219
attr_accessor :name
2320

@@ -58,7 +55,6 @@ def valid?(value)
5855
# Attribute mapping from ruby-style variable name to JSON key.
5956
def self.attribute_map
6057
{
61-
:'id' => :'id',
6258
:'name' => :'name',
6359
:'category' => :'category',
6460
:'type' => :'type',
@@ -70,7 +66,6 @@ def self.attribute_map
7066
# Attribute type mapping.
7167
def self.swagger_types
7268
{
73-
:'id' => :'Integer',
7469
:'name' => :'String',
7570
:'category' => :'String',
7671
:'type' => :'String',
@@ -87,10 +82,6 @@ def initialize(attributes = {})
8782
# convert string to symbol for hash key
8883
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
8984

90-
if attributes.has_key?(:'id')
91-
self.id = attributes[:'id']
92-
end
93-
9485
if attributes.has_key?(:'name')
9586
self.name = attributes[:'name']
9687
end
@@ -119,10 +110,6 @@ def initialize(attributes = {})
119110
# @return Array for valid properies with the reasons
120111
def list_invalid_properties
121112
invalid_properties = Array.new
122-
if @id.nil?
123-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
124-
end
125-
126113
if @name.nil?
127114
invalid_properties.push("invalid value for 'name', name cannot be nil.")
128115
end
@@ -137,7 +124,6 @@ def list_invalid_properties
137124
# Check to see if the all the properties in the model are valid
138125
# @return true if the model is valid
139126
def valid?
140-
return false if @id.nil?
141127
return false if @name.nil?
142128
return false if @category.nil?
143129
category_validator = EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"])
@@ -172,7 +158,6 @@ def type=(type)
172158
def ==(o)
173159
return true if self.equal?(o)
174160
self.class == o.class &&
175-
id == o.id &&
176161
name == o.name &&
177162
category == o.category &&
178163
type == o.type &&
@@ -189,7 +174,7 @@ def eql?(o)
189174
# Calculates hash code according to all attributes.
190175
# @return [Fixnum] Hash code
191176
def hash
192-
[id, name, category, type, enumeration, calculated_value].hash
177+
[name, category, type, enumeration, calculated_value].hash
193178
end
194179

195180
# Builds the object from hash

‎lib/sib-api-v3-sdk/models/send_sms.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ module SibApiV3Sdk
1717
class SendSms
1818
attr_accessor :reference
1919

20+
attr_accessor :message_id
21+
2022

2123
# Attribute mapping from ruby-style variable name to JSON key.
2224
def self.attribute_map
2325
{
24-
:'reference' => :'reference'
26+
:'reference' => :'reference',
27+
:'message_id' => :'messageId'
2528
}
2629
end
2730

2831
# Attribute type mapping.
2932
def self.swagger_types
3033
{
31-
:'reference' => :'String'
34+
:'reference' => :'String',
35+
:'message_id' => :'Integer'
3236
}
3337
end
3438

@@ -44,6 +48,10 @@ def initialize(attributes = {})
4448
self.reference = attributes[:'reference']
4549
end
4650

51+
if attributes.has_key?(:'messageId')
52+
self.message_id = attributes[:'messageId']
53+
end
54+
4755
end
4856

4957
# Show invalid properties with the reasons. Usually used together with valid?
@@ -54,13 +62,18 @@ def list_invalid_properties
5462
invalid_properties.push("invalid value for 'reference', reference cannot be nil.")
5563
end
5664

65+
if @message_id.nil?
66+
invalid_properties.push("invalid value for 'message_id', message_id cannot be nil.")
67+
end
68+
5769
return invalid_properties
5870
end
5971

6072
# Check to see if the all the properties in the model are valid
6173
# @return true if the model is valid
6274
def valid?
6375
return false if @reference.nil?
76+
return false if @message_id.nil?
6477
return true
6578
end
6679

@@ -69,7 +82,8 @@ def valid?
6982
def ==(o)
7083
return true if self.equal?(o)
7184
self.class == o.class &&
72-
reference == o.reference
85+
reference == o.reference &&
86+
message_id == o.message_id
7387
end
7488

7589
# @see the `==` method
@@ -81,7 +95,7 @@ def eql?(o)
8195
# Calculates hash code according to all attributes.
8296
# @return [Fixnum] Hash code
8397
def hash
84-
[reference].hash
98+
[reference, message_id].hash
8599
end
86100

87101
# Builds the object from hash

‎lib/sib-api-v3-sdk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module SibApiV3Sdk
14-
VERSION = "2.1.3"
14+
VERSION = "2.1.4"
1515
end

‎spec/api/attributes_api_spec.rb

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
end
3434

3535
# unit tests for create_attribute
36-
# Creates contact attributes
36+
# Creates contact attribute
3737
#
38+
# @param attribute_category Category of the attribute
39+
# @param attribute_name Name of the attribute
3840
# @param create_attribute Values to create an attribute
3941
# @param [Hash] opts the optional parameters
40-
# @return [CreateModel]
42+
# @return [nil]
4143
describe 'create_attribute test' do
4244
it "should work" do
4345
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -47,7 +49,8 @@
4749
# unit tests for delete_attribute
4850
# Deletes an attribute
4951
#
50-
# @param attribute_id id of the attribute
52+
# @param attribute_category Category of the attribute
53+
# @param attribute_name Name of the existing attribute
5154
# @param [Hash] opts the optional parameters
5255
# @return [nil]
5356
describe 'delete_attribute test' do
@@ -67,4 +70,18 @@
6770
end
6871
end
6972

73+
# unit tests for update_attribute
74+
# Updates contact attribute
75+
#
76+
# @param attribute_category Category of the attribute
77+
# @param attribute_name Name of the existing attribute
78+
# @param update_attribute Values to update an attribute
79+
# @param [Hash] opts the optional parameters
80+
# @return [nil]
81+
describe 'update_attribute test' do
82+
it "should work" do
83+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
84+
end
85+
end
86+
7087
end

‎spec/api/contacts_api_spec.rb

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@
4646
end
4747

4848
# unit tests for create_attribute
49-
# Creates contact attributes
49+
# Creates contact attribute
5050
#
51+
# @param attribute_category Category of the attribute
52+
# @param attribute_name Name of the attribute
5153
# @param create_attribute Values to create an attribute
5254
# @param [Hash] opts the optional parameters
53-
# @return [CreateModel]
55+
# @return [nil]
5456
describe 'create_attribute test' do
5557
it "should work" do
5658
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -96,7 +98,8 @@
9698
# unit tests for delete_attribute
9799
# Deletes an attribute
98100
#
99-
# @param attribute_id id of the attribute
101+
# @param attribute_category Category of the attribute
102+
# @param attribute_name Name of the existing attribute
100103
# @param [Hash] opts the optional parameters
101104
# @return [nil]
102105
describe 'delete_attribute test' do
@@ -294,6 +297,20 @@
294297
end
295298
end
296299

300+
# unit tests for update_attribute
301+
# Updates contact attribute
302+
#
303+
# @param attribute_category Category of the attribute
304+
# @param attribute_name Name of the existing attribute
305+
# @param update_attribute Values to update an attribute
306+
# @param [Hash] opts the optional parameters
307+
# @return [nil]
308+
describe 'update_attribute test' do
309+
it "should work" do
310+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
311+
end
312+
end
313+
297314
# unit tests for update_contact
298315
# Updates a contact
299316
#

‎spec/models/create_attribute_enumemaration_spec.rb

Lines changed: 0 additions & 48 deletions
This file was deleted.

‎spec/models/create_attribute_spec.rb

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,13 @@
3232
expect(@instance).to be_instance_of(SibApiV3Sdk::CreateAttribute)
3333
end
3434
end
35-
describe 'test attribute "category"' do
36-
it 'should work' do
37-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38-
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"])
39-
#validator.allowable_values.each do |value|
40-
# expect { @instance.category = value }.not_to raise_error
41-
#end
42-
end
43-
end
44-
45-
describe 'test attribute "name"' do
46-
it 'should work' do
47-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48-
end
49-
end
50-
5135
describe 'test attribute "value"' do
5236
it 'should work' do
5337
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
5438
end
5539
end
5640

57-
describe 'test attribute "enumemaration"' do
41+
describe 'test attribute "enumeration"' do
5842
it 'should work' do
5943
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
6044
end
@@ -63,7 +47,7 @@
6347
describe 'test attribute "type"' do
6448
it 'should work' do
6549
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
66-
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "date", "float", "id"])
50+
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
6751
#validator.allowable_values.each do |value|
6852
# expect { @instance.type = value }.not_to raise_error
6953
#end

‎spec/models/error_model_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
describe 'test attribute "code"' do
3636
it 'should work' do
3737
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38-
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission", "not_enough_credits", "permission_denied", "duplicate_parameter", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"])
38+
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission", "not_enough_credits", "permission_denied", "duplicate_parameter", "duplicate_request", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"])
3939
#validator.allowable_values.each do |value|
4040
# expect { @instance.code = value }.not_to raise_error
4141
#end

‎spec/models/get_attributes_attributes_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
expect(@instance).to be_instance_of(SibApiV3Sdk::GetAttributesAttributes)
3333
end
3434
end
35-
describe 'test attribute "id"' do
36-
it 'should work' do
37-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38-
end
39-
end
40-
4135
describe 'test attribute "name"' do
4236
it 'should work' do
4337
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers

‎spec/models/send_sms_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,11 @@
3838
end
3939
end
4040

41+
describe 'test attribute "message_id"' do
42+
it 'should work' do
43+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44+
end
45+
end
46+
4147
end
4248

0 commit comments

Comments
 (0)
Please sign in to comment.