Skip to content

Commit

Permalink
added endppoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalosh committed Oct 9, 2023
1 parent 407bda3 commit 9f64acd
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/client/AccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {

UpdateServerRequest,
UpdateSignatureRequest,
CreateDataRemovalRequest,
DataRemovalStatus
} from "./models";

export default class AccountClient extends BaseClient {
Expand Down Expand Up @@ -301,4 +303,26 @@ export default class AccountClient extends BaseClient {
public pushTemplates(options: TemplatesPushRequest, callback?: Callback<TemplatesPush>): Promise<TemplatesPush> {
return this.processRequestWithBody(ClientOptions.HttpMethod.PUT, "/templates/push", options, callback);
}

/**
* Request a data removal.
*
* @param options - details for creating data removal request
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
public createDataRemoval(options: CreateDataRemovalRequest, callback?: Callback<DataRemovalStatus>): Promise<DataRemovalStatus> {
return this.processRequestWithBody(ClientOptions.HttpMethod.POST, "/data-removals", options, callback);
}

/**
* Retrieve a single data removal status by ID.
*
* @param id - The ID of the DataRemoval for which you wish to retrieve details.
* @param callback - If the callback is provided, it will be passed to the resulting promise as a continuation.
* @returns A promise that will complete when the API responds (or an error occurs).
*/
public getDataRemoval(id: number, callback?: Callback<DataRemovalStatus>): Promise<DataRemovalStatus> {
return this.processRequestWithoutBody(ClientOptions.HttpMethod.GET, `/data-removals/${id}`, {}, callback);
}
}
22 changes: 22 additions & 0 deletions src/client/models/data_removal/DataRemovals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export enum DataRemovalStatusTypes {
Pending= "Pending",
Done = "Done"
}

export interface DataRemovalStatus {
ID: number;
Status: DataRemovalStatusTypes;
}


export class CreateDataRemovalRequest {
public RequestedBy: string;
public RequestedFor: string;
public NotifyWhenCompleted: boolean;

public constructor(requestedBy: string, requestedFor: string, notifyWhenCompleted: boolean) {
this.RequestedBy = requestedBy
this.RequestedFor = requestedFor;
this.NotifyWhenCompleted = notifyWhenCompleted
}
}
1 change: 1 addition & 0 deletions src/client/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ export * from "./webhooks/payload/InboundWebhook";
export * from "./suppressions/Suppression";
export * from "./streams/MessageStream";
export * from "./streams/MessageStreamsFilteringParameters";
export * from "./data_removal/DataRemovals";

0 comments on commit 9f64acd

Please sign in to comment.