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

[AutoPR azure-mgmt-rdbms] Fix: Capacity is a mandatory Property #597

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
from ._models_py3 import Resource
from ._models_py3 import Server
from ._models_py3 import ServerForCreate
from ._models_py3 import ServerPrivateEndpointConnection
from ._models_py3 import ServerPrivateEndpointConnectionProperties
from ._models_py3 import ServerPrivateLinkServiceConnectionStateProperty
from ._models_py3 import ServerPropertiesForCreate
from ._models_py3 import ServerPropertiesForDefaultCreate
from ._models_py3 import ServerPropertiesForGeoRestore
Expand Down Expand Up @@ -84,6 +87,9 @@
from ._models import Resource
from ._models import Server
from ._models import ServerForCreate
from ._models import ServerPrivateEndpointConnection
from ._models import ServerPrivateEndpointConnectionProperties
from ._models import ServerPrivateLinkServiceConnectionStateProperty
from ._models import ServerPropertiesForCreate
from ._models import ServerPropertiesForDefaultCreate
from ._models import ServerPropertiesForGeoRestore
Expand Down Expand Up @@ -116,9 +122,13 @@
from ._maria_db_management_client_enums import (
ServerVersion,
SslEnforcementEnum,
PrivateLinkServiceConnectionStateStatus,
PrivateLinkServiceConnectionStateActionsRequire,
PrivateEndpointProvisioningState,
ServerState,
GeoRedundantBackup,
StorageAutogrow,
PublicNetworkAccessEnum,
SkuTier,
VirtualNetworkRuleState,
OperationOrigin,
Expand Down Expand Up @@ -155,6 +165,9 @@
'Resource',
'Server',
'ServerForCreate',
'ServerPrivateEndpointConnection',
'ServerPrivateEndpointConnectionProperties',
'ServerPrivateLinkServiceConnectionStateProperty',
'ServerPropertiesForCreate',
'ServerPropertiesForDefaultCreate',
'ServerPropertiesForGeoRestore',
Expand Down Expand Up @@ -186,9 +199,13 @@
'PrivateLinkResourcePaged',
'ServerVersion',
'SslEnforcementEnum',
'PrivateLinkServiceConnectionStateStatus',
'PrivateLinkServiceConnectionStateActionsRequire',
'PrivateEndpointProvisioningState',
'ServerState',
'GeoRedundantBackup',
'StorageAutogrow',
'PublicNetworkAccessEnum',
'SkuTier',
'VirtualNetworkRuleState',
'OperationOrigin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ class SslEnforcementEnum(str, Enum):
disabled = "Disabled"


class PrivateLinkServiceConnectionStateStatus(str, Enum):

approved = "Approved"
pending = "Pending"
rejected = "Rejected"
disconnected = "Disconnected"


class PrivateLinkServiceConnectionStateActionsRequire(str, Enum):

none = "None"


class PrivateEndpointProvisioningState(str, Enum):

approving = "Approving"
ready = "Ready"
dropping = "Dropping"
failed = "Failed"
rejecting = "Rejecting"


class ServerState(str, Enum):

ready = "Ready"
Expand All @@ -43,6 +65,12 @@ class StorageAutogrow(str, Enum):
disabled = "Disabled"


class PublicNetworkAccessEnum(str, Enum):

enabled = "Enabled"
disabled = "Disabled"


class SkuTier(str, Enum):

basic = "Basic"
Expand Down
120 changes: 120 additions & 0 deletions sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,15 @@ class Server(TrackedResource):
:param replica_capacity: The maximum number of replicas that a master
server can have.
:type replica_capacity: int
:param public_network_access: Whether or not public endpoint access is
allowed for this server. Value is optional but if passed in, must be
'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled'
:type public_network_access: str or
~azure.mgmt.rdbms.mariadb.models.PublicNetworkAccessEnum
:ivar private_endpoint_connections: List of private endpoint connections
on a server
:vartype private_endpoint_connections:
list[~azure.mgmt.rdbms.mariadb.models.ServerPrivateEndpointConnection]
"""

_validation = {
Expand All @@ -1169,6 +1178,7 @@ class Server(TrackedResource):
'type': {'readonly': True},
'location': {'required': True},
'replica_capacity': {'minimum': 0},
'private_endpoint_connections': {'readonly': True},
}

_attribute_map = {
Expand All @@ -1188,6 +1198,8 @@ class Server(TrackedResource):
'replication_role': {'key': 'properties.replicationRole', 'type': 'str'},
'master_server_id': {'key': 'properties.masterServerId', 'type': 'str'},
'replica_capacity': {'key': 'properties.replicaCapacity', 'type': 'int'},
'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'},
'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'},
}

def __init__(self, **kwargs):
Expand All @@ -1203,6 +1215,8 @@ def __init__(self, **kwargs):
self.replication_role = kwargs.get('replication_role', None)
self.master_server_id = kwargs.get('master_server_id', None)
self.replica_capacity = kwargs.get('replica_capacity', None)
self.public_network_access = kwargs.get('public_network_access', None)
self.private_endpoint_connections = None


class ServerForCreate(Model):
Expand Down Expand Up @@ -1241,6 +1255,112 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)


class ServerPrivateEndpointConnection(Model):
"""A private endpoint connection under a server.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Resource Id of the private endpoint connection.
:vartype id: str
:ivar properties: Private endpoint connection properties
:vartype properties:
~azure.mgmt.rdbms.mariadb.models.ServerPrivateEndpointConnectionProperties
"""

_validation = {
'id': {'readonly': True},
'properties': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'ServerPrivateEndpointConnectionProperties'},
}

def __init__(self, **kwargs):
super(ServerPrivateEndpointConnection, self).__init__(**kwargs)
self.id = None
self.properties = None


class ServerPrivateEndpointConnectionProperties(Model):
"""Properties of a private endpoint connection.

Variables are only populated by the server, and will be ignored when
sending a request.

:param private_endpoint: Private endpoint which the connection belongs to.
:type private_endpoint:
~azure.mgmt.rdbms.mariadb.models.PrivateEndpointProperty
:param private_link_service_connection_state: Connection state of the
private endpoint connection.
:type private_link_service_connection_state:
~azure.mgmt.rdbms.mariadb.models.ServerPrivateLinkServiceConnectionStateProperty
:ivar provisioning_state: State of the private endpoint connection.
Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed',
'Rejecting'
:vartype provisioning_state: str or
~azure.mgmt.rdbms.mariadb.models.PrivateEndpointProvisioningState
"""

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

_attribute_map = {
'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'},
'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'ServerPrivateLinkServiceConnectionStateProperty'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ServerPrivateEndpointConnectionProperties, self).__init__(**kwargs)
self.private_endpoint = kwargs.get('private_endpoint', None)
self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None)
self.provisioning_state = None


class ServerPrivateLinkServiceConnectionStateProperty(Model):
"""ServerPrivateLinkServiceConnectionStateProperty.

Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:param status: Required. The private link service connection status.
Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'
:type status: str or
~azure.mgmt.rdbms.mariadb.models.PrivateLinkServiceConnectionStateStatus
:param description: Required. The private link service connection
description.
:type description: str
:ivar actions_required: The actions required for private link service
connection. Possible values include: 'None'
:vartype actions_required: str or
~azure.mgmt.rdbms.mariadb.models.PrivateLinkServiceConnectionStateActionsRequire
"""

_validation = {
'status': {'required': True},
'description': {'required': True},
'actions_required': {'readonly': True},
}

_attribute_map = {
'status': {'key': 'status', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'actions_required': {'key': 'actionsRequired', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ServerPrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs)
self.status = kwargs.get('status', None)
self.description = kwargs.get('description', None)
self.actions_required = None


class ServerPropertiesForCreate(Model):
"""The properties used to create a new server.

Expand Down
Loading