import {z} from 'zod' export type DeleteApiV2SettingsSecurityKeysKeyIdArgs = {key_id: string}; export type DeleteApiV2SettingsSecurityKeysKeyIdOptions = {baseUrl?: string | undefined, HEADER?: string | undefined, fetch?: typeof fetch | undefined}; export const componentReferenceResponse = z.object({component_id: z.string().optional(), socket_names: z.array(z.string()).optional()}); export const zonedDateTime = z.string(); export const descriptionInClientKeyResponseBase = z.union([z.string().nullable(), z.string(), z.string()]); export const nameInClientKeyResponseBase = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthClientKeyResponse = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthGenericClientKeyResponse = z.union([z.string(), z.string()]); export const requestInOAuthGenericClientKeyResponse = z.union([z.object({body: z.string().nullable().optional(), headers: z.record(z.string(), z.array(z.string())).optional(), url: z.string().optional()}), z.string(), z.string(), z.string(), z.string()]); export const responseHandlerInOAuthGenericClientKeyResponse = z.union([z.object({accessToken: z.string().optional(), expiresIn: z.number().int().optional()}), z.string(), z.string(), z.string(), z.string()]); export const authorizationUrlInOAuthLeadPerfectionClientKeyResponse = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthListrakClientKeyResponse = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthOptimoveClientKeyResponse = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthSalesforceClientKeyResponse = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthSfdcClientKeyResponse = z.union([z.string(), z.string()]); export const authorizationUrlInOAuthSfdcPasswordClientKeyResponse = z.union([z.string(), z.string()]); export const clientKeyResponse = z.discriminatedUnion("algorithm", [z.object({algorithm: z.literal("A128KW"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("A192KW"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("A256KW"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("ES256_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("ES256_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("ES384_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("ES384_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("ES512_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("ES512_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("HS256"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("HS384"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("HS512"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("HTTP_BASIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("OAUTH"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, authorization_url: authorizationUrlInOAuthClientKeyResponse, oauth_client_id: z.string(), scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_GENERIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, authorization_url: authorizationUrlInOAuthGenericClientKeyResponse, oauth_client_id: z.string(), request: requestInOAuthGenericClientKeyResponse, response_handler: responseHandlerInOAuthGenericClientKeyResponse, scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_LEAD_PERFECTION"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, appKey: z.string(), app_key: z.string().optional(), authorization_url: authorizationUrlInOAuthLeadPerfectionClientKeyResponse, leadPerfectionClientId: z.string(), lead_perfection_client_id: z.string().optional(), oauth_client_id: z.string(), scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_LISTRAK"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, authorization_url: authorizationUrlInOAuthListrakClientKeyResponse, oauth_client_id: z.string(), scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_OPTIMOVE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, authorization_url: authorizationUrlInOAuthOptimoveClientKeyResponse, oauth_client_id: z.string(), scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_SALESFORCE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, account_id: z.number().int(), authorization_url: authorizationUrlInOAuthSalesforceClientKeyResponse, oauth_client_id: z.string(), scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_SFDC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, authorization_url: authorizationUrlInOAuthSfdcClientKeyResponse, oauth_client_id: z.string(), scope: z.string().nullable()}), z.object({algorithm: z.literal("OAUTH_SFDC_PASSWORD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, authorization_url: authorizationUrlInOAuthSfdcPasswordClientKeyResponse, oauth_client_id: z.string(), password: z.string(), scope: z.string().nullable(), username: z.string()}), z.object({algorithm: z.literal("PASSWORD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("PS256_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("PS256_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("PS384_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("PS384_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("PS512_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("PS512_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RS256_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RS256_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RS384_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RS384_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RS512_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RS512_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA_OAEP_256_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA_OAEP_256_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA_OAEP_384_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA_OAEP_384_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA_OAEP_512_PRIVATE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("RSA_OAEP_512_PUBLIC"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime}), z.object({algorithm: z.literal("SSL_PKCS_12"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_at: zonedDateTime, description: descriptionInClientKeyResponseBase, id: z.string(), key: z.string(), name: nameInClientKeyResponseBase, partner_key_id: z.string(), tags: z.array(z.string()), type: z.enum(["JWT", "PASSWORD", "PGP", "PGP_EXTOLE", "SSH", "WEBHOOK"]), updated_at: zonedDateTime, password: z.string()})]); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Archive client key * * DELETE /v2/settings/security/keys/{key_id} * * Also accepts auth: QUERY, COOKIE */ export const deleteApiV2SettingsSecurityKeysKeyId = async (args: DeleteApiV2SettingsSecurityKeysKeyIdArgs, options?: DeleteApiV2SettingsSecurityKeysKeyIdOptions) => { const {baseUrl = "https://api.extole.io", fetch: fetchFn = fetch, HEADER} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (HEADER !== undefined) headers.set("Authorization", HEADER) const url = `${baseUrl.replace(/\/+$/, '')}/v2/settings/security/keys/${encodeURIComponent(String(args.key_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(clientKeyResponse, await res.json()) };