Skip to content

Commit

Permalink
feat(client-frauddetector): This release introduces Lists feature whi…
Browse files Browse the repository at this point in the history
…ch allows customers to reference a set of values in Fraud Detector's rules. With Lists, customers can dynamically manage these attributes in real time. Lists can be created/deleted and its contents can be modified using the Fraud Detector API.
  • Loading branch information
awstools committed Feb 15, 2023
1 parent dc28d4e commit 6186c03
Show file tree
Hide file tree
Showing 16 changed files with 2,754 additions and 342 deletions.
168 changes: 168 additions & 0 deletions clients/client-frauddetector/src/FraudDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
CreateDetectorVersionCommandInput,
CreateDetectorVersionCommandOutput,
} from "./commands/CreateDetectorVersionCommand";
import { CreateListCommand, CreateListCommandInput, CreateListCommandOutput } from "./commands/CreateListCommand";
import { CreateModelCommand, CreateModelCommandInput, CreateModelCommandOutput } from "./commands/CreateModelCommand";
import {
CreateModelVersionCommand,
Expand Down Expand Up @@ -90,6 +91,7 @@ import {
DeleteExternalModelCommandOutput,
} from "./commands/DeleteExternalModelCommand";
import { DeleteLabelCommand, DeleteLabelCommandInput, DeleteLabelCommandOutput } from "./commands/DeleteLabelCommand";
import { DeleteListCommand, DeleteListCommandInput, DeleteListCommandOutput } from "./commands/DeleteListCommand";
import { DeleteModelCommand, DeleteModelCommandInput, DeleteModelCommandOutput } from "./commands/DeleteModelCommand";
import {
DeleteModelVersionCommand,
Expand Down Expand Up @@ -174,6 +176,16 @@ import {
GetKMSEncryptionKeyCommandOutput,
} from "./commands/GetKMSEncryptionKeyCommand";
import { GetLabelsCommand, GetLabelsCommandInput, GetLabelsCommandOutput } from "./commands/GetLabelsCommand";
import {
GetListElementsCommand,
GetListElementsCommandInput,
GetListElementsCommandOutput,
} from "./commands/GetListElementsCommand";
import {
GetListsMetadataCommand,
GetListsMetadataCommandInput,
GetListsMetadataCommandOutput,
} from "./commands/GetListsMetadataCommand";
import { GetModelsCommand, GetModelsCommandInput, GetModelsCommandOutput } from "./commands/GetModelsCommand";
import {
GetModelVersionCommand,
Expand Down Expand Up @@ -247,6 +259,7 @@ import {
UpdateEventLabelCommandInput,
UpdateEventLabelCommandOutput,
} from "./commands/UpdateEventLabelCommand";
import { UpdateListCommand, UpdateListCommandInput, UpdateListCommandOutput } from "./commands/UpdateListCommand";
import { UpdateModelCommand, UpdateModelCommandInput, UpdateModelCommandOutput } from "./commands/UpdateModelCommand";
import {
UpdateModelVersionCommand,
Expand Down Expand Up @@ -511,6 +524,36 @@ export class FraudDetector extends FraudDetectorClient {
}
}

/**
* <p>
* Creates a list.
* </p>
* <p>List is a set of input data for a variable in your event dataset. You use the input data in a rule that's associated with your detector.
* For more information, see <a href="https://docs.aws.amazon.com/frauddetector/latest/ug/lists.html">Lists</a>.</p>
*/
public createList(args: CreateListCommandInput, options?: __HttpHandlerOptions): Promise<CreateListCommandOutput>;
public createList(args: CreateListCommandInput, cb: (err: any, data?: CreateListCommandOutput) => void): void;
public createList(
args: CreateListCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateListCommandOutput) => void
): void;
public createList(
args: CreateListCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateListCommandOutput) => void),
cb?: (err: any, data?: CreateListCommandOutput) => void
): Promise<CreateListCommandOutput> | void {
const command = new CreateListCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Creates a model using the specified model type.</p>
*/
Expand Down Expand Up @@ -947,6 +990,35 @@ export class FraudDetector extends FraudDetectorClient {
}
}

/**
* <p>
* Deletes the list, provided it is not used in a rule.
* </p>
* <p> When you delete a list, Amazon Fraud Detector permanently deletes that list and the elements in the list.</p>
*/
public deleteList(args: DeleteListCommandInput, options?: __HttpHandlerOptions): Promise<DeleteListCommandOutput>;
public deleteList(args: DeleteListCommandInput, cb: (err: any, data?: DeleteListCommandOutput) => void): void;
public deleteList(
args: DeleteListCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteListCommandOutput) => void
): void;
public deleteList(
args: DeleteListCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteListCommandOutput) => void),
cb?: (err: any, data?: DeleteListCommandOutput) => void
): Promise<DeleteListCommandOutput> | void {
const command = new DeleteListCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Deletes a model.</p>
* <p>You can delete models and model versions in Amazon Fraud Detector, provided that they are not associated with a detector version.</p>
Expand Down Expand Up @@ -1600,6 +1672,74 @@ export class FraudDetector extends FraudDetectorClient {
}
}

/**
* <p>
* Gets all the elements in the specified list.
* </p>
*/
public getListElements(
args: GetListElementsCommandInput,
options?: __HttpHandlerOptions
): Promise<GetListElementsCommandOutput>;
public getListElements(
args: GetListElementsCommandInput,
cb: (err: any, data?: GetListElementsCommandOutput) => void
): void;
public getListElements(
args: GetListElementsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetListElementsCommandOutput) => void
): void;
public getListElements(
args: GetListElementsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetListElementsCommandOutput) => void),
cb?: (err: any, data?: GetListElementsCommandOutput) => void
): Promise<GetListElementsCommandOutput> | void {
const command = new GetListElementsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>
* Gets the metadata of either all the lists under the account or the specified list.
* </p>
*/
public getListsMetadata(
args: GetListsMetadataCommandInput,
options?: __HttpHandlerOptions
): Promise<GetListsMetadataCommandOutput>;
public getListsMetadata(
args: GetListsMetadataCommandInput,
cb: (err: any, data?: GetListsMetadataCommandOutput) => void
): void;
public getListsMetadata(
args: GetListsMetadataCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetListsMetadataCommandOutput) => void
): void;
public getListsMetadata(
args: GetListsMetadataCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetListsMetadataCommandOutput) => void),
cb?: (err: any, data?: GetListsMetadataCommandOutput) => void
): Promise<GetListsMetadataCommandOutput> | void {
const command = new GetListsMetadataCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Gets one or more models. Gets all models for the Amazon Web Services account if no model type and no model id provided. Gets all models for the Amazon Web Services account and model type, if the model type is specified but model id is not provided. Gets a specific model if (model type, model id) tuple is specified. </p>
* <p>This is a paginated API. If you
Expand Down Expand Up @@ -2250,6 +2390,34 @@ export class FraudDetector extends FraudDetectorClient {
}
}

/**
* <p>
* Updates a list.
* </p>
*/
public updateList(args: UpdateListCommandInput, options?: __HttpHandlerOptions): Promise<UpdateListCommandOutput>;
public updateList(args: UpdateListCommandInput, cb: (err: any, data?: UpdateListCommandOutput) => void): void;
public updateList(
args: UpdateListCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateListCommandOutput) => void
): void;
public updateList(
args: UpdateListCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateListCommandOutput) => void),
cb?: (err: any, data?: UpdateListCommandOutput) => void
): Promise<UpdateListCommandOutput> | void {
const command = new UpdateListCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Updates model description.</p>
*/
Expand Down
15 changes: 15 additions & 0 deletions clients/client-frauddetector/src/FraudDetectorClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import {
CreateDetectorVersionCommandInput,
CreateDetectorVersionCommandOutput,
} from "./commands/CreateDetectorVersionCommand";
import { CreateListCommandInput, CreateListCommandOutput } from "./commands/CreateListCommand";
import { CreateModelCommandInput, CreateModelCommandOutput } from "./commands/CreateModelCommand";
import { CreateModelVersionCommandInput, CreateModelVersionCommandOutput } from "./commands/CreateModelVersionCommand";
import { CreateRuleCommandInput, CreateRuleCommandOutput } from "./commands/CreateRuleCommand";
Expand Down Expand Up @@ -103,6 +104,7 @@ import {
DeleteExternalModelCommandOutput,
} from "./commands/DeleteExternalModelCommand";
import { DeleteLabelCommandInput, DeleteLabelCommandOutput } from "./commands/DeleteLabelCommand";
import { DeleteListCommandInput, DeleteListCommandOutput } from "./commands/DeleteListCommand";
import { DeleteModelCommandInput, DeleteModelCommandOutput } from "./commands/DeleteModelCommand";
import { DeleteModelVersionCommandInput, DeleteModelVersionCommandOutput } from "./commands/DeleteModelVersionCommand";
import { DeleteOutcomeCommandInput, DeleteOutcomeCommandOutput } from "./commands/DeleteOutcomeCommand";
Expand Down Expand Up @@ -138,6 +140,8 @@ import {
GetKMSEncryptionKeyCommandOutput,
} from "./commands/GetKMSEncryptionKeyCommand";
import { GetLabelsCommandInput, GetLabelsCommandOutput } from "./commands/GetLabelsCommand";
import { GetListElementsCommandInput, GetListElementsCommandOutput } from "./commands/GetListElementsCommand";
import { GetListsMetadataCommandInput, GetListsMetadataCommandOutput } from "./commands/GetListsMetadataCommand";
import { GetModelsCommandInput, GetModelsCommandOutput } from "./commands/GetModelsCommand";
import { GetModelVersionCommandInput, GetModelVersionCommandOutput } from "./commands/GetModelVersionCommand";
import { GetOutcomesCommandInput, GetOutcomesCommandOutput } from "./commands/GetOutcomesCommand";
Expand Down Expand Up @@ -177,6 +181,7 @@ import {
UpdateDetectorVersionStatusCommandOutput,
} from "./commands/UpdateDetectorVersionStatusCommand";
import { UpdateEventLabelCommandInput, UpdateEventLabelCommandOutput } from "./commands/UpdateEventLabelCommand";
import { UpdateListCommandInput, UpdateListCommandOutput } from "./commands/UpdateListCommand";
import { UpdateModelCommandInput, UpdateModelCommandOutput } from "./commands/UpdateModelCommand";
import { UpdateModelVersionCommandInput, UpdateModelVersionCommandOutput } from "./commands/UpdateModelVersionCommand";
import {
Expand All @@ -202,6 +207,7 @@ export type ServiceInputTypes =
| CreateBatchImportJobCommandInput
| CreateBatchPredictionJobCommandInput
| CreateDetectorVersionCommandInput
| CreateListCommandInput
| CreateModelCommandInput
| CreateModelVersionCommandInput
| CreateRuleCommandInput
Expand All @@ -216,6 +222,7 @@ export type ServiceInputTypes =
| DeleteEventsByEventTypeCommandInput
| DeleteExternalModelCommandInput
| DeleteLabelCommandInput
| DeleteListCommandInput
| DeleteModelCommandInput
| DeleteModelVersionCommandInput
| DeleteOutcomeCommandInput
Expand All @@ -236,6 +243,8 @@ export type ServiceInputTypes =
| GetExternalModelsCommandInput
| GetKMSEncryptionKeyCommandInput
| GetLabelsCommandInput
| GetListElementsCommandInput
| GetListsMetadataCommandInput
| GetModelVersionCommandInput
| GetModelsCommandInput
| GetOutcomesCommandInput
Expand All @@ -257,6 +266,7 @@ export type ServiceInputTypes =
| UpdateDetectorVersionMetadataCommandInput
| UpdateDetectorVersionStatusCommandInput
| UpdateEventLabelCommandInput
| UpdateListCommandInput
| UpdateModelCommandInput
| UpdateModelVersionCommandInput
| UpdateModelVersionStatusCommandInput
Expand All @@ -272,6 +282,7 @@ export type ServiceOutputTypes =
| CreateBatchImportJobCommandOutput
| CreateBatchPredictionJobCommandOutput
| CreateDetectorVersionCommandOutput
| CreateListCommandOutput
| CreateModelCommandOutput
| CreateModelVersionCommandOutput
| CreateRuleCommandOutput
Expand All @@ -286,6 +297,7 @@ export type ServiceOutputTypes =
| DeleteEventsByEventTypeCommandOutput
| DeleteExternalModelCommandOutput
| DeleteLabelCommandOutput
| DeleteListCommandOutput
| DeleteModelCommandOutput
| DeleteModelVersionCommandOutput
| DeleteOutcomeCommandOutput
Expand All @@ -306,6 +318,8 @@ export type ServiceOutputTypes =
| GetExternalModelsCommandOutput
| GetKMSEncryptionKeyCommandOutput
| GetLabelsCommandOutput
| GetListElementsCommandOutput
| GetListsMetadataCommandOutput
| GetModelVersionCommandOutput
| GetModelsCommandOutput
| GetOutcomesCommandOutput
Expand All @@ -327,6 +341,7 @@ export type ServiceOutputTypes =
| UpdateDetectorVersionMetadataCommandOutput
| UpdateDetectorVersionStatusCommandOutput
| UpdateEventLabelCommandOutput
| UpdateListCommandOutput
| UpdateModelCommandOutput
| UpdateModelVersionCommandOutput
| UpdateModelVersionStatusCommandOutput
Expand Down
Loading

0 comments on commit 6186c03

Please sign in to comment.