Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add two_factor_authentication_reset_request destroy
Browse files Browse the repository at this point in the history
souljuse committed Apr 2, 2024
1 parent 53990b7 commit 90abef6
Showing 4 changed files with 67 additions and 15 deletions.
14 changes: 10 additions & 4 deletions packages/dashboard-client/resources.json
Original file line number Diff line number Diff line change
@@ -1742,15 +1742,15 @@
},
{
"returnsCollection": true,
"rel": "requested_instances",
"rel": "instances",
"urlTemplate": "/tfa-reset-requests",
"method": "GET",
"comment": "List all two-factor authentication reset requests",
"optionalRequestBody": false,
"queryParamsRequired": false,
"responseType": "TwoFactorAuthenticationResetRequestRequestedInstancesTargetSchema",
"name": "requestedList",
"rawName": "rawRequestedList"
"responseType": "TwoFactorAuthenticationResetRequestInstancesTargetSchema",
"name": "list",
"rawName": "rawList"
},
{
"returnsCollection": false,
@@ -1763,7 +1763,13 @@
"isEntityId": true,
"relType": "TwoFactorAuthenticationResetRequestData"
},
"requestBodyType": "TwoFactorAuthenticationResetRequestDestroySchema",
"optionalRequestBody": false,
"requestStructure": {
"type": "two_factor_authentication_reset_request",
"attributes": ["email", "password"],
"relationships": []
},
"queryParamsRequired": false,
"responseType": "TwoFactorAuthenticationResetRequestDestroyTargetSchema",
"name": "destroy",
27 changes: 23 additions & 4 deletions packages/dashboard-client/src/generated/SchemaTypes.ts
Original file line number Diff line number Diff line change
@@ -4345,12 +4345,31 @@ export type TwoFactorAuthenticationResetRequestCreateTargetSchema = {

/**
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
* via the `requested_instances.targetSchema` link.
* via the `instances.targetSchema` link.
*/
export type TwoFactorAuthenticationResetRequestRequestedInstancesTargetSchema =
{
data: TwoFactorAuthenticationResetRequest[];
export type TwoFactorAuthenticationResetRequestInstancesTargetSchema = {
data: TwoFactorAuthenticationResetRequest[];
};

/**
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
* via the `destroy.schema` link.
*/
export type TwoFactorAuthenticationResetRequestDestroySchema = {
data: {
type: 'two_factor_authentication_reset_request';
attributes: {
/**
* Email
*/
email: string;
/**
* Current password
*/
password: string;
};
};
};

/**
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
20 changes: 18 additions & 2 deletions packages/dashboard-client/src/generated/SimpleSchemaTypes.ts
Original file line number Diff line number Diff line change
@@ -785,9 +785,9 @@ export type TwoFactorAuthenticationResetRequestType =
'two_factor_authentication_reset_request';
/**
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
* via the `requested_instances.targetSchema` link.
* via the `instances.targetSchema` link.
*/
export type TwoFactorAuthenticationResetRequestRequestedInstancesTargetSchema =
export type TwoFactorAuthenticationResetRequestInstancesTargetSchema =
TwoFactorAuthenticationResetRequest[];

export type DatoApi = {
@@ -4106,3 +4106,19 @@ export type TwoFactorAuthenticationResetRequestCreateSchema = {
*/
password: string;
};

/**
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
* via the `destroy.schema` link.
*/
export type TwoFactorAuthenticationResetRequestDestroySchema = {
type?: 'two_factor_authentication_reset_request';
/**
* Email
*/
email: string;
/**
* Current password
*/
password: string;
};
Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ export default class TwoFactorAuthenticationResetRequest extends BaseResource {
* @throws {ApiError}
* @throws {TimeoutError}
*/
requestedList() {
return this.rawRequestedList().then((body) =>
Utils.deserializeResponseBody<SimpleSchemaTypes.TwoFactorAuthenticationResetRequestRequestedInstancesTargetSchema>(
list() {
return this.rawList().then((body) =>
Utils.deserializeResponseBody<SimpleSchemaTypes.TwoFactorAuthenticationResetRequestInstancesTargetSchema>(
body,
),
);
@@ -73,8 +73,8 @@ export default class TwoFactorAuthenticationResetRequest extends BaseResource {
* @throws {ApiError}
* @throws {TimeoutError}
*/
rawRequestedList(): Promise<SchemaTypes.TwoFactorAuthenticationResetRequestRequestedInstancesTargetSchema> {
return this.client.request<SchemaTypes.TwoFactorAuthenticationResetRequestRequestedInstancesTargetSchema>(
rawList(): Promise<SchemaTypes.TwoFactorAuthenticationResetRequestInstancesTargetSchema> {
return this.client.request<SchemaTypes.TwoFactorAuthenticationResetRequestInstancesTargetSchema>(
{
method: 'GET',
url: '/tfa-reset-requests',
@@ -92,9 +92,18 @@ export default class TwoFactorAuthenticationResetRequest extends BaseResource {
twoFactorAuthenticationResetRequestId:
| string
| SimpleSchemaTypes.TwoFactorAuthenticationResetRequestData,
body: SimpleSchemaTypes.TwoFactorAuthenticationResetRequestDestroySchema,
) {
return this.rawDestroy(
Utils.toId(twoFactorAuthenticationResetRequestId),
Utils.serializeRequestBody<SchemaTypes.TwoFactorAuthenticationResetRequestDestroySchema>(
body,
{
type: 'two_factor_authentication_reset_request',
attributes: ['email', 'password'],
relationships: [],
},
),
).then((body) =>
Utils.deserializeResponseBody<SimpleSchemaTypes.TwoFactorAuthenticationResetRequestDestroyTargetSchema>(
body,
@@ -110,11 +119,13 @@ export default class TwoFactorAuthenticationResetRequest extends BaseResource {
*/
rawDestroy(
twoFactorAuthenticationResetRequestId: string,
body: SchemaTypes.TwoFactorAuthenticationResetRequestDestroySchema,
): Promise<SchemaTypes.TwoFactorAuthenticationResetRequestDestroyTargetSchema> {
return this.client.request<SchemaTypes.TwoFactorAuthenticationResetRequestDestroyTargetSchema>(
{
method: 'DELETE',
url: `/tfa-reset-requests/${twoFactorAuthenticationResetRequestId}`,
body,
},
);
}

0 comments on commit 90abef6

Please sign in to comment.