From 18bac7f7e4d42abe0d8f80754d079225b0873c8f Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 21 Jun 2024 09:18:29 +0000 Subject: [PATCH] feat: update generated APIs --- scaleway-async/scaleway_async/tem/v1alpha1/api.py | 7 ++++--- .../scaleway_async/tem/v1alpha1/marshalling.py | 6 +++--- scaleway-async/scaleway_async/tem/v1alpha1/types.py | 10 +++++----- scaleway/scaleway/tem/v1alpha1/api.py | 7 ++++--- scaleway/scaleway/tem/v1alpha1/marshalling.py | 6 +++--- scaleway/scaleway/tem/v1alpha1/types.py | 10 +++++----- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/scaleway-async/scaleway_async/tem/v1alpha1/api.py b/scaleway-async/scaleway_async/tem/v1alpha1/api.py index 8ed3a0f8..0e9d66c6 100644 --- a/scaleway-async/scaleway_async/tem/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/tem/v1alpha1/api.py @@ -70,11 +70,11 @@ class TemV1Alpha1API(API): async def create_email( self, *, + from_: CreateEmailRequestAddress, subject: str, text: str, html: str, region: Optional[Region] = None, - from_: Optional[CreateEmailRequestAddress] = None, to: Optional[List[CreateEmailRequestAddress]] = None, cc: Optional[List[CreateEmailRequestAddress]] = None, bcc: Optional[List[CreateEmailRequestAddress]] = None, @@ -86,11 +86,11 @@ async def create_email( """ Send an email. You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters. + :param from_: Sender information. Must be from a checked domain declared in the Project. :param subject: Subject of the email. :param text: Text content. :param html: HTML content. :param region: Region to target. If none is passed will use default region from the config. - :param from_: Sender information. Must be from a checked domain declared in the Project. :param to: An array of the primary recipient's information. :param cc: An array of the carbon copy recipient's information. :param bcc: An array of the blind carbon copy recipient's information. @@ -104,6 +104,7 @@ async def create_email( :: result = await api.create_email( + from=CreateEmailRequestAddress(), subject="example", text="example", html="example", @@ -119,11 +120,11 @@ async def create_email( f"/transactional-email/v1alpha1/regions/{param_region}/emails", body=marshal_CreateEmailRequest( CreateEmailRequest( + from_=from_, subject=subject, text=text, html=html, region=region, - from_=from_, to=to, cc=cc, bcc=bcc, diff --git a/scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py index 6941bd76..b5e32ae1 100644 --- a/scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py @@ -789,6 +789,9 @@ def marshal_CreateEmailRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.from_ is not None: + output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults) + if request.subject is not None: output["subject"] = request.subject @@ -798,9 +801,6 @@ def marshal_CreateEmailRequest( if request.html is not None: output["html"] = request.html - if request.from_ is not None: - output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults) - if request.to is not None: output["to"] = [ marshal_CreateEmailRequestAddress(item, defaults) for item in request.to diff --git a/scaleway-async/scaleway_async/tem/v1alpha1/types.py b/scaleway-async/scaleway_async/tem/v1alpha1/types.py index e76fb1db..1fa1cf64 100644 --- a/scaleway-async/scaleway_async/tem/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/tem/v1alpha1/types.py @@ -642,6 +642,11 @@ class CreateDomainRequest: @dataclass class CreateEmailRequest: + from_: CreateEmailRequestAddress + """ + Sender information. Must be from a checked domain declared in the Project. + """ + subject: str """ Subject of the email. @@ -662,11 +667,6 @@ class CreateEmailRequest: Region to target. If none is passed will use default region from the config. """ - from_: Optional[CreateEmailRequestAddress] - """ - Sender information. Must be from a checked domain declared in the Project. - """ - to: Optional[List[CreateEmailRequestAddress]] """ An array of the primary recipient's information. diff --git a/scaleway/scaleway/tem/v1alpha1/api.py b/scaleway/scaleway/tem/v1alpha1/api.py index 229bf831..ccd002d2 100644 --- a/scaleway/scaleway/tem/v1alpha1/api.py +++ b/scaleway/scaleway/tem/v1alpha1/api.py @@ -70,11 +70,11 @@ class TemV1Alpha1API(API): def create_email( self, *, + from_: CreateEmailRequestAddress, subject: str, text: str, html: str, region: Optional[Region] = None, - from_: Optional[CreateEmailRequestAddress] = None, to: Optional[List[CreateEmailRequestAddress]] = None, cc: Optional[List[CreateEmailRequestAddress]] = None, bcc: Optional[List[CreateEmailRequestAddress]] = None, @@ -86,11 +86,11 @@ def create_email( """ Send an email. You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters. + :param from_: Sender information. Must be from a checked domain declared in the Project. :param subject: Subject of the email. :param text: Text content. :param html: HTML content. :param region: Region to target. If none is passed will use default region from the config. - :param from_: Sender information. Must be from a checked domain declared in the Project. :param to: An array of the primary recipient's information. :param cc: An array of the carbon copy recipient's information. :param bcc: An array of the blind carbon copy recipient's information. @@ -104,6 +104,7 @@ def create_email( :: result = api.create_email( + from=CreateEmailRequestAddress(), subject="example", text="example", html="example", @@ -119,11 +120,11 @@ def create_email( f"/transactional-email/v1alpha1/regions/{param_region}/emails", body=marshal_CreateEmailRequest( CreateEmailRequest( + from_=from_, subject=subject, text=text, html=html, region=region, - from_=from_, to=to, cc=cc, bcc=bcc, diff --git a/scaleway/scaleway/tem/v1alpha1/marshalling.py b/scaleway/scaleway/tem/v1alpha1/marshalling.py index 6941bd76..b5e32ae1 100644 --- a/scaleway/scaleway/tem/v1alpha1/marshalling.py +++ b/scaleway/scaleway/tem/v1alpha1/marshalling.py @@ -789,6 +789,9 @@ def marshal_CreateEmailRequest( ) -> Dict[str, Any]: output: Dict[str, Any] = {} + if request.from_ is not None: + output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults) + if request.subject is not None: output["subject"] = request.subject @@ -798,9 +801,6 @@ def marshal_CreateEmailRequest( if request.html is not None: output["html"] = request.html - if request.from_ is not None: - output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults) - if request.to is not None: output["to"] = [ marshal_CreateEmailRequestAddress(item, defaults) for item in request.to diff --git a/scaleway/scaleway/tem/v1alpha1/types.py b/scaleway/scaleway/tem/v1alpha1/types.py index e76fb1db..1fa1cf64 100644 --- a/scaleway/scaleway/tem/v1alpha1/types.py +++ b/scaleway/scaleway/tem/v1alpha1/types.py @@ -642,6 +642,11 @@ class CreateDomainRequest: @dataclass class CreateEmailRequest: + from_: CreateEmailRequestAddress + """ + Sender information. Must be from a checked domain declared in the Project. + """ + subject: str """ Subject of the email. @@ -662,11 +667,6 @@ class CreateEmailRequest: Region to target. If none is passed will use default region from the config. """ - from_: Optional[CreateEmailRequestAddress] - """ - Sender information. Must be from a checked domain declared in the Project. - """ - to: Optional[List[CreateEmailRequestAddress]] """ An array of the primary recipient's information.