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

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

export type MyPlex = {
  authToken?: string | undefined;
  username?: string | undefined;
  mappingState?: string | undefined;
  mappingError?: string | undefined;
  signInState?: string | undefined;
  publicAddress?: string | undefined;
  publicPort?: number | undefined;
  privateAddress?: string | undefined;
  privatePort?: number | undefined;
  subscriptionFeatures?: string | undefined;
  subscriptionActive?: boolean | undefined;
  subscriptionState?: string | undefined;
};

/**
 * MyPlex Account
 */
export type GetMyPlexAccountResponseBody = {
  myPlex?: MyPlex | undefined;
};

export type GetMyPlexAccountResponse = {
  /**
   * 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;
  /**
   * MyPlex Account
   */
  object?: GetMyPlexAccountResponseBody | undefined;
};

/** @internal */
export const MyPlex$inboundSchema: z.ZodType<MyPlex, z.ZodTypeDef, unknown> = z
  .object({
    authToken: z.string().optional(),
    username: z.string().optional(),
    mappingState: z.string().optional(),
    mappingError: z.string().optional(),
    signInState: z.string().optional(),
    publicAddress: z.string().optional(),
    publicPort: z.number().optional(),
    privateAddress: z.string().optional(),
    privatePort: z.number().optional(),
    subscriptionFeatures: z.string().optional(),
    subscriptionActive: z.boolean().optional(),
    subscriptionState: z.string().optional(),
  });

/** @internal */
export type MyPlex$Outbound = {
  authToken?: string | undefined;
  username?: string | undefined;
  mappingState?: string | undefined;
  mappingError?: string | undefined;
  signInState?: string | undefined;
  publicAddress?: string | undefined;
  publicPort?: number | undefined;
  privateAddress?: string | undefined;
  privatePort?: number | undefined;
  subscriptionFeatures?: string | undefined;
  subscriptionActive?: boolean | undefined;
  subscriptionState?: string | undefined;
};

/** @internal */
export const MyPlex$outboundSchema: z.ZodType<
  MyPlex$Outbound,
  z.ZodTypeDef,
  MyPlex
> = z.object({
  authToken: z.string().optional(),
  username: z.string().optional(),
  mappingState: z.string().optional(),
  mappingError: z.string().optional(),
  signInState: z.string().optional(),
  publicAddress: z.string().optional(),
  publicPort: z.number().optional(),
  privateAddress: z.string().optional(),
  privatePort: z.number().optional(),
  subscriptionFeatures: z.string().optional(),
  subscriptionActive: z.boolean().optional(),
  subscriptionState: 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 MyPlex$ {
  /** @deprecated use `MyPlex$inboundSchema` instead. */
  export const inboundSchema = MyPlex$inboundSchema;
  /** @deprecated use `MyPlex$outboundSchema` instead. */
  export const outboundSchema = MyPlex$outboundSchema;
  /** @deprecated use `MyPlex$Outbound` instead. */
  export type Outbound = MyPlex$Outbound;
}

/** @internal */
export const GetMyPlexAccountResponseBody$inboundSchema: z.ZodType<
  GetMyPlexAccountResponseBody,
  z.ZodTypeDef,
  unknown
> = z.object({
  MyPlex: z.lazy(() => MyPlex$inboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    "MyPlex": "myPlex",
  });
});

/** @internal */
export type GetMyPlexAccountResponseBody$Outbound = {
  MyPlex?: MyPlex$Outbound | undefined;
};

/** @internal */
export const GetMyPlexAccountResponseBody$outboundSchema: z.ZodType<
  GetMyPlexAccountResponseBody$Outbound,
  z.ZodTypeDef,
  GetMyPlexAccountResponseBody
> = z.object({
  myPlex: z.lazy(() => MyPlex$outboundSchema).optional(),
}).transform((v) => {
  return remap$(v, {
    myPlex: "MyPlex",
  });
});

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

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

/** @internal */
export type GetMyPlexAccountResponse$Outbound = {
  ContentType: string;
  StatusCode: number;
  RawResponse: never;
  object?: GetMyPlexAccountResponseBody$Outbound | undefined;
};

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