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

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

/**
 * Attributes for activity task started events.
 */
export type ActivityTaskStartedAttributesResponse = {
  /**
   * Unique identifier for the activity task within the workflow.
   */
  taskId: string;
  /**
   * The registered name of the activity being executed.
   */
  activityName: string;
  /**
   * A payload containing arbitrary JSON data.
   *
   * @remarks
   *
   * Used for complete state snapshots or final results.
   * When encrypted, the value field contains base64-encoded encrypted data
   * and encoding_options indicates the type of encryption applied.
   */
  input: JSONPayloadResponse;
};

/** @internal */
export const ActivityTaskStartedAttributesResponse$inboundSchema: z.ZodType<
  ActivityTaskStartedAttributesResponse,
  unknown
> = z.object({
  task_id: z.string(),
  activity_name: z.string(),
  input: JSONPayloadResponse$inboundSchema,
}).transform((v) => {
  return remap$(v, {
    "task_id": "taskId",
    "activity_name": "activityName",
  });
});

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