Skip to content

Commit 87b8104

Browse files
authored
feat(tem): add domain last status check (#213)
1 parent 63e4d1f commit 87b8104

File tree

8 files changed

+532
-110
lines changed

8 files changed

+532
-110
lines changed

scaleway-async/scaleway_async/tem/v1alpha1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file was automatically generated. DO NOT EDIT.
22
# If you have any remark or suggestion do not hesitate to open an issue.
3+
from .types import DomainLastStatusRecordStatus
34
from .types import DomainStatus
45
from .types import EmailRcptType
56
from .types import EmailStatus
@@ -8,6 +9,9 @@
89
from .types import CreateEmailRequestAttachment
910
from .types import CreateEmailResponse
1011
from .types import Domain
12+
from .types import DomainLastStatus
13+
from .types import DomainLastStatusDkimRecord
14+
from .types import DomainLastStatusSpfRecord
1115
from .types import DomainStatistics
1216
from .types import Email
1317
from .types import EmailTry
@@ -19,6 +23,7 @@
1923
from .api import TemV1Alpha1API
2024

2125
__all__ = [
26+
"DomainLastStatusRecordStatus",
2227
"DomainStatus",
2328
"EmailRcptType",
2429
"EmailStatus",
@@ -27,6 +32,9 @@
2732
"CreateEmailRequestAttachment",
2833
"CreateEmailResponse",
2934
"Domain",
35+
"DomainLastStatus",
36+
"DomainLastStatusDkimRecord",
37+
"DomainLastStatusSpfRecord",
3038
"DomainStatistics",
3139
"Email",
3240
"EmailTry",

scaleway-async/scaleway_async/tem/v1alpha1/api.py

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
CreateEmailRequestAttachment,
2323
CreateEmailResponse,
2424
Domain,
25+
DomainLastStatus,
2526
Email,
2627
ListDomainsResponse,
2728
ListEmailsResponse,
@@ -39,6 +40,7 @@
3940
unmarshal_Domain,
4041
unmarshal_Email,
4142
unmarshal_CreateEmailResponse,
43+
unmarshal_DomainLastStatus,
4244
unmarshal_ListDomainsResponse,
4345
unmarshal_ListEmailsResponse,
4446
unmarshal_Statistics,
@@ -219,7 +221,7 @@ async def list_emails(
219221
:param since: (Optional) List emails created after this date.
220222
:param until: (Optional) List emails created before this date.
221223
:param mail_from: (Optional) List emails sent with this sender's email address.
222-
:param mail_to: (Deprecated) List emails sent to this recipient's email address.
224+
:param mail_to: List emails sent to this recipient's email address.
223225
:param mail_rcpt: (Optional) List emails sent to this recipient's email address.
224226
:param statuses: (Optional) List emails with any of these statuses.
225227
:param subject: (Optional) List emails with this subject.
@@ -292,7 +294,7 @@ async def list_emails_all(
292294
:param since: (Optional) List emails created after this date.
293295
:param until: (Optional) List emails created before this date.
294296
:param mail_from: (Optional) List emails sent with this sender's email address.
295-
:param mail_to: (Deprecated) List emails sent to this recipient's email address.
297+
:param mail_to: List emails sent to this recipient's email address.
296298
:param mail_rcpt: (Optional) List emails sent to this recipient's email address.
297299
:param statuses: (Optional) List emails with any of these statuses.
298300
:param subject: (Optional) List emails with this subject.
@@ -678,3 +680,35 @@ async def check_domain(
678680

679681
self._throw_on_error(res)
680682
return unmarshal_Domain(res.json())
683+
684+
async def check_domain_last_status(
685+
self,
686+
*,
687+
domain_id: str,
688+
region: Optional[Region] = None,
689+
) -> DomainLastStatus:
690+
"""
691+
Display SPF and DKIM records status and potential errors.
692+
Display SPF and DKIM records status and potential errors, including the found records to make debugging easier.
693+
:param region: Region to target. If none is passed will use default region from the config.
694+
:param domain_id: ID of the domain to delete.
695+
:return: :class:`DomainLastStatus <DomainLastStatus>`
696+
697+
Usage:
698+
::
699+
700+
result = await api.check_domain_last_status(domain_id="example")
701+
"""
702+
703+
param_region = validate_path_param(
704+
"region", region or self.client.default_region
705+
)
706+
param_domain_id = validate_path_param("domain_id", domain_id)
707+
708+
res = self._request(
709+
"POST",
710+
f"/transactional-email/v1alpha1/regions/{param_region}/domains/{param_domain_id}/verification",
711+
)
712+
713+
self._throw_on_error(res)
714+
return unmarshal_DomainLastStatus(res.json())

0 commit comments

Comments
 (0)