@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
51 lines (46 loc) • 1.77 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
KeyResponseData,
KeyResponseData$inboundSchema,
} from "./keyresponsedata.js";
import { Meta, Meta$inboundSchema } from "./meta.js";
import { Pagination, Pagination$inboundSchema } from "./pagination.js";
export type V2ApisListKeysResponseBody = {
/**
* Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team.
*/
meta: Meta;
/**
* Array of API keys with complete configuration and metadata.
*/
data: Array<KeyResponseData>;
/**
* Pagination metadata for list endpoints. Provides information necessary to traverse through large result sets efficiently using cursor-based pagination.
*/
pagination?: Pagination | undefined;
};
/** @internal */
export const V2ApisListKeysResponseBody$inboundSchema: z.ZodType<
V2ApisListKeysResponseBody,
z.ZodTypeDef,
unknown
> = z.object({
meta: Meta$inboundSchema,
data: z.array(KeyResponseData$inboundSchema),
pagination: Pagination$inboundSchema.optional(),
});
export function v2ApisListKeysResponseBodyFromJSON(
jsonString: string,
): SafeParseResult<V2ApisListKeysResponseBody, SDKValidationError> {
return safeParse(
jsonString,
(x) => V2ApisListKeysResponseBody$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'V2ApisListKeysResponseBody' from JSON`,
);
}