Skip to content

Commit

Permalink
Generated from 4491b14acacd5768d831ac0f1f7c7db85c051ead
Browse files Browse the repository at this point in the history
Merge pull request #14 from moreOver0/conhua/ad_updates

resolve review comment
  • Loading branch information
AutorestCI committed Jun 21, 2019
1 parent 6ef5e83 commit 6fe271a
Show file tree
Hide file tree
Showing 26 changed files with 131 additions and 1,067 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from .operations.time_series_operations import TimeSeriesOperations
from .operations.time_series_group_operations import TimeSeriesGroupOperations
from . import models


Expand Down Expand Up @@ -56,8 +55,6 @@ class AnomalyDetectorClient(SDKClient):
:ivar time_series: TimeSeries operations
:vartype time_series: azure.cognitiveservices.anomalydetector.operations.TimeSeriesOperations
:ivar time_series_group: TimeSeriesGroup operations
:vartype time_series_group: azure.cognitiveservices.anomalydetector.operations.TimeSeriesGroupOperations
:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
Expand All @@ -80,8 +77,6 @@ def __init__(

self.time_series = TimeSeriesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.time_series_group = TimeSeriesGroupOperations(
self._client, self.config, self._serialize, self._deserialize)

def entire_detect(
self, body, custom_headers=None, raw=False, **operation_config):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
from .time_series_py3 import TimeSeries
from .time_series_create_request_py3 import TimeSeriesCreateRequest
from .time_series_list_py3 import TimeSeriesList
from .time_series_group_py3 import TimeSeriesGroup
from .time_series_group_create_request_py3 import TimeSeriesGroupCreateRequest
from .time_series_group_list_py3 import TimeSeriesGroupList
from .inconsistency_detect_request_py3 import InconsistencyDetectRequest
from .inconsistency_py3 import Inconsistency
from .inconsistency_query_request_py3 import InconsistencyQueryRequest
from .change_point_detect_request_py3 import ChangePointDetectRequest
from .change_point_detect_response_py3 import ChangePointDetectResponse
from .change_point_detect_on_timestamp_request_py3 import ChangePointDetectOnTimestampRequest
Expand All @@ -42,12 +38,8 @@
from .time_series import TimeSeries
from .time_series_create_request import TimeSeriesCreateRequest
from .time_series_list import TimeSeriesList
from .time_series_group import TimeSeriesGroup
from .time_series_group_create_request import TimeSeriesGroupCreateRequest
from .time_series_group_list import TimeSeriesGroupList
from .inconsistency_detect_request import InconsistencyDetectRequest
from .inconsistency import Inconsistency
from .inconsistency_query_request import InconsistencyQueryRequest
from .change_point_detect_request import ChangePointDetectRequest
from .change_point_detect_response import ChangePointDetectResponse
from .change_point_detect_on_timestamp_request import ChangePointDetectOnTimestampRequest
Expand All @@ -73,12 +65,8 @@
'TimeSeries',
'TimeSeriesCreateRequest',
'TimeSeriesList',
'TimeSeriesGroup',
'TimeSeriesGroupCreateRequest',
'TimeSeriesGroupList',
'InconsistencyDetectRequest',
'Inconsistency',
'InconsistencyQueryRequest',
'ChangePointDetectRequest',
'ChangePointDetectResponse',
'ChangePointDetectOnTimestampRequest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class AnomalyDetectOnTimestampResponse(Model):
positive anomaly means the point is detected as an anomaly and its real
value is larger than the expected one.
:type is_positive_anomaly: bool
:param confidence_score: Required. Confidence score of the anomaly,
significiant anomalies will get higher score.
:type confidence_score: float
"""

_validation = {
Expand All @@ -63,6 +66,7 @@ class AnomalyDetectOnTimestampResponse(Model):
'is_anomaly': {'required': True},
'is_negative_anomaly': {'required': True},
'is_positive_anomaly': {'required': True},
'confidence_score': {'required': True},
}

_attribute_map = {
Expand All @@ -75,6 +79,7 @@ class AnomalyDetectOnTimestampResponse(Model):
'is_anomaly': {'key': 'isAnomaly', 'type': 'bool'},
'is_negative_anomaly': {'key': 'isNegativeAnomaly', 'type': 'bool'},
'is_positive_anomaly': {'key': 'isPositiveAnomaly', 'type': 'bool'},
'confidence_score': {'key': 'confidenceScore', 'type': 'float'},
}

def __init__(self, **kwargs):
Expand All @@ -88,3 +93,4 @@ def __init__(self, **kwargs):
self.is_anomaly = kwargs.get('is_anomaly', None)
self.is_negative_anomaly = kwargs.get('is_negative_anomaly', None)
self.is_positive_anomaly = kwargs.get('is_positive_anomaly', None)
self.confidence_score = kwargs.get('confidence_score', None)
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class AnomalyDetectOnTimestampResponse(Model):
positive anomaly means the point is detected as an anomaly and its real
value is larger than the expected one.
:type is_positive_anomaly: bool
:param confidence_score: Required. Confidence score of the anomaly,
significiant anomalies will get higher score.
:type confidence_score: float
"""

_validation = {
Expand All @@ -63,6 +66,7 @@ class AnomalyDetectOnTimestampResponse(Model):
'is_anomaly': {'required': True},
'is_negative_anomaly': {'required': True},
'is_positive_anomaly': {'required': True},
'confidence_score': {'required': True},
}

_attribute_map = {
Expand All @@ -75,9 +79,10 @@ class AnomalyDetectOnTimestampResponse(Model):
'is_anomaly': {'key': 'isAnomaly', 'type': 'bool'},
'is_negative_anomaly': {'key': 'isNegativeAnomaly', 'type': 'bool'},
'is_positive_anomaly': {'key': 'isPositiveAnomaly', 'type': 'bool'},
'confidence_score': {'key': 'confidenceScore', 'type': 'float'},
}

def __init__(self, *, period: int, timestamp, value: float, expected_value: float, upper_margin: float, lower_margin: float, is_anomaly: bool, is_negative_anomaly: bool, is_positive_anomaly: bool, **kwargs) -> None:
def __init__(self, *, period: int, timestamp, value: float, expected_value: float, upper_margin: float, lower_margin: float, is_anomaly: bool, is_negative_anomaly: bool, is_positive_anomaly: bool, confidence_score: float, **kwargs) -> None:
super(AnomalyDetectOnTimestampResponse, self).__init__(**kwargs)
self.period = period
self.timestamp = timestamp
Expand All @@ -88,3 +93,4 @@ def __init__(self, *, period: int, timestamp, value: float, expected_value: floa
self.is_anomaly = is_anomaly
self.is_negative_anomaly = is_negative_anomaly
self.is_positive_anomaly = is_positive_anomaly
self.confidence_score = confidence_score
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ class LabelType(str, Enum):

class LabelValue(str, Enum):

true = "true"
false = "false"
positive_anomaly = "positiveAnomaly"
negative_anomaly = "negativeAnomaly"
positive_change_point = "positiveChangePoint"
negative_change_point = "negativeChangePoint"
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,25 @@ class Inconsistency(Model):
:param confidence_scores: Required. Scores of inconsistent series in the
time series group.
:type confidence_scores: list[float]
:param timestamp: Required. Inconsistency detect timestamp.
:type timestamp: datetime
:param epsilon: Parameter to be tuned to get inconsistency.
:type epsilon: float
:param principle_trend: Required. The principle trend of the group of time
series.
:type principle_trend: list[float]
"""

_validation = {
'inconsistent_series_ids': {'required': True},
'confidence_scores': {'required': True},
'timestamp': {'required': True},
'principle_trend': {'required': True},
}

_attribute_map = {
'inconsistent_series_ids': {'key': 'inconsistentSeriesIds', 'type': '[str]'},
'confidence_scores': {'key': 'confidenceScores', 'type': '[float]'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'epsilon': {'key': 'epsilon', 'type': 'float'},
'principle_trend': {'key': 'principleTrend', 'type': '[float]'},
}

def __init__(self, **kwargs):
super(Inconsistency, self).__init__(**kwargs)
self.inconsistent_series_ids = kwargs.get('inconsistent_series_ids', None)
self.confidence_scores = kwargs.get('confidence_scores', None)
self.timestamp = kwargs.get('timestamp', None)
self.epsilon = kwargs.get('epsilon', None)
self.principle_trend = kwargs.get('principle_trend', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class InconsistencyDetectRequest(Model):
:type timestamp: datetime
:param epsilon: Parameter to be tuned to get inconsistency.
:type epsilon: float
:param time_series_ids: IDs of time series need to be detected.
:type time_series_ids: list[str]
"""

_validation = {
Expand All @@ -30,9 +32,11 @@ class InconsistencyDetectRequest(Model):
_attribute_map = {
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'epsilon': {'key': 'epsilon', 'type': 'float'},
'time_series_ids': {'key': 'timeSeriesIds', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(InconsistencyDetectRequest, self).__init__(**kwargs)
self.timestamp = kwargs.get('timestamp', None)
self.epsilon = kwargs.get('epsilon', None)
self.time_series_ids = kwargs.get('time_series_ids', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class InconsistencyDetectRequest(Model):
:type timestamp: datetime
:param epsilon: Parameter to be tuned to get inconsistency.
:type epsilon: float
:param time_series_ids: IDs of time series need to be detected.
:type time_series_ids: list[str]
"""

_validation = {
Expand All @@ -30,9 +32,11 @@ class InconsistencyDetectRequest(Model):
_attribute_map = {
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'epsilon': {'key': 'epsilon', 'type': 'float'},
'time_series_ids': {'key': 'timeSeriesIds', 'type': '[str]'},
}

def __init__(self, *, timestamp, epsilon: float=None, **kwargs) -> None:
def __init__(self, *, timestamp, epsilon: float=None, time_series_ids=None, **kwargs) -> None:
super(InconsistencyDetectRequest, self).__init__(**kwargs)
self.timestamp = timestamp
self.epsilon = epsilon
self.time_series_ids = time_series_ids
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,25 @@ class Inconsistency(Model):
:param confidence_scores: Required. Scores of inconsistent series in the
time series group.
:type confidence_scores: list[float]
:param timestamp: Required. Inconsistency detect timestamp.
:type timestamp: datetime
:param epsilon: Parameter to be tuned to get inconsistency.
:type epsilon: float
:param principle_trend: Required. The principle trend of the group of time
series.
:type principle_trend: list[float]
"""

_validation = {
'inconsistent_series_ids': {'required': True},
'confidence_scores': {'required': True},
'timestamp': {'required': True},
'principle_trend': {'required': True},
}

_attribute_map = {
'inconsistent_series_ids': {'key': 'inconsistentSeriesIds', 'type': '[str]'},
'confidence_scores': {'key': 'confidenceScores', 'type': '[float]'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'epsilon': {'key': 'epsilon', 'type': 'float'},
'principle_trend': {'key': 'principleTrend', 'type': '[float]'},
}

def __init__(self, *, inconsistent_series_ids, confidence_scores, timestamp, epsilon: float=None, **kwargs) -> None:
def __init__(self, *, inconsistent_series_ids, confidence_scores, principle_trend, **kwargs) -> None:
super(Inconsistency, self).__init__(**kwargs)
self.inconsistent_series_ids = inconsistent_series_ids
self.confidence_scores = confidence_scores
self.timestamp = timestamp
self.epsilon = epsilon
self.principle_trend = principle_trend

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class LabelRequest(Model):
:param type: Required. Possible values include: 'changePoint', 'anomaly'
:type type: str or
~azure.cognitiveservices.anomalydetector.models.LabelType
:param value: Required. Possible values include: 'true', 'false'
:param value: Required. Possible values include: 'positiveAnomaly',
'negativeAnomaly', 'positiveChangePoint', 'negativeChangePoint'
:type value: str or
~azure.cognitiveservices.anomalydetector.models.LabelValue
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class LabelRequest(Model):
:param type: Required. Possible values include: 'changePoint', 'anomaly'
:type type: str or
~azure.cognitiveservices.anomalydetector.models.LabelType
:param value: Required. Possible values include: 'true', 'false'
:param value: Required. Possible values include: 'positiveAnomaly',
'negativeAnomaly', 'positiveChangePoint', 'negativeChangePoint'
:type value: str or
~azure.cognitiveservices.anomalydetector.models.LabelValue
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@ class TimeSeries(Model):
'daily', 'hourly', 'minutely'
:type granularity: str or
~azure.cognitiveservices.anomalydetector.models.Granularity
:param dimensions: Property of a time series
:type dimensions: dict[str, str]
:param custom_interval: Custom Interval is used to set non-standard time
interval, for example, if the series is 5 minutes, request can be set as
{"granularity":"minutely", "customInterval":5}.
:type custom_interval: int
:param retention_duration_in_hours: Hours that the data is kept.
:type retention_duration_in_hours: int
:param description: Description for the time series.
:type description: str
:param name: Name of the time series.
:type name: str
"""

_validation = {
Expand All @@ -47,19 +41,13 @@ class TimeSeries(Model):
_attribute_map = {
'series_id': {'key': 'seriesId', 'type': 'str'},
'granularity': {'key': 'granularity', 'type': 'Granularity'},
'dimensions': {'key': 'dimensions', 'type': '{str}'},
'custom_interval': {'key': 'customInterval', 'type': 'int'},
'retention_duration_in_hours': {'key': 'retentionDurationInHours', 'type': 'int'},
'description': {'key': 'description', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, **kwargs):
super(TimeSeries, self).__init__(**kwargs)
self.series_id = kwargs.get('series_id', None)
self.granularity = kwargs.get('granularity', None)
self.dimensions = kwargs.get('dimensions', None)
self.custom_interval = kwargs.get('custom_interval', None)
self.retention_duration_in_hours = kwargs.get('retention_duration_in_hours', None)
self.description = kwargs.get('description', None)
self.name = kwargs.get('name', None)
Loading

0 comments on commit 6fe271a

Please sign in to comment.