Skip to content

Commit 9c178ea

Browse files
authored
feat: update generated APIs (#561)
1 parent f17307e commit 9c178ea

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ class TemV1Alpha1API(API):
7070
async def create_email(
7171
self,
7272
*,
73+
from_: CreateEmailRequestAddress,
7374
subject: str,
7475
text: str,
7576
html: str,
7677
region: Optional[Region] = None,
77-
from_: Optional[CreateEmailRequestAddress] = None,
7878
to: Optional[List[CreateEmailRequestAddress]] = None,
7979
cc: Optional[List[CreateEmailRequestAddress]] = None,
8080
bcc: Optional[List[CreateEmailRequestAddress]] = None,
@@ -86,11 +86,11 @@ async def create_email(
8686
"""
8787
Send an email.
8888
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.
89+
:param from_: Sender information. Must be from a checked domain declared in the Project.
8990
:param subject: Subject of the email.
9091
:param text: Text content.
9192
:param html: HTML content.
9293
:param region: Region to target. If none is passed will use default region from the config.
93-
:param from_: Sender information. Must be from a checked domain declared in the Project.
9494
:param to: An array of the primary recipient's information.
9595
:param cc: An array of the carbon copy recipient's information.
9696
:param bcc: An array of the blind carbon copy recipient's information.
@@ -104,6 +104,7 @@ async def create_email(
104104
::
105105
106106
result = await api.create_email(
107+
from=CreateEmailRequestAddress(),
107108
subject="example",
108109
text="example",
109110
html="example",
@@ -119,11 +120,11 @@ async def create_email(
119120
f"/transactional-email/v1alpha1/regions/{param_region}/emails",
120121
body=marshal_CreateEmailRequest(
121122
CreateEmailRequest(
123+
from_=from_,
122124
subject=subject,
123125
text=text,
124126
html=html,
125127
region=region,
126-
from_=from_,
127128
to=to,
128129
cc=cc,
129130
bcc=bcc,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,9 @@ def marshal_CreateEmailRequest(
789789
) -> Dict[str, Any]:
790790
output: Dict[str, Any] = {}
791791

792+
if request.from_ is not None:
793+
output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults)
794+
792795
if request.subject is not None:
793796
output["subject"] = request.subject
794797

@@ -798,9 +801,6 @@ def marshal_CreateEmailRequest(
798801
if request.html is not None:
799802
output["html"] = request.html
800803

801-
if request.from_ is not None:
802-
output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults)
803-
804804
if request.to is not None:
805805
output["to"] = [
806806
marshal_CreateEmailRequestAddress(item, defaults) for item in request.to

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,11 @@ class CreateDomainRequest:
642642

643643
@dataclass
644644
class CreateEmailRequest:
645+
from_: CreateEmailRequestAddress
646+
"""
647+
Sender information. Must be from a checked domain declared in the Project.
648+
"""
649+
645650
subject: str
646651
"""
647652
Subject of the email.
@@ -662,11 +667,6 @@ class CreateEmailRequest:
662667
Region to target. If none is passed will use default region from the config.
663668
"""
664669

665-
from_: Optional[CreateEmailRequestAddress]
666-
"""
667-
Sender information. Must be from a checked domain declared in the Project.
668-
"""
669-
670670
to: Optional[List[CreateEmailRequestAddress]]
671671
"""
672672
An array of the primary recipient's information.

scaleway/scaleway/tem/v1alpha1/api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ class TemV1Alpha1API(API):
7070
def create_email(
7171
self,
7272
*,
73+
from_: CreateEmailRequestAddress,
7374
subject: str,
7475
text: str,
7576
html: str,
7677
region: Optional[Region] = None,
77-
from_: Optional[CreateEmailRequestAddress] = None,
7878
to: Optional[List[CreateEmailRequestAddress]] = None,
7979
cc: Optional[List[CreateEmailRequestAddress]] = None,
8080
bcc: Optional[List[CreateEmailRequestAddress]] = None,
@@ -86,11 +86,11 @@ def create_email(
8686
"""
8787
Send an email.
8888
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.
89+
:param from_: Sender information. Must be from a checked domain declared in the Project.
8990
:param subject: Subject of the email.
9091
:param text: Text content.
9192
:param html: HTML content.
9293
:param region: Region to target. If none is passed will use default region from the config.
93-
:param from_: Sender information. Must be from a checked domain declared in the Project.
9494
:param to: An array of the primary recipient's information.
9595
:param cc: An array of the carbon copy recipient's information.
9696
:param bcc: An array of the blind carbon copy recipient's information.
@@ -104,6 +104,7 @@ def create_email(
104104
::
105105
106106
result = api.create_email(
107+
from=CreateEmailRequestAddress(),
107108
subject="example",
108109
text="example",
109110
html="example",
@@ -119,11 +120,11 @@ def create_email(
119120
f"/transactional-email/v1alpha1/regions/{param_region}/emails",
120121
body=marshal_CreateEmailRequest(
121122
CreateEmailRequest(
123+
from_=from_,
122124
subject=subject,
123125
text=text,
124126
html=html,
125127
region=region,
126-
from_=from_,
127128
to=to,
128129
cc=cc,
129130
bcc=bcc,

scaleway/scaleway/tem/v1alpha1/marshalling.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,9 @@ def marshal_CreateEmailRequest(
789789
) -> Dict[str, Any]:
790790
output: Dict[str, Any] = {}
791791

792+
if request.from_ is not None:
793+
output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults)
794+
792795
if request.subject is not None:
793796
output["subject"] = request.subject
794797

@@ -798,9 +801,6 @@ def marshal_CreateEmailRequest(
798801
if request.html is not None:
799802
output["html"] = request.html
800803

801-
if request.from_ is not None:
802-
output["from"] = marshal_CreateEmailRequestAddress(request.from_, defaults)
803-
804804
if request.to is not None:
805805
output["to"] = [
806806
marshal_CreateEmailRequestAddress(item, defaults) for item in request.to

scaleway/scaleway/tem/v1alpha1/types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,11 @@ class CreateDomainRequest:
642642

643643
@dataclass
644644
class CreateEmailRequest:
645+
from_: CreateEmailRequestAddress
646+
"""
647+
Sender information. Must be from a checked domain declared in the Project.
648+
"""
649+
645650
subject: str
646651
"""
647652
Subject of the email.
@@ -662,11 +667,6 @@ class CreateEmailRequest:
662667
Region to target. If none is passed will use default region from the config.
663668
"""
664669

665-
from_: Optional[CreateEmailRequestAddress]
666-
"""
667-
Sender information. Must be from a checked domain declared in the Project.
668-
"""
669-
670670
to: Optional[List[CreateEmailRequestAddress]]
671671
"""
672672
An array of the primary recipient's information.

0 commit comments

Comments
 (0)