/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { SecretProvider, SecretProvider$inboundSchema, } from "./secret-provider.js"; import { SecretType, SecretType$inboundSchema } from "./secret-type.js"; import { Status, Status$inboundSchema } from "./status.js"; import { UserType, UserType$inboundSchema } from "./user-type.js"; export type SecretResponse = { createdAt?: Date | undefined; displayId?: string | undefined; expiresAt?: Date | undefined; id?: string | undefined; lastUsedAt?: Date | undefined; name?: string | undefined; provider?: SecretProvider | undefined; /** * RBAC roles */ roles?: Array | undefined; /** * name of the service account (populated for service_account user_type) */ serviceAccountName?: string | undefined; status?: Status | undefined; type?: SecretType | undefined; updatedAt?: Date | undefined; /** * user or service account this key belongs to */ userId?: string | undefined; userType?: UserType | undefined; }; /** @internal */ export const SecretResponse$inboundSchema: z.ZodMiniType< SecretResponse, unknown > = z.pipe( z.object({ created_at: types.optional(types.date()), display_id: types.optional(types.string()), expires_at: types.optional(types.date()), id: types.optional(types.string()), last_used_at: types.optional(types.date()), name: types.optional(types.string()), provider: types.optional(SecretProvider$inboundSchema), roles: types.optional(z.array(types.string())), service_account_name: types.optional(types.string()), status: types.optional(Status$inboundSchema), type: types.optional(SecretType$inboundSchema), updated_at: types.optional(types.date()), user_id: types.optional(types.string()), user_type: types.optional(UserType$inboundSchema), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "display_id": "displayId", "expires_at": "expiresAt", "last_used_at": "lastUsedAt", "service_account_name": "serviceAccountName", "updated_at": "updatedAt", "user_id": "userId", "user_type": "userType", }); }), ); export function secretResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SecretResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SecretResponse' from JSON`, ); }