Skip to content

Commit 91a3a8a

Browse files
Merge pull request #9 from sendinblue/feature_updated_swagger_sync
Swagger sync: contact attribute api added
2 parents a88f6de + 0f3d67b commit 91a3a8a

26 files changed

+1009
-238
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
*AccountApi* | [**get_account**](docs/AccountApi.md#get_account) | **GET** /account | Get your account informations, plans and credits details
83-
*AttributesApi* | [**create_attribute**](docs/AttributesApi.md#create_attribute) | **POST** /contacts/attributes | Creates contact attributes
84-
*AttributesApi* | [**delete_attribute**](docs/AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeId} | Deletes an attribute
83+
*AttributesApi* | [**create_attribute**](docs/AttributesApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute
84+
*AttributesApi* | [**delete_attribute**](docs/AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
8585
*AttributesApi* | [**get_attributes**](docs/AttributesApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
86+
*AttributesApi* | [**update_attribute**](docs/AttributesApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute
8687
*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-
*ContactsApi* | [**create_attribute**](docs/ContactsApi.md#create_attribute) | **POST** /contacts/attributes | Creates contact attributes
88+
*ContactsApi* | [**create_attribute**](docs/ContactsApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Creates contact attribute
8889
*ContactsApi* | [**create_contact**](docs/ContactsApi.md#create_contact) | **POST** /contacts | Create a contact
8990
*ContactsApi* | [**create_folder**](docs/ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder
9091
*ContactsApi* | [**create_list**](docs/ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list
91-
*ContactsApi* | [**delete_attribute**](docs/ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeId} | Deletes an attribute
92+
*ContactsApi* | [**delete_attribute**](docs/ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
9293
*ContactsApi* | [**delete_folder**](docs/ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
9394
*ContactsApi* | [**delete_list**](docs/ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list
9495
*ContactsApi* | [**get_attributes**](docs/ContactsApi.md#get_attributes) | **GET** /contacts/attributes | Lists all attributes
@@ -104,6 +105,7 @@ Class | Method | HTTP request | Description
104105
*ContactsApi* | [**import_contacts**](docs/ContactsApi.md#import_contacts) | **POST** /contacts/import | Import contacts
105106
*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
*ContactsApi* | [**request_contact_export**](docs/ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts
108+
*ContactsApi* | [**update_attribute**](docs/ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute
107109
*ContactsApi* | [**update_contact**](docs/ContactsApi.md#update_contact) | **PUT** /contacts/{email} | Updates a contact
108110
*ContactsApi* | [**update_folder**](docs/ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a contact folder
109111
*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
- [AddCredits](docs/AddCredits.md)
188190
- [AddRemoveContactToList](docs/AddRemoveContactToList.md)
189191
- [CreateAttribute](docs/CreateAttribute.md)
190-
- [CreateAttributeEnumemaration](docs/CreateAttributeEnumemaration.md)
192+
- [CreateAttributeEnumeration](docs/CreateAttributeEnumeration.md)
191193
- [CreateChild](docs/CreateChild.md)
192194
- [CreateContact](docs/CreateContact.md)
193195
- [CreateEmailCampaign](docs/CreateEmailCampaign.md)
@@ -310,6 +312,8 @@ Class | Method | HTTP request | Description
310312
- [SendTestEmail](docs/SendTestEmail.md)
311313
- [SendTestSms](docs/SendTestSms.md)
312314
- [SendTransacSms](docs/SendTransacSms.md)
315+
- [UpdateAttribute](docs/UpdateAttribute.md)
316+
- [UpdateAttributeEnumeration](docs/UpdateAttributeEnumeration.md)
313317
- [UpdateCampaignStatus](docs/UpdateCampaignStatus.md)
314318
- [UpdateChild](docs/UpdateChild.md)
315319
- [UpdateContact](docs/UpdateContact.md)

docs/AttributesApi.md

Lines changed: 72 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
```python
@@ -29,12 +30,13 @@ sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY'
2930

3031
# create an instance of the API class
3132
api_instance = sib_api_v3_sdk.AttributesApi()
33+
attribute_category = 'attribute_category_example' # str | Category of the attribute
34+
attribute_name = 'attribute_name_example' # str | Name of the attribute
3235
create_attribute = sib_api_v3_sdk.CreateAttribute() # CreateAttribute | Values to create an attribute
3336

3437
try:
35-
# Creates contact attributes
36-
api_response = api_instance.create_attribute(create_attribute)
37-
pprint(api_response)
38+
# Creates contact attribute
39+
api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
3840
except ApiException as e:
3941
print("Exception when calling AttributesApi->create_attribute: %s\n" % e)
4042
```
@@ -43,11 +45,13 @@ except ApiException as e:
4345

4446
Name | Type | Description | Notes
4547
------------- | ------------- | ------------- | -------------
48+
**attribute_category** | **str**| Category of the attribute |
49+
**attribute_name** | **str**| Name of the attribute |
4650
**create_attribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute |
4751

4852
### Return type
4953

50-
[**CreateModel**](CreateModel.md)
54+
void (empty response body)
5155

5256
### Authorization
5357

@@ -61,7 +65,7 @@ Name | Type | Description | Notes
6165
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
6266

6367
# **delete_attribute**
64-
> delete_attribute(attribute_id)
68+
> delete_attribute(attribute_category, attribute_name)
6569
6670
Deletes an attribute
6771

@@ -80,11 +84,12 @@ sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY'
8084

8185
# create an instance of the API class
8286
api_instance = sib_api_v3_sdk.AttributesApi()
83-
attribute_id = 789 # int | id of the attribute
87+
attribute_category = 'attribute_category_example' # str | Category of the attribute
88+
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
8489

8590
try:
8691
# Deletes an attribute
87-
api_instance.delete_attribute(attribute_id)
92+
api_instance.delete_attribute(attribute_category, attribute_name)
8893
except ApiException as e:
8994
print("Exception when calling AttributesApi->delete_attribute: %s\n" % e)
9095
```
@@ -93,7 +98,8 @@ except ApiException as e:
9398

9499
Name | Type | Description | Notes
95100
------------- | ------------- | ------------- | -------------
96-
**attribute_id** | **int**| id of the attribute |
101+
**attribute_category** | **str**| Category of the attribute |
102+
**attribute_name** | **str**| Name of the existing attribute |
97103

98104
### Return type
99105

@@ -157,3 +163,57 @@ This endpoint does not need any parameter.
157163

158164
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
159165

166+
# **update_attribute**
167+
> update_attribute(attribute_category, attribute_name, update_attribute)
168+
169+
Updates contact attribute
170+
171+
### Example
172+
```python
173+
from __future__ import print_function
174+
import time
175+
import sib_api_v3_sdk
176+
from sib_api_v3_sdk.rest import ApiException
177+
from pprint import pprint
178+
179+
# Configure API key authorization: api-key
180+
sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY'
181+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
182+
# sib_api_v3_sdk.configuration.api_key_prefix['api-key'] = 'Bearer'
183+
184+
# create an instance of the API class
185+
api_instance = sib_api_v3_sdk.AttributesApi()
186+
attribute_category = 'attribute_category_example' # str | Category of the attribute
187+
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
188+
update_attribute = sib_api_v3_sdk.UpdateAttribute() # UpdateAttribute | Values to update an attribute
189+
190+
try:
191+
# Updates contact attribute
192+
api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
193+
except ApiException as e:
194+
print("Exception when calling AttributesApi->update_attribute: %s\n" % e)
195+
```
196+
197+
### Parameters
198+
199+
Name | Type | Description | Notes
200+
------------- | ------------- | ------------- | -------------
201+
**attribute_category** | **str**| Category of the attribute |
202+
**attribute_name** | **str**| Name of the existing attribute |
203+
**update_attribute** | [**UpdateAttribute**](UpdateAttribute.md)| Values to update an attribute |
204+
205+
### Return type
206+
207+
void (empty response body)
208+
209+
### Authorization
210+
211+
[api-key](../README.md#api-key)
212+
213+
### HTTP request headers
214+
215+
- **Content-Type**: application/json
216+
- **Accept**: application/json
217+
218+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
219+

docs/ContactsApi.md

Lines changed: 72 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
@@ -84,9 +85,9 @@ Name | Type | Description | Notes
8485
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
8586

8687
# **create_attribute**
87-
> CreateModel create_attribute(create_attribute)
88+
> create_attribute(attribute_category, attribute_name, create_attribute)
8889
89-
Creates contact attributes
90+
Creates contact attribute
9091

9192
### Example
9293
```python
@@ -103,12 +104,13 @@ sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY'
103104

104105
# create an instance of the API class
105106
api_instance = sib_api_v3_sdk.ContactsApi()
107+
attribute_category = 'attribute_category_example' # str | Category of the attribute
108+
attribute_name = 'attribute_name_example' # str | Name of the attribute
106109
create_attribute = sib_api_v3_sdk.CreateAttribute() # CreateAttribute | Values to create an attribute
107110

108111
try:
109-
# Creates contact attributes
110-
api_response = api_instance.create_attribute(create_attribute)
111-
pprint(api_response)
112+
# Creates contact attribute
113+
api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
112114
except ApiException as e:
113115
print("Exception when calling ContactsApi->create_attribute: %s\n" % e)
114116
```
@@ -117,11 +119,13 @@ except ApiException as e:
117119

118120
Name | Type | Description | Notes
119121
------------- | ------------- | ------------- | -------------
122+
**attribute_category** | **str**| Category of the attribute |
123+
**attribute_name** | **str**| Name of the attribute |
120124
**create_attribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute |
121125

122126
### Return type
123127

124-
[**CreateModel**](CreateModel.md)
128+
void (empty response body)
125129

126130
### Authorization
127131

@@ -288,7 +292,7 @@ Name | Type | Description | Notes
288292
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
289293

290294
# **delete_attribute**
291-
> delete_attribute(attribute_id)
295+
> delete_attribute(attribute_category, attribute_name)
292296
293297
Deletes an attribute
294298

@@ -307,11 +311,12 @@ sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY'
307311

308312
# create an instance of the API class
309313
api_instance = sib_api_v3_sdk.ContactsApi()
310-
attribute_id = 789 # int | id of the attribute
314+
attribute_category = 'attribute_category_example' # str | Category of the attribute
315+
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
311316

312317
try:
313318
# Deletes an attribute
314-
api_instance.delete_attribute(attribute_id)
319+
api_instance.delete_attribute(attribute_category, attribute_name)
315320
except ApiException as e:
316321
print("Exception when calling ContactsApi->delete_attribute: %s\n" % e)
317322
```
@@ -320,7 +325,8 @@ except ApiException as e:
320325

321326
Name | Type | Description | Notes
322327
------------- | ------------- | ------------- | -------------
323-
**attribute_id** | **int**| id of the attribute |
328+
**attribute_category** | **str**| Category of the attribute |
329+
**attribute_name** | **str**| Name of the existing attribute |
324330

325331
### Return type
326332

@@ -1120,6 +1126,60 @@ Name | Type | Description | Notes
11201126

11211127
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
11221128

1129+
# **update_attribute**
1130+
> update_attribute(attribute_category, attribute_name, update_attribute)
1131+
1132+
Updates contact attribute
1133+
1134+
### Example
1135+
```python
1136+
from __future__ import print_function
1137+
import time
1138+
import sib_api_v3_sdk
1139+
from sib_api_v3_sdk.rest import ApiException
1140+
from pprint import pprint
1141+
1142+
# Configure API key authorization: api-key
1143+
sib_api_v3_sdk.configuration.api_key['api-key'] = 'YOUR_API_KEY'
1144+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
1145+
# sib_api_v3_sdk.configuration.api_key_prefix['api-key'] = 'Bearer'
1146+
1147+
# create an instance of the API class
1148+
api_instance = sib_api_v3_sdk.ContactsApi()
1149+
attribute_category = 'attribute_category_example' # str | Category of the attribute
1150+
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
1151+
update_attribute = sib_api_v3_sdk.UpdateAttribute() # UpdateAttribute | Values to update an attribute
1152+
1153+
try:
1154+
# Updates contact attribute
1155+
api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
1156+
except ApiException as e:
1157+
print("Exception when calling ContactsApi->update_attribute: %s\n" % e)
1158+
```
1159+
1160+
### Parameters
1161+
1162+
Name | Type | Description | Notes
1163+
------------- | ------------- | ------------- | -------------
1164+
**attribute_category** | **str**| Category of the attribute |
1165+
**attribute_name** | **str**| Name of the existing attribute |
1166+
**update_attribute** | [**UpdateAttribute**](UpdateAttribute.md)| Values to update an attribute |
1167+
1168+
### Return type
1169+
1170+
void (empty response body)
1171+
1172+
### Authorization
1173+
1174+
[api-key](../README.md#api-key)
1175+
1176+
### HTTP request headers
1177+
1178+
- **Content-Type**: application/json
1179+
- **Accept**: application/json
1180+
1181+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
1182+
11231183
# **update_contact**
11241184
> update_contact(email, update_contact)
11251185

docs/CreateAttribute.md

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

docs/CreateAttributeEnumeration.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# CreateAttributeEnumeration
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**value** | **int** | Id of the value |
7+
**label** | **str** | Label of the value |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

0 commit comments

Comments
 (0)