Skip to content

Commit

Permalink
Generated from 89cf22d8de4f8659cbe1c7af1655f8f3b3d9621a
Browse files Browse the repository at this point in the history
Fix SDK breaking change in 2017-10-01 DNS Swagger ref Azure/azure-rest-api-specs#2612
  • Loading branch information
AutorestCI committed Mar 14, 2018
1 parent 9479fba commit c697fd7
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 7 deletions.
2 changes: 2 additions & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .record_set_update_parameters import RecordSetUpdateParameters
from .sub_resource import SubResource
from .zone import Zone
from .zone_update import ZoneUpdate
from .resource import Resource
from .record_set_paged import RecordSetPaged
from .zone_paged import ZonePaged
Expand All @@ -46,6 +47,7 @@
'RecordSetUpdateParameters',
'SubResource',
'Zone',
'ZoneUpdate',
'Resource',
'RecordSetPaged',
'ZonePaged',
Expand Down
3 changes: 2 additions & 1 deletion azure-mgmt-dns/azure/mgmt/dns/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Resource(Model):
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}

_attribute_map = {
Expand All @@ -44,7 +45,7 @@ class Resource(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}

def __init__(self, location=None, tags=None):
def __init__(self, location, tags=None):
super(Resource, self).__init__()
self.id = None
self.name = None
Expand Down
3 changes: 2 additions & 1 deletion azure-mgmt-dns/azure/mgmt/dns/models/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Zone(Resource):
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
'max_number_of_record_sets': {'readonly': True},
'number_of_record_sets': {'readonly': True},
'name_servers': {'readonly': True},
Expand All @@ -80,7 +81,7 @@ class Zone(Resource):
'resolution_virtual_networks': {'key': 'properties.resolutionVirtualNetworks', 'type': '[SubResource]'},
}

def __init__(self, location=None, tags=None, etag=None, zone_type="Public", registration_virtual_networks=None, resolution_virtual_networks=None):
def __init__(self, location, tags=None, etag=None, zone_type="Public", registration_virtual_networks=None, resolution_virtual_networks=None):
super(Zone, self).__init__(location=location, tags=tags)
self.etag = etag
self.max_number_of_record_sets = None
Expand Down
28 changes: 28 additions & 0 deletions azure-mgmt-dns/azure/mgmt/dns/models/zone_update.py
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 ZoneUpdate(Model):
"""Describes a request to update a DNS zone.
:param tags: Resource tags.
:type tags: dict[str, str]
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
}

def __init__(self, tags=None):
super(ZoneUpdate, self).__init__()
self.tags = tags
10 changes: 6 additions & 4 deletions azure-mgmt-dns/azure/mgmt/dns/operations/zones_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,20 @@ def get(
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}'}

def update(
self, resource_group_name, zone_name, parameters, if_match=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, zone_name, if_match=None, tags=None, custom_headers=None, raw=False, **operation_config):
"""Updates a DNS zone. Does not modify DNS records within the zone.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param zone_name: The name of the DNS zone (without a terminating
dot).
:type zone_name: str
:param parameters: Parameters supplied to the Update operation.
:type parameters: ~azure.mgmt.dns.models.Zone
:param if_match: The etag of the DNS zone. Omit this value to always
overwrite the current zone. Specify the last-seen etag value to
prevent accidentally overwritting any concurrent changes.
:type if_match: str
:param tags: Resource tags.
:type tags: dict[str, str]
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -321,6 +321,8 @@ def update(
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
parameters = models.ZoneUpdate(tags=tags)

# Construct URL
url = self.update.metadata['url']
path_format_arguments = {
Expand All @@ -347,7 +349,7 @@ def update(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct body
body_content = self._serialize.body(parameters, 'Zone')
body_content = self._serialize.body(parameters, 'ZoneUpdate')

# Construct and send request
request = self._client.patch(url, query_parameters)
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-dns/azure/mgmt/dns/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "2.0.0rc1"
VERSION = "2018-03-01-preview"

0 comments on commit c697fd7

Please sign in to comment.