Skip to content

feat: update generated APIs #552

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

Merged
merged 1 commit into from
Jun 17, 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
38 changes: 38 additions & 0 deletions scaleway-async/scaleway_async/tem/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
ListEmailsRequestOrderBy,
ListWebhookEventsRequestOrderBy,
ListWebhooksRequestOrderBy,
WebhookEventStatus,
WebhookEventType,
CreateDomainRequest,
CreateEmailRequest,
Expand Down Expand Up @@ -929,13 +930,25 @@ async def list_webhook_events(
order_by: Optional[ListWebhookEventsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
email_id: Optional[str] = None,
event_types: Optional[List[WebhookEventType]] = None,
statuses: Optional[List[WebhookEventStatus]] = None,
project_id: Optional[str] = None,
organization_id: Optional[str] = None,
domain_id: Optional[str] = None,
) -> ListWebhookEventsResponse:
"""
:param webhook_id: ID of the Webhook linked to the events.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by: (Optional) List Webhook events corresponding to specific criteria.
:param page: Requested page number. Value must be greater or equal to 1.
:param page_size: Requested page size. Value must be between 1 and 100.
:param email_id: ID of the email linked to the events.
:param event_types: List of event types linked to the events.
:param statuses: List of event statuses.
:param project_id: ID of the webhook Project.
:param organization_id: ID of the webhook Organization.
:param domain_id: ID of the domain to watch for triggering events.
:return: :class:`ListWebhookEventsResponse <ListWebhookEventsResponse>`

Usage:
Expand All @@ -955,9 +968,16 @@ async def list_webhook_events(
"GET",
f"/transactional-email/v1alpha1/regions/{param_region}/webhooks/{param_webhook_id}/events",
params={
"domain_id": domain_id,
"email_id": email_id,
"event_types": event_types,
"order_by": order_by,
"organization_id": organization_id
or self.client.default_organization_id,
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
"statuses": statuses,
},
)

Expand All @@ -972,13 +992,25 @@ async def list_webhook_events_all(
order_by: Optional[ListWebhookEventsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
email_id: Optional[str] = None,
event_types: Optional[List[WebhookEventType]] = None,
statuses: Optional[List[WebhookEventStatus]] = None,
project_id: Optional[str] = None,
organization_id: Optional[str] = None,
domain_id: Optional[str] = None,
) -> List[WebhookEvent]:
"""
:param webhook_id: ID of the Webhook linked to the events.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by: (Optional) List Webhook events corresponding to specific criteria.
:param page: Requested page number. Value must be greater or equal to 1.
:param page_size: Requested page size. Value must be between 1 and 100.
:param email_id: ID of the email linked to the events.
:param event_types: List of event types linked to the events.
:param statuses: List of event statuses.
:param project_id: ID of the webhook Project.
:param organization_id: ID of the webhook Organization.
:param domain_id: ID of the domain to watch for triggering events.
:return: :class:`List[WebhookEvent] <List[WebhookEvent]>`

Usage:
Expand All @@ -999,5 +1031,11 @@ async def list_webhook_events_all(
"order_by": order_by,
"page": page,
"page_size": page_size,
"email_id": email_id,
"event_types": event_types,
"statuses": statuses,
"project_id": project_id,
"organization_id": organization_id,
"domain_id": domain_id,
},
)
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ def unmarshal_WebhookEvent(data: Any) -> WebhookEvent:
if field is not None:
args["project_id"] = field

field = data.get("domain_id", None)
if field is not None:
args["domain_id"] = field

field = data.get("type", None)
if field is not None:
args["type_"] = field
Expand Down
35 changes: 35 additions & 0 deletions scaleway-async/scaleway_async/tem/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ class WebhookEvent:
ID of the Webhook Event Project.
"""

domain_id: str
"""
ID of the webhook event domain.
"""

type_: WebhookEventType
"""
Type of the Webhook Event.
Expand Down Expand Up @@ -987,6 +992,36 @@ class ListWebhookEventsRequest:
Requested page size. Value must be between 1 and 100.
"""

email_id: Optional[str]
"""
ID of the email linked to the events.
"""

event_types: Optional[List[WebhookEventType]]
"""
List of event types linked to the events.
"""

statuses: Optional[List[WebhookEventStatus]]
"""
List of event statuses.
"""

project_id: Optional[str]
"""
ID of the webhook Project.
"""

organization_id: Optional[str]
"""
ID of the webhook Organization.
"""

domain_id: Optional[str]
"""
ID of the domain to watch for triggering events.
"""


@dataclass
class ListWebhookEventsResponse:
Expand Down
38 changes: 38 additions & 0 deletions scaleway/scaleway/tem/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
ListEmailsRequestOrderBy,
ListWebhookEventsRequestOrderBy,
ListWebhooksRequestOrderBy,
WebhookEventStatus,
WebhookEventType,
CreateDomainRequest,
CreateEmailRequest,
Expand Down Expand Up @@ -929,13 +930,25 @@ def list_webhook_events(
order_by: Optional[ListWebhookEventsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
email_id: Optional[str] = None,
event_types: Optional[List[WebhookEventType]] = None,
statuses: Optional[List[WebhookEventStatus]] = None,
project_id: Optional[str] = None,
organization_id: Optional[str] = None,
domain_id: Optional[str] = None,
) -> ListWebhookEventsResponse:
"""
:param webhook_id: ID of the Webhook linked to the events.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by: (Optional) List Webhook events corresponding to specific criteria.
:param page: Requested page number. Value must be greater or equal to 1.
:param page_size: Requested page size. Value must be between 1 and 100.
:param email_id: ID of the email linked to the events.
:param event_types: List of event types linked to the events.
:param statuses: List of event statuses.
:param project_id: ID of the webhook Project.
:param organization_id: ID of the webhook Organization.
:param domain_id: ID of the domain to watch for triggering events.
:return: :class:`ListWebhookEventsResponse <ListWebhookEventsResponse>`

Usage:
Expand All @@ -955,9 +968,16 @@ def list_webhook_events(
"GET",
f"/transactional-email/v1alpha1/regions/{param_region}/webhooks/{param_webhook_id}/events",
params={
"domain_id": domain_id,
"email_id": email_id,
"event_types": event_types,
"order_by": order_by,
"organization_id": organization_id
or self.client.default_organization_id,
"page": page,
"page_size": page_size or self.client.default_page_size,
"project_id": project_id or self.client.default_project_id,
"statuses": statuses,
},
)

Expand All @@ -972,13 +992,25 @@ def list_webhook_events_all(
order_by: Optional[ListWebhookEventsRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
email_id: Optional[str] = None,
event_types: Optional[List[WebhookEventType]] = None,
statuses: Optional[List[WebhookEventStatus]] = None,
project_id: Optional[str] = None,
organization_id: Optional[str] = None,
domain_id: Optional[str] = None,
) -> List[WebhookEvent]:
"""
:param webhook_id: ID of the Webhook linked to the events.
:param region: Region to target. If none is passed will use default region from the config.
:param order_by: (Optional) List Webhook events corresponding to specific criteria.
:param page: Requested page number. Value must be greater or equal to 1.
:param page_size: Requested page size. Value must be between 1 and 100.
:param email_id: ID of the email linked to the events.
:param event_types: List of event types linked to the events.
:param statuses: List of event statuses.
:param project_id: ID of the webhook Project.
:param organization_id: ID of the webhook Organization.
:param domain_id: ID of the domain to watch for triggering events.
:return: :class:`List[WebhookEvent] <List[WebhookEvent]>`

Usage:
Expand All @@ -999,5 +1031,11 @@ def list_webhook_events_all(
"order_by": order_by,
"page": page,
"page_size": page_size,
"email_id": email_id,
"event_types": event_types,
"statuses": statuses,
"project_id": project_id,
"organization_id": organization_id,
"domain_id": domain_id,
},
)
4 changes: 4 additions & 0 deletions scaleway/scaleway/tem/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ def unmarshal_WebhookEvent(data: Any) -> WebhookEvent:
if field is not None:
args["project_id"] = field

field = data.get("domain_id", None)
if field is not None:
args["domain_id"] = field

field = data.get("type", None)
if field is not None:
args["type_"] = field
Expand Down
35 changes: 35 additions & 0 deletions scaleway/scaleway/tem/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ class WebhookEvent:
ID of the Webhook Event Project.
"""

domain_id: str
"""
ID of the webhook event domain.
"""

type_: WebhookEventType
"""
Type of the Webhook Event.
Expand Down Expand Up @@ -987,6 +992,36 @@ class ListWebhookEventsRequest:
Requested page size. Value must be between 1 and 100.
"""

email_id: Optional[str]
"""
ID of the email linked to the events.
"""

event_types: Optional[List[WebhookEventType]]
"""
List of event types linked to the events.
"""

statuses: Optional[List[WebhookEventStatus]]
"""
List of event statuses.
"""

project_id: Optional[str]
"""
ID of the webhook Project.
"""

organization_id: Optional[str]
"""
ID of the webhook Organization.
"""

domain_id: Optional[str]
"""
ID of the domain to watch for triggering events.
"""


@dataclass
class ListWebhookEventsResponse:
Expand Down