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

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

export type ConnectorCreateOrUpdateWorkspaceCredentialsV1Request = {
  connectorIdOrName: string;
  credentialsCreateOrUpdate: components.CredentialsCreateOrUpdate;
};

/** @internal */
export type ConnectorCreateOrUpdateWorkspaceCredentialsV1Request$Outbound = {
  connector_id_or_name: string;
  CredentialsCreateOrUpdate: components.CredentialsCreateOrUpdate$Outbound;
};

/** @internal */
export const ConnectorCreateOrUpdateWorkspaceCredentialsV1Request$outboundSchema:
  z.ZodType<
    ConnectorCreateOrUpdateWorkspaceCredentialsV1Request$Outbound,
    ConnectorCreateOrUpdateWorkspaceCredentialsV1Request
  > = z.object({
    connectorIdOrName: z.string(),
    credentialsCreateOrUpdate:
      components.CredentialsCreateOrUpdate$outboundSchema,
  }).transform((v) => {
    return remap$(v, {
      connectorIdOrName: "connector_id_or_name",
      credentialsCreateOrUpdate: "CredentialsCreateOrUpdate",
    });
  });

export function connectorCreateOrUpdateWorkspaceCredentialsV1RequestToJSON(
  connectorCreateOrUpdateWorkspaceCredentialsV1Request:
    ConnectorCreateOrUpdateWorkspaceCredentialsV1Request,
): string {
  return JSON.stringify(
    ConnectorCreateOrUpdateWorkspaceCredentialsV1Request$outboundSchema.parse(
      connectorCreateOrUpdateWorkspaceCredentialsV1Request,
    ),
  );
}
