Skip to content

Commit

Permalink
set EffectiveOutboundIPs as readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-schndr committed Jul 25, 2023
1 parent 9a25493 commit a1b608d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .sha256sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
239c63228da1db172f298cd81d0c3cc0d52ecca907915efe61be98c42b6d8f1d swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-04-01/redhatopenshift.json
1d167031baf0209fe8c46df9654585c64e8cc9a0c89555d7479c4ed6dc150251 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2022-09-04/redhatopenshift.json
622404e8311c62f27fba778e30e760bb1901e5bd221b23de72f449cafbdf0c45 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2023-04-01/redhatopenshift.json
33e4564add5a26c8cc2272f7988b5a8b58779c15528461bf721f349ce1d9805a swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2023-07-01-preview/redhatopenshift.json
3aede70b183bad612c23cb776fe5a932c5709334e1fe1ad7ff8772b58be3661f swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/preview/2023-07-01-preview/redhatopenshift.json
415605101b133e4277711cdac0dd5f95112fbffca2376c7728f35b6c9700f794 swagger/redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/stable/2023-09-04/redhatopenshift.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/swagger/typewalker.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ func (tw *typeWalker) schemaFromType(t types.Type, deps map[*types.Named]struct{
properties := tw.schemaFromType(field.Type(), deps)
properties.Description = strings.Trim(node.Doc.Text(), "\n")

if field.Name() == "EffectiveOutboundIPs" {
properties.ReadOnly = true
}

ns := NameSchema{
Name: name,
Schema: properties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ def __init__(
class LoadBalancerProfile(msrest.serialization.Model):
"""LoadBalancerProfile represents the profile of the cluster public load balancer.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar managed_outbound_ips: The desired managed outbound IPs for the cluster public load
balancer.
:vartype managed_outbound_ips:
Expand All @@ -294,6 +296,10 @@ class LoadBalancerProfile(msrest.serialization.Model):
:vartype allocated_outbound_ports: int
"""

_validation = {
'effective_outbound_ips': {'readonly': True},
}

_attribute_map = {
'managed_outbound_ips': {'key': 'managedOutboundIps', 'type': 'ManagedOutboundIPs'},
'effective_outbound_ips': {'key': 'effectiveOutboundIps', 'type': '[EffectiveOutboundIP]'},
Expand All @@ -311,10 +317,6 @@ def __init__(
balancer.
:paramtype managed_outbound_ips:
~azure.mgmt.redhatopenshift.v2023_07_01_preview.models.ManagedOutboundIPs
:keyword effective_outbound_ips: The list of effective outbound IP addresses of the public load
balancer.
:paramtype effective_outbound_ips:
list[~azure.mgmt.redhatopenshift.v2023_07_01_preview.models.EffectiveOutboundIP]
:keyword outbound_ips: The desired outbound IP resources for the cluster load balancer.
:paramtype outbound_ips:
list[~azure.mgmt.redhatopenshift.v2023_07_01_preview.models.OutboundIP]
Expand All @@ -328,7 +330,7 @@ def __init__(
"""
super(LoadBalancerProfile, self).__init__(**kwargs)
self.managed_outbound_ips = kwargs.get('managed_outbound_ips', None)
self.effective_outbound_ips = kwargs.get('effective_outbound_ips', None)
self.effective_outbound_ips = None
self.outbound_ips = kwargs.get('outbound_ips', None)
self.outbound_ip_prefixes = kwargs.get('outbound_ip_prefixes', None)
self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ def __init__(
class LoadBalancerProfile(msrest.serialization.Model):
"""LoadBalancerProfile represents the profile of the cluster public load balancer.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar managed_outbound_ips: The desired managed outbound IPs for the cluster public load
balancer.
:vartype managed_outbound_ips:
Expand All @@ -327,6 +329,10 @@ class LoadBalancerProfile(msrest.serialization.Model):
:vartype allocated_outbound_ports: int
"""

_validation = {
'effective_outbound_ips': {'readonly': True},
}

_attribute_map = {
'managed_outbound_ips': {'key': 'managedOutboundIps', 'type': 'ManagedOutboundIPs'},
'effective_outbound_ips': {'key': 'effectiveOutboundIps', 'type': '[EffectiveOutboundIP]'},
Expand All @@ -339,7 +345,6 @@ def __init__(
self,
*,
managed_outbound_ips: Optional["ManagedOutboundIPs"] = None,
effective_outbound_ips: Optional[List["EffectiveOutboundIP"]] = None,
outbound_ips: Optional[List["OutboundIP"]] = None,
outbound_ip_prefixes: Optional[List["OutboundIPPrefix"]] = None,
allocated_outbound_ports: Optional[int] = None,
Expand All @@ -350,10 +355,6 @@ def __init__(
balancer.
:paramtype managed_outbound_ips:
~azure.mgmt.redhatopenshift.v2023_07_01_preview.models.ManagedOutboundIPs
:keyword effective_outbound_ips: The list of effective outbound IP addresses of the public load
balancer.
:paramtype effective_outbound_ips:
list[~azure.mgmt.redhatopenshift.v2023_07_01_preview.models.EffectiveOutboundIP]
:keyword outbound_ips: The desired outbound IP resources for the cluster load balancer.
:paramtype outbound_ips:
list[~azure.mgmt.redhatopenshift.v2023_07_01_preview.models.OutboundIP]
Expand All @@ -367,7 +368,7 @@ def __init__(
"""
super(LoadBalancerProfile, self).__init__(**kwargs)
self.managed_outbound_ips = managed_outbound_ips
self.effective_outbound_ips = effective_outbound_ips
self.effective_outbound_ips = None
self.outbound_ips = outbound_ips
self.outbound_ip_prefixes = outbound_ip_prefixes
self.allocated_outbound_ports = allocated_outbound_ports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,7 @@
"items": {
"$ref": "#/definitions/EffectiveOutboundIP"
},
"readOnly": true,
"x-ms-identifiers": []
},
"outboundIps": {
Expand Down

0 comments on commit a1b608d

Please sign in to comment.