Skip to content

Commit

Permalink
Update dashboard API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Apr 23, 2024
1 parent 589d9fb commit 9e49906
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 37 deletions.
1 change: 1 addition & 0 deletions packages/dashboard-client/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,7 @@
"attributes": [],
"relationships": ["approver_organization"]
},
"queryParamsType": "OrganizationMandateRequestCreateHrefSchema",
"queryParamsRequired": false,
"responseType": "OrganizationMandateRequestCreateTargetSchema",
"name": "create",
Expand Down
61 changes: 36 additions & 25 deletions packages/dashboard-client/src/generated/SchemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,17 @@ export type OrganizationMandateGivenInstancesHrefSchema = {
include?: string;
[k: string]: unknown;
};
/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `create.hrefSchema` link.
*/
export type OrganizationMandateRequestCreateHrefSchema = {
/**
* If the account is also part of the target organization, the request can be automatically approved
*/
auto_approve?: string;
[k: string]: unknown;
};
/**
* This interface was referenced by `TfaDeactivateRequest`'s JSON-Schema
* via the `definition` "type".
Expand Down Expand Up @@ -4130,31 +4141,7 @@ export type OrganizationMandateRequestCreateSchema = {
* via the `create.targetSchema` link.
*/
export type OrganizationMandateRequestCreateTargetSchema = {
data: OrganizationMandateRequest;
};

/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `pending_instances.targetSchema` link.
*/
export type OrganizationMandateRequestPendingInstancesTargetSchema = {
data: OrganizationMandateRequest[];
};

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

/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `destroy.targetSchema` link.
*/
export type OrganizationMandateRequestDestroyTargetSchema = {
data: OrganizationMandateRequest;
data: OrganizationMandateRequest | OrganizationMandate;
};

/**
Expand Down Expand Up @@ -4282,6 +4269,30 @@ export type OrganizationMandateDestroyTargetSchema = {
data: OrganizationMandate;
};

/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `pending_instances.targetSchema` link.
*/
export type OrganizationMandateRequestPendingInstancesTargetSchema = {
data: OrganizationMandateRequest[];
};

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

/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `destroy.targetSchema` link.
*/
export type OrganizationMandateRequestDestroyTargetSchema = {
data: OrganizationMandateRequest;
};

/**
* Accounts that belong to a single organization can ask owners to deactivate their two-factor authentication
*
Expand Down
38 changes: 27 additions & 11 deletions packages/dashboard-client/src/generated/SimpleSchemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,16 +719,11 @@ export type OrganizationMandateRequestIdentity = string;
export type OrganizationMandateRequestType = 'organization_mandate_request';
/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `pending_instances.targetSchema` link.
*/
export type OrganizationMandateRequestPendingInstancesTargetSchema =
OrganizationMandateRequest[];
/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `requested_instances.targetSchema` link.
* via the `create.targetSchema` link.
*/
export type OrganizationMandateRequestRequestedInstancesTargetSchema =
OrganizationMandateRequest[];
export type OrganizationMandateRequestCreateTargetSchema =
| OrganizationMandateRequest
| OrganizationMandate;
/**
* ID of mandate
*
Expand Down Expand Up @@ -767,6 +762,29 @@ export type OrganizationMandateGivenInstancesHrefSchema = {
include?: string;
[k: string]: unknown;
};
/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `create.hrefSchema` link.
*/
export type OrganizationMandateRequestCreateHrefSchema = {
/**
* If the account is also part of the target organization, the request can be automatically approved
*/
auto_approve?: string;
[k: string]: unknown;
};
/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `pending_instances.targetSchema` link.
*/
export type OrganizationMandateRequestPendingInstancesTargetSchema =
OrganizationMandateRequest[];
/**
* This interface was referenced by `OrganizationMandateRequest`'s JSON-Schema
* via the `requested_instances.targetSchema` link.
*/
export type OrganizationMandateRequestRequestedInstancesTargetSchema =
OrganizationMandateRequest[];
/**
* ID of 2FA deactivate request
*
Expand Down Expand Up @@ -3933,8 +3951,6 @@ export type OrganizationMandateRequest = {
requester_organization: OrganizationData;
meta: OrganizationMandateRequestMeta;
};
export type OrganizationMandateRequestCreateTargetSchema =
OrganizationMandateRequest;
export type OrganizationMandateRequestDestroyTargetSchema =
OrganizationMandateRequest;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export default class OrganizationMandateRequest extends BaseResource {
* @throws {ApiError}
* @throws {TimeoutError}
*/
create(body: SimpleSchemaTypes.OrganizationMandateRequestCreateSchema) {
create(
body: SimpleSchemaTypes.OrganizationMandateRequestCreateSchema,
queryParams?: SimpleSchemaTypes.OrganizationMandateRequestCreateHrefSchema,
) {
return this.rawCreate(
Utils.serializeRequestBody<SchemaTypes.OrganizationMandateRequestCreateSchema>(
body,
Expand All @@ -22,6 +25,7 @@ export default class OrganizationMandateRequest extends BaseResource {
relationships: ['approver_organization'],
},
),
queryParams,
).then((body) =>
Utils.deserializeResponseBody<SimpleSchemaTypes.OrganizationMandateRequestCreateTargetSchema>(
body,
Expand All @@ -37,12 +41,14 @@ export default class OrganizationMandateRequest extends BaseResource {
*/
rawCreate(
body: SchemaTypes.OrganizationMandateRequestCreateSchema,
queryParams?: SchemaTypes.OrganizationMandateRequestCreateHrefSchema,
): Promise<SchemaTypes.OrganizationMandateRequestCreateTargetSchema> {
return this.client.request<SchemaTypes.OrganizationMandateRequestCreateTargetSchema>(
{
method: 'POST',
url: '/organization-mandate-requests',
body,
queryParams,
},
);
}
Expand Down

0 comments on commit 9e49906

Please sign in to comment.