Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update generated APIs #561

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scaleway-async/scaleway_async/tem/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -104,6 +104,7 @@ async def create_email(
::

result = await api.create_email(
from=CreateEmailRequestAddress(),
subject="example",
text="example",
html="example",
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions scaleway-async/scaleway_async/tem/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions scaleway/scaleway/tem/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -104,6 +104,7 @@ def create_email(
::

result = api.create_email(
from=CreateEmailRequestAddress(),
subject="example",
text="example",
html="example",
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions scaleway/scaleway/tem/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions scaleway/scaleway/tem/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down