@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
44 lines (39 loc) • 1.3 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 {
V2KeysMigrateKeysMigration,
V2KeysMigrateKeysMigration$inboundSchema,
} from "./v2keysmigratekeysmigration.js";
export type V2KeysMigrateKeysResponseData = {
/**
* Successfully migrated keys with their hash and generated keyId
*/
migrated: Array<V2KeysMigrateKeysMigration>;
/**
* Hashes that could not be migrated (e.g., already exist in the system)
*/
failed: Array<string>;
};
/** @internal */
export const V2KeysMigrateKeysResponseData$inboundSchema: z.ZodType<
V2KeysMigrateKeysResponseData,
z.ZodTypeDef,
unknown
> = z.object({
migrated: z.array(V2KeysMigrateKeysMigration$inboundSchema),
failed: z.array(z.string()),
});
export function v2KeysMigrateKeysResponseDataFromJSON(
jsonString: string,
): SafeParseResult<V2KeysMigrateKeysResponseData, SDKValidationError> {
return safeParse(
jsonString,
(x) => V2KeysMigrateKeysResponseData$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'V2KeysMigrateKeysResponseData' from JSON`,
);
}