Skip to content

Commit 44b1abf

Browse files
committed
Initial commit
0 parents  commit 44b1abf

1,076 files changed

Lines changed: 128113 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*,cover
47+
.hypothesis/
48+
venv/
49+
.python-version
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
58+
# Sphinx documentation
59+
docs/_build/
60+
61+
# PyBuilder
62+
target/
63+
64+
#Ipython Notebook
65+
.ipynb_checkpoints

.swagger-codegen-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.swagger-codegen/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.12

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
# - "2.7"
5+
# - "3.2"
6+
# - "3.3"
7+
- "3.4"
8+
- "3.5"
9+
#- "3.5-dev" # 3.5 development branch
10+
#- "nightly" # points to the latest development branch e.g. 3.6-dev
11+
# command to install dependencies
12+
install: "pip install -r requirements.txt"
13+
# command to run tests
14+
script: nosetests

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 Brevo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 638 additions & 0 deletions
Large diffs are not rendered by default.

brevo_python/__init__.py

Lines changed: 367 additions & 0 deletions
Large diffs are not rendered by default.

brevo_python/api/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from __future__ import absolute_import
2+
3+
# flake8: noqa
4+
5+
# import apis into api package
6+
from brevo_python.api.account_api import AccountApi
7+
from brevo_python.api.companies_api import CompaniesApi
8+
from brevo_python.api.contacts_api import ContactsApi
9+
from brevo_python.api.conversations_api import ConversationsApi
10+
from brevo_python.api.deals_api import DealsApi
11+
from brevo_python.api.domains_api import DomainsApi
12+
from brevo_python.api.ecommerce_api import EcommerceApi
13+
from brevo_python.api.email_campaigns_api import EmailCampaignsApi
14+
from brevo_python.api.external_feeds_api import ExternalFeedsApi
15+
from brevo_python.api.files_api import FilesApi
16+
from brevo_python.api.inbound_parsing_api import InboundParsingApi
17+
from brevo_python.api.master_account_api import MasterAccountApi
18+
from brevo_python.api.notes_api import NotesApi
19+
from brevo_python.api.process_api import ProcessApi
20+
from brevo_python.api.reseller_api import ResellerApi
21+
from brevo_python.api.sms_campaigns_api import SMSCampaignsApi
22+
from brevo_python.api.senders_api import SendersApi
23+
from brevo_python.api.tasks_api import TasksApi
24+
from brevo_python.api.transactional_sms_api import TransactionalSMSApi
25+
from brevo_python.api.transactional_whats_app_api import TransactionalWhatsAppApi
26+
from brevo_python.api.transactional_emails_api import TransactionalEmailsApi
27+
from brevo_python.api.user_api import UserApi
28+
from brevo_python.api.webhooks_api import WebhooksApi
29+
from brevo_python.api.whats_app_campaigns_api import WhatsAppCampaignsApi

brevo_python/api/account_api.py

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# coding: utf-8
2+
3+
"""
4+
Brevo API
5+
6+
Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | # noqa: E501
7+
8+
OpenAPI spec version: 3.0.0
9+
Contact: contact@brevo.com
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
from __future__ import absolute_import
15+
16+
import re # noqa: F401
17+
18+
# python 2 and python 3 compatibility library
19+
import six
20+
21+
from brevo_python.api_client import ApiClient
22+
23+
24+
class AccountApi(object):
25+
"""NOTE: This class is auto generated by the swagger code generator program.
26+
27+
Do not edit the class manually.
28+
Ref: https://github.com/swagger-api/swagger-codegen
29+
"""
30+
31+
def __init__(self, api_client=None):
32+
if api_client is None:
33+
api_client = ApiClient()
34+
self.api_client = api_client
35+
36+
def get_account(self, **kwargs): # noqa: E501
37+
"""Get your account information, plan and credits details # noqa: E501
38+
39+
This method makes a synchronous HTTP request by default. To make an
40+
asynchronous HTTP request, please pass async_req=True
41+
>>> thread = api.get_account(async_req=True)
42+
>>> result = thread.get()
43+
44+
:param async_req bool
45+
:return: GetAccount
46+
If the method is called asynchronously,
47+
returns the request thread.
48+
"""
49+
kwargs['_return_http_data_only'] = True
50+
if kwargs.get('async_req'):
51+
return self.get_account_with_http_info(**kwargs) # noqa: E501
52+
else:
53+
(data) = self.get_account_with_http_info(**kwargs) # noqa: E501
54+
return data
55+
56+
def get_account_with_http_info(self, **kwargs): # noqa: E501
57+
"""Get your account information, plan and credits details # noqa: E501
58+
59+
This method makes a synchronous HTTP request by default. To make an
60+
asynchronous HTTP request, please pass async_req=True
61+
>>> thread = api.get_account_with_http_info(async_req=True)
62+
>>> result = thread.get()
63+
64+
:param async_req bool
65+
:return: GetAccount
66+
If the method is called asynchronously,
67+
returns the request thread.
68+
"""
69+
70+
all_params = [] # noqa: E501
71+
all_params.append('async_req')
72+
all_params.append('_return_http_data_only')
73+
all_params.append('_preload_content')
74+
all_params.append('_request_timeout')
75+
76+
params = locals()
77+
for key, val in six.iteritems(params['kwargs']):
78+
if key not in all_params:
79+
raise TypeError(
80+
"Got an unexpected keyword argument '%s'"
81+
" to method get_account" % key
82+
)
83+
params[key] = val
84+
del params['kwargs']
85+
86+
collection_formats = {}
87+
88+
path_params = {}
89+
90+
query_params = []
91+
92+
header_params = {}
93+
94+
form_params = []
95+
local_var_files = {}
96+
97+
body_params = None
98+
# HTTP header `Accept`
99+
header_params['Accept'] = self.api_client.select_header_accept(
100+
['application/json']) # noqa: E501
101+
102+
# HTTP header `Content-Type`
103+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
104+
['application/json']) # noqa: E501
105+
106+
# Authentication setting
107+
auth_settings = ['api-key', 'partner-key'] # noqa: E501
108+
109+
return self.api_client.call_api(
110+
'/account', 'GET',
111+
path_params,
112+
query_params,
113+
header_params,
114+
body=body_params,
115+
post_params=form_params,
116+
files=local_var_files,
117+
response_type='GetAccount', # noqa: E501
118+
auth_settings=auth_settings,
119+
async_req=params.get('async_req'),
120+
_return_http_data_only=params.get('_return_http_data_only'),
121+
_preload_content=params.get('_preload_content', True),
122+
_request_timeout=params.get('_request_timeout'),
123+
collection_formats=collection_formats)
124+
125+
def get_account_activity(self, **kwargs): # noqa: E501
126+
"""Get user activity logs # noqa: E501
127+
128+
This method makes a synchronous HTTP request by default. To make an
129+
asynchronous HTTP request, please pass async_req=True
130+
>>> thread = api.get_account_activity(async_req=True)
131+
>>> result = thread.get()
132+
133+
:param async_req bool
134+
:param str start_date: Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
135+
:param str end_date: Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
136+
:param int limit: Number of documents per page
137+
:param int offset: Index of the first document in the page.
138+
:return: GetAccountActivity
139+
If the method is called asynchronously,
140+
returns the request thread.
141+
"""
142+
kwargs['_return_http_data_only'] = True
143+
if kwargs.get('async_req'):
144+
return self.get_account_activity_with_http_info(**kwargs) # noqa: E501
145+
else:
146+
(data) = self.get_account_activity_with_http_info(**kwargs) # noqa: E501
147+
return data
148+
149+
def get_account_activity_with_http_info(self, **kwargs): # noqa: E501
150+
"""Get user activity logs # noqa: E501
151+
152+
This method makes a synchronous HTTP request by default. To make an
153+
asynchronous HTTP request, please pass async_req=True
154+
>>> thread = api.get_account_activity_with_http_info(async_req=True)
155+
>>> result = thread.get()
156+
157+
:param async_req bool
158+
:param str start_date: Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
159+
:param str end_date: Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
160+
:param int limit: Number of documents per page
161+
:param int offset: Index of the first document in the page.
162+
:return: GetAccountActivity
163+
If the method is called asynchronously,
164+
returns the request thread.
165+
"""
166+
167+
all_params = ['start_date', 'end_date', 'limit', 'offset'] # noqa: E501
168+
all_params.append('async_req')
169+
all_params.append('_return_http_data_only')
170+
all_params.append('_preload_content')
171+
all_params.append('_request_timeout')
172+
173+
params = locals()
174+
for key, val in six.iteritems(params['kwargs']):
175+
if key not in all_params:
176+
raise TypeError(
177+
"Got an unexpected keyword argument '%s'"
178+
" to method get_account_activity" % key
179+
)
180+
params[key] = val
181+
del params['kwargs']
182+
183+
if 'limit' in params and params['limit'] > 100: # noqa: E501
184+
raise ValueError("Invalid value for parameter `limit` when calling `get_account_activity`, must be a value less than or equal to `100`") # noqa: E501
185+
if 'limit' in params and params['limit'] < 1: # noqa: E501
186+
raise ValueError("Invalid value for parameter `limit` when calling `get_account_activity`, must be a value greater than or equal to `1`") # noqa: E501
187+
collection_formats = {}
188+
189+
path_params = {}
190+
191+
query_params = []
192+
if 'start_date' in params:
193+
query_params.append(('startDate', params['start_date'])) # noqa: E501
194+
if 'end_date' in params:
195+
query_params.append(('endDate', params['end_date'])) # noqa: E501
196+
if 'limit' in params:
197+
query_params.append(('limit', params['limit'])) # noqa: E501
198+
if 'offset' in params:
199+
query_params.append(('offset', params['offset'])) # noqa: E501
200+
201+
header_params = {}
202+
203+
form_params = []
204+
local_var_files = {}
205+
206+
body_params = None
207+
# HTTP header `Accept`
208+
header_params['Accept'] = self.api_client.select_header_accept(
209+
['application/json']) # noqa: E501
210+
211+
# HTTP header `Content-Type`
212+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
213+
['application/json']) # noqa: E501
214+
215+
# Authentication setting
216+
auth_settings = ['api-key', 'partner-key'] # noqa: E501
217+
218+
return self.api_client.call_api(
219+
'/organization/activities', 'GET',
220+
path_params,
221+
query_params,
222+
header_params,
223+
body=body_params,
224+
post_params=form_params,
225+
files=local_var_files,
226+
response_type='GetAccountActivity', # noqa: E501
227+
auth_settings=auth_settings,
228+
async_req=params.get('async_req'),
229+
_return_http_data_only=params.get('_return_http_data_only'),
230+
_preload_content=params.get('_preload_content', True),
231+
_request_timeout=params.get('_request_timeout'),
232+
collection_formats=collection_formats)

0 commit comments

Comments
 (0)