Skip to content

Commit

Permalink
CodeGen from PR 15753 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Changed FSPG RestartParameter.failoverMode from string to enum for API 2021-06-01, 2021-06-01-preview, and 2021-06-15-privatepreview (Azure#15753)

* Changed FSPG RestartParameter.failoverMode from string to enum for API 2021-06-01, 2021-06-01-preview, and 2021-06-15-privatepreview

* Change enum first letter to lower case

* Change to upper case
  • Loading branch information
SDKAuto committed Aug 24, 2021
1 parent 3fe8964 commit 90746b5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 92 deletions.
2 changes: 1 addition & 1 deletion sdk/rdbms/azure-mgmt-rdbms/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "1a22ee0be121e33f98b6290cc737f613f2e1a2d8",
"commit": "1b1df799fec498327cfc8d9d1e72902866f13ead",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/postgresql/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"readme": "specification/postgresql/resource-manager/readme.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.1.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.1.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from ._models_py3 import FlexibleServerEditionCapability
from ._models_py3 import HighAvailability
from ._models_py3 import HyperscaleNodeEditionCapability
from ._models_py3 import Identity
from ._models_py3 import MaintenanceWindow
from ._models_py3 import NameAvailability
from ._models_py3 import NameAvailabilityRequest
Expand Down Expand Up @@ -63,7 +62,6 @@
from ._models import FlexibleServerEditionCapability # type: ignore
from ._models import HighAvailability # type: ignore
from ._models import HyperscaleNodeEditionCapability # type: ignore
from ._models import Identity # type: ignore
from ._models import MaintenanceWindow # type: ignore
from ._models import NameAvailability # type: ignore
from ._models import NameAvailabilityRequest # type: ignore
Expand Down Expand Up @@ -94,6 +92,7 @@
CreateMode,
CreateModeForUpdate,
CreatedByType,
FailoverMode,
GeoRedundantBackupEnum,
HighAvailabilityMode,
OperationOrigin,
Expand All @@ -120,7 +119,6 @@
'FlexibleServerEditionCapability',
'HighAvailability',
'HyperscaleNodeEditionCapability',
'Identity',
'MaintenanceWindow',
'NameAvailability',
'NameAvailabilityRequest',
Expand Down Expand Up @@ -149,6 +147,7 @@
'CreateMode',
'CreateModeForUpdate',
'CreatedByType',
'FailoverMode',
'GeoRedundantBackupEnum',
'HighAvailabilityMode',
'OperationOrigin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,41 +674,6 @@ def __init__(
self.status = None


class Identity(msrest.serialization.Model):
"""Identity for the resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar principal_id: The principal ID of resource identity.
:vartype principal_id: str
:ivar tenant_id: The tenant ID of resource.
:vartype tenant_id: str
:param type: The identity type. The only acceptable values to pass in are None and
"SystemAssigned". The default value is None.
:type type: str
"""

_validation = {
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(
self,
**kwargs
):
super(Identity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = kwargs.get('type', None)


class MaintenanceWindow(msrest.serialization.Model):
"""Maintenance window properties of a server.
Expand Down Expand Up @@ -984,8 +949,9 @@ class RestartParameter(msrest.serialization.Model):
:param restart_with_failover: Indicates whether to restart the server with failover.
:type restart_with_failover: bool
:param failover_mode: Failover mode.
:type failover_mode: str
:param failover_mode: Failover mode. Possible values include: "PlannedFailover",
"ForcedFailover", "PlannedSwitchover", "ForcedSwitchover".
:type failover_mode: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FailoverMode
"""

_attribute_map = {
Expand Down Expand Up @@ -1066,8 +1032,6 @@ class Server(TrackedResource):
:type tags: dict[str, str]
:param location: Required. The geo-location where the resource lives.
:type location: str
:param identity: The Azure Active Directory identity of the server.
:type identity: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Identity
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku
:ivar system_data: The system metadata relating to this resource.
Expand Down Expand Up @@ -1129,7 +1093,6 @@ class Server(TrackedResource):
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'location': {'key': 'location', 'type': 'str'},
'identity': {'key': 'identity', 'type': 'Identity'},
'sku': {'key': 'sku', 'type': 'Sku'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
Expand All @@ -1155,7 +1118,6 @@ def __init__(
**kwargs
):
super(Server, self).__init__(**kwargs)
self.identity = kwargs.get('identity', None)
self.sku = kwargs.get('sku', None)
self.system_data = None
self.administrator_login = kwargs.get('administrator_login', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,43 +703,6 @@ def __init__(
self.status = None


class Identity(msrest.serialization.Model):
"""Identity for the resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar principal_id: The principal ID of resource identity.
:vartype principal_id: str
:ivar tenant_id: The tenant ID of resource.
:vartype tenant_id: str
:param type: The identity type. The only acceptable values to pass in are None and
"SystemAssigned". The default value is None.
:type type: str
"""

_validation = {
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(
self,
*,
type: Optional[str] = None,
**kwargs
):
super(Identity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = type


class MaintenanceWindow(msrest.serialization.Model):
"""Maintenance window properties of a server.
Expand Down Expand Up @@ -1036,8 +999,9 @@ class RestartParameter(msrest.serialization.Model):
:param restart_with_failover: Indicates whether to restart the server with failover.
:type restart_with_failover: bool
:param failover_mode: Failover mode.
:type failover_mode: str
:param failover_mode: Failover mode. Possible values include: "PlannedFailover",
"ForcedFailover", "PlannedSwitchover", "ForcedSwitchover".
:type failover_mode: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FailoverMode
"""

_attribute_map = {
Expand All @@ -1049,7 +1013,7 @@ def __init__(
self,
*,
restart_with_failover: Optional[bool] = None,
failover_mode: Optional[str] = None,
failover_mode: Optional[Union[str, "FailoverMode"]] = None,
**kwargs
):
super(RestartParameter, self).__init__(**kwargs)
Expand Down Expand Up @@ -1124,8 +1088,6 @@ class Server(TrackedResource):
:type tags: dict[str, str]
:param location: Required. The geo-location where the resource lives.
:type location: str
:param identity: The Azure Active Directory identity of the server.
:type identity: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Identity
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku
:ivar system_data: The system metadata relating to this resource.
Expand Down Expand Up @@ -1187,7 +1149,6 @@ class Server(TrackedResource):
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'location': {'key': 'location', 'type': 'str'},
'identity': {'key': 'identity', 'type': 'Identity'},
'sku': {'key': 'sku', 'type': 'Sku'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
Expand All @@ -1213,7 +1174,6 @@ def __init__(
*,
location: str,
tags: Optional[Dict[str, str]] = None,
identity: Optional["Identity"] = None,
sku: Optional["Sku"] = None,
administrator_login: Optional[str] = None,
administrator_login_password: Optional[str] = None,
Expand All @@ -1231,7 +1191,6 @@ def __init__(
**kwargs
):
super(Server, self).__init__(tags=tags, location=location, **kwargs)
self.identity = identity
self.sku = sku
self.system_data = None
self.administrator_login = administrator_login
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ class CreateModeForUpdate(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
DEFAULT = "Default"
UPDATE = "Update"

class FailoverMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""Failover mode.
"""

PLANNED_FAILOVER = "PlannedFailover"
FORCED_FAILOVER = "ForcedFailover"
PLANNED_SWITCHOVER = "PlannedSwitchover"
FORCED_SWITCHOVER = "ForcedSwitchover"

class GeoRedundantBackupEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
"""A value indicating whether Geo-Redundant backup is enabled on the server.
"""
Expand Down

0 comments on commit 90746b5

Please sign in to comment.