From aeaa3ee96b4ec76b810ffa93d17bfccf0d275b8f Mon Sep 17 00:00:00 2001 From: KarishmaGhiya Date: Wed, 3 Mar 2021 21:04:35 -0800 Subject: [PATCH] Fix enums that were gone after moving to V6 SDK code generator (#14067) Co-authored-by: Jose Manuel Heredia Hidalgo --- .../review/ai-metrics-advisor.api.md | 156 +--- .../src/generated/models/index.ts | 790 +++--------------- .../src/generated/models/mappers.ts | 185 +++- .../src/generated/models/parameters.ts | 32 +- .../ai-metrics-advisor/src/models.ts | 42 +- .../ai-metrics-advisor/src/transforms.ts | 2 +- .../ai-metrics-advisor/swagger/README.md | 38 +- 7 files changed, 339 insertions(+), 906 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md b/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md index aca5454cf681..5466cd7b90ae 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md +++ b/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md @@ -78,7 +78,7 @@ export interface AnomalyDetectionConfiguration { } // @public -export type AnomalyDetectorDirection = string; +export type AnomalyDetectorDirection = "Both" | "Down" | "Up"; // @public export interface AnomalyIncident { @@ -99,7 +99,7 @@ export type AnomalySeverity = "Low" | "Medium" | "High"; export type AnomalyStatus = "Active" | "Resolved"; // @public -export type AnomalyValue = string; +export type AnomalyValue = "AutoDetect" | "Anomaly" | "NotAnomaly"; // @public export type AzureApplicationInsightsDataFeedSource = { @@ -210,13 +210,13 @@ export type DataFeed = { } & DataFeedOptions; // @public -export type DataFeedAccessMode = "Private" | "Public" | string; +export type DataFeedAccessMode = "Private" | "Public"; // @public export type DataFeedDescriptor = Omit; // @public -export type DataFeedDetailStatus = string; +export type DataFeedDetailStatus = "Active" | "Paused"; // @public export interface DataFeedDimension { @@ -226,8 +226,7 @@ export interface DataFeedDimension { // @public export type DataFeedGranularity = { - granularityType: "Yearly" | "Monthly" | "Weekly" | "Daily" | "Hourly" | "PerMinute" | "PerSecond" | string; - customGranularityValue?: number; + granularityType: "Yearly" | "Monthly" | "Weekly" | "Daily" | "Hourly" | "PerMinute" | "PerSecond"; } | { granularityType: "Custom"; customGranularityValue: number; @@ -258,8 +257,7 @@ export interface DataFeedMetric { // @public export type DataFeedMissingDataPointFillSettings = { - fillType: "SmartFilling" | "PreviousValue" | "NoFilling" | string; - customFillValue?: number; + fillType: "SmartFilling" | "PreviousValue" | "NoFilling"; } | { fillType: "CustomValue"; customFillValue: number; @@ -289,7 +287,7 @@ export type DataFeedPatch = { }; // @public -export type DataFeedRollupMethod = "None" | "Sum" | "Max" | "Min" | "Avg" | "Count" | string; +export type DataFeedRollupMethod = "None" | "Sum" | "Max" | "Min" | "Avg" | "Count"; // @public export type DataFeedRollupSettings = { @@ -329,7 +327,7 @@ export interface DataFeedsPageResponse extends Array { } // @public (undocumented) -export type DataFeedStatus = "Paused" | "Active" | string; +export type DataFeedStatus = "Paused" | "Active"; // @public export interface DataPointAnomaly { @@ -344,7 +342,7 @@ export interface DataPointAnomaly { } // @public -export type DataSourceType = string; +export type DataSourceType = "AzureApplicationInsights" | "AzureBlob" | "AzureCosmosDB" | "AzureDataExplorer" | "AzureDataLakeStorageGen2" | "AzureTable" | "Elasticsearch" | "HttpRequest" | "InfluxDB" | "MongoDB" | "MySql" | "PostgreSql" | "SqlServer"; // @public export interface DetectionConditionsCommon { @@ -355,7 +353,7 @@ export interface DetectionConditionsCommon { } // @public -export type DetectionConditionsOperator = "AND" | "OR" | string; +export type DetectionConditionsOperator = "AND" | "OR"; // @public export interface DetectionConfigurationsPageResponse extends Array { @@ -416,10 +414,10 @@ export interface EnrichmentStatus { } // @public -export type FeedbackQueryTimeMode = string; +export type FeedbackQueryTimeMode = "MetricTimestamp" | "FeedbackCreatedTime"; // @public -export type FeedbackType = string; +export type FeedbackType = "Anomaly" | "ChangePoint" | "Period" | "Comment"; // @public export type GetAnomalyAlertConfigurationResponse = AnomalyAlertConfiguration & { @@ -592,123 +590,7 @@ export interface IngestionStatusPageResponse extends Array { } // @public -export type IngestionStatusType = string; - -// @public -export const enum KnownAnomalyDetectorDirection { - // (undocumented) - Both = "Both", - // (undocumented) - Down = "Down", - // (undocumented) - Up = "Up" -} - -// @public -export const enum KnownAnomalyValue { - // (undocumented) - Anomaly = "Anomaly", - // (undocumented) - AutoDetect = "AutoDetect", - // (undocumented) - NotAnomaly = "NotAnomaly" -} - -// @public -export const enum KnownDataFeedDetailStatus { - // (undocumented) - Active = "Active", - // (undocumented) - Paused = "Paused" -} - -// @public -export const enum KnownDataSourceType { - // (undocumented) - AzureApplicationInsights = "AzureApplicationInsights", - // (undocumented) - AzureBlob = "AzureBlob", - // (undocumented) - AzureCosmosDB = "AzureCosmosDB", - // (undocumented) - AzureDataExplorer = "AzureDataExplorer", - // (undocumented) - AzureDataLakeStorageGen2 = "AzureDataLakeStorageGen2", - // (undocumented) - AzureTable = "AzureTable", - // (undocumented) - Elasticsearch = "Elasticsearch", - // (undocumented) - HttpRequest = "HttpRequest", - // (undocumented) - InfluxDB = "InfluxDB", - // (undocumented) - MongoDB = "MongoDB", - // (undocumented) - MySql = "MySql", - // (undocumented) - PostgreSql = "PostgreSql", - // (undocumented) - SqlServer = "SqlServer" -} - -// @public -export const enum KnownFeedbackQueryTimeMode { - // (undocumented) - FeedbackCreatedTime = "FeedbackCreatedTime", - // (undocumented) - MetricTimestamp = "MetricTimestamp" -} - -// @public -export const enum KnownFeedbackType { - // (undocumented) - Anomaly = "Anomaly", - // (undocumented) - ChangePoint = "ChangePoint", - // (undocumented) - Comment = "Comment", - // (undocumented) - Period = "Period" -} - -// @public -export const enum KnownIngestionStatusType { - // (undocumented) - Error = "Error", - // (undocumented) - Failed = "Failed", - // (undocumented) - NoData = "NoData", - // (undocumented) - NotStarted = "NotStarted", - // (undocumented) - Paused = "Paused", - // (undocumented) - Running = "Running", - // (undocumented) - Scheduled = "Scheduled", - // (undocumented) - Succeeded = "Succeeded" -} - -// @public -export const enum KnownSeverity { - // (undocumented) - High = "High", - // (undocumented) - Low = "Low", - // (undocumented) - Medium = "Medium" -} - -// @public -export const enum KnownSnoozeScope { - // (undocumented) - Metric = "Metric", - // (undocumented) - Series = "Series" -} +export type IngestionStatusType = "NotStarted" | "Scheduled" | "Running" | "Succeeded" | "Failed" | "NoData" | "Error" | "Paused"; // @public export type ListAlertsOptions = { @@ -811,7 +693,7 @@ export interface MetricAlertConfiguration { } // @public -export type MetricAnomalyAlertConfigurationsOperator = "AND" | "OR" | "XOR" | string; +export type MetricAnomalyAlertConfigurationsOperator = "AND" | "OR" | "XOR"; // @public export type MetricAnomalyAlertScope = { @@ -829,7 +711,7 @@ export type MetricAnomalyFeedback = { feedbackType: "Anomaly"; startTime: Date; endTime: Date; - value: "AutoDetect" | "Anomaly" | "NotAnomaly" | string; + value: "AutoDetect" | "Anomaly" | "NotAnomaly"; readonly anomalyDetectionConfigurationId?: string; readonly anomalyDetectionConfigurationSnapshot?: AnomalyDetectionConfiguration; } & MetricFeedbackCommon; @@ -857,7 +739,7 @@ export type MetricBoundaryCondition = { export type MetricChangePointFeedback = { feedbackType: "ChangePoint"; startTime: Date; - value: "AutoDetect" | "ChangePoint" | "NotChangePoint" | string; + value: "AutoDetect" | "ChangePoint" | "NotChangePoint"; } & MetricFeedbackCommon; // @public @@ -916,7 +798,7 @@ export type MetricFeedbackUnion = MetricAnomalyFeedback | MetricChangePointFeedb // @public export type MetricPeriodFeedback = { feedbackType: "Period"; - periodType: "AutoDetect" | "AssignValue" | string; + periodType: "AutoDetect" | "AssignValue"; periodValue: number; } & MetricFeedbackCommon; @@ -1064,7 +946,7 @@ export type PostgreSqlDataFeedSource = { }; // @public -export type Severity = string; +export type Severity = "Low" | "Medium" | "High"; // @public (undocumented) export interface SeverityCondition { @@ -1087,7 +969,7 @@ export interface SmartDetectionCondition { } // @public -export type SnoozeScope = string; +export type SnoozeScope = "Metric" | "Series"; // @public export type SQLServerDataFeedSource = { diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/index.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/index.ts index ec5b4eb8ed65..2c39f78ca4a9 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/index.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/index.ts @@ -98,7 +98,7 @@ export interface AnomalyAlertingConfiguration { * * should be specified when setting up multiple metric alerting configurations */ - crossMetricsOperator?: AnomalyAlertingConfigurationCrossMetricsOperator; + crossMetricsOperator?: CrossMetricsOperator; /** hook unique ids */ hookIds: string[]; /** Anomaly alerting configurations */ @@ -184,7 +184,7 @@ export interface AnomalyAlertingConfigurationPatch { /** anomaly alerting configuration description */ description?: string; /** cross metrics operator */ - crossMetricsOperator?: AnomalyAlertingConfigurationPatchCrossMetricsOperator; + crossMetricsOperator?: CrossMetricsOperator; /** hook unique ids */ hookIds?: string[]; /** Anomaly alerting configurations */ @@ -278,7 +278,7 @@ export interface AnomalyProperty { * only return for alerting anomaly result * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly anomalyStatus?: AnomalyPropertyAnomalyStatus; + readonly anomalyStatus?: AnomalyStatus; } export interface IncidentResultList { @@ -325,7 +325,7 @@ export interface IncidentProperty { * only return for alerting incident result * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly incidentStatus?: IncidentPropertyIncidentStatus; + readonly incidentStatus?: IncidentStatus; } export interface AnomalyDetectionConfiguration { @@ -353,7 +353,7 @@ export interface WholeMetricConfiguration { * * should be specified when combining multiple detection conditions */ - conditionOperator?: WholeMetricConfigurationConditionOperator; + conditionOperator?: ConditionOperator; smartDetectionCondition?: SmartDetectionCondition; hardThresholdCondition?: HardThresholdCondition; changeThresholdCondition?: ChangeThresholdCondition; @@ -414,7 +414,7 @@ export interface DimensionGroupConfiguration { * * should be specified when combining multiple detection conditions */ - conditionOperator?: DimensionGroupConfigurationConditionOperator; + conditionOperator?: ConditionOperator; smartDetectionCondition?: SmartDetectionCondition; hardThresholdCondition?: HardThresholdCondition; changeThresholdCondition?: ChangeThresholdCondition; @@ -427,7 +427,7 @@ export interface SeriesConfiguration { * * should be specified when combining multiple detection conditions */ - conditionOperator?: SeriesConfigurationConditionOperator; + conditionOperator?: ConditionOperator; smartDetectionCondition?: SmartDetectionCondition; hardThresholdCondition?: HardThresholdCondition; changeThresholdCondition?: ChangeThresholdCondition; @@ -598,7 +598,7 @@ export interface DataFeedDetail { /** mark if the data feed need rollup */ needRollup?: NeedRollupEnum; /** roll up method */ - rollUpMethod?: DataFeedDetailRollUpMethod; + rollUpMethod?: RollUpMethod; /** roll up columns */ rollUpColumns?: string[]; /** the identification value for the row of calculated all-up value. */ @@ -627,7 +627,7 @@ export interface DataFeedDetail { * data feed status * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly status?: DataFeedDetailStatus; + readonly status?: Status; /** * data feed created time * NOTE: This property will not be serialized. It can only be populated by the server. @@ -693,25 +693,25 @@ export interface DataFeedDetailPatch { /** stop retry data ingestion after the data slice first schedule time in seconds. */ stopRetryAfterInSeconds?: number; /** mark if the data feed need rollup */ - needRollup?: DataFeedDetailPatchNeedRollup; + needRollup?: NeedRollup; /** roll up method */ - rollUpMethod?: DataFeedDetailPatchRollUpMethod; + rollUpMethod?: RollUpMethod; /** roll up columns */ rollUpColumns?: string[]; /** the identification value for the row of calculated all-up value. */ allUpIdentification?: string; /** the type of fill missing point for anomaly detection */ - fillMissingPointType?: DataFeedDetailPatchFillMissingPointType; + fillMissingPointType?: FillMissingPointType; /** the value of fill missing point for anomaly detection */ fillMissingPointValue?: number; /** data feed access mode, default is Private */ - viewMode?: DataFeedDetailPatchViewMode; + viewMode?: ViewMode; /** data feed administrator */ admins?: string[]; /** data feed viewer */ viewers?: string[]; /** data feed status */ - status?: DataFeedDetailPatchStatus; + status?: Status; /** action link for alert */ actionLinkTemplate?: string; } @@ -1361,683 +1361,91 @@ export interface GeneratedClientCreateHookHeaders { location?: string; } -/** Known values of {@link AnomalyAlertingConfigurationCrossMetricsOperator} that the service accepts. */ -export const enum KnownAnomalyAlertingConfigurationCrossMetricsOperator { - AND = "AND", - OR = "OR", - XOR = "XOR" -} - -/** - * Defines values for AnomalyAlertingConfigurationCrossMetricsOperator. \ - * {@link KnownAnomalyAlertingConfigurationCrossMetricsOperator} can be used interchangeably with AnomalyAlertingConfigurationCrossMetricsOperator, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AND** \ - * **OR** \ - * **XOR** - */ -export type AnomalyAlertingConfigurationCrossMetricsOperator = string; - -/** Known values of {@link AnomalyScope} that the service accepts. */ -export const enum KnownAnomalyScope { - All = "All", - Dimension = "Dimension", - TopN = "TopN" -} - -/** - * Defines values for AnomalyScope. \ - * {@link KnownAnomalyScope} can be used interchangeably with AnomalyScope, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **All** \ - * **Dimension** \ - * **TopN** - */ -export type AnomalyScope = string; - -/** Known values of {@link Severity} that the service accepts. */ -export const enum KnownSeverity { - Low = "Low", - Medium = "Medium", - High = "High" -} - -/** - * Defines values for Severity. \ - * {@link KnownSeverity} can be used interchangeably with Severity, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Low** \ - * **Medium** \ - * **High** - */ -export type Severity = string; - -/** Known values of {@link SnoozeScope} that the service accepts. */ -export const enum KnownSnoozeScope { - Metric = "Metric", - Series = "Series" -} - -/** - * Defines values for SnoozeScope. \ - * {@link KnownSnoozeScope} can be used interchangeably with SnoozeScope, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Metric** \ - * **Series** - */ -export type SnoozeScope = string; - -/** Known values of {@link Direction} that the service accepts. */ -export const enum KnownDirection { - Both = "Both", - Down = "Down", - Up = "Up" -} - -/** - * Defines values for Direction. \ - * {@link KnownDirection} can be used interchangeably with Direction, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Both** \ - * **Down** \ - * **Up** - */ -export type Direction = string; - -/** Known values of {@link AnomalyAlertingConfigurationPatchCrossMetricsOperator} that the service accepts. */ -export const enum KnownAnomalyAlertingConfigurationPatchCrossMetricsOperator { - AND = "AND", - OR = "OR", - XOR = "XOR" -} - -/** - * Defines values for AnomalyAlertingConfigurationPatchCrossMetricsOperator. \ - * {@link KnownAnomalyAlertingConfigurationPatchCrossMetricsOperator} can be used interchangeably with AnomalyAlertingConfigurationPatchCrossMetricsOperator, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AND** \ - * **OR** \ - * **XOR** - */ -export type AnomalyAlertingConfigurationPatchCrossMetricsOperator = string; - -/** Known values of {@link TimeMode} that the service accepts. */ -export const enum KnownTimeMode { - AnomalyTime = "AnomalyTime", - CreatedTime = "CreatedTime", - ModifiedTime = "ModifiedTime" -} - -/** - * Defines values for TimeMode. \ - * {@link KnownTimeMode} can be used interchangeably with TimeMode, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AnomalyTime** \ - * **CreatedTime** \ - * **ModifiedTime** - */ -export type TimeMode = string; - -/** Known values of {@link AnomalyPropertyAnomalyStatus} that the service accepts. */ -export const enum KnownAnomalyPropertyAnomalyStatus { - Active = "Active", - Resolved = "Resolved" -} - -/** - * Defines values for AnomalyPropertyAnomalyStatus. \ - * {@link KnownAnomalyPropertyAnomalyStatus} can be used interchangeably with AnomalyPropertyAnomalyStatus, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Active** \ - * **Resolved** - */ -export type AnomalyPropertyAnomalyStatus = string; - -/** Known values of {@link IncidentPropertyIncidentStatus} that the service accepts. */ -export const enum KnownIncidentPropertyIncidentStatus { - Active = "Active", - Resolved = "Resolved" -} - -/** - * Defines values for IncidentPropertyIncidentStatus. \ - * {@link KnownIncidentPropertyIncidentStatus} can be used interchangeably with IncidentPropertyIncidentStatus, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Active** \ - * **Resolved** - */ -export type IncidentPropertyIncidentStatus = string; - -/** Known values of {@link WholeMetricConfigurationConditionOperator} that the service accepts. */ -export const enum KnownWholeMetricConfigurationConditionOperator { - AND = "AND", - OR = "OR" -} - -/** - * Defines values for WholeMetricConfigurationConditionOperator. \ - * {@link KnownWholeMetricConfigurationConditionOperator} can be used interchangeably with WholeMetricConfigurationConditionOperator, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AND** \ - * **OR** - */ -export type WholeMetricConfigurationConditionOperator = string; - -/** Known values of {@link AnomalyDetectorDirection} that the service accepts. */ -export const enum KnownAnomalyDetectorDirection { - Both = "Both", - Down = "Down", - Up = "Up" -} - -/** - * Defines values for AnomalyDetectorDirection. \ - * {@link KnownAnomalyDetectorDirection} can be used interchangeably with AnomalyDetectorDirection, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Both** \ - * **Down** \ - * **Up** - */ -export type AnomalyDetectorDirection = string; - -/** Known values of {@link DimensionGroupConfigurationConditionOperator} that the service accepts. */ -export const enum KnownDimensionGroupConfigurationConditionOperator { - AND = "AND", - OR = "OR" -} - -/** - * Defines values for DimensionGroupConfigurationConditionOperator. \ - * {@link KnownDimensionGroupConfigurationConditionOperator} can be used interchangeably with DimensionGroupConfigurationConditionOperator, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AND** \ - * **OR** - */ -export type DimensionGroupConfigurationConditionOperator = string; - -/** Known values of {@link SeriesConfigurationConditionOperator} that the service accepts. */ -export const enum KnownSeriesConfigurationConditionOperator { - AND = "AND", - OR = "OR" -} - -/** - * Defines values for SeriesConfigurationConditionOperator. \ - * {@link KnownSeriesConfigurationConditionOperator} can be used interchangeably with SeriesConfigurationConditionOperator, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AND** \ - * **OR** - */ -export type SeriesConfigurationConditionOperator = string; - -/** Known values of {@link DataSourceType} that the service accepts. */ -export const enum KnownDataSourceType { - AzureApplicationInsights = "AzureApplicationInsights", - AzureBlob = "AzureBlob", - AzureCosmosDB = "AzureCosmosDB", - AzureDataExplorer = "AzureDataExplorer", - AzureDataLakeStorageGen2 = "AzureDataLakeStorageGen2", - AzureTable = "AzureTable", - Elasticsearch = "Elasticsearch", - HttpRequest = "HttpRequest", - InfluxDB = "InfluxDB", - MongoDB = "MongoDB", - MySql = "MySql", - PostgreSql = "PostgreSql", - SqlServer = "SqlServer" -} - -/** - * Defines values for DataSourceType. \ - * {@link KnownDataSourceType} can be used interchangeably with DataSourceType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AzureApplicationInsights** \ - * **AzureBlob** \ - * **AzureCosmosDB** \ - * **AzureDataExplorer** \ - * **AzureDataLakeStorageGen2** \ - * **AzureTable** \ - * **Elasticsearch** \ - * **HttpRequest** \ - * **InfluxDB** \ - * **MongoDB** \ - * **MySql** \ - * **PostgreSql** \ - * **SqlServer** - */ -export type DataSourceType = string; - -/** Known values of {@link Granularity} that the service accepts. */ -export const enum KnownGranularity { - Yearly = "Yearly", - Monthly = "Monthly", - Weekly = "Weekly", - Daily = "Daily", - Hourly = "Hourly", - Minutely = "Minutely", - Secondly = "Secondly", - Custom = "Custom" -} - -/** - * Defines values for Granularity. \ - * {@link KnownGranularity} can be used interchangeably with Granularity, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Yearly** \ - * **Monthly** \ - * **Weekly** \ - * **Daily** \ - * **Hourly** \ - * **Minutely** \ - * **Secondly** \ - * **Custom** - */ -export type Granularity = string; - -/** Known values of {@link EntityStatus} that the service accepts. */ -export const enum KnownEntityStatus { - Active = "Active", - Paused = "Paused" -} - -/** - * Defines values for EntityStatus. \ - * {@link KnownEntityStatus} can be used interchangeably with EntityStatus, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Active** \ - * **Paused** - */ -export type EntityStatus = string; - -/** Known values of {@link NeedRollupEnum} that the service accepts. */ -export const enum KnownNeedRollupEnum { - NoRollup = "NoRollup", - NeedRollup = "NeedRollup", - AlreadyRollup = "AlreadyRollup" -} - -/** - * Defines values for NeedRollupEnum. \ - * {@link KnownNeedRollupEnum} can be used interchangeably with NeedRollupEnum, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **NoRollup** \ - * **NeedRollup** \ - * **AlreadyRollup** - */ -export type NeedRollupEnum = string; - -/** Known values of {@link DataFeedDetailRollUpMethod} that the service accepts. */ -export const enum KnownDataFeedDetailRollUpMethod { - None = "None", - Sum = "Sum", - Max = "Max", - Min = "Min", - Avg = "Avg", - Count = "Count" -} - -/** - * Defines values for DataFeedDetailRollUpMethod. \ - * {@link KnownDataFeedDetailRollUpMethod} can be used interchangeably with DataFeedDetailRollUpMethod, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **None** \ - * **Sum** \ - * **Max** \ - * **Min** \ - * **Avg** \ - * **Count** - */ -export type DataFeedDetailRollUpMethod = string; - -/** Known values of {@link FillMissingPointType} that the service accepts. */ -export const enum KnownFillMissingPointType { - SmartFilling = "SmartFilling", - PreviousValue = "PreviousValue", - CustomValue = "CustomValue", - NoFilling = "NoFilling" -} - -/** - * Defines values for FillMissingPointType. \ - * {@link KnownFillMissingPointType} can be used interchangeably with FillMissingPointType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **SmartFilling** \ - * **PreviousValue** \ - * **CustomValue** \ - * **NoFilling** - */ -export type FillMissingPointType = string; - -/** Known values of {@link ViewMode} that the service accepts. */ -export const enum KnownViewMode { - Private = "Private", - Public = "Public" -} - -/** - * Defines values for ViewMode. \ - * {@link KnownViewMode} can be used interchangeably with ViewMode, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Private** \ - * **Public** - */ -export type ViewMode = string; - -/** Known values of {@link DataFeedDetailStatus} that the service accepts. */ -export const enum KnownDataFeedDetailStatus { - Active = "Active", - Paused = "Paused" -} - -/** - * Defines values for DataFeedDetailStatus. \ - * {@link KnownDataFeedDetailStatus} can be used interchangeably with DataFeedDetailStatus, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Active** \ - * **Paused** - */ -export type DataFeedDetailStatus = string; - -/** Known values of {@link DataFeedDetailPatchDataSourceType} that the service accepts. */ -export const enum KnownDataFeedDetailPatchDataSourceType { - AzureApplicationInsights = "AzureApplicationInsights", - AzureBlob = "AzureBlob", - AzureCosmosDB = "AzureCosmosDB", - AzureDataExplorer = "AzureDataExplorer", - AzureDataLakeStorageGen2 = "AzureDataLakeStorageGen2", - AzureTable = "AzureTable", - Elasticsearch = "Elasticsearch", - HttpRequest = "HttpRequest", - InfluxDB = "InfluxDB", - MongoDB = "MongoDB", - MySql = "MySql", - PostgreSql = "PostgreSql", - SqlServer = "SqlServer" -} - -/** - * Defines values for DataFeedDetailPatchDataSourceType. \ - * {@link KnownDataFeedDetailPatchDataSourceType} can be used interchangeably with DataFeedDetailPatchDataSourceType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AzureApplicationInsights** \ - * **AzureBlob** \ - * **AzureCosmosDB** \ - * **AzureDataExplorer** \ - * **AzureDataLakeStorageGen2** \ - * **AzureTable** \ - * **Elasticsearch** \ - * **HttpRequest** \ - * **InfluxDB** \ - * **MongoDB** \ - * **MySql** \ - * **PostgreSql** \ - * **SqlServer** - */ -export type DataFeedDetailPatchDataSourceType = string; - -/** Known values of {@link DataFeedDetailPatchNeedRollup} that the service accepts. */ -export const enum KnownDataFeedDetailPatchNeedRollup { - NoRollup = "NoRollup", - NeedRollup = "NeedRollup", - AlreadyRollup = "AlreadyRollup" -} - -/** - * Defines values for DataFeedDetailPatchNeedRollup. \ - * {@link KnownDataFeedDetailPatchNeedRollup} can be used interchangeably with DataFeedDetailPatchNeedRollup, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **NoRollup** \ - * **NeedRollup** \ - * **AlreadyRollup** - */ -export type DataFeedDetailPatchNeedRollup = string; - -/** Known values of {@link DataFeedDetailPatchRollUpMethod} that the service accepts. */ -export const enum KnownDataFeedDetailPatchRollUpMethod { - None = "None", - Sum = "Sum", - Max = "Max", - Min = "Min", - Avg = "Avg", - Count = "Count" -} - -/** - * Defines values for DataFeedDetailPatchRollUpMethod. \ - * {@link KnownDataFeedDetailPatchRollUpMethod} can be used interchangeably with DataFeedDetailPatchRollUpMethod, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **None** \ - * **Sum** \ - * **Max** \ - * **Min** \ - * **Avg** \ - * **Count** - */ -export type DataFeedDetailPatchRollUpMethod = string; - -/** Known values of {@link DataFeedDetailPatchFillMissingPointType} that the service accepts. */ -export const enum KnownDataFeedDetailPatchFillMissingPointType { - SmartFilling = "SmartFilling", - PreviousValue = "PreviousValue", - CustomValue = "CustomValue", - NoFilling = "NoFilling" -} - -/** - * Defines values for DataFeedDetailPatchFillMissingPointType. \ - * {@link KnownDataFeedDetailPatchFillMissingPointType} can be used interchangeably with DataFeedDetailPatchFillMissingPointType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **SmartFilling** \ - * **PreviousValue** \ - * **CustomValue** \ - * **NoFilling** - */ -export type DataFeedDetailPatchFillMissingPointType = string; - -/** Known values of {@link DataFeedDetailPatchViewMode} that the service accepts. */ -export const enum KnownDataFeedDetailPatchViewMode { - Private = "Private", - Public = "Public" -} - -/** - * Defines values for DataFeedDetailPatchViewMode. \ - * {@link KnownDataFeedDetailPatchViewMode} can be used interchangeably with DataFeedDetailPatchViewMode, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Private** \ - * **Public** - */ -export type DataFeedDetailPatchViewMode = string; - -/** Known values of {@link DataFeedDetailPatchStatus} that the service accepts. */ -export const enum KnownDataFeedDetailPatchStatus { - Active = "Active", - Paused = "Paused" -} - -/** - * Defines values for DataFeedDetailPatchStatus. \ - * {@link KnownDataFeedDetailPatchStatus} can be used interchangeably with DataFeedDetailPatchStatus, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Active** \ - * **Paused** - */ -export type DataFeedDetailPatchStatus = string; - -/** Known values of {@link FeedbackType} that the service accepts. */ -export const enum KnownFeedbackType { - Anomaly = "Anomaly", - ChangePoint = "ChangePoint", - Period = "Period", - Comment = "Comment" -} - -/** - * Defines values for FeedbackType. \ - * {@link KnownFeedbackType} can be used interchangeably with FeedbackType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Anomaly** \ - * **ChangePoint** \ - * **Period** \ - * **Comment** - */ -export type FeedbackType = string; - -/** Known values of {@link FeedbackQueryTimeMode} that the service accepts. */ -export const enum KnownFeedbackQueryTimeMode { - MetricTimestamp = "MetricTimestamp", - FeedbackCreatedTime = "FeedbackCreatedTime" -} - -/** - * Defines values for FeedbackQueryTimeMode. \ - * {@link KnownFeedbackQueryTimeMode} can be used interchangeably with FeedbackQueryTimeMode, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **MetricTimestamp** \ - * **FeedbackCreatedTime** - */ -export type FeedbackQueryTimeMode = string; - -/** Known values of {@link HookType} that the service accepts. */ -export const enum KnownHookType { - Webhook = "Webhook", - Email = "Email" -} - -/** - * Defines values for HookType. \ - * {@link KnownHookType} can be used interchangeably with HookType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Webhook** \ - * **Email** - */ -export type HookType = string; - -/** Known values of {@link HookInfoPatchHookType} that the service accepts. */ -export const enum KnownHookInfoPatchHookType { - Webhook = "Webhook", - Email = "Email" -} - -/** - * Defines values for HookInfoPatchHookType. \ - * {@link KnownHookInfoPatchHookType} can be used interchangeably with HookInfoPatchHookType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **Webhook** \ - * **Email** - */ -export type HookInfoPatchHookType = string; - -/** Known values of {@link IngestionStatusType} that the service accepts. */ -export const enum KnownIngestionStatusType { - NotStarted = "NotStarted", - Scheduled = "Scheduled", - Running = "Running", - Succeeded = "Succeeded", - Failed = "Failed", - NoData = "NoData", - Error = "Error", - Paused = "Paused" -} - -/** - * Defines values for IngestionStatusType. \ - * {@link KnownIngestionStatusType} can be used interchangeably with IngestionStatusType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **NotStarted** \ - * **Scheduled** \ - * **Running** \ - * **Succeeded** \ - * **Failed** \ - * **NoData** \ - * **Error** \ - * **Paused** - */ -export type IngestionStatusType = string; - -/** Known values of {@link AnomalyValue} that the service accepts. */ -export const enum KnownAnomalyValue { - AutoDetect = "AutoDetect", - Anomaly = "Anomaly", - NotAnomaly = "NotAnomaly" -} - -/** - * Defines values for AnomalyValue. \ - * {@link KnownAnomalyValue} can be used interchangeably with AnomalyValue, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AutoDetect** \ - * **Anomaly** \ - * **NotAnomaly** - */ -export type AnomalyValue = string; - -/** Known values of {@link ChangePointValue} that the service accepts. */ -export const enum KnownChangePointValue { - AutoDetect = "AutoDetect", - ChangePoint = "ChangePoint", - NotChangePoint = "NotChangePoint" -} - -/** - * Defines values for ChangePointValue. \ - * {@link KnownChangePointValue} can be used interchangeably with ChangePointValue, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AutoDetect** \ - * **ChangePoint** \ - * **NotChangePoint** - */ -export type ChangePointValue = string; - -/** Known values of {@link PeriodType} that the service accepts. */ -export const enum KnownPeriodType { - AutoDetect = "AutoDetect", - AssignValue = "AssignValue" -} - -/** - * Defines values for PeriodType. \ - * {@link KnownPeriodType} can be used interchangeably with PeriodType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **AutoDetect** \ - * **AssignValue** - */ -export type PeriodType = string; +/** Defines values for CrossMetricsOperator. */ +export type CrossMetricsOperator = "AND" | "OR" | "XOR"; +/** Defines values for AnomalyScope. */ +export type AnomalyScope = "All" | "Dimension" | "TopN"; +/** Defines values for Severity. */ +export type Severity = "Low" | "Medium" | "High"; +/** Defines values for SnoozeScope. */ +export type SnoozeScope = "Metric" | "Series"; +/** Defines values for Direction. */ +export type Direction = "Both" | "Down" | "Up"; +/** Defines values for TimeMode. */ +export type TimeMode = "AnomalyTime" | "CreatedTime" | "ModifiedTime"; +/** Defines values for AnomalyStatus. */ +export type AnomalyStatus = "Active" | "Resolved"; +/** Defines values for IncidentStatus. */ +export type IncidentStatus = "Active" | "Resolved"; +/** Defines values for ConditionOperator. */ +export type ConditionOperator = "AND" | "OR"; +/** Defines values for AnomalyDetectorDirection. */ +export type AnomalyDetectorDirection = "Both" | "Down" | "Up"; +/** Defines values for DataSourceType. */ +export type DataSourceType = + | "AzureApplicationInsights" + | "AzureBlob" + | "AzureCosmosDB" + | "AzureDataExplorer" + | "AzureDataLakeStorageGen2" + | "AzureTable" + | "Elasticsearch" + | "HttpRequest" + | "InfluxDB" + | "MongoDB" + | "MySql" + | "PostgreSql" + | "SqlServer"; +/** Defines values for Granularity. */ +export type Granularity = + | "Yearly" + | "Monthly" + | "Weekly" + | "Daily" + | "Hourly" + | "Minutely" + | "Secondly" + | "Custom"; +/** Defines values for EntityStatus. */ +export type EntityStatus = "Active" | "Paused"; +/** Defines values for NeedRollupEnum. */ +export type NeedRollupEnum = "NoRollup" | "NeedRollup" | "AlreadyRollup"; +/** Defines values for RollUpMethod. */ +export type RollUpMethod = "None" | "Sum" | "Max" | "Min" | "Avg" | "Count"; +/** Defines values for FillMissingPointType. */ +export type FillMissingPointType = + | "SmartFilling" + | "PreviousValue" + | "CustomValue" + | "NoFilling"; +/** Defines values for ViewMode. */ +export type ViewMode = "Private" | "Public"; +/** Defines values for Status. */ +export type Status = "Active" | "Paused"; +/** Defines values for NeedRollup. */ +export type NeedRollup = "NoRollup" | "NeedRollup" | "AlreadyRollup"; +/** Defines values for FeedbackType. */ +export type FeedbackType = "Anomaly" | "ChangePoint" | "Period" | "Comment"; +/** Defines values for FeedbackQueryTimeMode. */ +export type FeedbackQueryTimeMode = "MetricTimestamp" | "FeedbackCreatedTime"; +/** Defines values for HookType. */ +export type HookType = "Webhook" | "Email"; +/** Defines values for IngestionStatusType. */ +export type IngestionStatusType = + | "NotStarted" + | "Scheduled" + | "Running" + | "Succeeded" + | "Failed" + | "NoData" + | "Error" + | "Paused"; +/** Defines values for AnomalyValue. */ +export type AnomalyValue = "AutoDetect" | "Anomaly" | "NotAnomaly"; +/** Defines values for ChangePointValue. */ +export type ChangePointValue = "AutoDetect" | "ChangePoint" | "NotChangePoint"; +/** Defines values for PeriodType. */ +export type PeriodType = "AutoDetect" | "AssignValue"; /** Contains response data for the getActiveSeriesCount operation. */ export type GeneratedClientGetActiveSeriesCountResponse = UsageStats & { diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/mappers.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/mappers.ts index 9aa85e9e634d..65935c0c2db1 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/mappers.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/mappers.ts @@ -101,7 +101,8 @@ export const AnomalyAlertingConfiguration: coreHttp.CompositeMapper = { crossMetricsOperator: { serializedName: "crossMetricsOperator", type: { - name: "String" + name: "Enum", + allowedValues: ["AND", "OR", "XOR"] } }, hookIds: { @@ -155,7 +156,8 @@ export const MetricAlertingConfiguration: coreHttp.CompositeMapper = { serializedName: "anomalyScopeType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["All", "Dimension", "TopN"] } }, negationOperation: { @@ -259,14 +261,16 @@ export const SeverityCondition: coreHttp.CompositeMapper = { serializedName: "minAlertSeverity", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Low", "Medium", "High"] } }, maxAlertSeverity: { serializedName: "maxAlertSeverity", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Low", "Medium", "High"] } } } @@ -289,7 +293,8 @@ export const AlertSnoozeCondition: coreHttp.CompositeMapper = { serializedName: "snoozeScope", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Metric", "Series"] } }, onlyForSuccessive: { @@ -324,7 +329,8 @@ export const ValueCondition: coreHttp.CompositeMapper = { serializedName: "direction", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Both", "Down", "Up"] } }, metricId: { @@ -363,7 +369,8 @@ export const AnomalyAlertingConfigurationPatch: coreHttp.CompositeMapper = { crossMetricsOperator: { serializedName: "crossMetricsOperator", type: { - name: "String" + name: "Enum", + allowedValues: ["AND", "OR", "XOR"] } }, hookIds: { @@ -422,7 +429,8 @@ export const AlertingResultQuery: coreHttp.CompositeMapper = { serializedName: "timeMode", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["AnomalyTime", "CreatedTime", "ModifiedTime"] } } } @@ -592,14 +600,16 @@ export const AnomalyProperty: coreHttp.CompositeMapper = { serializedName: "anomalySeverity", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Low", "Medium", "High"] } }, anomalyStatus: { serializedName: "anomalyStatus", readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Resolved"] } } } @@ -719,14 +729,16 @@ export const IncidentProperty: coreHttp.CompositeMapper = { serializedName: "maxSeverity", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Low", "Medium", "High"] } }, incidentStatus: { serializedName: "incidentStatus", readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Resolved"] } } } @@ -814,7 +826,8 @@ export const WholeMetricConfiguration: coreHttp.CompositeMapper = { conditionOperator: { serializedName: "conditionOperator", type: { - name: "String" + name: "Enum", + allowedValues: ["AND", "OR"] } }, smartDetectionCondition: { @@ -858,7 +871,8 @@ export const SmartDetectionCondition: coreHttp.CompositeMapper = { serializedName: "anomalyDetectorDirection", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Both", "Down", "Up"] } }, suppressCondition: { @@ -916,7 +930,8 @@ export const HardThresholdCondition: coreHttp.CompositeMapper = { serializedName: "anomalyDetectorDirection", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Both", "Down", "Up"] } }, suppressCondition: { @@ -960,7 +975,8 @@ export const ChangeThresholdCondition: coreHttp.CompositeMapper = { serializedName: "anomalyDetectorDirection", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Both", "Down", "Up"] } }, suppressCondition: { @@ -989,7 +1005,8 @@ export const DimensionGroupConfiguration: coreHttp.CompositeMapper = { conditionOperator: { serializedName: "conditionOperator", type: { - name: "String" + name: "Enum", + allowedValues: ["AND", "OR"] } }, smartDetectionCondition: { @@ -1032,7 +1049,8 @@ export const SeriesConfiguration: coreHttp.CompositeMapper = { conditionOperator: { serializedName: "conditionOperator", type: { - name: "String" + name: "Enum", + allowedValues: ["AND", "OR"] } }, smartDetectionCondition: { @@ -1371,14 +1389,16 @@ export const SeverityFilterCondition: coreHttp.CompositeMapper = { serializedName: "min", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Low", "Medium", "High"] } }, max: { serializedName: "max", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Low", "Medium", "High"] } } } @@ -1611,7 +1631,22 @@ export const DataFeedDetail: coreHttp.CompositeMapper = { serializedName: "dataSourceType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "AzureApplicationInsights", + "AzureBlob", + "AzureCosmosDB", + "AzureDataExplorer", + "AzureDataLakeStorageGen2", + "AzureTable", + "Elasticsearch", + "HttpRequest", + "InfluxDB", + "MongoDB", + "MySql", + "PostgreSql", + "SqlServer" + ] } }, dataFeedId: { @@ -1638,7 +1673,17 @@ export const DataFeedDetail: coreHttp.CompositeMapper = { serializedName: "granularityName", required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "Yearly", + "Monthly", + "Weekly", + "Daily", + "Hourly", + "Minutely", + "Secondly", + "Custom" + ] } }, granularityAmount: { @@ -1722,13 +1767,15 @@ export const DataFeedDetail: coreHttp.CompositeMapper = { defaultValue: "NeedRollup", serializedName: "needRollup", type: { - name: "String" + name: "Enum", + allowedValues: ["NoRollup", "NeedRollup", "AlreadyRollup"] } }, rollUpMethod: { serializedName: "rollUpMethod", type: { - name: "String" + name: "Enum", + allowedValues: ["None", "Sum", "Max", "Min", "Avg", "Count"] } }, rollUpColumns: { @@ -1752,10 +1799,15 @@ export const DataFeedDetail: coreHttp.CompositeMapper = { } }, fillMissingPointType: { - defaultValue: "SmartFilling", serializedName: "fillMissingPointType", type: { - name: "String" + name: "Enum", + allowedValues: [ + "SmartFilling", + "PreviousValue", + "CustomValue", + "NoFilling" + ] } }, fillMissingPointValue: { @@ -1765,10 +1817,10 @@ export const DataFeedDetail: coreHttp.CompositeMapper = { } }, viewMode: { - defaultValue: "Private", serializedName: "viewMode", type: { - name: "String" + name: "Enum", + allowedValues: ["Private", "Public"] } }, admins: { @@ -1814,11 +1866,11 @@ export const DataFeedDetail: coreHttp.CompositeMapper = { } }, status: { - defaultValue: "Active", serializedName: "status", readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Paused"] } }, createdTime: { @@ -1915,7 +1967,22 @@ export const DataFeedDetailPatch: coreHttp.CompositeMapper = { serializedName: "dataSourceType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "AzureApplicationInsights", + "AzureBlob", + "AzureCosmosDB", + "AzureDataExplorer", + "AzureDataLakeStorageGen2", + "AzureTable", + "Elasticsearch", + "HttpRequest", + "InfluxDB", + "MongoDB", + "MySql", + "PostgreSql", + "SqlServer" + ] } }, dataFeedName: { @@ -1969,13 +2036,15 @@ export const DataFeedDetailPatch: coreHttp.CompositeMapper = { needRollup: { serializedName: "needRollup", type: { - name: "String" + name: "Enum", + allowedValues: ["NoRollup", "NeedRollup", "AlreadyRollup"] } }, rollUpMethod: { serializedName: "rollUpMethod", type: { - name: "String" + name: "Enum", + allowedValues: ["None", "Sum", "Max", "Min", "Avg", "Count"] } }, rollUpColumns: { @@ -2001,7 +2070,13 @@ export const DataFeedDetailPatch: coreHttp.CompositeMapper = { fillMissingPointType: { serializedName: "fillMissingPointType", type: { - name: "String" + name: "Enum", + allowedValues: [ + "SmartFilling", + "PreviousValue", + "CustomValue", + "NoFilling" + ] } }, fillMissingPointValue: { @@ -2013,7 +2088,8 @@ export const DataFeedDetailPatch: coreHttp.CompositeMapper = { viewMode: { serializedName: "viewMode", type: { - name: "String" + name: "Enum", + allowedValues: ["Private", "Public"] } }, admins: { @@ -2047,7 +2123,8 @@ export const DataFeedDetailPatch: coreHttp.CompositeMapper = { status: { serializedName: "status", type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Paused"] } }, actionLinkTemplate: { @@ -2074,7 +2151,8 @@ export const MetricFeedback: coreHttp.CompositeMapper = { serializedName: "feedbackType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Anomaly", "ChangePoint", "Period", "Comment"] } }, feedbackId: { @@ -2155,7 +2233,8 @@ export const MetricFeedbackFilter: coreHttp.CompositeMapper = { feedbackType: { serializedName: "feedbackType", type: { - name: "String" + name: "Enum", + allowedValues: ["Anomaly", "ChangePoint", "Period", "Comment"] } }, startTime: { @@ -2173,7 +2252,8 @@ export const MetricFeedbackFilter: coreHttp.CompositeMapper = { timeMode: { serializedName: "timeMode", type: { - name: "String" + name: "Enum", + allowedValues: ["MetricTimestamp", "FeedbackCreatedTime"] } } } @@ -2255,7 +2335,8 @@ export const HookInfo: coreHttp.CompositeMapper = { serializedName: "hookType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Webhook", "Email"] } }, id: { @@ -2317,7 +2398,8 @@ export const HookInfoPatch: coreHttp.CompositeMapper = { serializedName: "hookType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["Webhook", "Email"] } }, hookName: { @@ -2425,7 +2507,17 @@ export const IngestionStatus: coreHttp.CompositeMapper = { serializedName: "status", readOnly: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "NotStarted", + "Scheduled", + "Running", + "Succeeded", + "Failed", + "NoData", + "Error", + "Paused" + ] } }, message: { @@ -3176,7 +3268,8 @@ export const AnomalyFeedbackValue: coreHttp.CompositeMapper = { serializedName: "anomalyValue", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["AutoDetect", "Anomaly", "NotAnomaly"] } } } @@ -3192,7 +3285,8 @@ export const ChangePointFeedbackValue: coreHttp.CompositeMapper = { serializedName: "changePointValue", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["AutoDetect", "ChangePoint", "NotChangePoint"] } } } @@ -3224,7 +3318,8 @@ export const PeriodFeedbackValue: coreHttp.CompositeMapper = { serializedName: "periodType", required: true, type: { - name: "String" + name: "Enum", + allowedValues: ["AutoDetect", "AssignValue"] } }, periodValue: { diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/parameters.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/parameters.ts index 5578fdf16e8f..30db2eb9469b 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/parameters.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/generated/models/parameters.ts @@ -206,7 +206,22 @@ export const dataSourceType: OperationQueryParameter = { mapper: { serializedName: "dataSourceType", type: { - name: "String" + name: "Enum", + allowedValues: [ + "AzureApplicationInsights", + "AzureBlob", + "AzureCosmosDB", + "AzureDataExplorer", + "AzureDataLakeStorageGen2", + "AzureTable", + "Elasticsearch", + "HttpRequest", + "InfluxDB", + "MongoDB", + "MySql", + "PostgreSql", + "SqlServer" + ] } } }; @@ -216,7 +231,17 @@ export const granularityName: OperationQueryParameter = { mapper: { serializedName: "granularityName", type: { - name: "String" + name: "Enum", + allowedValues: [ + "Yearly", + "Monthly", + "Weekly", + "Daily", + "Hourly", + "Minutely", + "Secondly", + "Custom" + ] } } }; @@ -226,7 +251,8 @@ export const status: OperationQueryParameter = { mapper: { serializedName: "status", type: { - name: "String" + name: "Enum", + allowedValues: ["Active", "Paused"] } } }; diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts index 721596f64ed3..f77182ab2023 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts @@ -19,17 +19,14 @@ import { EmailHookParameter, WebhookHookParameter, TopNGroupScope, - KnownSeverity, Severity, SeverityCondition, AlertSnoozeCondition, - DataFeedDetailStatus, - KnownDataFeedDetailStatus, - IngestionStatusType + IngestionStatusType, + Status as DataFeedDetailStatus } from "./generated/models"; export { - KnownSeverity, Severity, SeverityCondition, AlertSnoozeCondition, @@ -48,28 +45,20 @@ export { SuppressCondition, EmailHookParameter, WebhookHookParameter, - DataFeedDetailStatus, - KnownDataFeedDetailStatus + DataFeedDetailStatus }; // not used directly here but needed by public API surface. export { AnomalyValue, - KnownAnomalyValue, DataFeedIngestionProgress, IngestionStatusType, - KnownIngestionStatusType, DataSourceType, - KnownDataSourceType, SeverityFilterCondition, SnoozeScope, - KnownSnoozeScope, AnomalyDetectorDirection, - KnownAnomalyDetectorDirection, FeedbackType, - KnownFeedbackType, - FeedbackQueryTimeMode, - KnownFeedbackQueryTimeMode + FeedbackQueryTimeMode } from "./generated/models"; /** @@ -155,7 +144,7 @@ export interface DataFeedIngestionSettings { /** * Defines values for DataFeedRollupMethod. */ -export type DataFeedRollupMethod = "None" | "Sum" | "Max" | "Min" | "Avg" | "Count" | string; +export type DataFeedRollupMethod = "None" | "Sum" | "Max" | "Min" | "Avg" | "Count"; /** * Specifies the rollup settings for a data feed. @@ -192,8 +181,7 @@ export type DataFeedRollupSettings = */ export type DataFeedMissingDataPointFillSettings = | { - fillType: "SmartFilling" | "PreviousValue" | "NoFilling" | string; - customFillValue?: number; + fillType: "SmartFilling" | "PreviousValue" | "NoFilling"; } | { fillType: "CustomValue"; @@ -206,7 +194,7 @@ export type DataFeedMissingDataPointFillSettings = /** * Access mode of the data feed */ -export type DataFeedAccessMode = "Private" | "Public" | string; +export type DataFeedAccessMode = "Private" | "Public"; /** * Various optional configurations for a data feed. @@ -260,16 +248,14 @@ export type DataFeedGranularity = | "Daily" | "Hourly" | "PerMinute" - | "PerSecond" - | string; - customGranularityValue?: number; + | "PerSecond"; } | { granularityType: "Custom"; customGranularityValue: number; }; -export type DataFeedStatus = "Paused" | "Active" | string; +export type DataFeedStatus = "Paused" | "Active"; /** * Represents a Metrics Advisor data feed. @@ -496,12 +482,12 @@ export type DataFeedSourcePatch = Omit & /** * The logical operator to apply across multiple {@link MetricAlertConfiguration} */ -export type MetricAnomalyAlertConfigurationsOperator = "AND" | "OR" | "XOR" | string; +export type MetricAnomalyAlertConfigurationsOperator = "AND" | "OR" | "XOR"; /** * The logical operator to apply across anomaly detection conditions. */ -export type DetectionConditionsOperator = "AND" | "OR" | string; +export type DetectionConditionsOperator = "AND" | "OR"; /** * Represents properties common to anomaly detection conditions. @@ -690,7 +676,7 @@ export type MetricAnomalyFeedback = { /** * feedback value */ - value: "AutoDetect" | "Anomaly" | "NotAnomaly" | string; + value: "AutoDetect" | "Anomaly" | "NotAnomaly"; /** * The anomaly detection configuration id. @@ -721,7 +707,7 @@ export type MetricChangePointFeedback = { /** * value for ChangePointValue */ - value: "AutoDetect" | "ChangePoint" | "NotChangePoint" | string; + value: "AutoDetect" | "ChangePoint" | "NotChangePoint"; } & MetricFeedbackCommon; /** @@ -757,7 +743,7 @@ export type MetricPeriodFeedback = { /** * the type of setting period */ - periodType: "AutoDetect" | "AssignValue" | string; + periodType: "AutoDetect" | "AssignValue"; /** * the number of intervals a period contains, when no period set to 0 */ diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts index f20f7cde5ab9..13b915057f0f 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts @@ -16,7 +16,7 @@ import { WebhookHookInfo, EmailHookInfo, NeedRollupEnum, - DataFeedDetailRollUpMethod + RollUpMethod as DataFeedDetailRollUpMethod } from "./generated/models"; import { MetricFeedbackUnion, diff --git a/sdk/metricsadvisor/ai-metrics-advisor/swagger/README.md b/sdk/metricsadvisor/ai-metrics-advisor/swagger/README.md index 40e01a44996f..2e7579365219 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/swagger/README.md +++ b/sdk/metricsadvisor/ai-metrics-advisor/swagger/README.md @@ -18,7 +18,7 @@ input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3cbc984 add-credentials: false override-client-name: GeneratedClient use-extension: - "@autorest/typescript": "6.0.0-dev.20210121.2" + "@autorest/typescript": "6.0.0-dev.20210223.1" disable-async-iterators: true hide-clients: true ``` @@ -652,3 +652,39 @@ directive: } } ``` + +### Make Sealed enums + +```yaml +directive: + - from: swagger-document + where: $.definitions..properties + transform: > + if($) { + let props = Object.keys($); + for(let i = 0; i < props.length; i++) { + + if ($[props[i]] && $[props[i]]["x-ms-enum"]) { + $[props[i]]["x-ms-enum"].modelAsString = false; + } else if ($[props[i]] && $[props[i]]["enum"]) { + $[props[i]]["x-ms-enum"] = {modelAsString: false, name: props[i] } + } + } + } +``` + +```yaml +directive: + - from: swagger-document + where: $.paths..get.parameters + transform: > + if($) { + for(let i = 0; i < $.length; i++) { + if ($[i] && $[i]["x-ms-enum"]) { + $[i]["x-ms-enum"].modelAsString = false; + } else if ($[i] && $[i]["enum"]) { + $[i]["x-ms-enum"] = {modelAsString: false, name: props[i] } + } + } + } +```