From 872386c39aeca35d659f8760d448a3aff9a991fc Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 9 May 2022 18:17:51 +0000 Subject: [PATCH] feat(client-evidently): Add detail message inside GetExperimentResults API response to indicate experiment result availability --- clients/client-evidently/src/Evidently.ts | 6 +++++- .../src/commands/GetExperimentResultsCommand.ts | 6 +++++- clients/client-evidently/src/models/models_0.ts | 13 +++++++++++-- .../client-evidently/src/protocols/Aws_restJson1.ts | 4 ++++ codegen/sdk-codegen/aws-models/evidently.json | 12 +++++++++--- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/clients/client-evidently/src/Evidently.ts b/clients/client-evidently/src/Evidently.ts index b39006213a05..344c387312ee 100644 --- a/clients/client-evidently/src/Evidently.ts +++ b/clients/client-evidently/src/Evidently.ts @@ -550,7 +550,11 @@ export class Evidently extends EvidentlyClient { } /** - *

Retrieves the results of a running or completed experiment.

+ *

Retrieves the results of a running or completed experiment. No results are available until + * there have been 100 events for each variation and at least 10 minutes have passed since the start of the experiment.

+ *

Experiment + * results are available up to 63 days after the start of the experiment. They are not available after that because + * of CloudWatch data retention policies.

*/ public getExperimentResults( args: GetExperimentResultsCommandInput, diff --git a/clients/client-evidently/src/commands/GetExperimentResultsCommand.ts b/clients/client-evidently/src/commands/GetExperimentResultsCommand.ts index 0e5c40d05da9..5c6128cf334a 100644 --- a/clients/client-evidently/src/commands/GetExperimentResultsCommand.ts +++ b/clients/client-evidently/src/commands/GetExperimentResultsCommand.ts @@ -23,7 +23,11 @@ export interface GetExperimentResultsCommandInput extends GetExperimentResultsRe export interface GetExperimentResultsCommandOutput extends GetExperimentResultsResponse, __MetadataBearer {} /** - *

Retrieves the results of a running or completed experiment.

+ *

Retrieves the results of a running or completed experiment. No results are available until + * there have been 100 events for each variation and at least 10 minutes have passed since the start of the experiment.

+ *

Experiment + * results are available up to 63 days after the start of the experiment. They are not available after that because + * of CloudWatch data retention policies.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-evidently/src/models/models_0.ts b/clients/client-evidently/src/models/models_0.ts index 9f33e9a3424e..570b1969a90f 100644 --- a/clients/client-evidently/src/models/models_0.ts +++ b/clients/client-evidently/src/models/models_0.ts @@ -2325,7 +2325,8 @@ export interface GetExperimentResultsRequest { startTime?: Date; /** - *

The date and time that the experiment ended, if it is completed.

+ *

The date and time that the experiment ended, if it is completed. This must be no longer than 30 days + * after the experiment start time.

*/ endTime?: Date; @@ -2491,6 +2492,13 @@ export interface GetExperimentResultsResponse { *

The timestamps of each result returned.

*/ timestamps?: Date[]; + + /** + *

If the experiment doesn't yet have enough events to provide valid results, this + * field is returned with the message Not enough events to generate results. If there are + * enough events to provide valid results, this field is not returned.

+ */ + details?: string; } export namespace GetExperimentResultsResponse { @@ -2569,7 +2577,8 @@ export interface StartExperimentRequest { experiment: string | undefined; /** - *

The date and time to end the experiment.

+ *

The date and time to end the experiment. This must be no more than 30 days after + * the experiment starts.

*/ analysisCompleteTime: Date | undefined; } diff --git a/clients/client-evidently/src/protocols/Aws_restJson1.ts b/clients/client-evidently/src/protocols/Aws_restJson1.ts index 41d18e9b4605..61a027ee41a6 100644 --- a/clients/client-evidently/src/protocols/Aws_restJson1.ts +++ b/clients/client-evidently/src/protocols/Aws_restJson1.ts @@ -2044,11 +2044,15 @@ export const deserializeAws_restJson1GetExperimentResultsCommand = async ( } const contents: GetExperimentResultsCommandOutput = { $metadata: deserializeMetadata(output), + details: undefined, reports: undefined, resultsData: undefined, timestamps: undefined, }; const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.details !== undefined && data.details !== null) { + contents.details = __expectString(data.details); + } if (data.reports !== undefined && data.reports !== null) { contents.reports = deserializeAws_restJson1ExperimentReportList(data.reports, context); } diff --git a/codegen/sdk-codegen/aws-models/evidently.json b/codegen/sdk-codegen/aws-models/evidently.json index 262baf5763e9..cc301d626c27 100644 --- a/codegen/sdk-codegen/aws-models/evidently.json +++ b/codegen/sdk-codegen/aws-models/evidently.json @@ -1996,7 +1996,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieves the results of a running or completed experiment.

", + "smithy.api#documentation": "

Retrieves the results of a running or completed experiment. No results are available until\n there have been 100 events for each variation and at least 10 minutes have passed since the start of the experiment.

\n

Experiment\n results are available up to 63 days after the start of the experiment. They are not available after that because\n of CloudWatch data retention policies.

", "smithy.api#http": { "method": "POST", "uri": "/projects/{project}/experiments/{experiment}/results", @@ -2032,7 +2032,7 @@ "endTime": { "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "

The date and time that the experiment ended, if it is completed.

" + "smithy.api#documentation": "

The date and time that the experiment ended, if it is completed. This must be no longer than 30 days \n after the experiment start time.

" } }, "metricNames": { @@ -2095,6 +2095,12 @@ "traits": { "smithy.api#documentation": "

The timestamps of each result returned.

" } + }, + "details": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

If the experiment doesn't yet have enough events to provide valid results, this \n field is returned with the message Not enough events to generate results. If there are \n enough events to provide valid results, this field is not returned.

" + } } } }, @@ -4135,7 +4141,7 @@ "analysisCompleteTime": { "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "

The date and time to end the experiment.

", + "smithy.api#documentation": "

The date and time to end the experiment. This must be no more than 30 days after\n the experiment starts.

", "smithy.api#required": {} } }