Skip to content

Commit 0512b09

Browse files
Merge pull request sendinblue#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

+9-5
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

+78-12
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

+78-12
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

+3-5
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

-9
This file was deleted.

0 commit comments

Comments
 (0)