Skip to content

Commit

Permalink
Add two_factor_authentication_reset_request destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
souljuse committed Apr 5, 2024
1 parent 0150dfd commit 0224177
Show file tree
Hide file tree
Showing 4 changed files with 111 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
Expand Up @@ -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,
Expand All @@ -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",
Expand Down
49 changes: 45 additions & 4 deletions packages/dashboard-client/src/generated/SchemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4281,6 +4281,7 @@ export type TwoFactorAuthenticationResetRequest = {
type: TwoFactorAuthenticationResetRequestType;
id: TwoFactorAuthenticationResetRequestIdentity;
relationships: TwoFactorAuthenticationResetRequestRelationships;
meta: TwoFactorAuthenticationResetRequestMeta;
};

/**
Expand All @@ -4304,6 +4305,27 @@ export type TwoFactorAuthenticationResetRequestRelationships = {
};
};

/**
* JSON API meta
*
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
* via the `definition` "meta".
*/
export type TwoFactorAuthenticationResetRequestMeta = {
/**
* Email
*/
email: string;
/**
* First name
*/
first_name?: string | null;
/**
* Last name
*/
last_name?: string | null;
};

/**
* JSON API data
*
Expand Down Expand Up @@ -4345,12 +4367,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
Expand Down
42 changes: 40 additions & 2 deletions packages/dashboard-client/src/generated/SimpleSchemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -4064,11 +4064,33 @@ export type TwoFactorAuthenticationResetRequest = {
type: TwoFactorAuthenticationResetRequestType;
organization: OrganizationData;
account: AccountData;
meta: TwoFactorAuthenticationResetRequestMeta;
};
export type TwoFactorAuthenticationResetRequestCreateTargetSchema =
TwoFactorAuthenticationResetRequest;
export type TwoFactorAuthenticationResetRequestDestroyTargetSchema =
TwoFactorAuthenticationResetRequest;
/**
* JSON API meta
*
* This interface was referenced by `TwoFactorAuthenticationResetRequest`'s JSON-Schema
* via the `definition` "meta".
*/
export type TwoFactorAuthenticationResetRequestMeta = {
/**
* Email
*/
email: string;
/**
* First name
*/
first_name?: string | null;
/**
* Last name
*/
last_name?: string | null;
};

/**
* JSON API data
*
Expand Down Expand Up @@ -4106,3 +4128,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
Expand Up @@ -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,
),
);
Expand All @@ -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',
Expand All @@ -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,
Expand All @@ -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,
},
);
}
Expand Down

0 comments on commit 0224177

Please sign in to comment.