/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod";
import { remap as remap$ } from "../../../lib/primitives.js";

/**
 * `delegation` - This is the only supported `type` parameter.
 */
export enum GetTransientTokenQueryParamType {
  Delegation = "delegation",
}

/**
 * `all` - This is the only supported `scope` parameter.
 */
export enum Scope {
  All = "all",
}

export type GetTransientTokenRequest = {
  /**
   * `delegation` - This is the only supported `type` parameter.
   */
  type: GetTransientTokenQueryParamType;
  /**
   * `all` - This is the only supported `scope` parameter.
   */
  scope: Scope;
};

export type GetTransientTokenResponse = {
  /**
   * 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;
};

/** @internal */
export const GetTransientTokenQueryParamType$inboundSchema: z.ZodNativeEnum<
  typeof GetTransientTokenQueryParamType
> = z.nativeEnum(GetTransientTokenQueryParamType);

/** @internal */
export const GetTransientTokenQueryParamType$outboundSchema: z.ZodNativeEnum<
  typeof GetTransientTokenQueryParamType
> = GetTransientTokenQueryParamType$inboundSchema;

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetTransientTokenQueryParamType$ {
  /** @deprecated use `GetTransientTokenQueryParamType$inboundSchema` instead. */
  export const inboundSchema = GetTransientTokenQueryParamType$inboundSchema;
  /** @deprecated use `GetTransientTokenQueryParamType$outboundSchema` instead. */
  export const outboundSchema = GetTransientTokenQueryParamType$outboundSchema;
}

/** @internal */
export const Scope$inboundSchema: z.ZodNativeEnum<typeof Scope> = z.nativeEnum(
  Scope,
);

/** @internal */
export const Scope$outboundSchema: z.ZodNativeEnum<typeof Scope> =
  Scope$inboundSchema;

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace Scope$ {
  /** @deprecated use `Scope$inboundSchema` instead. */
  export const inboundSchema = Scope$inboundSchema;
  /** @deprecated use `Scope$outboundSchema` instead. */
  export const outboundSchema = Scope$outboundSchema;
}

/** @internal */
export const GetTransientTokenRequest$inboundSchema: z.ZodType<
  GetTransientTokenRequest,
  z.ZodTypeDef,
  unknown
> = z.object({
  type: GetTransientTokenQueryParamType$inboundSchema,
  scope: Scope$inboundSchema,
});

/** @internal */
export type GetTransientTokenRequest$Outbound = {
  type: string;
  scope: string;
};

/** @internal */
export const GetTransientTokenRequest$outboundSchema: z.ZodType<
  GetTransientTokenRequest$Outbound,
  z.ZodTypeDef,
  GetTransientTokenRequest
> = z.object({
  type: GetTransientTokenQueryParamType$outboundSchema,
  scope: Scope$outboundSchema,
});

/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export namespace GetTransientTokenRequest$ {
  /** @deprecated use `GetTransientTokenRequest$inboundSchema` instead. */
  export const inboundSchema = GetTransientTokenRequest$inboundSchema;
  /** @deprecated use `GetTransientTokenRequest$outboundSchema` instead. */
  export const outboundSchema = GetTransientTokenRequest$outboundSchema;
  /** @deprecated use `GetTransientTokenRequest$Outbound` instead. */
  export type Outbound = GetTransientTokenRequest$Outbound;
}

/** @internal */
export const GetTransientTokenResponse$inboundSchema: z.ZodType<
  GetTransientTokenResponse,
  z.ZodTypeDef,
  unknown
> = z.object({
  ContentType: z.string(),
  StatusCode: z.number().int(),
  RawResponse: z.instanceof(Response),
}).transform((v) => {
  return remap$(v, {
    "ContentType": "contentType",
    "StatusCode": "statusCode",
    "RawResponse": "rawResponse",
  });
});

/** @internal */
export type GetTransientTokenResponse$Outbound = {
  ContentType: string;
  StatusCode: number;
  RawResponse: never;
};

/** @internal */
export const GetTransientTokenResponse$outboundSchema: z.ZodType<
  GetTransientTokenResponse$Outbound,
  z.ZodTypeDef,
  GetTransientTokenResponse
> = z.object({
  contentType: z.string(),
  statusCode: z.number().int(),
  rawResponse: z.instanceof(Response).transform(() => {
    throw new Error("Response cannot be serialized");
  }),
}).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 GetTransientTokenResponse$ {
  /** @deprecated use `GetTransientTokenResponse$inboundSchema` instead. */
  export const inboundSchema = GetTransientTokenResponse$inboundSchema;
  /** @deprecated use `GetTransientTokenResponse$outboundSchema` instead. */
  export const outboundSchema = GetTransientTokenResponse$outboundSchema;
  /** @deprecated use `GetTransientTokenResponse$Outbound` instead. */
  export type Outbound = GetTransientTokenResponse$Outbound;
}
