/**
* Zod schemas for Flexible Asset endpoints
*/
import { z } from 'zod';
import { PaginationSchema, ResponseFormatSchema, SortDirectionSchema, IdSchema, NameFilterSchema, OrganizationIdFilterSchema } from './common.js';
/**
* List flexible assets input schema
*/
export const ListFlexibleAssetsSchema = z.object({
...PaginationSchema.shape,
response_format: ResponseFormatSchema,
organization_id: OrganizationIdFilterSchema,
flexible_asset_type_id: z.number().int().positive().optional()
.describe('Filter by flexible asset type ID (required for filtering by traits)'),
name: NameFilterSchema,
archived: z.boolean().optional()
.describe('Filter by archived status'),
sort: z.enum(['name', 'id', 'updated_at', 'created_at'])
.default('name')
.describe('Field to sort by'),
sort_direction: SortDirectionSchema,
include: z.array(z.enum(['adapters_resources', 'passwords', 'attachments', 'related_items']))
.optional()
.describe('Related resources to include')
}).strict();
export type ListFlexibleAssetsInput = z.infer<typeof ListFlexibleAssetsSchema>;
/**
* Get flexible asset by ID schema
*/
export const GetFlexibleAssetSchema = z.object({
id: IdSchema,
response_format: ResponseFormatSchema,
include: z.array(z.enum(['adapters_resources', 'passwords', 'attachments', 'related_items']))
.optional()
.describe('Related resources to include')
}).strict();
export type GetFlexibleAssetInput = z.infer<typeof GetFlexibleAssetSchema>;
/**
* Create flexible asset schema
*/
export const CreateFlexibleAssetSchema = z.object({
organization_id: z.number().int().positive()
.describe('Organization ID (required)'),
flexible_asset_type_id: z.number().int().positive()
.describe('Flexible asset type ID (required)'),
traits: z.record(z.string(), z.unknown())
.describe('Trait values as key-value pairs. Keys are the trait name-keys from the flexible asset type.'),
response_format: ResponseFormatSchema
}).strict();
export type CreateFlexibleAssetInput = z.infer<typeof CreateFlexibleAssetSchema>;
/**
* Update flexible asset schema
*/
export const UpdateFlexibleAssetSchema = z.object({
id: IdSchema,
organization_id: z.number().int().positive().optional()
.describe('Organization ID'),
traits: z.record(z.string(), z.unknown()).optional()
.describe('Trait values to update. Keys are the trait name-keys from the flexible asset type.'),
archived: z.boolean().optional()
.describe('Archive status'),
response_format: ResponseFormatSchema
}).strict();
export type UpdateFlexibleAssetInput = z.infer<typeof UpdateFlexibleAssetSchema>;
/**
* List flexible asset types input schema
*/
export const ListFlexibleAssetTypesSchema = z.object({
...PaginationSchema.shape,
response_format: ResponseFormatSchema,
name: NameFilterSchema,
enabled: z.boolean().optional()
.describe('Filter by enabled status'),
include: z.array(z.enum(['flexible_asset_fields']))
.optional()
.describe('Include flexible asset fields in response')
}).strict();
export type ListFlexibleAssetTypesInput = z.infer<typeof ListFlexibleAssetTypesSchema>;
/**
* Get flexible asset type by ID schema
*/
export const GetFlexibleAssetTypeSchema = z.object({
id: IdSchema,
response_format: ResponseFormatSchema,
include: z.array(z.enum(['flexible_asset_fields']))
.optional()
.describe('Include flexible asset fields in response')
}).strict();
export type GetFlexibleAssetTypeInput = z.infer<typeof GetFlexibleAssetTypeSchema>;
/**
* List flexible asset fields input schema
*/
export const ListFlexibleAssetFieldsSchema = z.object({
flexible_asset_type_id: z.number().int().positive()
.describe('Flexible asset type ID (required)'),
response_format: ResponseFormatSchema
}).strict();
export type ListFlexibleAssetFieldsInput = z.infer<typeof ListFlexibleAssetFieldsSchema>;