/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 6d51270e238f */ 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"; /** * Describes the response body of the /rotatetoken API call */ export type RotateTokenResponse = { /** * New raw secret */ rawSecret?: string | undefined; /** * Unix timestamp in seconds when the new secret value is assigned to the token. The token needs to be rotated before `rotationPeriodMinutes` past the createdAt timestamp otherwise it would be rendered unusable. */ createdAt?: number | undefined; /** * Refers to the time period in minutes before which this token needs to be rotated. It is required to rotate the token within the specified `rotationPeriodMinutes` after each `/rotatetoken` call, otherwise the tokens would expire. Note that the token would still expire at `expiresAt` timestamp provided during token creation even if the token is being regularly rotated. `rotationPeriodMinutes` property is inherited from the parent token being rotated */ rotationPeriodMinutes?: number | undefined; }; /** @internal */ export const RotateTokenResponse$inboundSchema: z.ZodType< RotateTokenResponse, z.ZodTypeDef, unknown > = z.object({ rawSecret: z.string().optional(), createdAt: z.number().int().optional(), rotationPeriodMinutes: z.number().int().optional(), }); export function rotateTokenResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RotateTokenResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RotateTokenResponse' from JSON`, ); }