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 netapp/resource-manager] Small correction to list handling #4638

Merged
merged 1 commit into from
Mar 22, 2019
Merged
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
12 changes: 9 additions & 3 deletions azure-mgmt-netapp/azure/mgmt/netapp/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
from .metric_specification_py3 import MetricSpecification
from .service_specification_py3 import ServiceSpecification
from .operation_py3 import Operation
from .active_directories_py3 import ActiveDirectories
from .active_directory_py3 import ActiveDirectory
from .net_app_account_py3 import NetAppAccount
from .net_app_account_patch_py3 import NetAppAccountPatch
from .capacity_pool_py3 import CapacityPool
from .capacity_pool_patch_py3 import CapacityPoolPatch
from .export_policy_rule_py3 import ExportPolicyRule
from .volume_properties_export_policy_py3 import VolumePropertiesExportPolicy
from .volume_py3 import Volume
from .volume_patch_properties_export_policy_py3 import VolumePatchPropertiesExportPolicy
from .volume_patch_py3 import VolumePatch
from .mount_target_py3 import MountTarget
from .snapshot_py3 import Snapshot
Expand All @@ -33,13 +35,15 @@
from .metric_specification import MetricSpecification
from .service_specification import ServiceSpecification
from .operation import Operation
from .active_directories import ActiveDirectories
from .active_directory import ActiveDirectory
from .net_app_account import NetAppAccount
from .net_app_account_patch import NetAppAccountPatch
from .capacity_pool import CapacityPool
from .capacity_pool_patch import CapacityPoolPatch
from .export_policy_rule import ExportPolicyRule
from .volume_properties_export_policy import VolumePropertiesExportPolicy
from .volume import Volume
from .volume_patch_properties_export_policy import VolumePatchPropertiesExportPolicy
from .volume_patch import VolumePatch
from .mount_target import MountTarget
from .snapshot import Snapshot
Expand All @@ -61,13 +65,15 @@
'MetricSpecification',
'ServiceSpecification',
'Operation',
'ActiveDirectories',
'ActiveDirectory',
'NetAppAccount',
'NetAppAccountPatch',
'CapacityPool',
'CapacityPoolPatch',
'ExportPolicyRule',
'VolumePropertiesExportPolicy',
'Volume',
'VolumePatchPropertiesExportPolicy',
'VolumePatch',
'MountTarget',
'Snapshot',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from msrest.serialization import Model


class ActiveDirectories(Model):
"""Active Directories.
class ActiveDirectory(Model):
"""Active Directory.
:param active_directory_id: Id of the Active Directory
:type active_directory_id: str
Expand Down Expand Up @@ -49,7 +49,7 @@ class ActiveDirectories(Model):
}

def __init__(self, **kwargs):
super(ActiveDirectories, self).__init__(**kwargs)
super(ActiveDirectory, self).__init__(**kwargs)
self.active_directory_id = kwargs.get('active_directory_id', None)
self.username = kwargs.get('username', None)
self.password = kwargs.get('password', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from msrest.serialization import Model


class ActiveDirectories(Model):
"""Active Directories.
class ActiveDirectory(Model):
"""Active Directory.
:param active_directory_id: Id of the Active Directory
:type active_directory_id: str
Expand Down Expand Up @@ -49,7 +49,7 @@ class ActiveDirectories(Model):
}

def __init__(self, *, active_directory_id: str=None, username: str=None, password: str=None, domain: str=None, d_ns: str=None, status: str=None, s_mb_server_name: str=None, organizational_unit: str=None, **kwargs) -> None:
super(ActiveDirectories, self).__init__(**kwargs)
super(ActiveDirectory, self).__init__(**kwargs)
self.active_directory_id = active_directory_id
self.username = username
self.password = password
Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-netapp/azure/mgmt/netapp/models/net_app_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NetAppAccount(Model):
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param active_directories: Active Directories
:type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories
:type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory]
"""

_validation = {
Expand All @@ -51,7 +51,7 @@ class NetAppAccount(Model):
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': 'object'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'},
'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NetAppAccountPatch(Model):
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param active_directories: Active Directories
:type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories
:type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory]
"""

_validation = {
Expand All @@ -48,7 +48,7 @@ class NetAppAccountPatch(Model):
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': 'object'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'},
'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NetAppAccountPatch(Model):
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param active_directories: Active Directories
:type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories
:type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory]
"""

_validation = {
Expand All @@ -48,7 +48,7 @@ class NetAppAccountPatch(Model):
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': 'object'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'},
'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'},
}

def __init__(self, *, location: str=None, tags=None, active_directories=None, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NetAppAccount(Model):
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param active_directories: Active Directories
:type active_directories: ~azure.mgmt.netapp.models.ActiveDirectories
:type active_directories: list[~azure.mgmt.netapp.models.ActiveDirectory]
"""

_validation = {
Expand All @@ -51,7 +51,7 @@ class NetAppAccount(Model):
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': 'object'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'active_directories': {'key': 'properties.activeDirectories', 'type': 'ActiveDirectories'},
'active_directories': {'key': 'properties.activeDirectories', 'type': '[ActiveDirectory]'},
}

def __init__(self, *, location: str, tags=None, active_directories=None, **kwargs) -> None:
Expand Down
5 changes: 3 additions & 2 deletions azure-mgmt-netapp/azure/mgmt/netapp/models/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Volume(Model):
107374182400 .
:type usage_threshold: long
:param export_policy: Export policy rule
:type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule
:type export_policy:
~azure.mgmt.netapp.models.VolumePropertiesExportPolicy
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param subnet_id: The Azure Resource URI for a delegated subnet. Must have
Expand Down Expand Up @@ -75,7 +76,7 @@ class Volume(Model):
'creation_token': {'key': 'properties.creationToken', 'type': 'str'},
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'subnet_id': {'key': 'properties.subnetId', 'type': 'str'},
}
Expand Down
5 changes: 3 additions & 2 deletions azure-mgmt-netapp/azure/mgmt/netapp/models/volume_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class VolumePatch(Model):
107374182400 .
:type usage_threshold: long
:param export_policy: Export policy rule
:type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule
:type export_policy:
~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy
"""

_validation = {
Expand All @@ -56,7 +57,7 @@ class VolumePatch(Model):
'tags': {'key': 'tags', 'type': 'object'},
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePatchPropertiesExportPolicy'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class VolumePatchPropertiesExportPolicy(Model):
"""Export policy rule.
:param rules:
:type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule]
"""

_attribute_map = {
'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'},
}

def __init__(self, **kwargs):
super(VolumePatchPropertiesExportPolicy, self).__init__(**kwargs)
self.rules = kwargs.get('rules', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class VolumePatchPropertiesExportPolicy(Model):
"""Export policy rule.
:param rules:
:type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule]
"""

_attribute_map = {
'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'},
}

def __init__(self, *, rules=None, **kwargs) -> None:
super(VolumePatchPropertiesExportPolicy, self).__init__(**kwargs)
self.rules = rules
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class VolumePatch(Model):
107374182400 .
:type usage_threshold: long
:param export_policy: Export policy rule
:type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule
:type export_policy:
~azure.mgmt.netapp.models.VolumePatchPropertiesExportPolicy
"""

_validation = {
Expand All @@ -56,7 +57,7 @@ class VolumePatch(Model):
'tags': {'key': 'tags', 'type': 'object'},
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePatchPropertiesExportPolicy'},
}

def __init__(self, *, location: str=None, tags=None, service_level="Premium", usage_threshold: int=107374182400, export_policy=None, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class VolumePropertiesExportPolicy(Model):
"""Export policy rule.
:param rules:
:type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule]
"""

_attribute_map = {
'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'},
}

def __init__(self, **kwargs):
super(VolumePropertiesExportPolicy, self).__init__(**kwargs)
self.rules = kwargs.get('rules', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class VolumePropertiesExportPolicy(Model):
"""Export policy rule.
:param rules:
:type rules: list[~azure.mgmt.netapp.models.ExportPolicyRule]
"""

_attribute_map = {
'rules': {'key': 'rules', 'type': '[ExportPolicyRule]'},
}

def __init__(self, *, rules=None, **kwargs) -> None:
super(VolumePropertiesExportPolicy, self).__init__(**kwargs)
self.rules = rules
5 changes: 3 additions & 2 deletions azure-mgmt-netapp/azure/mgmt/netapp/models/volume_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Volume(Model):
107374182400 .
:type usage_threshold: long
:param export_policy: Export policy rule
:type export_policy: ~azure.mgmt.netapp.models.ExportPolicyRule
:type export_policy:
~azure.mgmt.netapp.models.VolumePropertiesExportPolicy
:ivar provisioning_state: Azure lifecycle management
:vartype provisioning_state: str
:param subnet_id: The Azure Resource URI for a delegated subnet. Must have
Expand Down Expand Up @@ -75,7 +76,7 @@ class Volume(Model):
'creation_token': {'key': 'properties.creationToken', 'type': 'str'},
'service_level': {'key': 'properties.serviceLevel', 'type': 'str'},
'usage_threshold': {'key': 'properties.usageThreshold', 'type': 'long'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'ExportPolicyRule'},
'export_policy': {'key': 'properties.exportPolicy', 'type': 'VolumePropertiesExportPolicy'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'subnet_id': {'key': 'properties.subnetId', 'type': 'str'},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ def _create_or_update_initial(
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [201, 202]:
if response.status_code not in [200, 201, 202]:
raise models.ErrorException(self._deserialize, response)

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('NetAppAccount', response)
if response.status_code == 201:
deserialized = self._deserialize('NetAppAccount', response)

Expand Down