stackit-loadbalancer 0.2.3__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/PKG-INFO +1 -1
  2. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/pyproject.toml +1 -1
  3. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/__init__.py +1 -0
  4. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/api/default_api.py +6 -6
  5. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/__init__.py +1 -0
  6. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/create_load_balancer_payload.py +17 -0
  7. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/load_balancer.py +17 -0
  8. stackit_loadbalancer-0.3.0/src/stackit/loadbalancer/models/security_group.py +82 -0
  9. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/update_load_balancer_payload.py +17 -0
  10. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/LICENSE.md +0 -0
  11. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/NOTICE.txt +0 -0
  12. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/README.md +0 -0
  13. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/api/__init__.py +0 -0
  14. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/api_client.py +0 -0
  15. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/api_response.py +0 -0
  16. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/configuration.py +0 -0
  17. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/exceptions.py +0 -0
  18. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/active_health_check.py +0 -0
  19. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/create_credentials_payload.py +0 -0
  20. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/create_credentials_response.py +0 -0
  21. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/credentials_response.py +0 -0
  22. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/get_credentials_response.py +0 -0
  23. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/get_quota_response.py +0 -0
  24. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/google_protobuf_any.py +0 -0
  25. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/list_credentials_response.py +0 -0
  26. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/list_load_balancers_response.py +0 -0
  27. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/list_plans_response.py +0 -0
  28. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/listener.py +0 -0
  29. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/load_balancer_error.py +0 -0
  30. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/load_balancer_options.py +0 -0
  31. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/loadbalancer_option_access_control.py +0 -0
  32. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/loadbalancer_option_logs.py +0 -0
  33. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/loadbalancer_option_metrics.py +0 -0
  34. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/loadbalancer_option_observability.py +0 -0
  35. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/network.py +0 -0
  36. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/options_tcp.py +0 -0
  37. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/options_udp.py +0 -0
  38. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/plan_details.py +0 -0
  39. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/server_name_indicator.py +0 -0
  40. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/session_persistence.py +0 -0
  41. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/status.py +0 -0
  42. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/target.py +0 -0
  43. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/target_pool.py +0 -0
  44. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/update_credentials_payload.py +0 -0
  45. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/update_credentials_response.py +0 -0
  46. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/models/update_target_pool_payload.py +0 -0
  47. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/py.typed +0 -0
  48. {stackit_loadbalancer-0.2.3 → stackit_loadbalancer-0.3.0}/src/stackit/loadbalancer/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stackit-loadbalancer
3
- Version: 0.2.3
3
+ Version: 0.3.0
4
4
  Summary: Load Balancer API
5
5
  Author: STACKIT Developer Tools
6
6
  Author-email: developer-tools@stackit.cloud
@@ -3,7 +3,7 @@ name = "stackit-loadbalancer"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "stackit-loadbalancer"
6
- version = "v0.2.3"
6
+ version = "v0.3.0"
7
7
  authors = [
8
8
  "STACKIT Developer Tools <developer-tools@stackit.cloud>",
9
9
  ]
@@ -72,6 +72,7 @@ from stackit.loadbalancer.models.network import Network
72
72
  from stackit.loadbalancer.models.options_tcp import OptionsTCP
73
73
  from stackit.loadbalancer.models.options_udp import OptionsUDP
74
74
  from stackit.loadbalancer.models.plan_details import PlanDetails
75
+ from stackit.loadbalancer.models.security_group import SecurityGroup
75
76
  from stackit.loadbalancer.models.server_name_indicator import ServerNameIndicator
76
77
  from stackit.loadbalancer.models.session_persistence import SessionPersistence
77
78
  from stackit.loadbalancer.models.status import Status
@@ -1745,9 +1745,9 @@ class DefaultApi:
1745
1745
  _headers: Optional[Dict[StrictStr, Any]] = None,
1746
1746
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1747
1747
  ) -> GetQuotaResponse:
1748
- """Get the quota of Load Balancers and Target Pools in a project.
1748
+ """Get the quota of Load Balancers in a project.
1749
1749
 
1750
- GetQuota gets the configured load balancer quota for the project. Default is 3.
1750
+ Retrieves the configured Load Balancer quota for the project. Limit can be changed via service request. There can be 3 times as many observability credentials as Load Balancers.
1751
1751
 
1752
1752
  :param project_id: (required)
1753
1753
  :type project_id: str
@@ -1813,9 +1813,9 @@ class DefaultApi:
1813
1813
  _headers: Optional[Dict[StrictStr, Any]] = None,
1814
1814
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1815
1815
  ) -> ApiResponse[GetQuotaResponse]:
1816
- """Get the quota of Load Balancers and Target Pools in a project.
1816
+ """Get the quota of Load Balancers in a project.
1817
1817
 
1818
- GetQuota gets the configured load balancer quota for the project. Default is 3.
1818
+ Retrieves the configured Load Balancer quota for the project. Limit can be changed via service request. There can be 3 times as many observability credentials as Load Balancers.
1819
1819
 
1820
1820
  :param project_id: (required)
1821
1821
  :type project_id: str
@@ -1881,9 +1881,9 @@ class DefaultApi:
1881
1881
  _headers: Optional[Dict[StrictStr, Any]] = None,
1882
1882
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1883
1883
  ) -> RESTResponseType:
1884
- """Get the quota of Load Balancers and Target Pools in a project.
1884
+ """Get the quota of Load Balancers in a project.
1885
1885
 
1886
- GetQuota gets the configured load balancer quota for the project. Default is 3.
1886
+ Retrieves the configured Load Balancer quota for the project. Limit can be changed via service request. There can be 3 times as many observability credentials as Load Balancers.
1887
1887
 
1888
1888
  :param project_id: (required)
1889
1889
  :type project_id: str
@@ -53,6 +53,7 @@ from stackit.loadbalancer.models.network import Network
53
53
  from stackit.loadbalancer.models.options_tcp import OptionsTCP
54
54
  from stackit.loadbalancer.models.options_udp import OptionsUDP
55
55
  from stackit.loadbalancer.models.plan_details import PlanDetails
56
+ from stackit.loadbalancer.models.security_group import SecurityGroup
56
57
  from stackit.loadbalancer.models.server_name_indicator import ServerNameIndicator
57
58
  from stackit.loadbalancer.models.session_persistence import SessionPersistence
58
59
  from stackit.loadbalancer.models.status import Status
@@ -25,6 +25,7 @@ from stackit.loadbalancer.models.listener import Listener
25
25
  from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError
26
26
  from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions
27
27
  from stackit.loadbalancer.models.network import Network
28
+ from stackit.loadbalancer.models.security_group import SecurityGroup
28
29
  from stackit.loadbalancer.models.target_pool import TargetPool
29
30
 
30
31
 
@@ -70,6 +71,11 @@ class CreateLoadBalancerPayload(BaseModel):
70
71
  description="List of all target pools which will be used in the load balancer. Limited to 20.",
71
72
  alias="targetPools",
72
73
  )
74
+ target_security_group: Optional[SecurityGroup] = Field(
75
+ default=None,
76
+ description="Security Group permitting network traffic from the LoadBalancer to the targets.",
77
+ alias="targetSecurityGroup",
78
+ )
73
79
  version: Optional[StrictStr] = Field(
74
80
  default=None,
75
81
  description="Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case.",
@@ -86,6 +92,7 @@ class CreateLoadBalancerPayload(BaseModel):
86
92
  "region",
87
93
  "status",
88
94
  "targetPools",
95
+ "targetSecurityGroup",
89
96
  "version",
90
97
  ]
91
98
 
@@ -146,6 +153,7 @@ class CreateLoadBalancerPayload(BaseModel):
146
153
  * OpenAPI `readOnly` fields are excluded.
147
154
  * OpenAPI `readOnly` fields are excluded.
148
155
  * OpenAPI `readOnly` fields are excluded.
156
+ * OpenAPI `readOnly` fields are excluded.
149
157
  """
150
158
  excluded_fields: Set[str] = set(
151
159
  [
@@ -153,6 +161,7 @@ class CreateLoadBalancerPayload(BaseModel):
153
161
  "private_address",
154
162
  "region",
155
163
  "status",
164
+ "target_security_group",
156
165
  ]
157
166
  )
158
167
 
@@ -192,6 +201,9 @@ class CreateLoadBalancerPayload(BaseModel):
192
201
  if _item:
193
202
  _items.append(_item.to_dict())
194
203
  _dict["targetPools"] = _items
204
+ # override the default output from pydantic by calling `to_dict()` of target_security_group
205
+ if self.target_security_group:
206
+ _dict["targetSecurityGroup"] = self.target_security_group.to_dict()
195
207
  return _dict
196
208
 
197
209
  @classmethod
@@ -230,6 +242,11 @@ class CreateLoadBalancerPayload(BaseModel):
230
242
  if obj.get("targetPools") is not None
231
243
  else None
232
244
  ),
245
+ "targetSecurityGroup": (
246
+ SecurityGroup.from_dict(obj["targetSecurityGroup"])
247
+ if obj.get("targetSecurityGroup") is not None
248
+ else None
249
+ ),
233
250
  "version": obj.get("version"),
234
251
  }
235
252
  )
@@ -25,6 +25,7 @@ from stackit.loadbalancer.models.listener import Listener
25
25
  from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError
26
26
  from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions
27
27
  from stackit.loadbalancer.models.network import Network
28
+ from stackit.loadbalancer.models.security_group import SecurityGroup
28
29
  from stackit.loadbalancer.models.target_pool import TargetPool
29
30
 
30
31
 
@@ -70,6 +71,11 @@ class LoadBalancer(BaseModel):
70
71
  description="List of all target pools which will be used in the load balancer. Limited to 20.",
71
72
  alias="targetPools",
72
73
  )
74
+ target_security_group: Optional[SecurityGroup] = Field(
75
+ default=None,
76
+ description="Security Group permitting network traffic from the LoadBalancer to the targets.",
77
+ alias="targetSecurityGroup",
78
+ )
73
79
  version: Optional[StrictStr] = Field(
74
80
  default=None,
75
81
  description="Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case.",
@@ -86,6 +92,7 @@ class LoadBalancer(BaseModel):
86
92
  "region",
87
93
  "status",
88
94
  "targetPools",
95
+ "targetSecurityGroup",
89
96
  "version",
90
97
  ]
91
98
 
@@ -146,6 +153,7 @@ class LoadBalancer(BaseModel):
146
153
  * OpenAPI `readOnly` fields are excluded.
147
154
  * OpenAPI `readOnly` fields are excluded.
148
155
  * OpenAPI `readOnly` fields are excluded.
156
+ * OpenAPI `readOnly` fields are excluded.
149
157
  """
150
158
  excluded_fields: Set[str] = set(
151
159
  [
@@ -153,6 +161,7 @@ class LoadBalancer(BaseModel):
153
161
  "private_address",
154
162
  "region",
155
163
  "status",
164
+ "target_security_group",
156
165
  ]
157
166
  )
158
167
 
@@ -192,6 +201,9 @@ class LoadBalancer(BaseModel):
192
201
  if _item:
193
202
  _items.append(_item.to_dict())
194
203
  _dict["targetPools"] = _items
204
+ # override the default output from pydantic by calling `to_dict()` of target_security_group
205
+ if self.target_security_group:
206
+ _dict["targetSecurityGroup"] = self.target_security_group.to_dict()
195
207
  return _dict
196
208
 
197
209
  @classmethod
@@ -230,6 +242,11 @@ class LoadBalancer(BaseModel):
230
242
  if obj.get("targetPools") is not None
231
243
  else None
232
244
  ),
245
+ "targetSecurityGroup": (
246
+ SecurityGroup.from_dict(obj["targetSecurityGroup"])
247
+ if obj.get("targetSecurityGroup") is not None
248
+ else None
249
+ ),
233
250
  "version": obj.get("version"),
234
251
  }
235
252
  )
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Load Balancer API
5
+
6
+ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501 docstring might be too long
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ from typing import Any, ClassVar, Dict, List, Optional, Set
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing_extensions import Self
22
+
23
+
24
+ class SecurityGroup(BaseModel):
25
+ """
26
+ SecurityGroup
27
+ """
28
+
29
+ id: Optional[StrictStr] = Field(default=None, description="ID of the security Group")
30
+ name: Optional[StrictStr] = Field(default=None, description="Name of the security Group")
31
+ __properties: ClassVar[List[str]] = ["id", "name"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of SecurityGroup from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of SecurityGroup from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")})
82
+ return _obj
@@ -25,6 +25,7 @@ from stackit.loadbalancer.models.listener import Listener
25
25
  from stackit.loadbalancer.models.load_balancer_error import LoadBalancerError
26
26
  from stackit.loadbalancer.models.load_balancer_options import LoadBalancerOptions
27
27
  from stackit.loadbalancer.models.network import Network
28
+ from stackit.loadbalancer.models.security_group import SecurityGroup
28
29
  from stackit.loadbalancer.models.target_pool import TargetPool
29
30
 
30
31
 
@@ -70,6 +71,11 @@ class UpdateLoadBalancerPayload(BaseModel):
70
71
  description="List of all target pools which will be used in the load balancer. Limited to 20.",
71
72
  alias="targetPools",
72
73
  )
74
+ target_security_group: Optional[SecurityGroup] = Field(
75
+ default=None,
76
+ description="Security Group permitting network traffic from the LoadBalancer to the targets.",
77
+ alias="targetSecurityGroup",
78
+ )
73
79
  version: Optional[StrictStr] = Field(
74
80
  default=None,
75
81
  description="Load balancer resource version. Must be empty or unset for creating load balancers, non-empty for updating load balancers. Semantics: While retrieving load balancers, this is the current version of this load balancer resource that changes during updates of the load balancers. On updates this field specified the load balancer version you calculated your update for instead of the future version to enable concurrency safe updates. Update calls will then report the new version in their result as you would see with a load balancer retrieval call later. There exist no total order of the version, so you can only compare it for equality, but not for less/greater than another version. Since the creation of load balancer is always intended to create the first version of it, there should be no existing version. That's why this field must by empty of not present in that case.",
@@ -86,6 +92,7 @@ class UpdateLoadBalancerPayload(BaseModel):
86
92
  "region",
87
93
  "status",
88
94
  "targetPools",
95
+ "targetSecurityGroup",
89
96
  "version",
90
97
  ]
91
98
 
@@ -146,6 +153,7 @@ class UpdateLoadBalancerPayload(BaseModel):
146
153
  * OpenAPI `readOnly` fields are excluded.
147
154
  * OpenAPI `readOnly` fields are excluded.
148
155
  * OpenAPI `readOnly` fields are excluded.
156
+ * OpenAPI `readOnly` fields are excluded.
149
157
  """
150
158
  excluded_fields: Set[str] = set(
151
159
  [
@@ -153,6 +161,7 @@ class UpdateLoadBalancerPayload(BaseModel):
153
161
  "private_address",
154
162
  "region",
155
163
  "status",
164
+ "target_security_group",
156
165
  ]
157
166
  )
158
167
 
@@ -192,6 +201,9 @@ class UpdateLoadBalancerPayload(BaseModel):
192
201
  if _item:
193
202
  _items.append(_item.to_dict())
194
203
  _dict["targetPools"] = _items
204
+ # override the default output from pydantic by calling `to_dict()` of target_security_group
205
+ if self.target_security_group:
206
+ _dict["targetSecurityGroup"] = self.target_security_group.to_dict()
195
207
  return _dict
196
208
 
197
209
  @classmethod
@@ -230,6 +242,11 @@ class UpdateLoadBalancerPayload(BaseModel):
230
242
  if obj.get("targetPools") is not None
231
243
  else None
232
244
  ),
245
+ "targetSecurityGroup": (
246
+ SecurityGroup.from_dict(obj["targetSecurityGroup"])
247
+ if obj.get("targetSecurityGroup") is not None
248
+ else None
249
+ ),
233
250
  "version": obj.get("version"),
234
251
  }
235
252
  )