python3-core-api-client 0.1__tar.gz → 0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/PKG-INFO +40 -11
  2. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/README.md +39 -10
  3. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/pyproject.toml +1 -1
  4. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/connector.py +4 -7
  5. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/python3_core_api_client.egg-info/PKG-INFO +40 -11
  6. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/setup.cfg +0 -0
  7. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/__init__.py +0 -0
  8. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/_encoders.py +0 -0
  9. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/exceptions.py +0 -0
  10. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/http.py +0 -0
  11. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/interfaces.py +0 -0
  12. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/models.py +0 -0
  13. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/__init__.py +0 -0
  14. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/basic_authentication_realms.py +0 -0
  15. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/borg_archives.py +0 -0
  16. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/borg_repositories.py +0 -0
  17. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/certificate_managers.py +0 -0
  18. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/certificates.py +0 -0
  19. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/clusters.py +0 -0
  20. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/cmses.py +0 -0
  21. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/crons.py +0 -0
  22. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/custom_config_snippets.py +0 -0
  23. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/custom_configs.py +0 -0
  24. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/customers.py +0 -0
  25. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/daemons.py +0 -0
  26. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/database_user_grants.py +0 -0
  27. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/database_users.py +0 -0
  28. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/databases.py +0 -0
  29. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/domain_routers.py +0 -0
  30. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/firewall_groups.py +0 -0
  31. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/firewall_rules.py +0 -0
  32. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/fpm_pools.py +0 -0
  33. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/ftp_users.py +0 -0
  34. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/haproxy_listens.py +0 -0
  35. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/haproxy_listens_to_nodes.py +0 -0
  36. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/health.py +0 -0
  37. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/hosts_entries.py +0 -0
  38. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/htpasswd_files.py +0 -0
  39. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/htpasswd_users.py +0 -0
  40. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/login.py +0 -0
  41. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/logs.py +0 -0
  42. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/mail_accounts.py +0 -0
  43. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/mail_aliases.py +0 -0
  44. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/mail_domains.py +0 -0
  45. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/mail_hostnames.py +0 -0
  46. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/malwares.py +0 -0
  47. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/mariadb_encryption_keys.py +0 -0
  48. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/node_add_ons.py +0 -0
  49. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/nodes.py +0 -0
  50. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/passenger_apps.py +0 -0
  51. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/redis_instances.py +0 -0
  52. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/root_ssh_keys.py +0 -0
  53. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/security_txt_policies.py +0 -0
  54. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/sites.py +0 -0
  55. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/ssh_keys.py +0 -0
  56. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/task_collections.py +0 -0
  57. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/tombstones.py +0 -0
  58. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/unix_users.py +0 -0
  59. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/url_redirects.py +0 -0
  60. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/cyberfusion/CoreApiClient/resources/virtual_hosts.py +0 -0
  61. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/python3_core_api_client.egg-info/SOURCES.txt +0 -0
  62. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/python3_core_api_client.egg-info/dependency_links.txt +0 -0
  63. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/python3_core_api_client.egg-info/requires.txt +0 -0
  64. {python3_core_api_client-0.1 → python3_core_api_client-0.2}/src/python3_core_api_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-core-api-client
3
- Version: 0.1
3
+ Version: 0.2
4
4
  Summary: Python client for Core API.
5
5
  Author-email: Cyberfusion <support@cyberfusion.io>
6
6
  Project-URL: Source, https://github.com/CyberfusionIO/python3-core-api-client
@@ -52,7 +52,7 @@ Refer to the [API documentation](https://core-api.cyberfusion.io/) for informati
52
52
 
53
53
  Initialise the `CoreApiConnector` with your username and password **or** API key.
54
54
 
55
- The connector takes care of authentication, and offers several resources (such as `virtual_hosts`) and endpoints (i.e. `list_virtual_hosts`).
55
+ The connector takes care of authentication, and offers several resources (e.g. `virtual_hosts`) and endpoints (e.g. `list_virtual_hosts`).
56
56
 
57
57
  ```python
58
58
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -78,7 +78,7 @@ This client takes care of authentication.
78
78
 
79
79
  If authentication using username and password fails, `cyberfusion.CoreApiClient.exceptions.AuthenticationException` is thrown.
80
80
 
81
- If authentication using API key fails, the regular `CallException` exception fis raised.
81
+ If authentication using API key fails, the regular `CallException` exception is raised.
82
82
 
83
83
  Don't have an API user? Contact Cyberfusion.
84
84
 
@@ -86,8 +86,6 @@ Don't have an API user? Contact Cyberfusion.
86
86
 
87
87
  The client uses a fluent interface to build requests.
88
88
 
89
- To view all possible requests:
90
-
91
89
  - Start with the connector
92
90
  - Go to the desired resource
93
91
  - Call the desired endpoint
@@ -115,7 +113,7 @@ connector.mail_domains.create_mail_domain(
115
113
 
116
114
  Models are validated before sending the request (using [Pydantic](https://docs.pydantic.dev/latest/)). If invalid data is provided, `pydantic.ValidationError` is thrown.
117
115
 
118
- For example:
116
+ Code example:
119
117
 
120
118
  ```python
121
119
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -135,15 +133,44 @@ connector.mail_aliases.create_mail_alias(
135
133
  # throw pydantic.ValidationError
136
134
  ```
137
135
 
138
- The exception will provide more details about the validation errors.
136
+ The exception has an `errors()` method to get all validation errors.
137
+
138
+ Code example:
139
+
140
+ ```python
141
+ from cyberfusion.CoreApiClient.connector import CoreApiConnector
142
+
143
+ from cyberfusion.CoreApiClient.models import MailAliasCreateRequest
144
+
145
+ import pydantic
146
+
147
+ connector = CoreApiConnector(
148
+ username='username', password='password'
149
+ )
150
+
151
+ try:
152
+ connector.mail_aliases.create_mail_alias(
153
+ MailAliasCreateRequest(
154
+ local_part='&^@$#^&@$#^&',
155
+ mail_domain_id=1,
156
+ )
157
+ )
158
+ except pydantic.ValidationError as e:
159
+ errors = e.errors()
160
+
161
+ for error in errors:
162
+ print(error['loc'])
163
+ print(error['msg'])
164
+ print(error['type'])
165
+ ```
139
166
 
140
167
  ## Responses
141
168
 
142
169
  ### Get model from response
143
170
 
144
- Calling a n endpoint returns the resource model.
171
+ Calling an endpoint returns the resource model.
145
172
 
146
- For example:
173
+ Code example:
147
174
 
148
175
  ```python
149
176
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -169,6 +196,8 @@ mail_domain_resource = connector.mail_domains.create_mail_domain(
169
196
 
170
197
  If a request returns an unexpected HTTP status code, `cyberfusion.CoreApiClient.exceptions.CallException` is thrown.
171
198
 
199
+ The exception includes the response, and the HTTP status code.
200
+
172
201
  ## Enums
173
202
 
174
203
  Some properties only accept certain values (enums).
@@ -191,7 +220,7 @@ connector = CoreApiConnector(
191
220
  )
192
221
  ```
193
222
 
194
- Don't pass a custom session? A default one is created, including retries.
223
+ Don't pass a custom session? A default one is created, with retries enabled.
195
224
 
196
225
  ### Manual requests
197
226
 
@@ -215,7 +244,7 @@ response.headers
215
244
  response.failed
216
245
  ```
217
246
 
218
- To raise `cyberfusion.CoreApiClient.exceptions.CallException` in case of an unexpected HTTP status code, use `send_or_fail`.
247
+ To raise `cyberfusion.CoreApiClient.exceptions.CallException` in case of an unexpected HTTP status code, use `send_or_fail` instead of `send`. It takes the same parameters.
219
248
 
220
249
  ### Generating models
221
250
 
@@ -41,7 +41,7 @@ Refer to the [API documentation](https://core-api.cyberfusion.io/) for informati
41
41
 
42
42
  Initialise the `CoreApiConnector` with your username and password **or** API key.
43
43
 
44
- The connector takes care of authentication, and offers several resources (such as `virtual_hosts`) and endpoints (i.e. `list_virtual_hosts`).
44
+ The connector takes care of authentication, and offers several resources (e.g. `virtual_hosts`) and endpoints (e.g. `list_virtual_hosts`).
45
45
 
46
46
  ```python
47
47
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -67,7 +67,7 @@ This client takes care of authentication.
67
67
 
68
68
  If authentication using username and password fails, `cyberfusion.CoreApiClient.exceptions.AuthenticationException` is thrown.
69
69
 
70
- If authentication using API key fails, the regular `CallException` exception fis raised.
70
+ If authentication using API key fails, the regular `CallException` exception is raised.
71
71
 
72
72
  Don't have an API user? Contact Cyberfusion.
73
73
 
@@ -75,8 +75,6 @@ Don't have an API user? Contact Cyberfusion.
75
75
 
76
76
  The client uses a fluent interface to build requests.
77
77
 
78
- To view all possible requests:
79
-
80
78
  - Start with the connector
81
79
  - Go to the desired resource
82
80
  - Call the desired endpoint
@@ -104,7 +102,7 @@ connector.mail_domains.create_mail_domain(
104
102
 
105
103
  Models are validated before sending the request (using [Pydantic](https://docs.pydantic.dev/latest/)). If invalid data is provided, `pydantic.ValidationError` is thrown.
106
104
 
107
- For example:
105
+ Code example:
108
106
 
109
107
  ```python
110
108
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -124,15 +122,44 @@ connector.mail_aliases.create_mail_alias(
124
122
  # throw pydantic.ValidationError
125
123
  ```
126
124
 
127
- The exception will provide more details about the validation errors.
125
+ The exception has an `errors()` method to get all validation errors.
126
+
127
+ Code example:
128
+
129
+ ```python
130
+ from cyberfusion.CoreApiClient.connector import CoreApiConnector
131
+
132
+ from cyberfusion.CoreApiClient.models import MailAliasCreateRequest
133
+
134
+ import pydantic
135
+
136
+ connector = CoreApiConnector(
137
+ username='username', password='password'
138
+ )
139
+
140
+ try:
141
+ connector.mail_aliases.create_mail_alias(
142
+ MailAliasCreateRequest(
143
+ local_part='&^@$#^&@$#^&',
144
+ mail_domain_id=1,
145
+ )
146
+ )
147
+ except pydantic.ValidationError as e:
148
+ errors = e.errors()
149
+
150
+ for error in errors:
151
+ print(error['loc'])
152
+ print(error['msg'])
153
+ print(error['type'])
154
+ ```
128
155
 
129
156
  ## Responses
130
157
 
131
158
  ### Get model from response
132
159
 
133
- Calling a n endpoint returns the resource model.
160
+ Calling an endpoint returns the resource model.
134
161
 
135
- For example:
162
+ Code example:
136
163
 
137
164
  ```python
138
165
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -158,6 +185,8 @@ mail_domain_resource = connector.mail_domains.create_mail_domain(
158
185
 
159
186
  If a request returns an unexpected HTTP status code, `cyberfusion.CoreApiClient.exceptions.CallException` is thrown.
160
187
 
188
+ The exception includes the response, and the HTTP status code.
189
+
161
190
  ## Enums
162
191
 
163
192
  Some properties only accept certain values (enums).
@@ -180,7 +209,7 @@ connector = CoreApiConnector(
180
209
  )
181
210
  ```
182
211
 
183
- Don't pass a custom session? A default one is created, including retries.
212
+ Don't pass a custom session? A default one is created, with retries enabled.
184
213
 
185
214
  ### Manual requests
186
215
 
@@ -204,7 +233,7 @@ response.headers
204
233
  response.failed
205
234
  ```
206
235
 
207
- To raise `cyberfusion.CoreApiClient.exceptions.CallException` in case of an unexpected HTTP status code, use `send_or_fail`.
236
+ To raise `cyberfusion.CoreApiClient.exceptions.CallException` in case of an unexpected HTTP status code, use `send_or_fail` instead of `send`. It takes the same parameters.
208
237
 
209
238
  ### Generating models
210
239
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python3-core-api-client"
7
- version = "0.1"
7
+ version = "0.2"
8
8
  description = "Python client for Core API."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -1,6 +1,5 @@
1
1
  import json
2
2
  from typing import Optional, Tuple
3
- from urllib.parse import urlparse
4
3
 
5
4
  from cyberfusion.CoreApiClient._encoders import DatetimeEncoder
6
5
  from cyberfusion.CoreApiClient.exceptions import CallException, AuthenticationException
@@ -17,7 +16,7 @@ import importlib.metadata
17
16
  from cyberfusion.CoreApiClient.http import Response
18
17
 
19
18
 
20
- class CoreApiConnector:
19
+ class CoreApiClient:
21
20
  def __init__(
22
21
  self,
23
22
  base_url: str = "https://core-api.cyberfusion.io",
@@ -50,10 +49,6 @@ class CoreApiConnector:
50
49
 
51
50
  self.requests_session = requests_session or self.get_default_requests_session()
52
51
 
53
- @property
54
- def root_url(self) -> str:
55
- return urlparse(self.base_url)._replace(path="").geturl()
56
-
57
52
  @property
58
53
  def authentication_headers(self) -> Dict[str, str]:
59
54
  headers = {}
@@ -73,7 +68,7 @@ class CoreApiConnector:
73
68
 
74
69
  if login:
75
70
  response = self.requests_session.post(
76
- "".join([self.root_url, "/api/v1/login/access-token"]),
71
+ "".join([self.base_url, "/api/v1/login/access-token"]),
77
72
  data={"username": self.username, "password": self.password},
78
73
  verify=certifi.where(),
79
74
  timeout=60,
@@ -181,6 +176,8 @@ class CoreApiConnector:
181
176
 
182
177
  return session
183
178
 
179
+
180
+ class CoreApiConnector(CoreApiClient):
184
181
  @cached_property
185
182
  def login(self) -> resources.login.Login:
186
183
  return resources.login.Login(self)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-core-api-client
3
- Version: 0.1
3
+ Version: 0.2
4
4
  Summary: Python client for Core API.
5
5
  Author-email: Cyberfusion <support@cyberfusion.io>
6
6
  Project-URL: Source, https://github.com/CyberfusionIO/python3-core-api-client
@@ -52,7 +52,7 @@ Refer to the [API documentation](https://core-api.cyberfusion.io/) for informati
52
52
 
53
53
  Initialise the `CoreApiConnector` with your username and password **or** API key.
54
54
 
55
- The connector takes care of authentication, and offers several resources (such as `virtual_hosts`) and endpoints (i.e. `list_virtual_hosts`).
55
+ The connector takes care of authentication, and offers several resources (e.g. `virtual_hosts`) and endpoints (e.g. `list_virtual_hosts`).
56
56
 
57
57
  ```python
58
58
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -78,7 +78,7 @@ This client takes care of authentication.
78
78
 
79
79
  If authentication using username and password fails, `cyberfusion.CoreApiClient.exceptions.AuthenticationException` is thrown.
80
80
 
81
- If authentication using API key fails, the regular `CallException` exception fis raised.
81
+ If authentication using API key fails, the regular `CallException` exception is raised.
82
82
 
83
83
  Don't have an API user? Contact Cyberfusion.
84
84
 
@@ -86,8 +86,6 @@ Don't have an API user? Contact Cyberfusion.
86
86
 
87
87
  The client uses a fluent interface to build requests.
88
88
 
89
- To view all possible requests:
90
-
91
89
  - Start with the connector
92
90
  - Go to the desired resource
93
91
  - Call the desired endpoint
@@ -115,7 +113,7 @@ connector.mail_domains.create_mail_domain(
115
113
 
116
114
  Models are validated before sending the request (using [Pydantic](https://docs.pydantic.dev/latest/)). If invalid data is provided, `pydantic.ValidationError` is thrown.
117
115
 
118
- For example:
116
+ Code example:
119
117
 
120
118
  ```python
121
119
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -135,15 +133,44 @@ connector.mail_aliases.create_mail_alias(
135
133
  # throw pydantic.ValidationError
136
134
  ```
137
135
 
138
- The exception will provide more details about the validation errors.
136
+ The exception has an `errors()` method to get all validation errors.
137
+
138
+ Code example:
139
+
140
+ ```python
141
+ from cyberfusion.CoreApiClient.connector import CoreApiConnector
142
+
143
+ from cyberfusion.CoreApiClient.models import MailAliasCreateRequest
144
+
145
+ import pydantic
146
+
147
+ connector = CoreApiConnector(
148
+ username='username', password='password'
149
+ )
150
+
151
+ try:
152
+ connector.mail_aliases.create_mail_alias(
153
+ MailAliasCreateRequest(
154
+ local_part='&^@$#^&@$#^&',
155
+ mail_domain_id=1,
156
+ )
157
+ )
158
+ except pydantic.ValidationError as e:
159
+ errors = e.errors()
160
+
161
+ for error in errors:
162
+ print(error['loc'])
163
+ print(error['msg'])
164
+ print(error['type'])
165
+ ```
139
166
 
140
167
  ## Responses
141
168
 
142
169
  ### Get model from response
143
170
 
144
- Calling a n endpoint returns the resource model.
171
+ Calling an endpoint returns the resource model.
145
172
 
146
- For example:
173
+ Code example:
147
174
 
148
175
  ```python
149
176
  from cyberfusion.CoreApiClient.connector import CoreApiConnector
@@ -169,6 +196,8 @@ mail_domain_resource = connector.mail_domains.create_mail_domain(
169
196
 
170
197
  If a request returns an unexpected HTTP status code, `cyberfusion.CoreApiClient.exceptions.CallException` is thrown.
171
198
 
199
+ The exception includes the response, and the HTTP status code.
200
+
172
201
  ## Enums
173
202
 
174
203
  Some properties only accept certain values (enums).
@@ -191,7 +220,7 @@ connector = CoreApiConnector(
191
220
  )
192
221
  ```
193
222
 
194
- Don't pass a custom session? A default one is created, including retries.
223
+ Don't pass a custom session? A default one is created, with retries enabled.
195
224
 
196
225
  ### Manual requests
197
226
 
@@ -215,7 +244,7 @@ response.headers
215
244
  response.failed
216
245
  ```
217
246
 
218
- To raise `cyberfusion.CoreApiClient.exceptions.CallException` in case of an unexpected HTTP status code, use `send_or_fail`.
247
+ To raise `cyberfusion.CoreApiClient.exceptions.CallException` in case of an unexpected HTTP status code, use `send_or_fail` instead of `send`. It takes the same parameters.
219
248
 
220
249
  ### Generating models
221
250