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

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

export type BenefitSlackSharedChannelCreateProperties = {
  /**
   * Polar Slack integration to use for this benefit.
   */
  slackIntegrationId: string;
  channelNameTemplate: string;
  private?: boolean | undefined;
  welcomeMessage?: string | null | undefined;
  archiveOnRevoke?: boolean | undefined;
  teamInvitees?: Array<string> | undefined;
};

/** @internal */
export type BenefitSlackSharedChannelCreateProperties$Outbound = {
  slack_integration_id: string;
  channel_name_template: string;
  private: boolean;
  welcome_message?: string | null | undefined;
  archive_on_revoke: boolean;
  team_invitees?: Array<string> | undefined;
};

/** @internal */
export const BenefitSlackSharedChannelCreateProperties$outboundSchema:
  z.ZodMiniType<
    BenefitSlackSharedChannelCreateProperties$Outbound,
    BenefitSlackSharedChannelCreateProperties
  > = z.pipe(
    z.object({
      slackIntegrationId: z.string(),
      channelNameTemplate: z.string(),
      private: z._default(z.boolean(), true),
      welcomeMessage: z.optional(z.nullable(z.string())),
      archiveOnRevoke: z._default(z.boolean(), true),
      teamInvitees: z.optional(z.array(z.string())),
    }),
    z.transform((v) => {
      return remap$(v, {
        slackIntegrationId: "slack_integration_id",
        channelNameTemplate: "channel_name_template",
        welcomeMessage: "welcome_message",
        archiveOnRevoke: "archive_on_revoke",
        teamInvitees: "team_invitees",
      });
    }),
  );

export function benefitSlackSharedChannelCreatePropertiesToJSON(
  benefitSlackSharedChannelCreateProperties:
    BenefitSlackSharedChannelCreateProperties,
): string {
  return JSON.stringify(
    BenefitSlackSharedChannelCreateProperties$outboundSchema.parse(
      benefitSlackSharedChannelCreateProperties,
    ),
  );
}
