Skip to content

[MetricsAdvisor] Add an alias type for createDateFeed feed parameter#12202

Merged
jeremymeng merged 1 commit into
Azure:masterfrom
jeremymeng:ma-alias-types
Nov 5, 2020
Merged

[MetricsAdvisor] Add an alias type for createDateFeed feed parameter#12202
jeremymeng merged 1 commit into
Azure:masterfrom
jeremymeng:ma-alias-types

Conversation

@jeremymeng
Copy link
Copy Markdown
Member

and fix TypeScript sample build errors

This resolves #11957

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this? @jeremymeng

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the correct type, building samples would give errors like

error TS2345: Argument of type '{ name: string; crossMetricsOperator: string; metricAlertConfigurations: ({ detectionConfigurationId: string; alertScope: { scopeType: string; dimensionAnomalyScope?: undefined; }; } | { ...; })[]; hookIds: never[]; description: string; }' is not assignable to parameter of type 'Pick<AnomalyAlertConfiguration, "name" | "description" | "crossMetricsOperator" | "hookIds" | "metricAlertConfigurations">'.
  Types of property 'crossMetricsOperator' are incompatible.
    Type 'string' is not assignable to type '"AND" | "OR" | "XOR" | undefined'.

Copy link
Copy Markdown
Member

@KarishmaGhiya KarishmaGhiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DataFeedDescriptor type looks good.

@jeremymeng jeremymeng merged commit 7dfd5cc into Azure:master Nov 5, 2020
@jeremymeng jeremymeng deleted the ma-alias-types branch November 5, 2020 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MetricsAdvisor] Add an alias type for parameter type to createDataFeed()

3 participants