Skip to content

Commit

Permalink
feat(client-forecast): Introduced a new field in Auto Predictor as Ti…
Browse files Browse the repository at this point in the history
…me Alignment Boundary. It helps in aligning the timestamps generated during Forecast exports
  • Loading branch information
awstools committed May 26, 2022
1 parent 8c98a71 commit 4ce40b0
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 5 deletions.
3 changes: 2 additions & 1 deletion clients/client-forecast/src/Forecast.ts
Expand Up @@ -2247,7 +2247,8 @@ export class Forecast extends ForecastClient {
/**
* <p>Returns a list of the monitoring evaluation results and predictor events collected by
* the monitor resource during different windows of time.</p>
* <p>For information about monitoring see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring-results.html">Viewing Monitoring Results</a>. For more information about retrieving monitoring results see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring-results.html">Viewing Monitoring Results</a>.</p>
* <p>For information about monitoring see <a>predictor-monitoring</a>. For
* more information about retrieving monitoring results see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring-results.html">Viewing Monitoring Results</a>.</p>
*/
public listMonitorEvaluations(
args: ListMonitorEvaluationsCommandInput,
Expand Down
Expand Up @@ -25,7 +25,8 @@ export interface ListMonitorEvaluationsCommandOutput extends ListMonitorEvaluati
/**
* <p>Returns a list of the monitoring evaluation results and predictor events collected by
* the monitor resource during different windows of time.</p>
* <p>For information about monitoring see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring-results.html">Viewing Monitoring Results</a>. For more information about retrieving monitoring results see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring-results.html">Viewing Monitoring Results</a>.</p>
* <p>For information about monitoring see <a>predictor-monitoring</a>. For
* more information about retrieving monitoring results see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring-results.html">Viewing Monitoring Results</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
89 changes: 89 additions & 0 deletions clients/client-forecast/src/models/models_0.ts
Expand Up @@ -506,6 +506,74 @@ export namespace Tag {
});
}

export enum DayOfWeek {
FRIDAY = "FRIDAY",
MONDAY = "MONDAY",
SATURDAY = "SATURDAY",
SUNDAY = "SUNDAY",
THURSDAY = "THURSDAY",
TUESDAY = "TUESDAY",
WEDNESDAY = "WEDNESDAY",
}

export enum Month {
APRIL = "APRIL",
AUGUST = "AUGUST",
DECEMBER = "DECEMBER",
FEBRUARY = "FEBRUARY",
JANUARY = "JANUARY",
JULY = "JULY",
JUNE = "JUNE",
MARCH = "MARCH",
MAY = "MAY",
NOVEMBER = "NOVEMBER",
OCTOBER = "OCTOBER",
SEPTEMBER = "SEPTEMBER",
}

/**
* <p>The time boundary Forecast uses to align and aggregate your data to match your forecast frequency. Provide the unit of time and the time boundary as a key value pair. If you
* don't provide a time boundary, Forecast uses a set of <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#default-time-boundaries">Default Time Boundaries</a>.
* </p>
*
* <p>For more information about aggregation,
* see <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html">Data Aggregation for Different Forecast Frequencies</a>.
* For more information setting a custom time boundary,
* see <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#specifying-time-boundary">Specifying a Time Boundary</a>.
*
* </p>
*/
export interface TimeAlignmentBoundary {
/**
* <p>The month to use for time alignment during aggregation. The month must be in uppercase.</p>
*/
Month?: Month | string;

/**
* <p>The day of the month to use for time alignment during aggregation.</p>
*/
DayOfMonth?: number;

/**
* <p>The day of week to use for time alignment during aggregation. The day must be in uppercase.</p>
*/
DayOfWeek?: DayOfWeek | string;

/**
* <p>The hour of day to use for time alignment during aggregation.</p>
*/
Hour?: number;
}

export namespace TimeAlignmentBoundary {
/**
* @internal
*/
export const filterSensitiveLog = (obj: TimeAlignmentBoundary): any => ({
...obj,
});
}

export interface CreateAutoPredictorRequest {
/**
* <p>A unique name for the predictor</p>
Expand Down Expand Up @@ -627,6 +695,14 @@ export interface CreateAutoPredictorRequest {
* For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/predictor-monitoring.html">Predictor Monitoring</a>.</p>
*/
MonitorConfig?: MonitorConfig;

/**
* <p>The time boundary Forecast uses to align and aggregate any data that doesn't align with your forecast frequency. Provide the unit of time and the time boundary as a key value pair.
* For more information on specifying a time boundary, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#specifying-time-boundary">Specifying a Time Boundary</a>.
* If you
* don't provide a time boundary, Forecast uses a set of <a href="https://docs.aws.amazon.com/forecast/latest/dg/data-aggregation.html#default-time-boundaries">Default Time Boundaries</a>.</p>
*/
TimeAlignmentBoundary?: TimeAlignmentBoundary;
}

export namespace CreateAutoPredictorRequest {
Expand Down Expand Up @@ -3255,6 +3331,11 @@ export interface DescribeAutoPredictorResponse {
* <p>A object with the Amazon Resource Name (ARN) and status of the monitor resource.</p>
*/
MonitorInfo?: MonitorInfo;

/**
* <p>The time boundary Forecast uses when aggregating data.</p>
*/
TimeAlignmentBoundary?: TimeAlignmentBoundary;
}

export namespace DescribeAutoPredictorResponse {
Expand Down Expand Up @@ -6355,8 +6436,16 @@ export namespace PredictorEvent {
* <p>Describes the results of a monitor evaluation.</p>
*/
export interface PredictorMonitorEvaluation {
/**
* <p>The Amazon Resource Name (ARN) of the resource to monitor.</p>
*/
ResourceArn?: string;

/**
* <p>The Amazon Resource Name (ARN) of the monitor resource.</p>
*/
MonitorArn?: string;

/**
* <p>The timestamp that indicates when the monitor evaluation was started. </p>
*/
Expand Down
27 changes: 27 additions & 0 deletions clients/client-forecast/src/protocols/Aws_json1_1.ts
Expand Up @@ -289,6 +289,7 @@ import {
TagResourceRequest,
TagResourceResponse,
TestWindowSummary,
TimeAlignmentBoundary,
UntagResourceRequest,
UntagResourceResponse,
UpdateDatasetGroupRequest,
Expand Down Expand Up @@ -3637,6 +3638,10 @@ const serializeAws_json1_1CreateAutoPredictorRequest = (
...(input.ReferencePredictorArn !== undefined &&
input.ReferencePredictorArn !== null && { ReferencePredictorArn: input.ReferencePredictorArn }),
...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }),
...(input.TimeAlignmentBoundary !== undefined &&
input.TimeAlignmentBoundary !== null && {
TimeAlignmentBoundary: serializeAws_json1_1TimeAlignmentBoundary(input.TimeAlignmentBoundary, context),
}),
};
};

Expand Down Expand Up @@ -4494,6 +4499,15 @@ const serializeAws_json1_1Tags = (input: Tag[], context: __SerdeContext): any =>
});
};

const serializeAws_json1_1TimeAlignmentBoundary = (input: TimeAlignmentBoundary, context: __SerdeContext): any => {
return {
...(input.DayOfMonth !== undefined && input.DayOfMonth !== null && { DayOfMonth: input.DayOfMonth }),
...(input.DayOfWeek !== undefined && input.DayOfWeek !== null && { DayOfWeek: input.DayOfWeek }),
...(input.Hour !== undefined && input.Hour !== null && { Hour: input.Hour }),
...(input.Month !== undefined && input.Month !== null && { Month: input.Month }),
};
};

const serializeAws_json1_1TrainingParameters = (input: { [key: string]: string }, context: __SerdeContext): any => {
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
if (value === null) {
Expand Down Expand Up @@ -4967,6 +4981,10 @@ const deserializeAws_json1_1DescribeAutoPredictorResponse = (
? deserializeAws_json1_1ReferencePredictorSummary(output.ReferencePredictorSummary, context)
: undefined,
Status: __expectString(output.Status),
TimeAlignmentBoundary:
output.TimeAlignmentBoundary !== undefined && output.TimeAlignmentBoundary !== null
? deserializeAws_json1_1TimeAlignmentBoundary(output.TimeAlignmentBoundary, context)
: undefined,
} as any;
};

Expand Down Expand Up @@ -6284,6 +6302,15 @@ const deserializeAws_json1_1TestWindowSummary = (output: any, context: __SerdeCo
} as any;
};

const deserializeAws_json1_1TimeAlignmentBoundary = (output: any, context: __SerdeContext): TimeAlignmentBoundary => {
return {
DayOfMonth: __expectInt32(output.DayOfMonth),
DayOfWeek: __expectString(output.DayOfWeek),
Hour: __expectInt32(output.Hour),
Month: __expectString(output.Month),
} as any;
};

const deserializeAws_json1_1TrainingParameters = (output: any, context: __SerdeContext): { [key: string]: string } => {
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
if (value === null) {
Expand Down

0 comments on commit 4ce40b0

Please sign in to comment.