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

import * as z from "zod/v3";
import { safeParse } from "../lib/schemas.js";
import { Result as SafeParseResult } from "../types/fp.js";
import * as types from "../types/primitives.js";
import { SDKValidationError } from "./sdkvalidationerror.js";

export type RemoveProjectMemberRequest = {
  /**
   * The ID or name of the Project.
   */
  idOrName: string;
  /**
   * The user ID of the member.
   */
  uid: string;
  /**
   * The Team identifier to perform the request on behalf of.
   */
  teamId?: string | undefined;
  /**
   * The Team slug to perform the request on behalf of.
   */
  slug?: string | undefined;
};

export type RemoveProjectMemberResponseBody = {
  id: string;
};

/** @internal */
export type RemoveProjectMemberRequest$Outbound = {
  idOrName: string;
  uid: string;
  teamId?: string | undefined;
  slug?: string | undefined;
};

/** @internal */
export const RemoveProjectMemberRequest$outboundSchema: z.ZodType<
  RemoveProjectMemberRequest$Outbound,
  z.ZodTypeDef,
  RemoveProjectMemberRequest
> = z.object({
  idOrName: z.string(),
  uid: z.string(),
  teamId: z.string().optional(),
  slug: z.string().optional(),
});

export function removeProjectMemberRequestToJSON(
  removeProjectMemberRequest: RemoveProjectMemberRequest,
): string {
  return JSON.stringify(
    RemoveProjectMemberRequest$outboundSchema.parse(removeProjectMemberRequest),
  );
}

/** @internal */
export const RemoveProjectMemberResponseBody$inboundSchema: z.ZodType<
  RemoveProjectMemberResponseBody,
  z.ZodTypeDef,
  unknown
> = z.object({
  id: types.string(),
});

export function removeProjectMemberResponseBodyFromJSON(
  jsonString: string,
): SafeParseResult<RemoveProjectMemberResponseBody, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => RemoveProjectMemberResponseBody$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'RemoveProjectMemberResponseBody' from JSON`,
  );
}
