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 dns/resource-manager] Fix SDK breaking change in 2017-10-01 DNS Swagger ref https://github.… #2173

Merged
merged 1 commit into from
Mar 14, 2018
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
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"