/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; export type CreateBadgeRequestBody = { /** * The ID for the badge type. 1 for Gold, 2 for Silver, 3 for Bronze. */ badgeTypeId: number; /** * The name for the new badge. */ name: string; }; export type Badge = { allowTitle: boolean; autoRevoke: boolean; badgeGroupingId: number; badgeTypeId: number; description: string; enabled: boolean; grantCount: number; icon: string; id: number; imageUrl: string | null; listable: boolean; longDescription: string; manuallyGrantable: boolean; multipleGrant: boolean; name: string; query: string | null; showPosts: boolean; slug: string; system: boolean; targetPosts: boolean; trigger: string | null; }; export type CreateBadgeBadgeTypes = { id: number; name: string; sortOrder: number; }; /** * success response */ export type CreateBadgeResponseBody = { badge: Badge; badgeTypes: Array; }; /** @internal */ export const CreateBadgeRequestBody$inboundSchema: z.ZodType< CreateBadgeRequestBody, z.ZodTypeDef, unknown > = z.object({ badge_type_id: z.number().int(), name: z.string(), }).transform((v) => { return remap$(v, { "badge_type_id": "badgeTypeId", }); }); /** @internal */ export type CreateBadgeRequestBody$Outbound = { badge_type_id: number; name: string; }; /** @internal */ export const CreateBadgeRequestBody$outboundSchema: z.ZodType< CreateBadgeRequestBody$Outbound, z.ZodTypeDef, CreateBadgeRequestBody > = z.object({ badgeTypeId: z.number().int(), name: z.string(), }).transform((v) => { return remap$(v, { badgeTypeId: "badge_type_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateBadgeRequestBody$ { /** @deprecated use `CreateBadgeRequestBody$inboundSchema` instead. */ export const inboundSchema = CreateBadgeRequestBody$inboundSchema; /** @deprecated use `CreateBadgeRequestBody$outboundSchema` instead. */ export const outboundSchema = CreateBadgeRequestBody$outboundSchema; /** @deprecated use `CreateBadgeRequestBody$Outbound` instead. */ export type Outbound = CreateBadgeRequestBody$Outbound; } /** @internal */ export const Badge$inboundSchema: z.ZodType = z .object({ allow_title: z.boolean(), auto_revoke: z.boolean(), badge_grouping_id: z.number().int(), badge_type_id: z.number().int(), description: z.string(), enabled: z.boolean(), grant_count: z.number().int(), icon: z.string(), id: z.number().int(), image_url: z.nullable(z.string()), listable: z.boolean(), long_description: z.string(), manually_grantable: z.boolean(), multiple_grant: z.boolean(), name: z.string(), query: z.nullable(z.string()), show_posts: z.boolean(), slug: z.string(), system: z.boolean(), target_posts: z.boolean(), trigger: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "allow_title": "allowTitle", "auto_revoke": "autoRevoke", "badge_grouping_id": "badgeGroupingId", "badge_type_id": "badgeTypeId", "grant_count": "grantCount", "image_url": "imageUrl", "long_description": "longDescription", "manually_grantable": "manuallyGrantable", "multiple_grant": "multipleGrant", "show_posts": "showPosts", "target_posts": "targetPosts", }); }); /** @internal */ export type Badge$Outbound = { allow_title: boolean; auto_revoke: boolean; badge_grouping_id: number; badge_type_id: number; description: string; enabled: boolean; grant_count: number; icon: string; id: number; image_url: string | null; listable: boolean; long_description: string; manually_grantable: boolean; multiple_grant: boolean; name: string; query: string | null; show_posts: boolean; slug: string; system: boolean; target_posts: boolean; trigger: string | null; }; /** @internal */ export const Badge$outboundSchema: z.ZodType< Badge$Outbound, z.ZodTypeDef, Badge > = z.object({ allowTitle: z.boolean(), autoRevoke: z.boolean(), badgeGroupingId: z.number().int(), badgeTypeId: z.number().int(), description: z.string(), enabled: z.boolean(), grantCount: z.number().int(), icon: z.string(), id: z.number().int(), imageUrl: z.nullable(z.string()), listable: z.boolean(), longDescription: z.string(), manuallyGrantable: z.boolean(), multipleGrant: z.boolean(), name: z.string(), query: z.nullable(z.string()), showPosts: z.boolean(), slug: z.string(), system: z.boolean(), targetPosts: z.boolean(), trigger: z.nullable(z.string()), }).transform((v) => { return remap$(v, { allowTitle: "allow_title", autoRevoke: "auto_revoke", badgeGroupingId: "badge_grouping_id", badgeTypeId: "badge_type_id", grantCount: "grant_count", imageUrl: "image_url", longDescription: "long_description", manuallyGrantable: "manually_grantable", multipleGrant: "multiple_grant", showPosts: "show_posts", targetPosts: "target_posts", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Badge$ { /** @deprecated use `Badge$inboundSchema` instead. */ export const inboundSchema = Badge$inboundSchema; /** @deprecated use `Badge$outboundSchema` instead. */ export const outboundSchema = Badge$outboundSchema; /** @deprecated use `Badge$Outbound` instead. */ export type Outbound = Badge$Outbound; } /** @internal */ export const CreateBadgeBadgeTypes$inboundSchema: z.ZodType< CreateBadgeBadgeTypes, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), name: z.string(), sort_order: z.number().int(), }).transform((v) => { return remap$(v, { "sort_order": "sortOrder", }); }); /** @internal */ export type CreateBadgeBadgeTypes$Outbound = { id: number; name: string; sort_order: number; }; /** @internal */ export const CreateBadgeBadgeTypes$outboundSchema: z.ZodType< CreateBadgeBadgeTypes$Outbound, z.ZodTypeDef, CreateBadgeBadgeTypes > = z.object({ id: z.number().int(), name: z.string(), sortOrder: z.number().int(), }).transform((v) => { return remap$(v, { sortOrder: "sort_order", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateBadgeBadgeTypes$ { /** @deprecated use `CreateBadgeBadgeTypes$inboundSchema` instead. */ export const inboundSchema = CreateBadgeBadgeTypes$inboundSchema; /** @deprecated use `CreateBadgeBadgeTypes$outboundSchema` instead. */ export const outboundSchema = CreateBadgeBadgeTypes$outboundSchema; /** @deprecated use `CreateBadgeBadgeTypes$Outbound` instead. */ export type Outbound = CreateBadgeBadgeTypes$Outbound; } /** @internal */ export const CreateBadgeResponseBody$inboundSchema: z.ZodType< CreateBadgeResponseBody, z.ZodTypeDef, unknown > = z.object({ badge: z.lazy(() => Badge$inboundSchema), badge_types: z.array(z.lazy(() => CreateBadgeBadgeTypes$inboundSchema)), }).transform((v) => { return remap$(v, { "badge_types": "badgeTypes", }); }); /** @internal */ export type CreateBadgeResponseBody$Outbound = { badge: Badge$Outbound; badge_types: Array; }; /** @internal */ export const CreateBadgeResponseBody$outboundSchema: z.ZodType< CreateBadgeResponseBody$Outbound, z.ZodTypeDef, CreateBadgeResponseBody > = z.object({ badge: z.lazy(() => Badge$outboundSchema), badgeTypes: z.array(z.lazy(() => CreateBadgeBadgeTypes$outboundSchema)), }).transform((v) => { return remap$(v, { badgeTypes: "badge_types", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateBadgeResponseBody$ { /** @deprecated use `CreateBadgeResponseBody$inboundSchema` instead. */ export const inboundSchema = CreateBadgeResponseBody$inboundSchema; /** @deprecated use `CreateBadgeResponseBody$outboundSchema` instead. */ export const outboundSchema = CreateBadgeResponseBody$outboundSchema; /** @deprecated use `CreateBadgeResponseBody$Outbound` instead. */ export type Outbound = CreateBadgeResponseBody$Outbound; }