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

Generator: Update SDK /services/lbapplication #628

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Release (2025-XX-XX)

- `lbapplication`: [v0.3.0](services/lbapplication/CHANGELOG.md#v030-2025-02-07)
- **Bugfix**: Set type from interface to int64 of `HealthyThreshold`, `UnhealthyThreshold`, `MaxLoadBalancers`, `Port`, `MaxConnections`, `Code` and `TargetPort`
- `ske`: [v0.3.0](services/ske/CHANGELOG.md#v030-2025-02-06)
- **Removal:** The following methods were removed after deprecation (2024-04-16) and [`serviceenablement` SDK](https://github.com/stackitcloud/stackit-sdk-python/tree/main/services/serviceenablement) must be used instead.
- `DisableService`
Expand Down
4 changes: 4 additions & 0 deletions services/lbapplication/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.3.0 (2025-02-07)

- **Bugfix**: Set type from interface to int64 of `HealthyThreshold`, `UnhealthyThreshold`, `MaxLoadBalancers`, `Port`, `MaxConnections`, `Code` and `TargetPort`

## v0.2.1 (2025-01-14)

- **Bugfix**: `configuration.py` region adjustment was missing
Expand Down
2 changes: 1 addition & 1 deletion services/lbapplication/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "stackit-lbapplication"

[tool.poetry]
name = "stackit-lbapplication"
version = "v0.2.1"
version = "v0.3.0"
authors = [
"STACKIT Developer Tools <[email protected]>",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator
from typing_extensions import Annotated, Self

from stackit.lbapplication.models.http_health_checks import HttpHealthChecks
Expand All @@ -29,7 +29,7 @@ class ActiveHealthCheck(BaseModel):
ActiveHealthCheck
"""

healthy_threshold: Optional[Any] = Field(
healthy_threshold: Optional[StrictInt] = Field(
default=None, description="Healthy threshold of the health checking", alias="healthyThreshold"
)
http_health_checks: Optional[HttpHealthChecks] = Field(default=None, alias="httpHealthChecks")
Expand All @@ -44,7 +44,7 @@ class ActiveHealthCheck(BaseModel):
timeout: Optional[Annotated[str, Field(strict=True)]] = Field(
default=None, description="Active health checking timeout duration in seconds"
)
unhealthy_threshold: Optional[Any] = Field(
unhealthy_threshold: Optional[StrictInt] = Field(
default=None, description="Unhealthy threshold of the health checking", alias="unhealthyThreshold"
)
__properties: ClassVar[List[str]] = [
Expand Down Expand Up @@ -126,16 +126,6 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of http_health_checks
if self.http_health_checks:
_dict["httpHealthChecks"] = self.http_health_checks.to_dict()
# set to None if healthy_threshold (nullable) is None
# and model_fields_set contains the field
if self.healthy_threshold is None and "healthy_threshold" in self.model_fields_set:
_dict["healthyThreshold"] = None

# set to None if unhealthy_threshold (nullable) is None
# and model_fields_set contains the field
if self.unhealthy_threshold is None and "unhealthy_threshold" in self.model_fields_set:
_dict["unhealthyThreshold"] = None

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GetQuotaResponse(BaseModel):
GetQuotaResponse
"""

max_load_balancers: Optional[Any] = Field(
max_load_balancers: Optional[Annotated[int, Field(le=999, strict=True, ge=-1)]] = Field(
default=None,
description="The maximum number of load balancing servers in this project. Unlimited if set to -1.",
alias="maxLoadBalancers",
Expand Down Expand Up @@ -91,11 +91,6 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if max_load_balancers (nullable) is None
# and model_fields_set contains the field
if self.max_load_balancers is None and "max_load_balancers" in self.model_fields_set:
_dict["maxLoadBalancers"] = None

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing_extensions import Self
from typing_extensions import Annotated, Self

from stackit.lbapplication.models.protocol_options_https import ProtocolOptionsHTTPS
from stackit.lbapplication.models.rule import Rule
Expand All @@ -36,7 +36,9 @@ class Listener(BaseModel):
default=None,
description="Will be used to reference a listener and will replace display name in the future. Currently uses <protocol>-<port> as the name if no display name is given.",
)
port: Optional[Any] = Field(default=None, description="Port number where we listen for traffic")
port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(
default=None, description="Port number where we listen for traffic"
)
protocol: Optional[StrictStr] = Field(
default=None,
description="Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported.",
Expand Down Expand Up @@ -108,11 +110,6 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict["rules"] = _items
# set to None if port (nullable) is None
# and model_fields_set contains the field
if self.port is None and "port" in self.model_fields_set:
_dict["port"] = None

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing_extensions import Self


Expand All @@ -28,7 +28,7 @@ class PlanDetails(BaseModel):

description: Optional[StrictStr] = Field(default=None, description="Description")
flavor_name: Optional[StrictStr] = Field(default=None, description="Flavor Name", alias="flavorName")
max_connections: Optional[Any] = Field(
max_connections: Optional[StrictInt] = Field(
default=None,
description="Maximum number of concurrent connections per application load balancer VM instance.",
alias="maxConnections",
Expand Down Expand Up @@ -74,11 +74,6 @@ def to_dict(self) -> Dict[str, Any]:
exclude=excluded_fields,
exclude_none=True,
)
# set to None if max_connections (nullable) is None
# and model_fields_set contains the field
if self.max_connections is None and "max_connections" in self.model_fields_set:
_dict["maxConnections"] = None

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing_extensions import Self

from stackit.lbapplication.models.google_protobuf_any import GoogleProtobufAny
Expand All @@ -28,7 +28,7 @@ class Status(BaseModel):
The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
"""

code: Optional[Any] = Field(
code: Optional[StrictInt] = Field(
default=None,
description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].",
)
Expand Down Expand Up @@ -86,11 +86,6 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict["details"] = _items
# set to None if code (nullable) is None
# and model_fields_set contains the field
if self.code is None and "code" in self.model_fields_set:
_dict["code"] = None

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TargetPool(BaseModel):

active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck")
name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name")
target_port: Optional[Any] = Field(
target_port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(
default=None,
description="The number identifying the port where each target listens for traffic.",
alias="targetPort",
Expand Down Expand Up @@ -99,11 +99,6 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict["targets"] = _items
# set to None if target_port (nullable) is None
# and model_fields_set contains the field
if self.target_port is None and "target_port" in self.model_fields_set:
_dict["targetPort"] = None

return _dict

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UpdateTargetPoolPayload(BaseModel):

active_health_check: Optional[ActiveHealthCheck] = Field(default=None, alias="activeHealthCheck")
name: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Target pool name")
target_port: Optional[Any] = Field(
target_port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(
default=None,
description="The number identifying the port where each target listens for traffic.",
alias="targetPort",
Expand Down Expand Up @@ -99,11 +99,6 @@ def to_dict(self) -> Dict[str, Any]:
if _item:
_items.append(_item.to_dict())
_dict["targets"] = _items
# set to None if target_port (nullable) is None
# and model_fields_set contains the field
if self.target_port is None and "target_port" in self.model_fields_set:
_dict["targetPort"] = None

return _dict

@classmethod
Expand Down
Loading