Skip to content

Commit

Permalink
feat(webhosting): add public v1 offer name and quota warning (scalewa…
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Dec 26, 2024
1 parent 2cf774e commit dff7dc2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scaleway-async/scaleway_async/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ def unmarshal_Offer(data: Any) -> Offer:
if field is not None:
args["id"] = field

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

field = data.get("billing_operation_path", None)
if field is not None:
args["billing_operation_path"] = field
Expand All @@ -388,6 +392,10 @@ def unmarshal_Offer(data: Any) -> Offer:
if field is not None:
args["end_of_life"] = field

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

field = data.get("price", None)
if field is not None:
args["price"] = unmarshal_Money(field)
Expand Down
13 changes: 13 additions & 0 deletions scaleway-async/scaleway_async/webhosting/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ class OfferOptionName(str, Enum, metaclass=StrEnumMeta):
RAM_GB = "ram_gb"
BACKUP = "backup"
DEDICATED_IP = "dedicated_ip"
EMAIL_STORAGE_GB = "email_storage_gb"
DATABASE_COUNT = "database_count"

def __str__(self) -> str:
return str(self.value)
Expand All @@ -160,6 +162,7 @@ def __str__(self) -> str:
class OfferOptionWarning(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_WARNING = "unknown_warning"
QUOTA_EXCEEDED_WARNING = "quota_exceeded_warning"
USAGE_LOW_WARNING = "usage_low_warning"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -357,6 +360,11 @@ class Offer:
Offer ID.
"""

name: str
"""
Offer name.
"""

billing_operation_path: str
"""
Unique identifier used for billing.
Expand All @@ -382,6 +390,11 @@ class Offer:
Indicates if the offer has reached its end of life.
"""

quota_warning: OfferOptionWarning
"""
Defines a warning if the maximum value for an option in the offer is exceeded.
"""

price: Optional[Money]
"""
Price of the offer.
Expand Down
8 changes: 8 additions & 0 deletions scaleway/scaleway/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ def unmarshal_Offer(data: Any) -> Offer:
if field is not None:
args["id"] = field

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

field = data.get("billing_operation_path", None)
if field is not None:
args["billing_operation_path"] = field
Expand All @@ -388,6 +392,10 @@ def unmarshal_Offer(data: Any) -> Offer:
if field is not None:
args["end_of_life"] = field

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

field = data.get("price", None)
if field is not None:
args["price"] = unmarshal_Money(field)
Expand Down
13 changes: 13 additions & 0 deletions scaleway/scaleway/webhosting/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ class OfferOptionName(str, Enum, metaclass=StrEnumMeta):
RAM_GB = "ram_gb"
BACKUP = "backup"
DEDICATED_IP = "dedicated_ip"
EMAIL_STORAGE_GB = "email_storage_gb"
DATABASE_COUNT = "database_count"

def __str__(self) -> str:
return str(self.value)
Expand All @@ -160,6 +162,7 @@ def __str__(self) -> str:
class OfferOptionWarning(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_WARNING = "unknown_warning"
QUOTA_EXCEEDED_WARNING = "quota_exceeded_warning"
USAGE_LOW_WARNING = "usage_low_warning"

def __str__(self) -> str:
return str(self.value)
Expand Down Expand Up @@ -357,6 +360,11 @@ class Offer:
Offer ID.
"""

name: str
"""
Offer name.
"""

billing_operation_path: str
"""
Unique identifier used for billing.
Expand All @@ -382,6 +390,11 @@ class Offer:
Indicates if the offer has reached its end of life.
"""

quota_warning: OfferOptionWarning
"""
Defines a warning if the maximum value for an option in the offer is exceeded.
"""

price: Optional[Money]
"""
Price of the offer.
Expand Down

0 comments on commit dff7dc2

Please sign in to comment.