Skip to content

Commit

Permalink
feat(client-evidently): Add detail message inside GetExperimentResult…
Browse files Browse the repository at this point in the history
…s API response to indicate experiment result availability
  • Loading branch information
awstools committed May 9, 2022
1 parent 49661ab commit 872386c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
6 changes: 5 additions & 1 deletion clients/client-evidently/src/Evidently.ts
Expand Up @@ -550,7 +550,11 @@ export class Evidently extends EvidentlyClient {
}

/**
* <p>Retrieves the results of a running or completed experiment.</p>
* <p>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.</p>
* <p>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.</p>
*/
public getExperimentResults(
args: GetExperimentResultsCommandInput,
Expand Down
Expand Up @@ -23,7 +23,11 @@ export interface GetExperimentResultsCommandInput extends GetExperimentResultsRe
export interface GetExperimentResultsCommandOutput extends GetExperimentResultsResponse, __MetadataBearer {}

/**
* <p>Retrieves the results of a running or completed experiment.</p>
* <p>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.</p>
* <p>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.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
13 changes: 11 additions & 2 deletions clients/client-evidently/src/models/models_0.ts
Expand Up @@ -2325,7 +2325,8 @@ export interface GetExperimentResultsRequest {
startTime?: Date;

/**
* <p>The date and time that the experiment ended, if it is completed.</p>
* <p>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.</p>
*/
endTime?: Date;

Expand Down Expand Up @@ -2491,6 +2492,13 @@ export interface GetExperimentResultsResponse {
* <p>The timestamps of each result returned.</p>
*/
timestamps?: Date[];

/**
* <p>If the experiment doesn't yet have enough events to provide valid results, this
* field is returned with the message <code>Not enough events to generate results</code>. If there are
* enough events to provide valid results, this field is not returned.</p>
*/
details?: string;
}

export namespace GetExperimentResultsResponse {
Expand Down Expand Up @@ -2569,7 +2577,8 @@ export interface StartExperimentRequest {
experiment: string | undefined;

/**
* <p>The date and time to end the experiment.</p>
* <p>The date and time to end the experiment. This must be no more than 30 days after
* the experiment starts.</p>
*/
analysisCompleteTime: Date | undefined;
}
Expand Down
4 changes: 4 additions & 0 deletions clients/client-evidently/src/protocols/Aws_restJson1.ts
Expand Up @@ -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);
}
Expand Down
12 changes: 9 additions & 3 deletions codegen/sdk-codegen/aws-models/evidently.json
Expand Up @@ -1996,7 +1996,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Retrieves the results of a running or completed experiment.</p>",
"smithy.api#documentation": "<p>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.</p>\n <p>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.</p>",
"smithy.api#http": {
"method": "POST",
"uri": "/projects/{project}/experiments/{experiment}/results",
Expand Down Expand Up @@ -2032,7 +2032,7 @@
"endTime": {
"target": "smithy.api#Timestamp",
"traits": {
"smithy.api#documentation": "<p>The date and time that the experiment ended, if it is completed.</p>"
"smithy.api#documentation": "<p>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.</p>"
}
},
"metricNames": {
Expand Down Expand Up @@ -2095,6 +2095,12 @@
"traits": {
"smithy.api#documentation": "<p>The timestamps of each result returned.</p>"
}
},
"details": {
"target": "smithy.api#String",
"traits": {
"smithy.api#documentation": "<p>If the experiment doesn't yet have enough events to provide valid results, this \n field is returned with the message <code>Not enough events to generate results</code>. If there are \n enough events to provide valid results, this field is not returned.</p>"
}
}
}
},
Expand Down Expand Up @@ -4135,7 +4141,7 @@
"analysisCompleteTime": {
"target": "smithy.api#Timestamp",
"traits": {
"smithy.api#documentation": "<p>The date and time to end the experiment.</p>",
"smithy.api#documentation": "<p>The date and time to end the experiment. This must be no more than 30 days after\n the experiment starts.</p>",
"smithy.api#required": {}
}
}
Expand Down

0 comments on commit 872386c

Please sign in to comment.