Skip to content

Commit

Permalink
[AutoPR redis/resource-manager] Swagger completeness for Redis Cache (#…
Browse files Browse the repository at this point in the history
…2055)

* Generated from adccbe159e32ef8112a0aadccc07d3c6c5390d11

Name change for notification

* Generated from fdcb7d3837ae11e3fe8af22e28dadb032c498672

Fixing code review comments in PR
  • Loading branch information
AutorestCI authored Mar 2, 2018
1 parent f896c05 commit ce9aa1a
Show file tree
Hide file tree
Showing 9 changed files with 302 additions and 28 deletions.
6 changes: 6 additions & 0 deletions azure-mgmt-redis/azure/mgmt/redis/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
from .redis_linked_server_create_parameters import RedisLinkedServerCreateParameters
from .operation_display import OperationDisplay
from .operation import Operation
from .check_name_availability_parameters import CheckNameAvailabilityParameters
from .upgrade_notification import UpgradeNotification
from .notification_list_response import NotificationListResponse
from .operation_paged import OperationPaged
from .redis_resource_paged import RedisResourcePaged
from .redis_firewall_rule_paged import RedisFirewallRulePaged
Expand Down Expand Up @@ -67,6 +70,9 @@
'RedisLinkedServerCreateParameters',
'OperationDisplay',
'Operation',
'CheckNameAvailabilityParameters',
'UpgradeNotification',
'NotificationListResponse',
'OperationPaged',
'RedisResourcePaged',
'RedisFirewallRulePaged',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 CheckNameAvailabilityParameters(Model):
"""Parameters body to pass for name availability check.
:param name: Resource name.
:type name: str
:param type: Resource type.
:type type: str
"""

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

def __init__(self, name=None, type=None):
super(CheckNameAvailabilityParameters, self).__init__()
self.name = name
self.type = type
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 NotificationListResponse(Model):
"""The response of listUpgradeNotifications.
Variables are only populated by the server, and will be ignored when
sending a request.
:param value: List of all notifications.
:type value: list[~azure.mgmt.redis.models.UpgradeNotification]
:ivar next_link: Link for next set of notifications.
:vartype next_link: str
"""

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

_attribute_map = {
'value': {'key': 'value', 'type': '[UpgradeNotification]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, value=None):
super(NotificationListResponse, self).__init__()
self.value = value
self.next_link = None
45 changes: 45 additions & 0 deletions azure-mgmt-redis/azure/mgmt/redis/models/upgrade_notification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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 UpgradeNotification(Model):
"""Properties of upgrade notification.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: Name of upgrade notification.
:vartype name: str
:ivar timestamp: Timestamp when upgrade notification occured.
:vartype timestamp: datetime
:ivar upsell_notification: Details about this upgrade notification
:vartype upsell_notification: dict[str, str]
"""

_validation = {
'name': {'readonly': True},
'timestamp': {'readonly': True},
'upsell_notification': {'readonly': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'upsell_notification': {'key': 'upsellNotification', 'type': '{str}'},
}

def __init__(self):
super(UpgradeNotification, self).__init__()
self.name = None
self.timestamp = None
self.upsell_notification = None
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FirewallRulesOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Client Api Version. Constant value: "2017-10-01".
"""

Expand Down Expand Up @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'
url = self.list_by_redis_resource.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
Expand Down Expand Up @@ -106,6 +106,7 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list_by_redis_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules'}

def create_or_update(
self, resource_group_name, cache_name, rule_name, start_ip, end_ip, custom_headers=None, raw=False, **operation_config):
Expand Down Expand Up @@ -134,7 +135,7 @@ def create_or_update(
parameters = models.RedisFirewallRuleCreateParameters(start_ip=start_ip, end_ip=end_ip)

# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'
url = self.create_or_update.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'cacheName': self._serialize.url("cache_name", cache_name, 'str'),
Expand Down Expand Up @@ -182,6 +183,7 @@ def create_or_update(
return client_raw_response

return deserialized
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'}

def get(
self, resource_group_name, cache_name, rule_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -204,7 +206,7 @@ def get(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'
url = self.get.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'cacheName': self._serialize.url("cache_name", cache_name, 'str'),
Expand Down Expand Up @@ -246,6 +248,7 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'}

def delete(
self, resource_group_name, cache_name, rule_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -267,7 +270,7 @@ def delete(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'
url = self.delete.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'cacheName': self._serialize.url("cache_name", cache_name, 'str'),
Expand Down Expand Up @@ -302,3 +305,4 @@ def delete(
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{cacheName}/firewallRules/{ruleName}'}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LinkedServerOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Client Api Version. Constant value: "2017-10-01".
"""

Expand All @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer):
def _create_initial(
self, resource_group_name, name, linked_server_name, parameters, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'
url = self.create.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
Expand Down Expand Up @@ -164,6 +164,7 @@ def get_long_running_output(response):
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'}

def delete(
self, resource_group_name, name, linked_server_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -186,7 +187,7 @@ def delete(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'
url = self.delete.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
Expand Down Expand Up @@ -221,6 +222,7 @@ def delete(
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'}

def get(
self, resource_group_name, name, linked_server_name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -245,7 +247,7 @@ def get(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'
url = self.get.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
Expand Down Expand Up @@ -287,6 +289,7 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers/{linkedServerName}'}

def list(
self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -311,7 +314,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers'
url = self.list.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
Expand Down Expand Up @@ -358,3 +361,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/linkedServers'}
5 changes: 3 additions & 2 deletions azure-mgmt-redis/azure/mgmt/redis/operations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Operations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar api_version: Client Api Version. Constant value: "2017-10-01".
"""

Expand Down Expand Up @@ -56,7 +56,7 @@ def internal_paging(next_link=None, raw=False):

if not next_link:
# Construct URL
url = '/providers/Microsoft.Cache/operations'
url = self.list.metadata['url']

# Construct parameters
query_parameters = {}
Expand Down Expand Up @@ -97,3 +97,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/providers/Microsoft.Cache/operations'}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class PatchSchedulesOperations(object):
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An objec model deserializer.
:param deserializer: An object model deserializer.
:ivar default: Default string modeled as parameter for auto generation to work correctly. Constant value: "default".
:ivar api_version: Client Api Version. Constant value: "2017-10-01".
"""

Expand All @@ -33,6 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.default = "default"
self.api_version = "2017-10-01"

self.config = config
Expand Down Expand Up @@ -61,10 +63,11 @@ def create_or_update(
parameters = models.RedisPatchSchedule(schedule_entries=schedule_entries)

# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
url = self.create_or_update.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
'default': self._serialize.url("self.default", self.default, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -108,6 +111,7 @@ def create_or_update(
return client_raw_response

return deserialized
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'}

def delete(
self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -127,10 +131,11 @@ def delete(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
url = self.delete.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
'default': self._serialize.url("self.default", self.default, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -161,6 +166,7 @@ def delete(
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'}

def get(
self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
Expand All @@ -181,10 +187,11 @@ def get(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/default'
url = self.get.metadata['url']
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'name': self._serialize.url("name", name, 'str'),
'default': self._serialize.url("self.default", self.default, 'str'),
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -222,3 +229,4 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/Redis/{name}/patchSchedules/{default}'}
Loading

0 comments on commit ce9aa1a

Please sign in to comment.