/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type UpdateSigningKeyRequestBody = { disabled?: boolean | undefined; name?: string | undefined; }; export type UpdateSigningKeyRequest = { /** * ID of the signing key */ keyId: string; requestBody: UpdateSigningKeyRequestBody; }; export type UpdateSigningKeyResponse = { /** * HTTP response content type for this operation */ contentType: string; /** * HTTP response status code for this operation */ statusCode: number; /** * Raw HTTP response; suitable for custom response parsing */ rawResponse: Response; /** * Error */ error?: components.ErrorT | undefined; }; /** @internal */ export const UpdateSigningKeyRequestBody$inboundSchema: z.ZodType< UpdateSigningKeyRequestBody, z.ZodTypeDef, unknown > = z.object({ disabled: z.boolean().optional(), name: z.string().optional(), }); /** @internal */ export type UpdateSigningKeyRequestBody$Outbound = { disabled?: boolean | undefined; name?: string | undefined; }; /** @internal */ export const UpdateSigningKeyRequestBody$outboundSchema: z.ZodType< UpdateSigningKeyRequestBody$Outbound, z.ZodTypeDef, UpdateSigningKeyRequestBody > = z.object({ disabled: z.boolean().optional(), name: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateSigningKeyRequestBody$ { /** @deprecated use `UpdateSigningKeyRequestBody$inboundSchema` instead. */ export const inboundSchema = UpdateSigningKeyRequestBody$inboundSchema; /** @deprecated use `UpdateSigningKeyRequestBody$outboundSchema` instead. */ export const outboundSchema = UpdateSigningKeyRequestBody$outboundSchema; /** @deprecated use `UpdateSigningKeyRequestBody$Outbound` instead. */ export type Outbound = UpdateSigningKeyRequestBody$Outbound; } export function updateSigningKeyRequestBodyToJSON( updateSigningKeyRequestBody: UpdateSigningKeyRequestBody, ): string { return JSON.stringify( UpdateSigningKeyRequestBody$outboundSchema.parse( updateSigningKeyRequestBody, ), ); } export function updateSigningKeyRequestBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateSigningKeyRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSigningKeyRequestBody' from JSON`, ); } /** @internal */ export const UpdateSigningKeyRequest$inboundSchema: z.ZodType< UpdateSigningKeyRequest, z.ZodTypeDef, unknown > = z.object({ keyId: z.string(), RequestBody: z.lazy(() => UpdateSigningKeyRequestBody$inboundSchema), }).transform((v) => { return remap$(v, { "RequestBody": "requestBody", }); }); /** @internal */ export type UpdateSigningKeyRequest$Outbound = { keyId: string; RequestBody: UpdateSigningKeyRequestBody$Outbound; }; /** @internal */ export const UpdateSigningKeyRequest$outboundSchema: z.ZodType< UpdateSigningKeyRequest$Outbound, z.ZodTypeDef, UpdateSigningKeyRequest > = z.object({ keyId: z.string(), requestBody: z.lazy(() => UpdateSigningKeyRequestBody$outboundSchema), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateSigningKeyRequest$ { /** @deprecated use `UpdateSigningKeyRequest$inboundSchema` instead. */ export const inboundSchema = UpdateSigningKeyRequest$inboundSchema; /** @deprecated use `UpdateSigningKeyRequest$outboundSchema` instead. */ export const outboundSchema = UpdateSigningKeyRequest$outboundSchema; /** @deprecated use `UpdateSigningKeyRequest$Outbound` instead. */ export type Outbound = UpdateSigningKeyRequest$Outbound; } export function updateSigningKeyRequestToJSON( updateSigningKeyRequest: UpdateSigningKeyRequest, ): string { return JSON.stringify( UpdateSigningKeyRequest$outboundSchema.parse(updateSigningKeyRequest), ); } export function updateSigningKeyRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateSigningKeyRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSigningKeyRequest' from JSON`, ); } /** @internal */ export const UpdateSigningKeyResponse$inboundSchema: z.ZodType< UpdateSigningKeyResponse, z.ZodTypeDef, unknown > = z.object({ ContentType: z.string(), StatusCode: z.number().int(), RawResponse: z.instanceof(Response), error: components.ErrorT$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "ContentType": "contentType", "StatusCode": "statusCode", "RawResponse": "rawResponse", }); }); /** @internal */ export type UpdateSigningKeyResponse$Outbound = { ContentType: string; StatusCode: number; RawResponse: never; error?: components.ErrorT$Outbound | undefined; }; /** @internal */ export const UpdateSigningKeyResponse$outboundSchema: z.ZodType< UpdateSigningKeyResponse$Outbound, z.ZodTypeDef, UpdateSigningKeyResponse > = z.object({ contentType: z.string(), statusCode: z.number().int(), rawResponse: z.instanceof(Response).transform(() => { throw new Error("Response cannot be serialized"); }), error: components.ErrorT$outboundSchema.optional(), }).transform((v) => { return remap$(v, { contentType: "ContentType", statusCode: "StatusCode", rawResponse: "RawResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateSigningKeyResponse$ { /** @deprecated use `UpdateSigningKeyResponse$inboundSchema` instead. */ export const inboundSchema = UpdateSigningKeyResponse$inboundSchema; /** @deprecated use `UpdateSigningKeyResponse$outboundSchema` instead. */ export const outboundSchema = UpdateSigningKeyResponse$outboundSchema; /** @deprecated use `UpdateSigningKeyResponse$Outbound` instead. */ export type Outbound = UpdateSigningKeyResponse$Outbound; } export function updateSigningKeyResponseToJSON( updateSigningKeyResponse: UpdateSigningKeyResponse, ): string { return JSON.stringify( UpdateSigningKeyResponse$outboundSchema.parse(updateSigningKeyResponse), ); } export function updateSigningKeyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateSigningKeyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateSigningKeyResponse' from JSON`, ); }