/* * 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 AuthenticationGenerateServiceAccountTokenSecurity = { apiKeyAuth: string; }; export type AuthenticationGenerateServiceAccountTokenResponse = { httpMeta: components.HTTPMetadata; /** * OK */ token?: components.Token | undefined; /** * INVALID_ARGUMENT: The request was not well formed. */ status?: components.Status | undefined; }; /** @internal */ export const AuthenticationGenerateServiceAccountTokenSecurity$inboundSchema: z.ZodType< AuthenticationGenerateServiceAccountTokenSecurity, z.ZodTypeDef, unknown > = z.object({ ApiKeyAuth: z.string(), }).transform((v) => { return remap$(v, { "ApiKeyAuth": "apiKeyAuth", }); }); /** @internal */ export type AuthenticationGenerateServiceAccountTokenSecurity$Outbound = { ApiKeyAuth: string; }; /** @internal */ export const AuthenticationGenerateServiceAccountTokenSecurity$outboundSchema: z.ZodType< AuthenticationGenerateServiceAccountTokenSecurity$Outbound, z.ZodTypeDef, AuthenticationGenerateServiceAccountTokenSecurity > = z.object({ apiKeyAuth: z.string(), }).transform((v) => { return remap$(v, { apiKeyAuth: "ApiKeyAuth", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AuthenticationGenerateServiceAccountTokenSecurity$ { /** @deprecated use `AuthenticationGenerateServiceAccountTokenSecurity$inboundSchema` instead. */ export const inboundSchema = AuthenticationGenerateServiceAccountTokenSecurity$inboundSchema; /** @deprecated use `AuthenticationGenerateServiceAccountTokenSecurity$outboundSchema` instead. */ export const outboundSchema = AuthenticationGenerateServiceAccountTokenSecurity$outboundSchema; /** @deprecated use `AuthenticationGenerateServiceAccountTokenSecurity$Outbound` instead. */ export type Outbound = AuthenticationGenerateServiceAccountTokenSecurity$Outbound; } export function authenticationGenerateServiceAccountTokenSecurityToJSON( authenticationGenerateServiceAccountTokenSecurity: AuthenticationGenerateServiceAccountTokenSecurity, ): string { return JSON.stringify( AuthenticationGenerateServiceAccountTokenSecurity$outboundSchema.parse( authenticationGenerateServiceAccountTokenSecurity, ), ); } export function authenticationGenerateServiceAccountTokenSecurityFromJSON( jsonString: string, ): SafeParseResult< AuthenticationGenerateServiceAccountTokenSecurity, SDKValidationError > { return safeParse( jsonString, (x) => AuthenticationGenerateServiceAccountTokenSecurity$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthenticationGenerateServiceAccountTokenSecurity' from JSON`, ); } /** @internal */ export const AuthenticationGenerateServiceAccountTokenResponse$inboundSchema: z.ZodType< AuthenticationGenerateServiceAccountTokenResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Token: components.Token$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Token": "token", "Status": "status", }); }); /** @internal */ export type AuthenticationGenerateServiceAccountTokenResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Token?: components.Token$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AuthenticationGenerateServiceAccountTokenResponse$outboundSchema: z.ZodType< AuthenticationGenerateServiceAccountTokenResponse$Outbound, z.ZodTypeDef, AuthenticationGenerateServiceAccountTokenResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, token: components.Token$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", token: "Token", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AuthenticationGenerateServiceAccountTokenResponse$ { /** @deprecated use `AuthenticationGenerateServiceAccountTokenResponse$inboundSchema` instead. */ export const inboundSchema = AuthenticationGenerateServiceAccountTokenResponse$inboundSchema; /** @deprecated use `AuthenticationGenerateServiceAccountTokenResponse$outboundSchema` instead. */ export const outboundSchema = AuthenticationGenerateServiceAccountTokenResponse$outboundSchema; /** @deprecated use `AuthenticationGenerateServiceAccountTokenResponse$Outbound` instead. */ export type Outbound = AuthenticationGenerateServiceAccountTokenResponse$Outbound; } export function authenticationGenerateServiceAccountTokenResponseToJSON( authenticationGenerateServiceAccountTokenResponse: AuthenticationGenerateServiceAccountTokenResponse, ): string { return JSON.stringify( AuthenticationGenerateServiceAccountTokenResponse$outboundSchema.parse( authenticationGenerateServiceAccountTokenResponse, ), ); } export function authenticationGenerateServiceAccountTokenResponseFromJSON( jsonString: string, ): SafeParseResult< AuthenticationGenerateServiceAccountTokenResponse, SDKValidationError > { return safeParse( jsonString, (x) => AuthenticationGenerateServiceAccountTokenResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthenticationGenerateServiceAccountTokenResponse' from JSON`, ); }