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 web/resource-manager] Fix recommendation resource properties, add disable recommendation APIs #2063

Merged
merged 3 commits into from
Feb 28, 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-web/azure/mgmt/web/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
from .analysis_definition_paged import AnalysisDefinitionPaged
from .detector_definition_paged import DetectorDefinitionPaged
from .application_stack_paged import ApplicationStackPaged
from .recommendation_paged import RecommendationPaged
from .source_control_paged import SourceControlPaged
from .geo_region_paged import GeoRegionPaged
from .identifier_paged import IdentifierPaged
Expand Down Expand Up @@ -537,6 +538,7 @@
'AnalysisDefinitionPaged',
'DetectorDefinitionPaged',
'ApplicationStackPaged',
'RecommendationPaged',
'SourceControlPaged',
'GeoRegionPaged',
'IdentifierPaged',
Expand Down
71 changes: 46 additions & 25 deletions azure-mgmt-web/azure/mgmt/web/models/recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from .proxy_only_resource import ProxyOnlyResource


class Recommendation(Model):
class Recommendation(ProxyOnlyResource):
"""Represents a recommendation result generated by the recommendation engine.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource Name.
:vartype name: str
:param kind: Kind of resource.
:type kind: str
:ivar type: Resource type.
:vartype type: str
:param creation_time: Timestamp when this instance was created.
:type creation_time: datetime
:param recommendation_id: A GUID value that each recommendation object is
Expand Down Expand Up @@ -74,32 +85,42 @@ class Recommendation(Model):
:type forward_link: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'creation_time': {'key': 'creationTime', 'type': 'iso-8601'},
'recommendation_id': {'key': 'recommendationId', 'type': 'str'},
'resource_id': {'key': 'resourceId', 'type': 'str'},
'resource_scope': {'key': 'resourceScope', 'type': 'str'},
'rule_name': {'key': 'ruleName', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'level': {'key': 'level', 'type': 'NotificationLevel'},
'channels': {'key': 'channels', 'type': 'Channels'},
'tags': {'key': 'tags', 'type': '[str]'},
'action_name': {'key': 'actionName', 'type': 'str'},
'start_time': {'key': 'startTime', 'type': 'iso-8601'},
'end_time': {'key': 'endTime', 'type': 'iso-8601'},
'next_notification_time': {'key': 'nextNotificationTime', 'type': 'iso-8601'},
'notification_expiration_time': {'key': 'notificationExpirationTime', 'type': 'iso-8601'},
'notified_time': {'key': 'notifiedTime', 'type': 'iso-8601'},
'score': {'key': 'score', 'type': 'float'},
'is_dynamic': {'key': 'isDynamic', 'type': 'bool'},
'extension_name': {'key': 'extensionName', 'type': 'str'},
'blade_name': {'key': 'bladeName', 'type': 'str'},
'forward_link': {'key': 'forwardLink', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'},
'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'},
'resource_id': {'key': 'properties.resourceId', 'type': 'str'},
'resource_scope': {'key': 'properties.resourceScope', 'type': 'str'},
'rule_name': {'key': 'properties.ruleName', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'message': {'key': 'properties.message', 'type': 'str'},
'level': {'key': 'properties.level', 'type': 'NotificationLevel'},
'channels': {'key': 'properties.channels', 'type': 'Channels'},
'tags': {'key': 'properties.tags', 'type': '[str]'},
'action_name': {'key': 'properties.actionName', 'type': 'str'},
'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'},
'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'},
'next_notification_time': {'key': 'properties.nextNotificationTime', 'type': 'iso-8601'},
'notification_expiration_time': {'key': 'properties.notificationExpirationTime', 'type': 'iso-8601'},
'notified_time': {'key': 'properties.notifiedTime', 'type': 'iso-8601'},
'score': {'key': 'properties.score', 'type': 'float'},
'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'},
'extension_name': {'key': 'properties.extensionName', 'type': 'str'},
'blade_name': {'key': 'properties.bladeName', 'type': 'str'},
'forward_link': {'key': 'properties.forwardLink', 'type': 'str'},
}

def __init__(self, creation_time=None, recommendation_id=None, resource_id=None, resource_scope=None, rule_name=None, display_name=None, message=None, level=None, channels=None, tags=None, action_name=None, start_time=None, end_time=None, next_notification_time=None, notification_expiration_time=None, notified_time=None, score=None, is_dynamic=None, extension_name=None, blade_name=None, forward_link=None):
super(Recommendation, self).__init__()
def __init__(self, kind=None, creation_time=None, recommendation_id=None, resource_id=None, resource_scope=None, rule_name=None, display_name=None, message=None, level=None, channels=None, tags=None, action_name=None, start_time=None, end_time=None, next_notification_time=None, notification_expiration_time=None, notified_time=None, score=None, is_dynamic=None, extension_name=None, blade_name=None, forward_link=None):
super(Recommendation, self).__init__(kind=kind)
self.creation_time = creation_time
self.recommendation_id = recommendation_id
self.resource_id = resource_id
Expand Down
27 changes: 27 additions & 0 deletions azure-mgmt-web/azure/mgmt/web/models/recommendation_paged.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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.paging import Paged


class RecommendationPaged(Paged):
"""
A paging container for iterating over a list of :class:`Recommendation <azure.mgmt.web.models.Recommendation>` object
"""

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

def __init__(self, *args, **kwargs):

super(RecommendationPaged, self).__init__(*args, **kwargs)
59 changes: 40 additions & 19 deletions azure-mgmt-web/azure/mgmt/web/models/recommendation_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from .proxy_only_resource import ProxyOnlyResource


class RecommendationRule(Model):
class RecommendationRule(ProxyOnlyResource):
"""Represents a recommendation rule that the recommendation engine can
perform.

:param name: Unique name of the rule.
:type name: str
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource Name.
:vartype name: str
:param kind: Kind of resource.
:type kind: str
:ivar type: Resource type.
:vartype type: str
:param recommendation_rule_name: Unique name of the rule.
:type recommendation_rule_name: str
:param display_name: UI friendly name of the rule.
:type display_name: str
:param message: Localized name of the rule (Good for UI).
Expand Down Expand Up @@ -54,25 +65,35 @@ class RecommendationRule(Model):
:type forward_link: str
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'recommendation_id': {'key': 'recommendationId', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'action_name': {'key': 'actionName', 'type': 'str'},
'level': {'key': 'level', 'type': 'NotificationLevel'},
'channels': {'key': 'channels', 'type': 'Channels'},
'tags': {'key': 'tags', 'type': '[str]'},
'is_dynamic': {'key': 'isDynamic', 'type': 'bool'},
'extension_name': {'key': 'extensionName', 'type': 'str'},
'blade_name': {'key': 'bladeName', 'type': 'str'},
'forward_link': {'key': 'forwardLink', 'type': 'str'},
'kind': {'key': 'kind', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'recommendation_rule_name': {'key': 'properties.name', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'message': {'key': 'properties.message', 'type': 'str'},
'recommendation_id': {'key': 'properties.recommendationId', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'action_name': {'key': 'properties.actionName', 'type': 'str'},
'level': {'key': 'properties.level', 'type': 'NotificationLevel'},
'channels': {'key': 'properties.channels', 'type': 'Channels'},
'tags': {'key': 'properties.tags', 'type': '[str]'},
'is_dynamic': {'key': 'properties.isDynamic', 'type': 'bool'},
'extension_name': {'key': 'properties.extensionName', 'type': 'str'},
'blade_name': {'key': 'properties.bladeName', 'type': 'str'},
'forward_link': {'key': 'properties.forwardLink', 'type': 'str'},
}

def __init__(self, name=None, display_name=None, message=None, recommendation_id=None, description=None, action_name=None, level=None, channels=None, tags=None, is_dynamic=None, extension_name=None, blade_name=None, forward_link=None):
super(RecommendationRule, self).__init__()
self.name = name
def __init__(self, kind=None, recommendation_rule_name=None, display_name=None, message=None, recommendation_id=None, description=None, action_name=None, level=None, channels=None, tags=None, is_dynamic=None, extension_name=None, blade_name=None, forward_link=None):
super(RecommendationRule, self).__init__(kind=kind)
self.recommendation_rule_name = recommendation_rule_name
self.display_name = display_name
self.message = message
self.recommendation_id = recommendation_id
Expand Down
Loading