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

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
  BaseTaskStatus,
  BaseTaskStatus$inboundSchema,
} from "./basetaskstatus.js";

export type FetchCampaignStatusResponse = {
  status: BaseTaskStatus;
};

/** @internal */
export const FetchCampaignStatusResponse$inboundSchema: z.ZodType<
  FetchCampaignStatusResponse,
  unknown
> = z.object({
  status: BaseTaskStatus$inboundSchema,
});

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