├── .github
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── build
└── lib
│ └── mailchimp_transactional
│ ├── __init__.py
│ ├── api
│ ├── __init__.py
│ ├── allowlists_api.py
│ ├── exports_api.py
│ ├── inbound_api.py
│ ├── ips_api.py
│ ├── messages_api.py
│ ├── metadata_api.py
│ ├── rejects_api.py
│ ├── senders_api.py
│ ├── subaccounts_api.py
│ ├── tags_api.py
│ ├── templates_api.py
│ ├── urls_api.py
│ ├── users_api.py
│ ├── webhooks_api.py
│ └── whitelists_api.py
│ └── api_client.py
├── dist
└── mailchimp_transactional-1.0.59-py3-none-any.whl
├── mailchimp_transactional.egg-info
├── PKG-INFO
├── SOURCES.txt
├── dependency_links.txt
├── requires.txt
└── top_level.txt
├── mailchimp_transactional
├── __init__.py
├── api
│ ├── __init__.py
│ ├── allowlists_api.py
│ ├── exports_api.py
│ ├── inbound_api.py
│ ├── ips_api.py
│ ├── messages_api.py
│ ├── metadata_api.py
│ ├── rejects_api.py
│ ├── senders_api.py
│ ├── subaccounts_api.py
│ ├── tags_api.py
│ ├── templates_api.py
│ ├── urls_api.py
│ ├── users_api.py
│ ├── webhooks_api.py
│ └── whitelists_api.py
└── api_client.py
├── requirements.txt
├── setup.py
└── test-requirements.txt
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Note: This repository is auto-generated, and does not accept pull requests.
2 |
3 | To make changes or open issues for this SDK, use the [code generation repository](https://github.com/mailchimp/mailchimp-client-lib-codegen).
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
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 | # PyInstaller
28 | # Usually these files are written by a python script from a template
29 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
30 | *.manifest
31 | *.spec
32 |
33 | # Installer logs
34 | pip-log.txt
35 | pip-delete-this-directory.txt
36 |
37 | # Unit test / coverage reports
38 | htmlcov/
39 | .tox/
40 | .coverage
41 | .coverage.*
42 | .cache
43 | nosetests.xml
44 | coverage.xml
45 | *,cover
46 | .hypothesis/
47 | venv/
48 | .python-version
49 |
50 | # Translations
51 | *.mo
52 | *.pot
53 |
54 | # Django stuff:
55 | *.log
56 |
57 | # Sphinx documentation
58 | docs/_build/
59 |
60 | # PyBuilder
61 | target/
62 |
63 | #Ipython Notebook
64 | .ipynb_checkpoints
65 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## Transactional
4 |
5 | ### 1.0.56
6 | * Adding DMARC and DKIM2 fields to the API reference
7 |
8 | ### 1.0.55
9 | * Updating github actions bot user email
10 |
11 | ### 1.0.54
12 | * Fixing a problem with Github auth token that was preventing builds from being created.
13 |
14 | ### 1.0.53
15 | * Fixed broken ruby SDK test, updated PHP SDK to send form data via JSON
16 |
17 | ### 1.0.52
18 | * Added the `is_broken_template` response to the /template endpoints that include it
19 |
20 | ### 1.0.51
21 | * Fixed `/messages/send-template` documentation where incorrectly referenced the template name usage.
22 |
23 | ### 1.0.50
24 | * Added a response parameter to /messages/send and /messages/send-template called 'queued_response' that details why an email was queued.
25 |
26 | ### 1.0.48
27 | * Allowing users to schedule messages (using messages/send, messages/send-template, messages/send-raw and messages/reschedule APIs) within a year from the date of scheduling.
28 |
29 | ### 1.0.46
30 | * Added a little more granularity to the `set_timeout` method to the Client class in the Ruby SDK; now supports `read`, `write` and `connect` parameters, which will default to the `timeout` param if unspecified, or 300 seconds if `timeout` is unspecified.
31 |
32 | ### 1.0.45
33 | * Added a `set_timeout` method to the Client class in the Ruby SDK
34 |
35 | ### 1.0.44
36 | * Added a `set_timeout` method to the Client class in the Python SDK
37 |
38 | ### 1.0.43
39 | * Added a `setTimeout` method to the Configuration class in the PHP SDK.
40 |
41 | ### 1.0.42
42 | * Added a `setDefaultTimeoutMs` method to the node client. This allows users to override the default timeout for API requests, which is set to 5 minutes by default.
43 |
44 | ### 1.0.41
45 | * Updated the "reject_reasons" response for /messages/send and /messages/send-template to correctly use "hard-bounce" and "soft-bounce" instead of the previously stated "hard_bounce" and "soft_bounce".
46 |
47 | ### 1.0.40
48 | * Added the new /allowlists/ series of endpoints and the /exports/allowlist endpoint to the API reference
49 |
50 | ### 1.0.39
51 | * Fixes the output directory for the Changelog for the php client library
52 |
53 | ### 1.0.38
54 | * A change was made to `mailchimp-transactional-php` - the API client will now always return an `Exception`, instead of an `Exception` or a string, when the API returns an error. Having to parse the response as a string was found to be a bit clunky.
55 |
56 | ### 1.0.37
57 | * Added a changelog, which will be used to describe changes to both transactional and marketing client libraries.
58 |
59 | ## Marketing
60 |
61 | ### 3.0.72
62 | * Updated the `PATCH /automations/.../emails/.../` documentation to state the required `workflow_type`
63 |
64 | ### 3.0.70
65 | * Added more granularity for the `timeout` field in the Ruby Marketing SDK; now supports `read_timeout`, `write_timeout` and `connect_timeout` fields which will default to the `timeout` value.
66 |
67 | ### 3.0.69
68 | * Added handling for a `timeout` field in the config block passed to the client constructor in the Ruby Marketing SDK.
69 |
70 | ### 3.0.68
71 | * Added handling for a `'timeout'` field in `set_config()` in the Python Marketing SDK.
72 |
73 | ### 3.0.67
74 | * Added a `setTimeout()` method to the configuration class in the PHP Marketing SDK, to allow manually setting the timeout for Guzzle requests.
75 |
76 | ### 3.0.65
77 | * Added a new API endpoint, `/3.0/account-exports`, allowing users to programatically export their account information
78 |
79 | ### 3.0.64
80 | * Fixes the output directory for the Changelog for the php client library
81 |
82 | ### 3.0.63
83 | * Added a changelog, which will be used to describe changes to both transactional and marketing client libraries.
84 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mailchimp Client Library License Agreement
2 |
3 | IMPORTANT- PLEASE READ CAREFULLY BEFORE OPENING, INSTALLING, COPYING OR USING THE CLIENT LIBRARY. This Client Library License Agreement (“Agreement”) is a legal document by and between you (hereinafter referred to as “You” “Your” or “Licensee”) and The Rocket Science Group LLC (“Mailchimp”) (each a “Party” and collectively, “Parties”) for the client library, including any upgrades, modified versions, updates, additions, and copies of the foregoing, including the software and related documentation (the “Mailchimp Client Library”).
4 |
5 | BY OPENING, INSTALLING, COPYING OR USING THE MAILCHIMP CLIENT LIBRARY OR ANY PORTION THEREOF, YOU AGREE TO ALL THE TERMS OF THIS AGREEMENT. IF YOU ARE AGREEING TO THIS AGREEMENT AS AN INDIVIDUAL, “YOU” “YOUR” AND “LICENSEE” REFERS TO YOU INDIVIDUALLY. IF YOU ARE AGREEING TO THIS AGREEMENT AS A REPRESENTATIVE OF A LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE AUTHORITY TO BIND THAT ENTITY AND “YOU” “YOUR” AND “LICENSEE” REFERS TO THAT LEGAL ENTITY AND ALL THE USERS ACCESSING THE SOFTWARE BY, THROUGH OR ON BEHALF OF THAT LEGAL ENTITY. IF YOU DO NOT AGREE WITH ALL OF THE TERMS OF THIS AGREEMENT, DO NOT (AND ENSURE THAT YOUR END USERS DO NOT) OPEN, INSTALL, COPY OR USE THE MAILCHIMP CLIENT LIBRARY.
6 |
7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8 | 1. Definitions.
9 | “License” shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 10 of these Terms and Conditions for Use, Reproduction and Distribution.
10 | “Legal Entity” shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
11 | “You” (or “Your”) shall mean an individual or Legal Entity exercising permissions granted by this License.
12 | “Source” form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
13 | “Object” form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
14 | “Work” shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work.
15 | “Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
16 | “Contribution” shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Mailchimp for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to Mailchimp or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Mailchimp for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as “Not a Contribution.”
17 | “Contributor” shall mean Mailchimp and any individual or Legal Entity on behalf of whom a Contribution has been received by Mailchimp and subsequently incorporated within the Work.
18 |
19 | 2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
20 |
21 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
22 |
23 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
24 | a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
25 | b) You must cause any modified files to carry prominent notices stating that You changed the files; and
26 | c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
27 | d) If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
28 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
29 |
30 | 5. Submission of Contributions. Any Contribution submitted for inclusion in the Work by You to Mailchimp shall be made under the terms and conditions of the Individual Contributor License Agreement or the Software Grant and Corporate Contributor License Agreement, as applicable.
31 |
32 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of Mailchimp, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
33 |
34 | 7. Export controls. The Mailchimp Client Library is subject to united states export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the Mailchimp Client Library. These laws include restrictions on destinations, end-users and end use.
35 |
36 | 8. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
37 |
38 | 9. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
39 |
40 | 10. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
41 |
42 | Copyright 2020, The Rocket Science Group LLC
43 |
44 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
45 |
46 | You should include a copy of the License, typically in a file called LICENSE, in your work, and consider also including a NOTICE file.
47 |
48 | To apply the License to specific files in your work, attach the following boilerplate declaration, with the fields enclosed by brackets “[]” replaced with your own identifying information. (Don’t include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same “printed page” as the copyright notice for easier identification within third-party archives.
49 | Copyright [yyyy] [name of copyright owner]
50 |
51 | Licensed under the Mailchimp Client Library License Agreement (the “License”); you may not use this file except in compliance with the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either or express or implied.
52 | See the License for the specific language governing permissions and
53 | limitations under the License.
54 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | # Mailchimp Transactional — Python
8 |
9 | The official Python client library for the Mailchimp Transactional API (v1)
10 |
11 | ## Requirements.
12 |
13 | Python 2.7 and 3.4+
14 |
15 | ## Installation & Usage
16 | ### pip install
17 |
18 | If the python package is hosted on GitHub, you can install directly from GitHub
19 |
20 | ```sh
21 | pip install git+https://github.com/mailchimp/mailchimp-transactional-python.git
22 | ```
23 | (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/mailchimp/mailchimp-transactional-python.git`)
24 |
25 | Then import the package:
26 | ```python
27 | import mailchimp_transactional
28 | ```
29 |
30 | ### Setuptools
31 |
32 | Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
33 |
34 | ```sh
35 | python setup.py install --user
36 | ```
37 | (or `sudo python setup.py install` to install the package for all users)
38 |
39 | Then import the package:
40 | ```python
41 | import mailchimp_transactional
42 | ```
43 |
44 | ## Quick Start
45 |
46 | Please follow the [installation procedure](#installation--usage) and then run the following:
47 |
48 | ## Quick Start
49 |
50 | ```python
51 | import mailchimp_transactional as MailchimpTransactional
52 | from mailchimp_transactional.api_client import ApiClientError
53 |
54 | try:
55 | mailchimp = MailchimpTransactional.Client('YOUR_API_KEY')
56 | response = mailchimp.users.ping()
57 | print('API called successfully: {}'.format(response))
58 | except ApiClientError as error:
59 | print('An exception occurred: {}'.format(error.text))
60 | ```
61 |
62 | ## Sending Requests
63 | All requests are sent via POST and accept a single argument as the request body parameter.
64 | ```python
65 | mailchimp.templates.publish({ name: 'My Template' });
66 | ```
67 |
68 | ## Output Formats
69 | Optionally, you can set the default response format for **all requests** to one of the following:
70 | - `json` *(default)*
71 | - `xml`
72 | - `php`
73 | - `yaml`
74 |
75 | ```python
76 | mailchimp.set_default_output_format('xml');
77 | ```
78 |
79 | You can also set the response format for a **single request** by passing in a special `outputFormat` param to the request body.
80 | ```python
81 | mailchimp.senders.list({ outputFormat: 'php' });
82 | ```
83 |
84 | ## PRs and Issues
85 | This repo is autogenerated from https://github.com/mailchimp/mailchimp-client-lib-codegen -- please submit PRs or issues there!
86 |
87 | ## API Endpoints
88 |
89 | All URIs are relative to *https://mandrillapp.com/api/1.0*
90 |
91 | | Method | Endpoint |
92 | | ---------- | -------- |
93 | | **allowlists.add** | /allowlists/add |
94 | | **allowlists.delete** | /allowlists/delete |
95 | | **allowlists.list** | /allowlists/list |
96 | | **exports.activity** | /exports/activity |
97 | | **exports.allowlist** | /exports/allowlist |
98 | | **exports.info** | /exports/info |
99 | | **exports.list** | /exports/list |
100 | | **exports.rejects** | /exports/rejects |
101 | | **exports.whitelist** | /exports/whitelist |
102 | | **inbound.add_domain** | /inbound/add-domain |
103 | | **inbound.add_route** | /inbound/add-route |
104 | | **inbound.check_domain** | /inbound/check-domain |
105 | | **inbound.delete_domain** | /inbound/delete-domain |
106 | | **inbound.delete_route** | /inbound/delete-route |
107 | | **inbound.domains** | /inbound/domains |
108 | | **inbound.routes** | /inbound/routes |
109 | | **inbound.send_raw** | /inbound/send-raw |
110 | | **inbound.update_route** | /inbound/update-route |
111 | | **ips.cancel_warmup** | /ips/cancel-warmup |
112 | | **ips.check_custom_dns** | /ips/check-custom-dns |
113 | | **ips.create_pool** | /ips/create-pool |
114 | | **ips.delete** | /ips/delete |
115 | | **ips.delete_pool** | /ips/delete-pool |
116 | | **ips.info** | /ips/info |
117 | | **ips.list** | /ips/list |
118 | | **ips.list_pools** | /ips/list-pools |
119 | | **ips.pool_info** | /ips/pool-info |
120 | | **ips.provision** | /ips/provision |
121 | | **ips.set_custom_dns** | /ips/set-custom-dns |
122 | | **ips.set_pool** | /ips/set-pool |
123 | | **ips.start_warmup** | /ips/start-warmup |
124 | | **messages.cancel_scheduled** | /messages/cancel-scheduled |
125 | | **messages.content** | /messages/content |
126 | | **messages.info** | /messages/info |
127 | | **messages.list_scheduled** | /messages/list-scheduled |
128 | | **messages.parse** | /messages/parse |
129 | | **messages.reschedule** | /messages/reschedule |
130 | | **messages.search** | /messages/search |
131 | | **messages.search_time_series** | /messages/search-time-series |
132 | | **messages.send** | /messages/send |
133 | | **messages.send_raw** | /messages/send-raw |
134 | | **messages.send_template** | /messages/send-template |
135 | | **metadata.add** | /metadata/add |
136 | | **metadata.delete** | /metadata/delete |
137 | | **metadata.list** | /metadata/list |
138 | | **metadata.update** | /metadata/update |
139 | | **rejects.add** | /rejects/add |
140 | | **rejects.delete** | /rejects/delete |
141 | | **rejects.list** | /rejects/list |
142 | | **senders.add_domain** | /senders/add-domain |
143 | | **senders.check_domain** | /senders/check-domain |
144 | | **senders.domains** | /senders/domains |
145 | | **senders.info** | /senders/info |
146 | | **senders.list** | /senders/list |
147 | | **senders.time_series** | /senders/time-series |
148 | | **senders.verify_domain** | /senders/verify-domain |
149 | | **subaccounts.add** | /subaccounts/add |
150 | | **subaccounts.delete** | /subaccounts/delete |
151 | | **subaccounts.info** | /subaccounts/info |
152 | | **subaccounts.list** | /subaccounts/list |
153 | | **subaccounts.pause** | /subaccounts/pause |
154 | | **subaccounts.resume** | /subaccounts/resume |
155 | | **subaccounts.update** | /subaccounts/update |
156 | | **tags.all_time_series** | /tags/all-time-series |
157 | | **tags.delete** | /tags/delete |
158 | | **tags.info** | /tags/info |
159 | | **tags.list** | /tags/list |
160 | | **tags.time_series** | /tags/time-series |
161 | | **templates.add** | /templates/add |
162 | | **templates.delete** | /templates/delete |
163 | | **templates.info** | /templates/info |
164 | | **templates.list** | /templates/list |
165 | | **templates.publish** | /templates/publish |
166 | | **templates.render** | /templates/render |
167 | | **templates.time_series** | /templates/time-series |
168 | | **templates.update** | /templates/update |
169 | | **urls.add_tracking_domain** | /urls/add-tracking-domain |
170 | | **urls.check_tracking_domain** | /urls/check-tracking-domain |
171 | | **urls.list** | /urls/list |
172 | | **urls.search** | /urls/search |
173 | | **urls.time_series** | /urls/time-series |
174 | | **urls.tracking_domains** | /urls/tracking-domains |
175 | | **users.info** | /users/info |
176 | | **users.ping** | /users/ping |
177 | | **users.ping2** | /users/ping2 |
178 | | **users.senders** | /users/senders |
179 | | **webhooks.add** | /webhooks/add |
180 | | **webhooks.delete** | /webhooks/delete |
181 | | **webhooks.info** | /webhooks/info |
182 | | **webhooks.list** | /webhooks/list |
183 | | **webhooks.update** | /webhooks/update |
184 | | **whitelists.add** | /whitelists/add |
185 | | **whitelists.delete** | /whitelists/delete |
186 | | **whitelists.list** | /whitelists/list |
187 |
188 |
189 | ## Additional Libraries
190 |
191 | Mailchimp Transactional libraries are available in the following languages:
192 |
193 |
207 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/__init__.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | # flake8: noqa
4 |
5 | """
6 | Mailchimp Transactional API
7 |
8 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
9 |
10 | OpenAPI spec version: 1.0.59
11 | Contact: apihelp@mailchimp.com
12 | Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | """
14 |
15 |
16 | from __future__ import absolute_import
17 |
18 | # import apis into sdk package
19 | from mailchimp_transactional.api.allowlists_api import AllowlistsApi
20 | from mailchimp_transactional.api.exports_api import ExportsApi
21 | from mailchimp_transactional.api.inbound_api import InboundApi
22 | from mailchimp_transactional.api.ips_api import IpsApi
23 | from mailchimp_transactional.api.messages_api import MessagesApi
24 | from mailchimp_transactional.api.metadata_api import MetadataApi
25 | from mailchimp_transactional.api.rejects_api import RejectsApi
26 | from mailchimp_transactional.api.senders_api import SendersApi
27 | from mailchimp_transactional.api.subaccounts_api import SubaccountsApi
28 | from mailchimp_transactional.api.tags_api import TagsApi
29 | from mailchimp_transactional.api.templates_api import TemplatesApi
30 | from mailchimp_transactional.api.urls_api import UrlsApi
31 | from mailchimp_transactional.api.users_api import UsersApi
32 | from mailchimp_transactional.api.webhooks_api import WebhooksApi
33 | from mailchimp_transactional.api.whitelists_api import WhitelistsApi
34 |
35 |
36 | from mailchimp_transactional.api_client import ApiClient
37 |
38 | class Client(object):
39 | def __init__(self, api_key = ''):
40 | self.api_key = api_key
41 | self.api_client = ApiClient()
42 |
43 | self.allowlists = AllowlistsApi(self.api_key, self.api_client)
44 | self.exports = ExportsApi(self.api_key, self.api_client)
45 | self.inbound = InboundApi(self.api_key, self.api_client)
46 | self.ips = IpsApi(self.api_key, self.api_client)
47 | self.messages = MessagesApi(self.api_key, self.api_client)
48 | self.metadata = MetadataApi(self.api_key, self.api_client)
49 | self.rejects = RejectsApi(self.api_key, self.api_client)
50 | self.senders = SendersApi(self.api_key, self.api_client)
51 | self.subaccounts = SubaccountsApi(self.api_key, self.api_client)
52 | self.tags = TagsApi(self.api_key, self.api_client)
53 | self.templates = TemplatesApi(self.api_key, self.api_client)
54 | self.urls = UrlsApi(self.api_key, self.api_client)
55 | self.users = UsersApi(self.api_key, self.api_client)
56 | self.webhooks = WebhooksApi(self.api_key, self.api_client)
57 | self.whitelists = WhitelistsApi(self.api_key, self.api_client)
58 |
59 |
60 | def set_api_key(self, api_key = ''):
61 | self.api_key = api_key
62 | self.allowlists = AllowlistsApi(self.api_key, self.api_client)
63 | self.exports = ExportsApi(self.api_key, self.api_client)
64 | self.inbound = InboundApi(self.api_key, self.api_client)
65 | self.ips = IpsApi(self.api_key, self.api_client)
66 | self.messages = MessagesApi(self.api_key, self.api_client)
67 | self.metadata = MetadataApi(self.api_key, self.api_client)
68 | self.rejects = RejectsApi(self.api_key, self.api_client)
69 | self.senders = SendersApi(self.api_key, self.api_client)
70 | self.subaccounts = SubaccountsApi(self.api_key, self.api_client)
71 | self.tags = TagsApi(self.api_key, self.api_client)
72 | self.templates = TemplatesApi(self.api_key, self.api_client)
73 | self.urls = UrlsApi(self.api_key, self.api_client)
74 | self.users = UsersApi(self.api_key, self.api_client)
75 | self.webhooks = WebhooksApi(self.api_key, self.api_client)
76 | self.whitelists = WhitelistsApi(self.api_key, self.api_client)
77 |
78 |
79 | def set_default_output_format(self, output_format):
80 | self.api_client.set_default_output_format(output_format)
81 |
82 | def set_timeout(self, timeout):
83 | self.api_client.set_timeout(timeout)
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | # flake8: noqa
4 |
5 | # import apis into api package
6 | from mailchimp_transactional.api.allowlists_api import AllowlistsApi
7 | from mailchimp_transactional.api.exports_api import ExportsApi
8 | from mailchimp_transactional.api.inbound_api import InboundApi
9 | from mailchimp_transactional.api.ips_api import IpsApi
10 | from mailchimp_transactional.api.messages_api import MessagesApi
11 | from mailchimp_transactional.api.metadata_api import MetadataApi
12 | from mailchimp_transactional.api.rejects_api import RejectsApi
13 | from mailchimp_transactional.api.senders_api import SendersApi
14 | from mailchimp_transactional.api.subaccounts_api import SubaccountsApi
15 | from mailchimp_transactional.api.tags_api import TagsApi
16 | from mailchimp_transactional.api.templates_api import TemplatesApi
17 | from mailchimp_transactional.api.urls_api import UrlsApi
18 | from mailchimp_transactional.api.users_api import UsersApi
19 | from mailchimp_transactional.api.webhooks_api import WebhooksApi
20 | from mailchimp_transactional.api.whitelists_api import WhitelistsApi
21 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/allowlists_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class AllowlistsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add email to allowlist # noqa: E501
39 |
40 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add email to allowlist # noqa: E501
47 |
48 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/allowlists/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse200') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Remove email from allowlist # noqa: E501
77 |
78 | Removes an email address from the allowlist. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Remove email from allowlist # noqa: E501
85 |
86 | Removes an email address from the allowlist. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/allowlists/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse2002') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List allowlisted emails # noqa: E501
115 |
116 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List allowlisted emails # noqa: E501
123 |
124 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/allowlists/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse2001]') # noqa: E501
150 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/exports_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class ExportsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def activity(self, body = {}, **kwargs): # noqa: E501
38 | """Export activity history # noqa: E501
39 |
40 | Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data. # noqa: E501
41 | """
42 | (data) = self.activity_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def activity_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Export activity history # noqa: E501
47 |
48 | Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method activity" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/exports/activity', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse2007') # noqa: E501
74 |
75 | def allowlist(self, body = {}, **kwargs): # noqa: E501
76 | """Export Allowlist # noqa: E501
77 |
78 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
79 | """
80 | (data) = self.allowlist_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def allowlist_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Export Allowlist # noqa: E501
85 |
86 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method allowlist" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/exports/allowlist', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse2006') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """View export info # noqa: E501
115 |
116 | Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """View export info # noqa: E501
123 |
124 | Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/exports/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse2003') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List exports # noqa: E501
153 |
154 | Returns a list of your exports. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List exports # noqa: E501
161 |
162 | Returns a list of your exports. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/exports/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse2004]') # noqa: E501
188 |
189 | def rejects(self, body = {}, **kwargs): # noqa: E501
190 | """Export denylist # noqa: E501
191 |
192 | Begins an export of your rejection denylist. The denylist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at. # noqa: E501
193 | """
194 | (data) = self.rejects_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def rejects_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Export denylist # noqa: E501
199 |
200 | Begins an export of your rejection denylist. The denylist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method rejects" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/exports/rejects', 'POST',
224 | body=body_params,
225 | response_type='InlineResponse2005') # noqa: E501
226 |
227 | def whitelist(self, body = {}, **kwargs): # noqa: E501
228 | """Export Allowlist # noqa: E501
229 |
230 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
231 | """
232 | (data) = self.whitelist_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def whitelist_with_http_info(self, body, **kwargs): # noqa: E501
236 | """Export Allowlist # noqa: E501
237 |
238 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method whitelist" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/exports/whitelist', 'POST',
262 | body=body_params,
263 | response_type='InlineResponse2006') # noqa: E501
264 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/metadata_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class MetadataApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add metadata field # noqa: E501
39 |
40 | Add a new custom metadata field to be indexed for the account. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add metadata field # noqa: E501
47 |
48 | Add a new custom metadata field to be indexed for the account. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/metadata/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20037') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete metadata field # noqa: E501
77 |
78 | Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete metadata field # noqa: E501
85 |
86 | Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/metadata/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20039') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List metadata fields # noqa: E501
115 |
116 | Get the list of custom metadata fields indexed for the account. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List metadata fields # noqa: E501
123 |
124 | Get the list of custom metadata fields indexed for the account. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/metadata/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20036]') # noqa: E501
150 |
151 | def update(self, body = {}, **kwargs): # noqa: E501
152 | """Update metadata field # noqa: E501
153 |
154 | Update an existing custom metadata field. # noqa: E501
155 | """
156 | (data) = self.update_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def update_with_http_info(self, body, **kwargs): # noqa: E501
160 | """Update metadata field # noqa: E501
161 |
162 | Update an existing custom metadata field. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method update" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/metadata/update', 'POST',
186 | body=body_params,
187 | response_type='InlineResponse20038') # noqa: E501
188 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/rejects_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class RejectsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add email to denylist # noqa: E501
39 |
40 | Adds an email to your email rejection denylist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your denylist. Attempting to denylist an address that has been added to the allowlist will have no effect. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add email to denylist # noqa: E501
47 |
48 | Adds an email to your email rejection denylist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your denylist. Attempting to denylist an address that has been added to the allowlist will have no effect. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/rejects/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20040') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete email from denylist # noqa: E501
77 |
78 | Deletes an email rejection. There is no limit to how many rejections you can remove from your denylist, but keep in mind that each deletion has an affect on your reputation. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete email from denylist # noqa: E501
85 |
86 | Deletes an email rejection. There is no limit to how many rejections you can remove from your denylist, but keep in mind that each deletion has an affect on your reputation. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/rejects/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20042') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List denylisted emails # noqa: E501
115 |
116 | Retrieves your email rejection denylist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List denylisted emails # noqa: E501
123 |
124 | Retrieves your email rejection denylist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/rejects/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20041]') # noqa: E501
150 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/senders_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class SendersApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add_domain(self, body = {}, **kwargs): # noqa: E501
38 | """Add sender domain # noqa: E501
39 |
40 | Adds a sender domain to your account. Sender domains are added automatically as you send, but you can use this call to add them ahead of time. # noqa: E501
41 | """
42 | (data) = self.add_domain_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_domain_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add sender domain # noqa: E501
47 |
48 | Adds a sender domain to your account. Sender domains are added automatically as you send, but you can use this call to add them ahead of time. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add_domain" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/senders/add-domain', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20045') # noqa: E501
74 |
75 | def check_domain(self, body = {}, **kwargs): # noqa: E501
76 | """Check domain settings # noqa: E501
77 |
78 | Checks the SPF and DKIM settings for a domain, as well the domain verification. If you haven't already added this domain to your account, it will be added automatically. # noqa: E501
79 | """
80 | (data) = self.check_domain_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def check_domain_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Check domain settings # noqa: E501
85 |
86 | Checks the SPF and DKIM settings for a domain, as well the domain verification. If you haven't already added this domain to your account, it will be added automatically. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method check_domain" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/senders/check-domain', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20046') # noqa: E501
112 |
113 | def domains(self, body = {}, **kwargs): # noqa: E501
114 | """List sender domains # noqa: E501
115 |
116 | Returns the sender domains that have been added to this account. # noqa: E501
117 | """
118 | (data) = self.domains_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def domains_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List sender domains # noqa: E501
123 |
124 | Returns the sender domains that have been added to this account. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method domains" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/senders/domains', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20044]') # noqa: E501
150 |
151 | def info(self, body = {}, **kwargs): # noqa: E501
152 | """Get sender info # noqa: E501
153 |
154 | Return more detailed information about a single sender, including aggregates of recent stats. # noqa: E501
155 | """
156 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def info_with_http_info(self, body, **kwargs): # noqa: E501
160 | """Get sender info # noqa: E501
161 |
162 | Return more detailed information about a single sender, including aggregates of recent stats. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method info" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/senders/info', 'POST',
186 | body=body_params,
187 | response_type='InlineResponse20048') # noqa: E501
188 |
189 | def list(self, body = {}, **kwargs): # noqa: E501
190 | """List account senders # noqa: E501
191 |
192 | Return the senders that have tried to use this account. # noqa: E501
193 | """
194 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def list_with_http_info(self, body, **kwargs): # noqa: E501
198 | """List account senders # noqa: E501
199 |
200 | Return the senders that have tried to use this account. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method list" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/senders/list', 'POST',
224 | body=body_params,
225 | response_type='list[InlineResponse20043]') # noqa: E501
226 |
227 | def time_series(self, body = {}, **kwargs): # noqa: E501
228 | """View sender history # noqa: E501
229 |
230 | Return the recent history (hourly stats for the last 30 days) for a sender. # noqa: E501
231 | """
232 | (data) = self.time_series_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def time_series_with_http_info(self, body, **kwargs): # noqa: E501
236 | """View sender history # noqa: E501
237 |
238 | Return the recent history (hourly stats for the last 30 days) for a sender. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method time_series" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/senders/time-series', 'POST',
262 | body=body_params,
263 | response_type='list[InlineResponse20049]') # noqa: E501
264 |
265 | def verify_domain(self, body = {}, **kwargs): # noqa: E501
266 | """Verify domain # noqa: E501
267 |
268 | Sends a verification email in order to verify ownership of a domain. Domain verification is a required step to confirm ownership of a domain. Once a domain has been verified in a Transactional API account, other accounts may not have their messages signed by that domain unless they also verify the domain. This prevents other Transactional API accounts from sending mail signed by your domain. # noqa: E501
269 | """
270 | (data) = self.verify_domain_with_http_info(body, **kwargs) # noqa: E501
271 | return data
272 |
273 | def verify_domain_with_http_info(self, body, **kwargs): # noqa: E501
274 | """Verify domain # noqa: E501
275 |
276 | Sends a verification email in order to verify ownership of a domain. Domain verification is a required step to confirm ownership of a domain. Once a domain has been verified in a Transactional API account, other accounts may not have their messages signed by that domain unless they also verify the domain. This prevents other Transactional API accounts from sending mail signed by your domain. # noqa: E501
277 | """
278 |
279 | all_params = ['body'] # noqa: E501
280 |
281 | params = locals()
282 | for key, val in six.iteritems(params['kwargs']):
283 | if key not in all_params:
284 | raise TypeError(
285 | "Got an unexpected keyword argument '%s'"
286 | " to method verify_domain" % key
287 | )
288 | params[key] = val
289 | del params['kwargs']
290 |
291 | # add api_key to body params
292 | params['body']['key'] = self.api_key
293 |
294 | body_params = None
295 | if 'body' in params:
296 | body_params = params['body']
297 |
298 | return self.api_client.call_api(
299 | '/senders/verify-domain', 'POST',
300 | body=body_params,
301 | response_type='InlineResponse20047') # noqa: E501
302 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/subaccounts_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class SubaccountsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add subaccount # noqa: E501
39 |
40 | Add a new subaccount. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add subaccount # noqa: E501
47 |
48 | Add a new subaccount. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/subaccounts/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20051') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete subaccount # noqa: E501
77 |
78 | Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete subaccount # noqa: E501
85 |
86 | Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/subaccounts/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20054') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """Get subaccount info # noqa: E501
115 |
116 | Given the ID of an existing subaccount, return the data about it. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Get subaccount info # noqa: E501
123 |
124 | Given the ID of an existing subaccount, return the data about it. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/subaccounts/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20052') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List subaccounts # noqa: E501
153 |
154 | Get the list of subaccounts defined for the account, optionally filtered by a prefix. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List subaccounts # noqa: E501
161 |
162 | Get the list of subaccounts defined for the account, optionally filtered by a prefix. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/subaccounts/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20050]') # noqa: E501
188 |
189 | def pause(self, body = {}, **kwargs): # noqa: E501
190 | """Pause subaccount # noqa: E501
191 |
192 | Pause a subaccount's sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed. # noqa: E501
193 | """
194 | (data) = self.pause_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def pause_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Pause subaccount # noqa: E501
199 |
200 | Pause a subaccount's sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method pause" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/subaccounts/pause', 'POST',
224 | body=body_params,
225 | response_type='InlineResponse20055') # noqa: E501
226 |
227 | def resume(self, body = {}, **kwargs): # noqa: E501
228 | """Resume subaccount # noqa: E501
229 |
230 | Resume a paused subaccount's sending. # noqa: E501
231 | """
232 | (data) = self.resume_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def resume_with_http_info(self, body, **kwargs): # noqa: E501
236 | """Resume subaccount # noqa: E501
237 |
238 | Resume a paused subaccount's sending. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method resume" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/subaccounts/resume', 'POST',
262 | body=body_params,
263 | response_type='InlineResponse20056') # noqa: E501
264 |
265 | def update(self, body = {}, **kwargs): # noqa: E501
266 | """Update subaccount # noqa: E501
267 |
268 | Update an existing subaccount. # noqa: E501
269 | """
270 | (data) = self.update_with_http_info(body, **kwargs) # noqa: E501
271 | return data
272 |
273 | def update_with_http_info(self, body, **kwargs): # noqa: E501
274 | """Update subaccount # noqa: E501
275 |
276 | Update an existing subaccount. # noqa: E501
277 | """
278 |
279 | all_params = ['body'] # noqa: E501
280 |
281 | params = locals()
282 | for key, val in six.iteritems(params['kwargs']):
283 | if key not in all_params:
284 | raise TypeError(
285 | "Got an unexpected keyword argument '%s'"
286 | " to method update" % key
287 | )
288 | params[key] = val
289 | del params['kwargs']
290 |
291 | # add api_key to body params
292 | params['body']['key'] = self.api_key
293 |
294 | body_params = None
295 | if 'body' in params:
296 | body_params = params['body']
297 |
298 | return self.api_client.call_api(
299 | '/subaccounts/update', 'POST',
300 | body=body_params,
301 | response_type='InlineResponse20053') # noqa: E501
302 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/tags_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class TagsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def all_time_series(self, body = {}, **kwargs): # noqa: E501
38 | """View all tags history # noqa: E501
39 |
40 | Return the recent history (hourly stats for the last 30 days) for all tags. # noqa: E501
41 | """
42 | (data) = self.all_time_series_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def all_time_series_with_http_info(self, body, **kwargs): # noqa: E501
46 | """View all tags history # noqa: E501
47 |
48 | Return the recent history (hourly stats for the last 30 days) for all tags. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method all_time_series" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/tags/all-time-series', 'POST',
72 | body=body_params,
73 | response_type='list[InlineResponse20031]') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete tag # noqa: E501
77 |
78 | Deletes a tag permanently. Deleting a tag removes the tag from any messages that have been sent, and also deletes the tag's stats. There is no way to undo this operation, so use it carefully. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete tag # noqa: E501
85 |
86 | Deletes a tag permanently. Deleting a tag removes the tag from any messages that have been sent, and also deletes the tag's stats. There is no way to undo this operation, so use it carefully. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/tags/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20058') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """Get tag info # noqa: E501
115 |
116 | Return more detailed information about a single tag, including aggregates of recent stats. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Get tag info # noqa: E501
123 |
124 | Return more detailed information about a single tag, including aggregates of recent stats. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/tags/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20059') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List tags # noqa: E501
153 |
154 | Return all of the user-defined tag information. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List tags # noqa: E501
161 |
162 | Return all of the user-defined tag information. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/tags/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20057]') # noqa: E501
188 |
189 | def time_series(self, body = {}, **kwargs): # noqa: E501
190 | """View tag history # noqa: E501
191 |
192 | Return the recent history (hourly stats for the last 30 days) for a tag. # noqa: E501
193 | """
194 | (data) = self.time_series_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def time_series_with_http_info(self, body, **kwargs): # noqa: E501
198 | """View tag history # noqa: E501
199 |
200 | Return the recent history (hourly stats for the last 30 days) for a tag. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method time_series" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/tags/time-series', 'POST',
224 | body=body_params,
225 | response_type='list[InlineResponse20031]') # noqa: E501
226 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/urls_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class UrlsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add_tracking_domain(self, body = {}, **kwargs): # noqa: E501
38 | """Add tracking domains # noqa: E501
39 |
40 | Add a tracking domain to your account. # noqa: E501
41 | """
42 | (data) = self.add_tracking_domain_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_tracking_domain_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add tracking domains # noqa: E501
47 |
48 | Add a tracking domain to your account. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add_tracking_domain" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/urls/add-tracking-domain', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20071') # noqa: E501
74 |
75 | def check_tracking_domain(self, body = {}, **kwargs): # noqa: E501
76 | """Check cname settings # noqa: E501
77 |
78 | Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call. # noqa: E501
79 | """
80 | (data) = self.check_tracking_domain_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def check_tracking_domain_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Check cname settings # noqa: E501
85 |
86 | Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method check_tracking_domain" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/urls/check-tracking-domain', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20071') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List most clicked urls # noqa: E501
115 |
116 | Get the 100 most clicked URLs. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List most clicked urls # noqa: E501
123 |
124 | Get the 100 most clicked URLs. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/urls/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20067]') # noqa: E501
150 |
151 | def search(self, body = {}, **kwargs): # noqa: E501
152 | """Search most clicked urls # noqa: E501
153 |
154 | Return the 100 most clicked URLs that match the search query given. # noqa: E501
155 | """
156 | (data) = self.search_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def search_with_http_info(self, body, **kwargs): # noqa: E501
160 | """Search most clicked urls # noqa: E501
161 |
162 | Return the 100 most clicked URLs that match the search query given. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method search" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/urls/search', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20068]') # noqa: E501
188 |
189 | def time_series(self, body = {}, **kwargs): # noqa: E501
190 | """Get url history # noqa: E501
191 |
192 | Return the recent history (hourly stats for the last 30 days) for a URL # noqa: E501
193 | """
194 | (data) = self.time_series_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def time_series_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Get url history # noqa: E501
199 |
200 | Return the recent history (hourly stats for the last 30 days) for a URL # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method time_series" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/urls/time-series', 'POST',
224 | body=body_params,
225 | response_type='list[InlineResponse20069]') # noqa: E501
226 |
227 | def tracking_domains(self, body = {}, **kwargs): # noqa: E501
228 | """List tracking domains # noqa: E501
229 |
230 | Get the list of tracking domains set up for this account. # noqa: E501
231 | """
232 | (data) = self.tracking_domains_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def tracking_domains_with_http_info(self, body, **kwargs): # noqa: E501
236 | """List tracking domains # noqa: E501
237 |
238 | Get the list of tracking domains set up for this account. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method tracking_domains" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/urls/tracking-domains', 'POST',
262 | body=body_params,
263 | response_type='list[InlineResponse20070]') # noqa: E501
264 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/users_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class UsersApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def info(self, body = {}, **kwargs): # noqa: E501
38 | """Get user info # noqa: E501
39 |
40 | Return the information about the API-connected user. # noqa: E501
41 | """
42 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def info_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Get user info # noqa: E501
47 |
48 | Return the information about the API-connected user. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method info" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/users/info', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20072') # noqa: E501
74 |
75 | def ping(self, body = {}, **kwargs): # noqa: E501
76 | """Ping # noqa: E501
77 |
78 | Validate an API key and respond to a ping. # noqa: E501
79 | """
80 | (data) = self.ping_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def ping_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Ping # noqa: E501
85 |
86 | Validate an API key and respond to a ping. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method ping" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/users/ping', 'POST',
110 | body=body_params,
111 | response_type='str') # noqa: E501
112 |
113 | def ping2(self, body = {}, **kwargs): # noqa: E501
114 | """Ping 2 # noqa: E501
115 |
116 | Validate an API key and respond to a ping (JSON parser version). # noqa: E501
117 | """
118 | (data) = self.ping2_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def ping2_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Ping 2 # noqa: E501
123 |
124 | Validate an API key and respond to a ping (JSON parser version). # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method ping2" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/users/ping2', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20073') # noqa: E501
150 |
151 | def senders(self, body = {}, **kwargs): # noqa: E501
152 | """List account senders # noqa: E501
153 |
154 | Return the senders that have tried to use this account, both verified and unverified. # noqa: E501
155 | """
156 | (data) = self.senders_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def senders_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List account senders # noqa: E501
161 |
162 | Return the senders that have tried to use this account, both verified and unverified. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method senders" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/users/senders', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20043]') # noqa: E501
188 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/webhooks_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class WebhooksApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add webhook # noqa: E501
39 |
40 | Add a new webhook. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add webhook # noqa: E501
47 |
48 | Add a new webhook. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/webhooks/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20075') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete webhook # noqa: E501
77 |
78 | Delete an existing webhook. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete webhook # noqa: E501
85 |
86 | Delete an existing webhook. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/webhooks/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20078') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """Get webhook info # noqa: E501
115 |
116 | Given the ID of an existing webhook, return the data about it. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Get webhook info # noqa: E501
123 |
124 | Given the ID of an existing webhook, return the data about it. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/webhooks/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20076') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List webhooks # noqa: E501
153 |
154 | Get the list of all webhooks defined on the account. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List webhooks # noqa: E501
161 |
162 | Get the list of all webhooks defined on the account. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/webhooks/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20074]') # noqa: E501
188 |
189 | def update(self, body = {}, **kwargs): # noqa: E501
190 | """Update webhook # noqa: E501
191 |
192 | Update an existing webhook. # noqa: E501
193 | """
194 | (data) = self.update_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def update_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Update webhook # noqa: E501
199 |
200 | Update an existing webhook. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method update" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/webhooks/update', 'POST',
224 | body=body_params,
225 | response_type='InlineResponse20077') # noqa: E501
226 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api/whitelists_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class WhitelistsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add email to allowlist # noqa: E501
39 |
40 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add email to allowlist # noqa: E501
47 |
48 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/whitelists/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse200') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Remove email from allowlist # noqa: E501
77 |
78 | Removes an email address from the allowlist. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Remove email from allowlist # noqa: E501
85 |
86 | Removes an email address from the allowlist. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/whitelists/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse2002') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List allowlisted emails # noqa: E501
115 |
116 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List allowlisted emails # noqa: E501
123 |
124 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/whitelists/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse2001]') # noqa: E501
150 |
--------------------------------------------------------------------------------
/build/lib/mailchimp_transactional/api_client.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | """
3 | Mailchimp Transactional API
4 |
5 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
6 |
7 | OpenAPI spec version: 1.0.59
8 | Contact: apihelp@mailchimp.com
9 | Generated by: https://github.com/swagger-api/swagger-codegen.git
10 | """
11 |
12 | from __future__ import absolute_import
13 |
14 | import datetime
15 | import requests
16 | import json
17 |
18 | class ApiClientError(Exception):
19 | def __init__(self, text, status_code):
20 | self.text = text
21 | self.status_code = status_code
22 |
23 | class ApiClient(object):
24 | def __init__(self):
25 | self.host = "https://mandrillapp.com/api/1.0"
26 | self.user_agent = 'Swagger-Codegen/1.0.59/python'
27 | self.format_list = ['json', 'xml', 'php', 'yaml']
28 | self.content_type = 'application/json'
29 | self.default_output_format = 'json'
30 | self.accepts = ['application/json', 'application/xml', 'application/x-php', 'application/x-yaml; charset=utf-8']
31 | self.timeout = 300
32 |
33 | def set_default_output_format(self, output_format):
34 | if output_format in self.format_list:
35 | self.default_output_format = output_format
36 |
37 | def set_timeout(self, timeout):
38 | self.timeout = timeout
39 |
40 | def call_api(self, resource_path, method, header_params=None, body=None, **kwargs):
41 | # header parameters
42 | headers = header_params or {}
43 | headers['User-Agent'] = self.user_agent
44 | headers['Content-Type'] = self.content_type
45 |
46 | # request url
47 | url = self.host + resource_path
48 |
49 | use_default_output_format = True
50 |
51 | if body and 'outputFormat' in body:
52 | format = body['outputFormat'].lower()
53 | if format in self.format_list:
54 | url += '.%s' % format
55 | del body['outputFormat']
56 | use_default_output_format = False
57 |
58 | if use_default_output_format and self.default_output_format in self.format_list:
59 | url += '.%s' % self.default_output_format
60 |
61 | # perform request and return response
62 | res = self.request(method, url, body, headers)
63 |
64 | try:
65 | if 'application/json' in res.headers.get('content-type'):
66 | data = res.json()
67 | else:
68 | data = res.text
69 | except Exception as err:
70 | data = None
71 |
72 | if data:
73 | if (res.ok):
74 | return data
75 | else:
76 | raise ApiClientError(text = data, status_code = res.status_code)
77 | else:
78 | return res
79 |
80 | def request(self, method, url, body=None, headers=None, timeout=None):
81 | if not timeout:
82 | timeout = self.timeout
83 |
84 | if method == 'POST':
85 | return requests.post(url, data=json.dumps(body), headers=headers, timeout=timeout)
86 | else:
87 | raise ValueError(
88 | "http method must be `POST`"
89 | )
--------------------------------------------------------------------------------
/dist/mailchimp_transactional-1.0.59-py3-none-any.whl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mailchimp/mailchimp-transactional-python/56ab18a1f749345662bb559a05194e94a5b135b2/dist/mailchimp_transactional-1.0.59-py3-none-any.whl
--------------------------------------------------------------------------------
/mailchimp_transactional.egg-info/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.0
2 | Name: mailchimp-transactional
3 | Version: 1.0.59
4 | Summary: Mailchimp Transactional API
5 | Home-page: UNKNOWN
6 | Author: UNKNOWN
7 | Author-email: apihelp@mailchimp.com
8 | License: UNKNOWN
9 | Description: No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
10 |
11 | Keywords: Swagger,Mailchimp Transactional API
12 | Platform: UNKNOWN
13 |
--------------------------------------------------------------------------------
/mailchimp_transactional.egg-info/SOURCES.txt:
--------------------------------------------------------------------------------
1 | README.md
2 | setup.py
3 | mailchimp_transactional/__init__.py
4 | mailchimp_transactional/api_client.py
5 | mailchimp_transactional.egg-info/PKG-INFO
6 | mailchimp_transactional.egg-info/SOURCES.txt
7 | mailchimp_transactional.egg-info/dependency_links.txt
8 | mailchimp_transactional.egg-info/requires.txt
9 | mailchimp_transactional.egg-info/top_level.txt
10 | mailchimp_transactional/api/__init__.py
11 | mailchimp_transactional/api/allowlists_api.py
12 | mailchimp_transactional/api/exports_api.py
13 | mailchimp_transactional/api/inbound_api.py
14 | mailchimp_transactional/api/ips_api.py
15 | mailchimp_transactional/api/messages_api.py
16 | mailchimp_transactional/api/metadata_api.py
17 | mailchimp_transactional/api/rejects_api.py
18 | mailchimp_transactional/api/senders_api.py
19 | mailchimp_transactional/api/subaccounts_api.py
20 | mailchimp_transactional/api/tags_api.py
21 | mailchimp_transactional/api/templates_api.py
22 | mailchimp_transactional/api/urls_api.py
23 | mailchimp_transactional/api/users_api.py
24 | mailchimp_transactional/api/webhooks_api.py
25 | mailchimp_transactional/api/whitelists_api.py
--------------------------------------------------------------------------------
/mailchimp_transactional.egg-info/dependency_links.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/mailchimp_transactional.egg-info/requires.txt:
--------------------------------------------------------------------------------
1 | certifi>=2017.4.17
2 | python-dateutil>=2.1
3 | requests>=2.23
4 | six>=1.10
5 | urllib3>=1.23
6 |
--------------------------------------------------------------------------------
/mailchimp_transactional.egg-info/top_level.txt:
--------------------------------------------------------------------------------
1 | mailchimp_transactional
2 |
--------------------------------------------------------------------------------
/mailchimp_transactional/__init__.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | # flake8: noqa
4 |
5 | """
6 | Mailchimp Transactional API
7 |
8 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
9 |
10 | OpenAPI spec version: 1.0.59
11 | Contact: apihelp@mailchimp.com
12 | Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | """
14 |
15 |
16 | from __future__ import absolute_import
17 |
18 | # import apis into sdk package
19 | from mailchimp_transactional.api.allowlists_api import AllowlistsApi
20 | from mailchimp_transactional.api.exports_api import ExportsApi
21 | from mailchimp_transactional.api.inbound_api import InboundApi
22 | from mailchimp_transactional.api.ips_api import IpsApi
23 | from mailchimp_transactional.api.messages_api import MessagesApi
24 | from mailchimp_transactional.api.metadata_api import MetadataApi
25 | from mailchimp_transactional.api.rejects_api import RejectsApi
26 | from mailchimp_transactional.api.senders_api import SendersApi
27 | from mailchimp_transactional.api.subaccounts_api import SubaccountsApi
28 | from mailchimp_transactional.api.tags_api import TagsApi
29 | from mailchimp_transactional.api.templates_api import TemplatesApi
30 | from mailchimp_transactional.api.urls_api import UrlsApi
31 | from mailchimp_transactional.api.users_api import UsersApi
32 | from mailchimp_transactional.api.webhooks_api import WebhooksApi
33 | from mailchimp_transactional.api.whitelists_api import WhitelistsApi
34 |
35 |
36 | from mailchimp_transactional.api_client import ApiClient
37 |
38 | class Client(object):
39 | def __init__(self, api_key = ''):
40 | self.api_key = api_key
41 | self.api_client = ApiClient()
42 |
43 | self.allowlists = AllowlistsApi(self.api_key, self.api_client)
44 | self.exports = ExportsApi(self.api_key, self.api_client)
45 | self.inbound = InboundApi(self.api_key, self.api_client)
46 | self.ips = IpsApi(self.api_key, self.api_client)
47 | self.messages = MessagesApi(self.api_key, self.api_client)
48 | self.metadata = MetadataApi(self.api_key, self.api_client)
49 | self.rejects = RejectsApi(self.api_key, self.api_client)
50 | self.senders = SendersApi(self.api_key, self.api_client)
51 | self.subaccounts = SubaccountsApi(self.api_key, self.api_client)
52 | self.tags = TagsApi(self.api_key, self.api_client)
53 | self.templates = TemplatesApi(self.api_key, self.api_client)
54 | self.urls = UrlsApi(self.api_key, self.api_client)
55 | self.users = UsersApi(self.api_key, self.api_client)
56 | self.webhooks = WebhooksApi(self.api_key, self.api_client)
57 | self.whitelists = WhitelistsApi(self.api_key, self.api_client)
58 |
59 |
60 | def set_api_key(self, api_key = ''):
61 | self.api_key = api_key
62 | self.allowlists = AllowlistsApi(self.api_key, self.api_client)
63 | self.exports = ExportsApi(self.api_key, self.api_client)
64 | self.inbound = InboundApi(self.api_key, self.api_client)
65 | self.ips = IpsApi(self.api_key, self.api_client)
66 | self.messages = MessagesApi(self.api_key, self.api_client)
67 | self.metadata = MetadataApi(self.api_key, self.api_client)
68 | self.rejects = RejectsApi(self.api_key, self.api_client)
69 | self.senders = SendersApi(self.api_key, self.api_client)
70 | self.subaccounts = SubaccountsApi(self.api_key, self.api_client)
71 | self.tags = TagsApi(self.api_key, self.api_client)
72 | self.templates = TemplatesApi(self.api_key, self.api_client)
73 | self.urls = UrlsApi(self.api_key, self.api_client)
74 | self.users = UsersApi(self.api_key, self.api_client)
75 | self.webhooks = WebhooksApi(self.api_key, self.api_client)
76 | self.whitelists = WhitelistsApi(self.api_key, self.api_client)
77 |
78 |
79 | def set_default_output_format(self, output_format):
80 | self.api_client.set_default_output_format(output_format)
81 |
82 | def set_timeout(self, timeout):
83 | self.api_client.set_timeout(timeout)
--------------------------------------------------------------------------------
/mailchimp_transactional/api/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | # flake8: noqa
4 |
5 | # import apis into api package
6 | from mailchimp_transactional.api.allowlists_api import AllowlistsApi
7 | from mailchimp_transactional.api.exports_api import ExportsApi
8 | from mailchimp_transactional.api.inbound_api import InboundApi
9 | from mailchimp_transactional.api.ips_api import IpsApi
10 | from mailchimp_transactional.api.messages_api import MessagesApi
11 | from mailchimp_transactional.api.metadata_api import MetadataApi
12 | from mailchimp_transactional.api.rejects_api import RejectsApi
13 | from mailchimp_transactional.api.senders_api import SendersApi
14 | from mailchimp_transactional.api.subaccounts_api import SubaccountsApi
15 | from mailchimp_transactional.api.tags_api import TagsApi
16 | from mailchimp_transactional.api.templates_api import TemplatesApi
17 | from mailchimp_transactional.api.urls_api import UrlsApi
18 | from mailchimp_transactional.api.users_api import UsersApi
19 | from mailchimp_transactional.api.webhooks_api import WebhooksApi
20 | from mailchimp_transactional.api.whitelists_api import WhitelistsApi
21 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/allowlists_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class AllowlistsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add email to allowlist # noqa: E501
39 |
40 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add email to allowlist # noqa: E501
47 |
48 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/allowlists/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse200') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Remove email from allowlist # noqa: E501
77 |
78 | Removes an email address from the allowlist. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Remove email from allowlist # noqa: E501
85 |
86 | Removes an email address from the allowlist. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/allowlists/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse2002') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List allowlisted emails # noqa: E501
115 |
116 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List allowlisted emails # noqa: E501
123 |
124 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/allowlists/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse2001]') # noqa: E501
150 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/exports_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class ExportsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def activity(self, body = {}, **kwargs): # noqa: E501
38 | """Export activity history # noqa: E501
39 |
40 | Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data. # noqa: E501
41 | """
42 | (data) = self.activity_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def activity_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Export activity history # noqa: E501
47 |
48 | Begins an export of your activity history. The activity will be exported to a zip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method activity" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/exports/activity', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse2007') # noqa: E501
74 |
75 | def allowlist(self, body = {}, **kwargs): # noqa: E501
76 | """Export Allowlist # noqa: E501
77 |
78 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
79 | """
80 | (data) = self.allowlist_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def allowlist_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Export Allowlist # noqa: E501
85 |
86 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method allowlist" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/exports/allowlist', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse2006') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """View export info # noqa: E501
115 |
116 | Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """View export info # noqa: E501
123 |
124 | Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/exports/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse2003') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List exports # noqa: E501
153 |
154 | Returns a list of your exports. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List exports # noqa: E501
161 |
162 | Returns a list of your exports. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/exports/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse2004]') # noqa: E501
188 |
189 | def rejects(self, body = {}, **kwargs): # noqa: E501
190 | """Export denylist # noqa: E501
191 |
192 | Begins an export of your rejection denylist. The denylist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at. # noqa: E501
193 | """
194 | (data) = self.rejects_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def rejects_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Export denylist # noqa: E501
199 |
200 | Begins an export of your rejection denylist. The denylist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method rejects" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/exports/rejects', 'POST',
224 | body=body_params,
225 | response_type='InlineResponse2005') # noqa: E501
226 |
227 | def whitelist(self, body = {}, **kwargs): # noqa: E501
228 | """Export Allowlist # noqa: E501
229 |
230 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
231 | """
232 | (data) = self.whitelist_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def whitelist_with_http_info(self, body, **kwargs): # noqa: E501
236 | """Export Allowlist # noqa: E501
237 |
238 | Begins an export of your rejection allowlist. The allowlist will be exported to a zip archive containing a single file named allowlist.csv that includes the following fields: email, detail, created_at. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method whitelist" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/exports/whitelist', 'POST',
262 | body=body_params,
263 | response_type='InlineResponse2006') # noqa: E501
264 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/metadata_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class MetadataApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add metadata field # noqa: E501
39 |
40 | Add a new custom metadata field to be indexed for the account. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add metadata field # noqa: E501
47 |
48 | Add a new custom metadata field to be indexed for the account. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/metadata/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20037') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete metadata field # noqa: E501
77 |
78 | Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete metadata field # noqa: E501
85 |
86 | Delete an existing custom metadata field. Deletion isn't instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/metadata/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20039') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List metadata fields # noqa: E501
115 |
116 | Get the list of custom metadata fields indexed for the account. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List metadata fields # noqa: E501
123 |
124 | Get the list of custom metadata fields indexed for the account. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/metadata/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20036]') # noqa: E501
150 |
151 | def update(self, body = {}, **kwargs): # noqa: E501
152 | """Update metadata field # noqa: E501
153 |
154 | Update an existing custom metadata field. # noqa: E501
155 | """
156 | (data) = self.update_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def update_with_http_info(self, body, **kwargs): # noqa: E501
160 | """Update metadata field # noqa: E501
161 |
162 | Update an existing custom metadata field. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method update" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/metadata/update', 'POST',
186 | body=body_params,
187 | response_type='InlineResponse20038') # noqa: E501
188 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/rejects_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class RejectsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add email to denylist # noqa: E501
39 |
40 | Adds an email to your email rejection denylist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your denylist. Attempting to denylist an address that has been added to the allowlist will have no effect. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add email to denylist # noqa: E501
47 |
48 | Adds an email to your email rejection denylist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your denylist. Attempting to denylist an address that has been added to the allowlist will have no effect. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/rejects/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20040') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete email from denylist # noqa: E501
77 |
78 | Deletes an email rejection. There is no limit to how many rejections you can remove from your denylist, but keep in mind that each deletion has an affect on your reputation. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete email from denylist # noqa: E501
85 |
86 | Deletes an email rejection. There is no limit to how many rejections you can remove from your denylist, but keep in mind that each deletion has an affect on your reputation. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/rejects/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20042') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List denylisted emails # noqa: E501
115 |
116 | Retrieves your email rejection denylist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List denylisted emails # noqa: E501
123 |
124 | Retrieves your email rejection denylist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/rejects/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20041]') # noqa: E501
150 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/senders_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class SendersApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add_domain(self, body = {}, **kwargs): # noqa: E501
38 | """Add sender domain # noqa: E501
39 |
40 | Adds a sender domain to your account. Sender domains are added automatically as you send, but you can use this call to add them ahead of time. # noqa: E501
41 | """
42 | (data) = self.add_domain_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_domain_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add sender domain # noqa: E501
47 |
48 | Adds a sender domain to your account. Sender domains are added automatically as you send, but you can use this call to add them ahead of time. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add_domain" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/senders/add-domain', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20045') # noqa: E501
74 |
75 | def check_domain(self, body = {}, **kwargs): # noqa: E501
76 | """Check domain settings # noqa: E501
77 |
78 | Checks the SPF and DKIM settings for a domain, as well the domain verification. If you haven't already added this domain to your account, it will be added automatically. # noqa: E501
79 | """
80 | (data) = self.check_domain_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def check_domain_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Check domain settings # noqa: E501
85 |
86 | Checks the SPF and DKIM settings for a domain, as well the domain verification. If you haven't already added this domain to your account, it will be added automatically. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method check_domain" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/senders/check-domain', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20046') # noqa: E501
112 |
113 | def domains(self, body = {}, **kwargs): # noqa: E501
114 | """List sender domains # noqa: E501
115 |
116 | Returns the sender domains that have been added to this account. # noqa: E501
117 | """
118 | (data) = self.domains_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def domains_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List sender domains # noqa: E501
123 |
124 | Returns the sender domains that have been added to this account. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method domains" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/senders/domains', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20044]') # noqa: E501
150 |
151 | def info(self, body = {}, **kwargs): # noqa: E501
152 | """Get sender info # noqa: E501
153 |
154 | Return more detailed information about a single sender, including aggregates of recent stats. # noqa: E501
155 | """
156 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def info_with_http_info(self, body, **kwargs): # noqa: E501
160 | """Get sender info # noqa: E501
161 |
162 | Return more detailed information about a single sender, including aggregates of recent stats. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method info" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/senders/info', 'POST',
186 | body=body_params,
187 | response_type='InlineResponse20048') # noqa: E501
188 |
189 | def list(self, body = {}, **kwargs): # noqa: E501
190 | """List account senders # noqa: E501
191 |
192 | Return the senders that have tried to use this account. # noqa: E501
193 | """
194 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def list_with_http_info(self, body, **kwargs): # noqa: E501
198 | """List account senders # noqa: E501
199 |
200 | Return the senders that have tried to use this account. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method list" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/senders/list', 'POST',
224 | body=body_params,
225 | response_type='list[InlineResponse20043]') # noqa: E501
226 |
227 | def time_series(self, body = {}, **kwargs): # noqa: E501
228 | """View sender history # noqa: E501
229 |
230 | Return the recent history (hourly stats for the last 30 days) for a sender. # noqa: E501
231 | """
232 | (data) = self.time_series_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def time_series_with_http_info(self, body, **kwargs): # noqa: E501
236 | """View sender history # noqa: E501
237 |
238 | Return the recent history (hourly stats for the last 30 days) for a sender. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method time_series" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/senders/time-series', 'POST',
262 | body=body_params,
263 | response_type='list[InlineResponse20049]') # noqa: E501
264 |
265 | def verify_domain(self, body = {}, **kwargs): # noqa: E501
266 | """Verify domain # noqa: E501
267 |
268 | Sends a verification email in order to verify ownership of a domain. Domain verification is a required step to confirm ownership of a domain. Once a domain has been verified in a Transactional API account, other accounts may not have their messages signed by that domain unless they also verify the domain. This prevents other Transactional API accounts from sending mail signed by your domain. # noqa: E501
269 | """
270 | (data) = self.verify_domain_with_http_info(body, **kwargs) # noqa: E501
271 | return data
272 |
273 | def verify_domain_with_http_info(self, body, **kwargs): # noqa: E501
274 | """Verify domain # noqa: E501
275 |
276 | Sends a verification email in order to verify ownership of a domain. Domain verification is a required step to confirm ownership of a domain. Once a domain has been verified in a Transactional API account, other accounts may not have their messages signed by that domain unless they also verify the domain. This prevents other Transactional API accounts from sending mail signed by your domain. # noqa: E501
277 | """
278 |
279 | all_params = ['body'] # noqa: E501
280 |
281 | params = locals()
282 | for key, val in six.iteritems(params['kwargs']):
283 | if key not in all_params:
284 | raise TypeError(
285 | "Got an unexpected keyword argument '%s'"
286 | " to method verify_domain" % key
287 | )
288 | params[key] = val
289 | del params['kwargs']
290 |
291 | # add api_key to body params
292 | params['body']['key'] = self.api_key
293 |
294 | body_params = None
295 | if 'body' in params:
296 | body_params = params['body']
297 |
298 | return self.api_client.call_api(
299 | '/senders/verify-domain', 'POST',
300 | body=body_params,
301 | response_type='InlineResponse20047') # noqa: E501
302 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/subaccounts_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class SubaccountsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add subaccount # noqa: E501
39 |
40 | Add a new subaccount. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add subaccount # noqa: E501
47 |
48 | Add a new subaccount. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/subaccounts/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20051') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete subaccount # noqa: E501
77 |
78 | Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete subaccount # noqa: E501
85 |
86 | Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/subaccounts/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20054') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """Get subaccount info # noqa: E501
115 |
116 | Given the ID of an existing subaccount, return the data about it. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Get subaccount info # noqa: E501
123 |
124 | Given the ID of an existing subaccount, return the data about it. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/subaccounts/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20052') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List subaccounts # noqa: E501
153 |
154 | Get the list of subaccounts defined for the account, optionally filtered by a prefix. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List subaccounts # noqa: E501
161 |
162 | Get the list of subaccounts defined for the account, optionally filtered by a prefix. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/subaccounts/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20050]') # noqa: E501
188 |
189 | def pause(self, body = {}, **kwargs): # noqa: E501
190 | """Pause subaccount # noqa: E501
191 |
192 | Pause a subaccount's sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed. # noqa: E501
193 | """
194 | (data) = self.pause_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def pause_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Pause subaccount # noqa: E501
199 |
200 | Pause a subaccount's sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method pause" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/subaccounts/pause', 'POST',
224 | body=body_params,
225 | response_type='InlineResponse20055') # noqa: E501
226 |
227 | def resume(self, body = {}, **kwargs): # noqa: E501
228 | """Resume subaccount # noqa: E501
229 |
230 | Resume a paused subaccount's sending. # noqa: E501
231 | """
232 | (data) = self.resume_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def resume_with_http_info(self, body, **kwargs): # noqa: E501
236 | """Resume subaccount # noqa: E501
237 |
238 | Resume a paused subaccount's sending. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method resume" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/subaccounts/resume', 'POST',
262 | body=body_params,
263 | response_type='InlineResponse20056') # noqa: E501
264 |
265 | def update(self, body = {}, **kwargs): # noqa: E501
266 | """Update subaccount # noqa: E501
267 |
268 | Update an existing subaccount. # noqa: E501
269 | """
270 | (data) = self.update_with_http_info(body, **kwargs) # noqa: E501
271 | return data
272 |
273 | def update_with_http_info(self, body, **kwargs): # noqa: E501
274 | """Update subaccount # noqa: E501
275 |
276 | Update an existing subaccount. # noqa: E501
277 | """
278 |
279 | all_params = ['body'] # noqa: E501
280 |
281 | params = locals()
282 | for key, val in six.iteritems(params['kwargs']):
283 | if key not in all_params:
284 | raise TypeError(
285 | "Got an unexpected keyword argument '%s'"
286 | " to method update" % key
287 | )
288 | params[key] = val
289 | del params['kwargs']
290 |
291 | # add api_key to body params
292 | params['body']['key'] = self.api_key
293 |
294 | body_params = None
295 | if 'body' in params:
296 | body_params = params['body']
297 |
298 | return self.api_client.call_api(
299 | '/subaccounts/update', 'POST',
300 | body=body_params,
301 | response_type='InlineResponse20053') # noqa: E501
302 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/tags_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class TagsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def all_time_series(self, body = {}, **kwargs): # noqa: E501
38 | """View all tags history # noqa: E501
39 |
40 | Return the recent history (hourly stats for the last 30 days) for all tags. # noqa: E501
41 | """
42 | (data) = self.all_time_series_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def all_time_series_with_http_info(self, body, **kwargs): # noqa: E501
46 | """View all tags history # noqa: E501
47 |
48 | Return the recent history (hourly stats for the last 30 days) for all tags. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method all_time_series" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/tags/all-time-series', 'POST',
72 | body=body_params,
73 | response_type='list[InlineResponse20031]') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete tag # noqa: E501
77 |
78 | Deletes a tag permanently. Deleting a tag removes the tag from any messages that have been sent, and also deletes the tag's stats. There is no way to undo this operation, so use it carefully. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete tag # noqa: E501
85 |
86 | Deletes a tag permanently. Deleting a tag removes the tag from any messages that have been sent, and also deletes the tag's stats. There is no way to undo this operation, so use it carefully. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/tags/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20058') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """Get tag info # noqa: E501
115 |
116 | Return more detailed information about a single tag, including aggregates of recent stats. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Get tag info # noqa: E501
123 |
124 | Return more detailed information about a single tag, including aggregates of recent stats. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/tags/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20059') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List tags # noqa: E501
153 |
154 | Return all of the user-defined tag information. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List tags # noqa: E501
161 |
162 | Return all of the user-defined tag information. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/tags/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20057]') # noqa: E501
188 |
189 | def time_series(self, body = {}, **kwargs): # noqa: E501
190 | """View tag history # noqa: E501
191 |
192 | Return the recent history (hourly stats for the last 30 days) for a tag. # noqa: E501
193 | """
194 | (data) = self.time_series_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def time_series_with_http_info(self, body, **kwargs): # noqa: E501
198 | """View tag history # noqa: E501
199 |
200 | Return the recent history (hourly stats for the last 30 days) for a tag. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method time_series" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/tags/time-series', 'POST',
224 | body=body_params,
225 | response_type='list[InlineResponse20031]') # noqa: E501
226 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/urls_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class UrlsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add_tracking_domain(self, body = {}, **kwargs): # noqa: E501
38 | """Add tracking domains # noqa: E501
39 |
40 | Add a tracking domain to your account. # noqa: E501
41 | """
42 | (data) = self.add_tracking_domain_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_tracking_domain_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add tracking domains # noqa: E501
47 |
48 | Add a tracking domain to your account. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add_tracking_domain" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/urls/add-tracking-domain', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20071') # noqa: E501
74 |
75 | def check_tracking_domain(self, body = {}, **kwargs): # noqa: E501
76 | """Check cname settings # noqa: E501
77 |
78 | Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call. # noqa: E501
79 | """
80 | (data) = self.check_tracking_domain_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def check_tracking_domain_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Check cname settings # noqa: E501
85 |
86 | Checks the CNAME settings for a tracking domain. The domain must have been added already with the add-tracking-domain call. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method check_tracking_domain" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/urls/check-tracking-domain', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20071') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List most clicked urls # noqa: E501
115 |
116 | Get the 100 most clicked URLs. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List most clicked urls # noqa: E501
123 |
124 | Get the 100 most clicked URLs. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/urls/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse20067]') # noqa: E501
150 |
151 | def search(self, body = {}, **kwargs): # noqa: E501
152 | """Search most clicked urls # noqa: E501
153 |
154 | Return the 100 most clicked URLs that match the search query given. # noqa: E501
155 | """
156 | (data) = self.search_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def search_with_http_info(self, body, **kwargs): # noqa: E501
160 | """Search most clicked urls # noqa: E501
161 |
162 | Return the 100 most clicked URLs that match the search query given. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method search" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/urls/search', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20068]') # noqa: E501
188 |
189 | def time_series(self, body = {}, **kwargs): # noqa: E501
190 | """Get url history # noqa: E501
191 |
192 | Return the recent history (hourly stats for the last 30 days) for a URL # noqa: E501
193 | """
194 | (data) = self.time_series_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def time_series_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Get url history # noqa: E501
199 |
200 | Return the recent history (hourly stats for the last 30 days) for a URL # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method time_series" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/urls/time-series', 'POST',
224 | body=body_params,
225 | response_type='list[InlineResponse20069]') # noqa: E501
226 |
227 | def tracking_domains(self, body = {}, **kwargs): # noqa: E501
228 | """List tracking domains # noqa: E501
229 |
230 | Get the list of tracking domains set up for this account. # noqa: E501
231 | """
232 | (data) = self.tracking_domains_with_http_info(body, **kwargs) # noqa: E501
233 | return data
234 |
235 | def tracking_domains_with_http_info(self, body, **kwargs): # noqa: E501
236 | """List tracking domains # noqa: E501
237 |
238 | Get the list of tracking domains set up for this account. # noqa: E501
239 | """
240 |
241 | all_params = ['body'] # noqa: E501
242 |
243 | params = locals()
244 | for key, val in six.iteritems(params['kwargs']):
245 | if key not in all_params:
246 | raise TypeError(
247 | "Got an unexpected keyword argument '%s'"
248 | " to method tracking_domains" % key
249 | )
250 | params[key] = val
251 | del params['kwargs']
252 |
253 | # add api_key to body params
254 | params['body']['key'] = self.api_key
255 |
256 | body_params = None
257 | if 'body' in params:
258 | body_params = params['body']
259 |
260 | return self.api_client.call_api(
261 | '/urls/tracking-domains', 'POST',
262 | body=body_params,
263 | response_type='list[InlineResponse20070]') # noqa: E501
264 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/users_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class UsersApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def info(self, body = {}, **kwargs): # noqa: E501
38 | """Get user info # noqa: E501
39 |
40 | Return the information about the API-connected user. # noqa: E501
41 | """
42 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def info_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Get user info # noqa: E501
47 |
48 | Return the information about the API-connected user. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method info" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/users/info', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20072') # noqa: E501
74 |
75 | def ping(self, body = {}, **kwargs): # noqa: E501
76 | """Ping # noqa: E501
77 |
78 | Validate an API key and respond to a ping. # noqa: E501
79 | """
80 | (data) = self.ping_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def ping_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Ping # noqa: E501
85 |
86 | Validate an API key and respond to a ping. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method ping" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/users/ping', 'POST',
110 | body=body_params,
111 | response_type='str') # noqa: E501
112 |
113 | def ping2(self, body = {}, **kwargs): # noqa: E501
114 | """Ping 2 # noqa: E501
115 |
116 | Validate an API key and respond to a ping (JSON parser version). # noqa: E501
117 | """
118 | (data) = self.ping2_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def ping2_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Ping 2 # noqa: E501
123 |
124 | Validate an API key and respond to a ping (JSON parser version). # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method ping2" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/users/ping2', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20073') # noqa: E501
150 |
151 | def senders(self, body = {}, **kwargs): # noqa: E501
152 | """List account senders # noqa: E501
153 |
154 | Return the senders that have tried to use this account, both verified and unverified. # noqa: E501
155 | """
156 | (data) = self.senders_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def senders_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List account senders # noqa: E501
161 |
162 | Return the senders that have tried to use this account, both verified and unverified. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method senders" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/users/senders', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20043]') # noqa: E501
188 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/webhooks_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class WebhooksApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add webhook # noqa: E501
39 |
40 | Add a new webhook. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add webhook # noqa: E501
47 |
48 | Add a new webhook. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/webhooks/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse20075') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Delete webhook # noqa: E501
77 |
78 | Delete an existing webhook. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Delete webhook # noqa: E501
85 |
86 | Delete an existing webhook. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/webhooks/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse20078') # noqa: E501
112 |
113 | def info(self, body = {}, **kwargs): # noqa: E501
114 | """Get webhook info # noqa: E501
115 |
116 | Given the ID of an existing webhook, return the data about it. # noqa: E501
117 | """
118 | (data) = self.info_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def info_with_http_info(self, body, **kwargs): # noqa: E501
122 | """Get webhook info # noqa: E501
123 |
124 | Given the ID of an existing webhook, return the data about it. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method info" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/webhooks/info', 'POST',
148 | body=body_params,
149 | response_type='InlineResponse20076') # noqa: E501
150 |
151 | def list(self, body = {}, **kwargs): # noqa: E501
152 | """List webhooks # noqa: E501
153 |
154 | Get the list of all webhooks defined on the account. # noqa: E501
155 | """
156 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
157 | return data
158 |
159 | def list_with_http_info(self, body, **kwargs): # noqa: E501
160 | """List webhooks # noqa: E501
161 |
162 | Get the list of all webhooks defined on the account. # noqa: E501
163 | """
164 |
165 | all_params = ['body'] # noqa: E501
166 |
167 | params = locals()
168 | for key, val in six.iteritems(params['kwargs']):
169 | if key not in all_params:
170 | raise TypeError(
171 | "Got an unexpected keyword argument '%s'"
172 | " to method list" % key
173 | )
174 | params[key] = val
175 | del params['kwargs']
176 |
177 | # add api_key to body params
178 | params['body']['key'] = self.api_key
179 |
180 | body_params = None
181 | if 'body' in params:
182 | body_params = params['body']
183 |
184 | return self.api_client.call_api(
185 | '/webhooks/list', 'POST',
186 | body=body_params,
187 | response_type='list[InlineResponse20074]') # noqa: E501
188 |
189 | def update(self, body = {}, **kwargs): # noqa: E501
190 | """Update webhook # noqa: E501
191 |
192 | Update an existing webhook. # noqa: E501
193 | """
194 | (data) = self.update_with_http_info(body, **kwargs) # noqa: E501
195 | return data
196 |
197 | def update_with_http_info(self, body, **kwargs): # noqa: E501
198 | """Update webhook # noqa: E501
199 |
200 | Update an existing webhook. # noqa: E501
201 | """
202 |
203 | all_params = ['body'] # noqa: E501
204 |
205 | params = locals()
206 | for key, val in six.iteritems(params['kwargs']):
207 | if key not in all_params:
208 | raise TypeError(
209 | "Got an unexpected keyword argument '%s'"
210 | " to method update" % key
211 | )
212 | params[key] = val
213 | del params['kwargs']
214 |
215 | # add api_key to body params
216 | params['body']['key'] = self.api_key
217 |
218 | body_params = None
219 | if 'body' in params:
220 | body_params = params['body']
221 |
222 | return self.api_client.call_api(
223 | '/webhooks/update', 'POST',
224 | body=body_params,
225 | response_type='InlineResponse20077') # noqa: E501
226 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api/whitelists_api.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.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 mailchimp_transactional.api_client import ApiClient
22 |
23 | class WhitelistsApi(object):
24 | """NOTE: This class is auto generated by the swagger code generator program.
25 |
26 | Do not edit the class manually.
27 | Ref: https://github.com/swagger-api/swagger-codegen
28 | """
29 |
30 | def __init__(self, api_key='', api_client = None):
31 | self.api_key = api_key
32 | if api_client:
33 | self.api_client = api_client
34 | else:
35 | self.api_client = ApiClient()
36 |
37 | def add(self, body = {}, **kwargs): # noqa: E501
38 | """Add email to allowlist # noqa: E501
39 |
40 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
41 | """
42 | (data) = self.add_with_http_info(body, **kwargs) # noqa: E501
43 | return data
44 |
45 | def add_with_http_info(self, body, **kwargs): # noqa: E501
46 | """Add email to allowlist # noqa: E501
47 |
48 | Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically. # noqa: E501
49 | """
50 |
51 | all_params = ['body'] # noqa: E501
52 |
53 | params = locals()
54 | for key, val in six.iteritems(params['kwargs']):
55 | if key not in all_params:
56 | raise TypeError(
57 | "Got an unexpected keyword argument '%s'"
58 | " to method add" % key
59 | )
60 | params[key] = val
61 | del params['kwargs']
62 |
63 | # add api_key to body params
64 | params['body']['key'] = self.api_key
65 |
66 | body_params = None
67 | if 'body' in params:
68 | body_params = params['body']
69 |
70 | return self.api_client.call_api(
71 | '/whitelists/add', 'POST',
72 | body=body_params,
73 | response_type='InlineResponse200') # noqa: E501
74 |
75 | def delete(self, body = {}, **kwargs): # noqa: E501
76 | """Remove email from allowlist # noqa: E501
77 |
78 | Removes an email address from the allowlist. # noqa: E501
79 | """
80 | (data) = self.delete_with_http_info(body, **kwargs) # noqa: E501
81 | return data
82 |
83 | def delete_with_http_info(self, body, **kwargs): # noqa: E501
84 | """Remove email from allowlist # noqa: E501
85 |
86 | Removes an email address from the allowlist. # noqa: E501
87 | """
88 |
89 | all_params = ['body'] # noqa: E501
90 |
91 | params = locals()
92 | for key, val in six.iteritems(params['kwargs']):
93 | if key not in all_params:
94 | raise TypeError(
95 | "Got an unexpected keyword argument '%s'"
96 | " to method delete" % key
97 | )
98 | params[key] = val
99 | del params['kwargs']
100 |
101 | # add api_key to body params
102 | params['body']['key'] = self.api_key
103 |
104 | body_params = None
105 | if 'body' in params:
106 | body_params = params['body']
107 |
108 | return self.api_client.call_api(
109 | '/whitelists/delete', 'POST',
110 | body=body_params,
111 | response_type='InlineResponse2002') # noqa: E501
112 |
113 | def list(self, body = {}, **kwargs): # noqa: E501
114 | """List allowlisted emails # noqa: E501
115 |
116 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
117 | """
118 | (data) = self.list_with_http_info(body, **kwargs) # noqa: E501
119 | return data
120 |
121 | def list_with_http_info(self, body, **kwargs): # noqa: E501
122 | """List allowlisted emails # noqa: E501
123 |
124 | Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results. # noqa: E501
125 | """
126 |
127 | all_params = ['body'] # noqa: E501
128 |
129 | params = locals()
130 | for key, val in six.iteritems(params['kwargs']):
131 | if key not in all_params:
132 | raise TypeError(
133 | "Got an unexpected keyword argument '%s'"
134 | " to method list" % key
135 | )
136 | params[key] = val
137 | del params['kwargs']
138 |
139 | # add api_key to body params
140 | params['body']['key'] = self.api_key
141 |
142 | body_params = None
143 | if 'body' in params:
144 | body_params = params['body']
145 |
146 | return self.api_client.call_api(
147 | '/whitelists/list', 'POST',
148 | body=body_params,
149 | response_type='list[InlineResponse2001]') # noqa: E501
150 |
--------------------------------------------------------------------------------
/mailchimp_transactional/api_client.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | """
3 | Mailchimp Transactional API
4 |
5 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
6 |
7 | OpenAPI spec version: 1.0.59
8 | Contact: apihelp@mailchimp.com
9 | Generated by: https://github.com/swagger-api/swagger-codegen.git
10 | """
11 |
12 | from __future__ import absolute_import
13 |
14 | import datetime
15 | import requests
16 | import json
17 |
18 | class ApiClientError(Exception):
19 | def __init__(self, text, status_code):
20 | self.text = text
21 | self.status_code = status_code
22 |
23 | class ApiClient(object):
24 | def __init__(self):
25 | self.host = "https://mandrillapp.com/api/1.0"
26 | self.user_agent = 'Swagger-Codegen/1.0.59/python'
27 | self.format_list = ['json', 'xml', 'php', 'yaml']
28 | self.content_type = 'application/json'
29 | self.default_output_format = 'json'
30 | self.accepts = ['application/json', 'application/xml', 'application/x-php', 'application/x-yaml; charset=utf-8']
31 | self.timeout = 300
32 |
33 | def set_default_output_format(self, output_format):
34 | if output_format in self.format_list:
35 | self.default_output_format = output_format
36 |
37 | def set_timeout(self, timeout):
38 | self.timeout = timeout
39 |
40 | def call_api(self, resource_path, method, header_params=None, body=None, **kwargs):
41 | # header parameters
42 | headers = header_params or {}
43 | headers['User-Agent'] = self.user_agent
44 | headers['Content-Type'] = self.content_type
45 |
46 | # request url
47 | url = self.host + resource_path
48 |
49 | use_default_output_format = True
50 |
51 | if body and 'outputFormat' in body:
52 | format = body['outputFormat'].lower()
53 | if format in self.format_list:
54 | url += '.%s' % format
55 | del body['outputFormat']
56 | use_default_output_format = False
57 |
58 | if use_default_output_format and self.default_output_format in self.format_list:
59 | url += '.%s' % self.default_output_format
60 |
61 | # perform request and return response
62 | res = self.request(method, url, body, headers)
63 |
64 | try:
65 | if 'application/json' in res.headers.get('content-type'):
66 | data = res.json()
67 | else:
68 | data = res.text
69 | except Exception as err:
70 | data = None
71 |
72 | if data:
73 | if (res.ok):
74 | return data
75 | else:
76 | raise ApiClientError(text = data, status_code = res.status_code)
77 | else:
78 | return res
79 |
80 | def request(self, method, url, body=None, headers=None, timeout=None):
81 | if not timeout:
82 | timeout = self.timeout
83 |
84 | if method == 'POST':
85 | return requests.post(url, data=json.dumps(body), headers=headers, timeout=timeout)
86 | else:
87 | raise ValueError(
88 | "http method must be `POST`"
89 | )
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | certifi >= 14.05.14
2 | six >= 1.10
3 | python_dateutil >= 2.5.3
4 | setuptools >= 21.0.0
5 | urllib3 >= 1.15.1
6 | requests>=2.23
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | """
4 | Mailchimp Transactional API
5 |
6 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 |
8 | OpenAPI spec version: 1.0.59
9 | Contact: apihelp@mailchimp.com
10 | Generated by: https://github.com/swagger-api/swagger-codegen.git
11 | """
12 |
13 |
14 | from setuptools import setup, find_packages # noqa: H301
15 |
16 | NAME = "mailchimp_transactional"
17 | VERSION = "1.0.59"
18 | # To install the library, run the following
19 | #
20 | # python setup.py install
21 | #
22 | # prerequisite: setuptools
23 | # http://pypi.python.org/pypi/setuptools
24 |
25 | REQUIRES = [
26 | "certifi>=2017.4.17",
27 | "python-dateutil>=2.1",
28 | "requests>=2.23",
29 | "six>=1.10",
30 | "urllib3>=1.23"
31 | ]
32 |
33 | setup(
34 | name=NAME,
35 | version=VERSION,
36 | description="Mailchimp Transactional API",
37 | author_email="apihelp@mailchimp.com",
38 | url="",
39 | keywords=["Swagger", "Mailchimp Transactional API"],
40 | install_requires=REQUIRES,
41 | packages=find_packages(),
42 | include_package_data=True,
43 | long_description="""\
44 | No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
45 | """
46 | )
47 |
--------------------------------------------------------------------------------
/test-requirements.txt:
--------------------------------------------------------------------------------
1 | coverage>=4.0.3
2 | nose>=1.3.7
3 | pluggy>=0.3.1
4 | py>=1.4.31
5 | randomize>=0.13
6 |
--------------------------------------------------------------------------------