-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-evidently): This release adds support for the new segment…
…ation feature.
- Loading branch information
awstools
committed
Jul 15, 2022
1 parent
2b37799
commit a60dfd8
Showing
18 changed files
with
2,862 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
clients/client-evidently/src/commands/CreateSegmentCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { EvidentlyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EvidentlyClient"; | ||
import { CreateSegmentRequest, CreateSegmentResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1CreateSegmentCommand, | ||
serializeAws_restJson1CreateSegmentCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface CreateSegmentCommandInput extends CreateSegmentRequest {} | ||
export interface CreateSegmentCommandOutput extends CreateSegmentResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Use this operation to define a <i>segment</i> of your audience. A segment | ||
* is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, | ||
* users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, | ||
* such as age.</p> | ||
* <p>Using a segment in an experiment limits that experiment to evaluate only the users who match the segment | ||
* criteria. Using one or more segments in a launch allow you to define different traffic splits for the different | ||
* audience segments.</p> | ||
* | ||
* <p>For more information about segment pattern syntax, see | ||
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-segments-syntax.html"> | ||
* Segment rule pattern syntax</a>.</p> | ||
* | ||
* <p>The pattern that you define for a segment is matched against the value of <code>evaluationContext</code>, which | ||
* is passed into Evidently in the <a href="https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_EvaluateFeature.html">EvaluateFeature</a> operation, | ||
* when Evidently assigns a feature variation to a user.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { EvidentlyClient, CreateSegmentCommand } from "@aws-sdk/client-evidently"; // ES Modules import | ||
* // const { EvidentlyClient, CreateSegmentCommand } = require("@aws-sdk/client-evidently"); // CommonJS import | ||
* const client = new EvidentlyClient(config); | ||
* const command = new CreateSegmentCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link CreateSegmentCommandInput} for command's `input` shape. | ||
* @see {@link CreateSegmentCommandOutput} for command's `response` shape. | ||
* @see {@link EvidentlyClientResolvedConfig | config} for EvidentlyClient's `config` shape. | ||
* | ||
*/ | ||
export class CreateSegmentCommand extends $Command< | ||
CreateSegmentCommandInput, | ||
CreateSegmentCommandOutput, | ||
EvidentlyClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: CreateSegmentCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: EvidentlyClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<CreateSegmentCommandInput, CreateSegmentCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "EvidentlyClient"; | ||
const commandName = "CreateSegmentCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: CreateSegmentRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: CreateSegmentResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: CreateSegmentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1CreateSegmentCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateSegmentCommandOutput> { | ||
return deserializeAws_restJson1CreateSegmentCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
97 changes: 97 additions & 0 deletions
97
clients/client-evidently/src/commands/DeleteSegmentCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { EvidentlyClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EvidentlyClient"; | ||
import { DeleteSegmentRequest, DeleteSegmentResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1DeleteSegmentCommand, | ||
serializeAws_restJson1DeleteSegmentCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface DeleteSegmentCommandInput extends DeleteSegmentRequest {} | ||
export interface DeleteSegmentCommandOutput extends DeleteSegmentResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Deletes a segment. You can't delete a segment that is being used in a launch or experiment, even if that | ||
* launch or experiment is not currently running.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { EvidentlyClient, DeleteSegmentCommand } from "@aws-sdk/client-evidently"; // ES Modules import | ||
* // const { EvidentlyClient, DeleteSegmentCommand } = require("@aws-sdk/client-evidently"); // CommonJS import | ||
* const client = new EvidentlyClient(config); | ||
* const command = new DeleteSegmentCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link DeleteSegmentCommandInput} for command's `input` shape. | ||
* @see {@link DeleteSegmentCommandOutput} for command's `response` shape. | ||
* @see {@link EvidentlyClientResolvedConfig | config} for EvidentlyClient's `config` shape. | ||
* | ||
*/ | ||
export class DeleteSegmentCommand extends $Command< | ||
DeleteSegmentCommandInput, | ||
DeleteSegmentCommandOutput, | ||
EvidentlyClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: DeleteSegmentCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: EvidentlyClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<DeleteSegmentCommandInput, DeleteSegmentCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "EvidentlyClient"; | ||
const commandName = "DeleteSegmentCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: DeleteSegmentRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: DeleteSegmentResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: DeleteSegmentCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1DeleteSegmentCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteSegmentCommandOutput> { | ||
return deserializeAws_restJson1DeleteSegmentCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.