/**
 * Generated by orval v8.5.3 🍺
 * Do not edit manually.
 * ⚔️ RPG 遊戲管理系統
 * 
        🎮 **完整的 RPG 遊戲管理 API**
        
        功能特色：
        - ⚔️ **角色管理**: 創建、查詢、升級遊戲角色
        - 🏰 **公會系統**: 管理遊戲公會和成員
        - 🗡️ **裝備系統**: 武器裝備的完整管理
        - 📜 **任務系統**: dict 欄位 Monaco 編輯器 + Union 子欄位展示
        - 🎯 **遊戲事件系統**: 使用 Message Queue 處理異步遊戲事件
        - 🚀 **AutoCRUD 驅動**: 自動生成的完整 CRUD API
        - 📊 **數據搜尋**: 強大的查詢和篩選功能
        - 📖 **版本控制**: 追蹤所有數據變更歷史
        
        🎯 **快速開始**:
        1. 查看角色列表: `GET /character/data`
        2. 創建新角色: `POST /character`  
        3. 查看公會列表: `GET /guild/data`
        4. 瀏覽裝備: `GET /equipment/data`
        5. 查看任務列表: `GET /quest/data` ← dict 欄位 + Union 子欄位示範
        6. 查看遊戲事件: `GET /game-event/data`
        7. 觸發遊戲事件: `POST /game-event`
        
 * OpenAPI spec version: 2.1.0
 */
import * as zod from 'zod';

/**
 * Retrieve a list of `character` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /character/data` - Get first 10 resources (data only)
- `GET /character/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /character/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /character/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List character Data Only
 */
export const listResourcesDataV1AutocrudCharacterDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudCharacterDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudCharacterDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudCharacterDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudCharacterDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudCharacterDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudCharacterDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudCharacterDataGetResponseValueADXDefault = 12;
export const listResourcesDataV1AutocrudCharacterDataGetResponseLevelDefault = 1;
export const listResourcesDataV1AutocrudCharacterDataGetResponseHpDefault = 100;
export const listResourcesDataV1AutocrudCharacterDataGetResponseMpDefault = 50;
export const listResourcesDataV1AutocrudCharacterDataGetResponseAttackDefault = 10;
export const listResourcesDataV1AutocrudCharacterDataGetResponseDefenseDefault = 5;
export const listResourcesDataV1AutocrudCharacterDataGetResponseExperienceDefault = 0;
export const listResourcesDataV1AutocrudCharacterDataGetResponseGoldDefault = 100;
export const listResourcesDataV1AutocrudCharacterDataGetResponseGuildIdDefault = null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseGuildNameDefault = null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseSpecialAbilityDefault = null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseSkillIdsDefault = [];
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneOwnerIdDefault =
  null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneCharacterClassReqDefault =
  null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneAttackBonusDefault = 0;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneDefenseBonusDefault = 0;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneSpecialEffectsDefault =
  [];
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOnePriceDefault = 100;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneIconDefault = null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemTwoDescriptionDefault = ``;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemTwoPriceDefault = 100;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemTwoIconDefault = null;
export const listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsDefault = [];
export const listResourcesDataV1AutocrudCharacterDataGetResponseCreatedAtDefault = `2026-03-28T17:34:51.079343`;

export const ListResourcesDataV1AutocrudCharacterDataGetResponseItem = zod
  .object({
    name: zod.string(),
    character_class: zod
      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
      .describe('職業系統'),
    valueAD__x: zod
      .union([zod.number(), zod.string()])
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseValueADXDefault),
    level: zod.number().default(listResourcesDataV1AutocrudCharacterDataGetResponseLevelDefault),
    hp: zod.number().default(listResourcesDataV1AutocrudCharacterDataGetResponseHpDefault),
    mp: zod.number().default(listResourcesDataV1AutocrudCharacterDataGetResponseMpDefault),
    attack: zod.number().default(listResourcesDataV1AutocrudCharacterDataGetResponseAttackDefault),
    defense: zod
      .number()
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseDefenseDefault),
    experience: zod
      .number()
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseExperienceDefault),
    gold: zod.number().default(listResourcesDataV1AutocrudCharacterDataGetResponseGoldDefault),
    guild_id: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseGuildIdDefault),
    guild_name: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseGuildNameDefault),
    special_ability: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseSpecialAbilityDefault),
    skill_ids: zod
      .array(zod.string())
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseSkillIdsDefault),
    equipments: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['Equipment']),
              name: zod.string(),
              rarity: zod
                .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                .describe('裝備稀有度'),
              owner_id: zod
                .union([zod.string(), zod.null()])
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneOwnerIdDefault,
                ),
              character_class_req: zod
                .union([
                  zod
                    .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                    .describe('職業系統'),
                  zod.null(),
                ])
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneCharacterClassReqDefault,
                ),
              attack_bonus: zod
                .number()
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneAttackBonusDefault,
                ),
              defense_bonus: zod
                .number()
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneDefenseBonusDefault,
                ),
              special_effects: zod
                .array(zod.string())
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneSpecialEffectsDefault,
                ),
              price: zod
                .number()
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOnePriceDefault,
                ),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemOneIconDefault,
                ),
            })
            .describe('遊戲裝備'),
          zod
            .object({
              type: zod.enum(['Item']),
              name: zod.string(),
              description: zod
                .string()
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemTwoDescriptionDefault,
                ),
              price: zod
                .number()
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemTwoPriceDefault,
                ),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(
                  listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsItemTwoIconDefault,
                ),
            })
            .describe('遊戲物品（裝備和消耗品的基類）'),
        ]),
      )
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseEquipmentsDefault),
    created_at: zod
      .string()
      .default(listResourcesDataV1AutocrudCharacterDataGetResponseCreatedAtDefault),
  })
  .describe('遊戲角色');
export const ListResourcesDataV1AutocrudCharacterDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudCharacterDataGetResponseItem,
);

/**
 * Retrieve a list of `character` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /character/meta` - Get metadata for first 10 resources
- `GET /character/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /character/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List character Metadata Only
 */
export const listResourcesMetaV1AutocrudCharacterMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudCharacterMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudCharacterMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudCharacterMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudCharacterMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudCharacterMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudCharacterMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudCharacterMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudCharacterMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudCharacterMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudCharacterMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudCharacterMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudCharacterMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudCharacterMetaGetResponseItem,
);

/**
 * Retrieve a list of `character` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /character/revision-info` - Get current revision info for first 10 resources
- `GET /character/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /character/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List character Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudCharacterRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /character` instead. Retrieve a list of `character` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List character Complete Information
 */
export const listResourcesFullV1AutocrudCharacterFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudCharacterFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudCharacterFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudCharacterFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudCharacterFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudCharacterFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudCharacterFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudCharacterFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudCharacterFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudCharacterFullGetResponseDataValueADXDefault = 12;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataLevelDefault = 1;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataHpDefault = 100;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataMpDefault = 50;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataAttackDefault = 10;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataDefenseDefault = 5;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataExperienceDefault = 0;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataGoldDefault = 100;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataGuildIdDefault = null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataGuildNameDefault = null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataSpecialAbilityDefault = null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataSkillIdsDefault = [];
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneOwnerIdDefault =
  null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneCharacterClassReqDefault =
  null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneAttackBonusDefault = 0;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneDefenseBonusDefault = 0;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneSpecialEffectsDefault =
  [];
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOnePriceDefault = 100;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneIconDefault =
  null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemTwoDescriptionDefault = ``;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemTwoPriceDefault = 100;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemTwoIconDefault =
  null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsDefault = [];
export const listResourcesFullV1AutocrudCharacterFullGetResponseDataCreatedAtDefault = `2026-03-28T17:34:51.079343`;
export const listResourcesFullV1AutocrudCharacterFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudCharacterFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudCharacterFullGetResponseItem = zod.object({
  data: zod
    .object({
      name: zod.string(),
      character_class: zod
        .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
        .describe('職業系統'),
      valueAD__x: zod
        .union([zod.number(), zod.string()])
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataValueADXDefault),
      level: zod
        .number()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataLevelDefault),
      hp: zod.number().default(listResourcesFullV1AutocrudCharacterFullGetResponseDataHpDefault),
      mp: zod.number().default(listResourcesFullV1AutocrudCharacterFullGetResponseDataMpDefault),
      attack: zod
        .number()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataAttackDefault),
      defense: zod
        .number()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataDefenseDefault),
      experience: zod
        .number()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataExperienceDefault),
      gold: zod
        .number()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataGoldDefault),
      guild_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataGuildIdDefault),
      guild_name: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataGuildNameDefault),
      special_ability: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataSpecialAbilityDefault),
      skill_ids: zod
        .array(zod.string())
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataSkillIdsDefault),
      equipments: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['Equipment']),
                name: zod.string(),
                rarity: zod
                  .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                  .describe('裝備稀有度'),
                owner_id: zod
                  .union([zod.string(), zod.null()])
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneOwnerIdDefault,
                  ),
                character_class_req: zod
                  .union([
                    zod
                      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                      .describe('職業系統'),
                    zod.null(),
                  ])
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneCharacterClassReqDefault,
                  ),
                attack_bonus: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneAttackBonusDefault,
                  ),
                defense_bonus: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneDefenseBonusDefault,
                  ),
                special_effects: zod
                  .array(zod.string())
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneSpecialEffectsDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOnePriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemOneIconDefault,
                  ),
              })
              .describe('遊戲裝備'),
            zod
              .object({
                type: zod.enum(['Item']),
                name: zod.string(),
                description: zod
                  .string()
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemTwoDescriptionDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemTwoPriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsItemTwoIconDefault,
                  ),
              })
              .describe('遊戲物品（裝備和消耗品的基類）'),
          ]),
        )
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataEquipmentsDefault),
      created_at: zod
        .string()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseDataCreatedAtDefault),
    })
    .optional()
    .describe('遊戲角色'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCharacterFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCharacterFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudCharacterFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudCharacterFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudCharacterFullGetResponseItem,
);

/**
 * Retrieve the count of `character` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /character/count` - Get total count of all resources
- `GET /character/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count character Resources
 */
export const getResourcesCountV1AutocrudCharacterCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudCharacterCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudCharacterCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudCharacterCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudCharacterCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudCharacterCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudCharacterCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudCharacterCountGetResponse = zod.number();

/**
 * Retrieve a list of `character` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /character` — full list (data + meta + revision_info)
- `GET /character?returns=data` — data only
- `GET /character?returns=data,meta` — data + meta, no revision_info
- `GET /character?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List character resources
 */
export const listResourcesV1AutocrudCharacterGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudCharacterGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudCharacterGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudCharacterGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudCharacterGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudCharacterGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudCharacterGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudCharacterGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudCharacterGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudCharacterGetResponseDataValueADXDefault = 12;
export const listResourcesV1AutocrudCharacterGetResponseDataLevelDefault = 1;
export const listResourcesV1AutocrudCharacterGetResponseDataHpDefault = 100;
export const listResourcesV1AutocrudCharacterGetResponseDataMpDefault = 50;
export const listResourcesV1AutocrudCharacterGetResponseDataAttackDefault = 10;
export const listResourcesV1AutocrudCharacterGetResponseDataDefenseDefault = 5;
export const listResourcesV1AutocrudCharacterGetResponseDataExperienceDefault = 0;
export const listResourcesV1AutocrudCharacterGetResponseDataGoldDefault = 100;
export const listResourcesV1AutocrudCharacterGetResponseDataGuildIdDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseDataGuildNameDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseDataSpecialAbilityDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseDataSkillIdsDefault = [];
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneOwnerIdDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneCharacterClassReqDefault =
  null;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneAttackBonusDefault = 0;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneDefenseBonusDefault = 0;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneSpecialEffectsDefault =
  [];
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOnePriceDefault = 100;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneIconDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemTwoDescriptionDefault = ``;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemTwoPriceDefault = 100;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemTwoIconDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseDataEquipmentsDefault = [];
export const listResourcesV1AutocrudCharacterGetResponseDataCreatedAtDefault = `2026-03-28T17:34:51.079343`;
export const listResourcesV1AutocrudCharacterGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudCharacterGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudCharacterGetResponseItem = zod.object({
  data: zod
    .object({
      name: zod.string(),
      character_class: zod
        .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
        .describe('職業系統'),
      valueAD__x: zod
        .union([zod.number(), zod.string()])
        .default(listResourcesV1AutocrudCharacterGetResponseDataValueADXDefault),
      level: zod.number().default(listResourcesV1AutocrudCharacterGetResponseDataLevelDefault),
      hp: zod.number().default(listResourcesV1AutocrudCharacterGetResponseDataHpDefault),
      mp: zod.number().default(listResourcesV1AutocrudCharacterGetResponseDataMpDefault),
      attack: zod.number().default(listResourcesV1AutocrudCharacterGetResponseDataAttackDefault),
      defense: zod.number().default(listResourcesV1AutocrudCharacterGetResponseDataDefenseDefault),
      experience: zod
        .number()
        .default(listResourcesV1AutocrudCharacterGetResponseDataExperienceDefault),
      gold: zod.number().default(listResourcesV1AutocrudCharacterGetResponseDataGoldDefault),
      guild_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCharacterGetResponseDataGuildIdDefault),
      guild_name: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCharacterGetResponseDataGuildNameDefault),
      special_ability: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCharacterGetResponseDataSpecialAbilityDefault),
      skill_ids: zod
        .array(zod.string())
        .default(listResourcesV1AutocrudCharacterGetResponseDataSkillIdsDefault),
      equipments: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['Equipment']),
                name: zod.string(),
                rarity: zod
                  .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                  .describe('裝備稀有度'),
                owner_id: zod
                  .union([zod.string(), zod.null()])
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneOwnerIdDefault,
                  ),
                character_class_req: zod
                  .union([
                    zod
                      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                      .describe('職業系統'),
                    zod.null(),
                  ])
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneCharacterClassReqDefault,
                  ),
                attack_bonus: zod
                  .number()
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneAttackBonusDefault,
                  ),
                defense_bonus: zod
                  .number()
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneDefenseBonusDefault,
                  ),
                special_effects: zod
                  .array(zod.string())
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneSpecialEffectsDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOnePriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemOneIconDefault,
                  ),
              })
              .describe('遊戲裝備'),
            zod
              .object({
                type: zod.enum(['Item']),
                name: zod.string(),
                description: zod
                  .string()
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemTwoDescriptionDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemTwoPriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    listResourcesV1AutocrudCharacterGetResponseDataEquipmentsItemTwoIconDefault,
                  ),
              })
              .describe('遊戲物品（裝備和消耗品的基類）'),
          ]),
        )
        .default(listResourcesV1AutocrudCharacterGetResponseDataEquipmentsDefault),
      created_at: zod
        .string()
        .default(listResourcesV1AutocrudCharacterGetResponseDataCreatedAtDefault),
    })
    .optional()
    .describe('遊戲角色'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCharacterGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCharacterGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCharacterGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudCharacterGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudCharacterGetResponse = zod.array(
  ListResourcesV1AutocrudCharacterGetResponseItem,
);

/**
 * Create a new `character` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `character` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /character` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create character
 */
export const createResourceV1AutocrudCharacterPostBodyValueADXDefault = 12;
export const createResourceV1AutocrudCharacterPostBodyLevelDefault = 1;
export const createResourceV1AutocrudCharacterPostBodyHpDefault = 100;
export const createResourceV1AutocrudCharacterPostBodyMpDefault = 50;
export const createResourceV1AutocrudCharacterPostBodyAttackDefault = 10;
export const createResourceV1AutocrudCharacterPostBodyDefenseDefault = 5;
export const createResourceV1AutocrudCharacterPostBodyExperienceDefault = 0;
export const createResourceV1AutocrudCharacterPostBodyGoldDefault = 100;
export const createResourceV1AutocrudCharacterPostBodyGuildIdDefault = null;
export const createResourceV1AutocrudCharacterPostBodyGuildNameDefault = null;
export const createResourceV1AutocrudCharacterPostBodySpecialAbilityDefault = null;
export const createResourceV1AutocrudCharacterPostBodySkillIdsDefault = [];
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneOwnerIdDefault = null;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneCharacterClassReqDefault =
  null;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneAttackBonusDefault = 0;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneDefenseBonusDefault = 0;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneSpecialEffectsDefault = [];
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOnePriceDefault = 100;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneIconDefault = null;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemTwoDescriptionDefault = ``;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemTwoPriceDefault = 100;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsItemTwoIconDefault = null;
export const createResourceV1AutocrudCharacterPostBodyEquipmentsDefault = [];
export const createResourceV1AutocrudCharacterPostBodyCreatedAtDefault = `2026-03-28T17:34:51.079343`;

export const CreateResourceV1AutocrudCharacterPostBody = zod
  .object({
    name: zod.string(),
    character_class: zod
      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
      .describe('職業系統'),
    valueAD__x: zod
      .union([zod.number(), zod.string()])
      .default(createResourceV1AutocrudCharacterPostBodyValueADXDefault),
    level: zod.number().default(createResourceV1AutocrudCharacterPostBodyLevelDefault),
    hp: zod.number().default(createResourceV1AutocrudCharacterPostBodyHpDefault),
    mp: zod.number().default(createResourceV1AutocrudCharacterPostBodyMpDefault),
    attack: zod.number().default(createResourceV1AutocrudCharacterPostBodyAttackDefault),
    defense: zod.number().default(createResourceV1AutocrudCharacterPostBodyDefenseDefault),
    experience: zod.number().default(createResourceV1AutocrudCharacterPostBodyExperienceDefault),
    gold: zod.number().default(createResourceV1AutocrudCharacterPostBodyGoldDefault),
    guild_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCharacterPostBodyGuildIdDefault),
    guild_name: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCharacterPostBodyGuildNameDefault),
    special_ability: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCharacterPostBodySpecialAbilityDefault),
    skill_ids: zod
      .array(zod.string())
      .default(createResourceV1AutocrudCharacterPostBodySkillIdsDefault),
    equipments: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['Equipment']),
              name: zod.string(),
              rarity: zod
                .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                .describe('裝備稀有度'),
              owner_id: zod
                .union([zod.string(), zod.null()])
                .default(createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneOwnerIdDefault),
              character_class_req: zod
                .union([
                  zod
                    .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                    .describe('職業系統'),
                  zod.null(),
                ])
                .default(
                  createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneCharacterClassReqDefault,
                ),
              attack_bonus: zod
                .number()
                .default(
                  createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneAttackBonusDefault,
                ),
              defense_bonus: zod
                .number()
                .default(
                  createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneDefenseBonusDefault,
                ),
              special_effects: zod
                .array(zod.string())
                .default(
                  createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneSpecialEffectsDefault,
                ),
              price: zod
                .number()
                .default(createResourceV1AutocrudCharacterPostBodyEquipmentsItemOnePriceDefault),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(createResourceV1AutocrudCharacterPostBodyEquipmentsItemOneIconDefault),
            })
            .describe('遊戲裝備'),
          zod
            .object({
              type: zod.enum(['Item']),
              name: zod.string(),
              description: zod
                .string()
                .default(
                  createResourceV1AutocrudCharacterPostBodyEquipmentsItemTwoDescriptionDefault,
                ),
              price: zod
                .number()
                .default(createResourceV1AutocrudCharacterPostBodyEquipmentsItemTwoPriceDefault),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(createResourceV1AutocrudCharacterPostBodyEquipmentsItemTwoIconDefault),
            })
            .describe('遊戲物品（裝備和消耗品的基類）'),
        ]),
      )
      .default(createResourceV1AutocrudCharacterPostBodyEquipmentsDefault),
    created_at: zod.string().default(createResourceV1AutocrudCharacterPostBodyCreatedAtDefault),
  })
  .describe('遊戲角色');

export const createResourceV1AutocrudCharacterPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudCharacterPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudCharacterPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCharacterPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCharacterPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `character` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /character?limit=100` — Delete up to 100 resources
- `DELETE /character?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete character
 */
export const batchDeleteV1AutocrudCharacterDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudCharacterDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudCharacterDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudCharacterDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudCharacterDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudCharacterDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudCharacterDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudCharacterDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudCharacterDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudCharacterDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudCharacterDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudCharacterDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudCharacterDeleteResponse = zod.array(
  BatchDeleteV1AutocrudCharacterDeleteResponseItem,
);

/**
 * Export all (or filtered) **character** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export character data
 */
export const exportModelV1AutocrudCharacterExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudCharacterExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudCharacterExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudCharacterExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudCharacterExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudCharacterExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudCharacterExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudCharacterExportGetResponse = zod.unknown();

/**
 * Import **character** resources from a ``.acbak`` archive.

The archive must contain a **character** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import character data
 */
export const importModelV1AutocrudCharacterImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudCharacterImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudCharacterImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudCharacterImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudCharacterImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /character/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get character Meta by ID
 */
export const GetResourceMetaV1AutocrudCharacterResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudCharacterResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudCharacterResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudCharacterResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudCharacterResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudCharacterResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudCharacterResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudCharacterResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudCharacterResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `character` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /character/123/revision-info` - Get current revision info
- `GET /character/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get character Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const GetResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudCharacterResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /character/{resource_id}` instead.

Retrieve complete information for a `character` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete character Information
 */
export const GetResourceFullV1AutocrudCharacterResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudCharacterResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudCharacterResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudCharacterResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudCharacterResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataValueADXDefault = 12;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataLevelDefault = 1;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataHpDefault = 100;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataMpDefault = 50;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataAttackDefault = 10;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataDefenseDefault = 5;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataExperienceDefault = 0;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataGoldDefault = 100;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataGuildIdDefault = null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataGuildNameDefault = null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataSpecialAbilityDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataSkillIdsDefault = [];
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneOwnerIdDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneCharacterClassReqDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneAttackBonusDefault = 0;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneDefenseBonusDefault = 0;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneSpecialEffectsDefault =
  [];
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOnePriceDefault = 100;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneIconDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemTwoDescriptionDefault = ``;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemTwoPriceDefault = 100;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemTwoIconDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsDefault = [];
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataCreatedAtDefault = `2026-03-28T17:34:51.079343`;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudCharacterResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudCharacterResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      name: zod.string(),
      character_class: zod
        .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
        .describe('職業系統'),
      valueAD__x: zod
        .union([zod.number(), zod.string()])
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataValueADXDefault),
      level: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataLevelDefault),
      hp: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataHpDefault),
      mp: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataMpDefault),
      attack: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataAttackDefault),
      defense: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataDefenseDefault),
      experience: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataExperienceDefault),
      gold: zod
        .number()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataGoldDefault),
      guild_id: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataGuildIdDefault),
      guild_name: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataGuildNameDefault),
      special_ability: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataSpecialAbilityDefault,
        ),
      skill_ids: zod
        .array(zod.string())
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataSkillIdsDefault),
      equipments: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['Equipment']),
                name: zod.string(),
                rarity: zod
                  .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                  .describe('裝備稀有度'),
                owner_id: zod
                  .union([zod.string(), zod.null()])
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneOwnerIdDefault,
                  ),
                character_class_req: zod
                  .union([
                    zod
                      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                      .describe('職業系統'),
                    zod.null(),
                  ])
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneCharacterClassReqDefault,
                  ),
                attack_bonus: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneAttackBonusDefault,
                  ),
                defense_bonus: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneDefenseBonusDefault,
                  ),
                special_effects: zod
                  .array(zod.string())
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneSpecialEffectsDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOnePriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemOneIconDefault,
                  ),
              })
              .describe('遊戲裝備'),
            zod
              .object({
                type: zod.enum(['Item']),
                name: zod.string(),
                description: zod
                  .string()
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemTwoDescriptionDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemTwoPriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsItemTwoIconDefault,
                  ),
              })
              .describe('遊戲物品（裝備和消耗品的基類）'),
          ]),
        )
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataEquipmentsDefault),
      created_at: zod
        .string()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseDataCreatedAtDefault),
    })
    .optional()
    .describe('遊戲角色'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCharacterResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCharacterResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCharacterResourceIdFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudCharacterResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `character` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /character/123/revision-list` - Get all revisions for resource 123
- `GET /character/123/revision-list?limit=10&offset=20`
- `GET /character/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /character/123/revision-list?from_revision_id=rev123`
- `GET /character/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get character Revision History
 */
export const GetResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryLimitDefault,
      ),
    offset: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryOffsetDefault,
      ),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponse =
  zod.object({
    meta: zod
      .object({
        current_revision_id: zod.string(),
        resource_id: zod.string(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
          ),
        total_revision_count: zod.number(),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
        is_deleted: zod
          .boolean()
          .default(
            getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseMetaIsDeletedDefault,
          ),
        indexed_data: zod.looseObject({}).optional(),
      })
      .describe(
        'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
      ),
    revisions: zod.array(
      zod
        .object({
          uid: zod.uuid(),
          resource_id: zod.string(),
          revision_id: zod.string(),
          parent_revision_id: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
            ),
          parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
          schema_version: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
            ),
          data_hash: zod.string().optional(),
          status: zod.enum(['draft', 'stable']),
          created_time: zod.string(),
          updated_time: zod.string(),
          created_by: zod.string(),
          updated_by: zod.string(),
        })
        .describe(
          'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
        ),
    ),
    total: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseTotalDefault,
      ),
    has_more: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCharacterResourceIdRevisionListGetResponseHasMoreDefault,
      ),
  });

/**
 * Retrieve only the data content of a `character` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /character/123/data` - Get current resource data only
- `GET /character/123/data?revision_id=rev456` - Get specific revision data only
- `GET /character/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get character Data
 */
export const GetResourceDataV1AutocrudCharacterResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudCharacterResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudCharacterResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudCharacterResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseValueADXDefault = 12;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseLevelDefault = 1;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseHpDefault = 100;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseMpDefault = 50;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseAttackDefault = 10;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseDefenseDefault = 5;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseExperienceDefault = 0;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseGoldDefault = 100;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseGuildIdDefault = null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseGuildNameDefault = null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseSpecialAbilityDefault =
  null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseSkillIdsDefault = [];
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneOwnerIdDefault =
  null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneCharacterClassReqDefault =
  null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneAttackBonusDefault = 0;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneDefenseBonusDefault = 0;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneSpecialEffectsDefault =
  [];
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOnePriceDefault = 100;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneIconDefault =
  null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemTwoDescriptionDefault = ``;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemTwoPriceDefault = 100;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemTwoIconDefault =
  null;
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsDefault = [];
export const getResourceDataV1AutocrudCharacterResourceIdDataGetResponseCreatedAtDefault = `2026-03-28T17:34:51.079343`;

export const GetResourceDataV1AutocrudCharacterResourceIdDataGetResponse = zod
  .object({
    name: zod.string(),
    character_class: zod
      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
      .describe('職業系統'),
    valueAD__x: zod
      .union([zod.number(), zod.string()])
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseValueADXDefault),
    level: zod
      .number()
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseLevelDefault),
    hp: zod.number().default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseHpDefault),
    mp: zod.number().default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseMpDefault),
    attack: zod
      .number()
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseAttackDefault),
    defense: zod
      .number()
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseDefenseDefault),
    experience: zod
      .number()
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseExperienceDefault),
    gold: zod
      .number()
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseGoldDefault),
    guild_id: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseGuildIdDefault),
    guild_name: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseGuildNameDefault),
    special_ability: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseSpecialAbilityDefault),
    skill_ids: zod
      .array(zod.string())
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseSkillIdsDefault),
    equipments: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['Equipment']),
              name: zod.string(),
              rarity: zod
                .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                .describe('裝備稀有度'),
              owner_id: zod
                .union([zod.string(), zod.null()])
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneOwnerIdDefault,
                ),
              character_class_req: zod
                .union([
                  zod
                    .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                    .describe('職業系統'),
                  zod.null(),
                ])
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneCharacterClassReqDefault,
                ),
              attack_bonus: zod
                .number()
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneAttackBonusDefault,
                ),
              defense_bonus: zod
                .number()
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneDefenseBonusDefault,
                ),
              special_effects: zod
                .array(zod.string())
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneSpecialEffectsDefault,
                ),
              price: zod
                .number()
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOnePriceDefault,
                ),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemOneIconDefault,
                ),
            })
            .describe('遊戲裝備'),
          zod
            .object({
              type: zod.enum(['Item']),
              name: zod.string(),
              description: zod
                .string()
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemTwoDescriptionDefault,
                ),
              price: zod
                .number()
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemTwoPriceDefault,
                ),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(
                  getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsItemTwoIconDefault,
                ),
            })
            .describe('遊戲物品（裝備和消耗品的基類）'),
        ]),
      )
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseEquipmentsDefault),
    created_at: zod
      .string()
      .default(getResourceDataV1AutocrudCharacterResourceIdDataGetResponseCreatedAtDefault),
  })
  .describe('遊戲角色');

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudCharacterResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `character` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /character/123` — full response (data + meta + revision_info)
- `GET /character/123?returns=data` — data only
- `GET /character/123?returns=data,meta` — data + meta, no revision_info
- `GET /character/123?returns=meta` — metadata only
- `GET /character/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get character resource
 */
export const GetResourceV1AutocrudCharacterResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudCharacterResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudCharacterResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudCharacterResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudCharacterResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudCharacterResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudCharacterResourceIdGetResponseDataValueADXDefault = 12;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataLevelDefault = 1;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataHpDefault = 100;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataMpDefault = 50;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataAttackDefault = 10;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataDefenseDefault = 5;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataExperienceDefault = 0;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataGoldDefault = 100;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataGuildIdDefault = null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataGuildNameDefault = null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataSpecialAbilityDefault = null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataSkillIdsDefault = [];
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneOwnerIdDefault =
  null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneCharacterClassReqDefault =
  null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneAttackBonusDefault = 0;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneDefenseBonusDefault = 0;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneSpecialEffectsDefault =
  [];
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOnePriceDefault = 100;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneIconDefault =
  null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemTwoDescriptionDefault = ``;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemTwoPriceDefault = 100;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemTwoIconDefault =
  null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsDefault = [];
export const getResourceV1AutocrudCharacterResourceIdGetResponseDataCreatedAtDefault = `2026-03-28T17:34:51.079343`;
export const getResourceV1AutocrudCharacterResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudCharacterResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudCharacterResourceIdGetResponse = zod.object({
  data: zod
    .object({
      name: zod.string(),
      character_class: zod
        .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
        .describe('職業系統'),
      valueAD__x: zod
        .union([zod.number(), zod.string()])
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataValueADXDefault),
      level: zod
        .number()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataLevelDefault),
      hp: zod.number().default(getResourceV1AutocrudCharacterResourceIdGetResponseDataHpDefault),
      mp: zod.number().default(getResourceV1AutocrudCharacterResourceIdGetResponseDataMpDefault),
      attack: zod
        .number()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataAttackDefault),
      defense: zod
        .number()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataDefenseDefault),
      experience: zod
        .number()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataExperienceDefault),
      gold: zod
        .number()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataGoldDefault),
      guild_id: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataGuildIdDefault),
      guild_name: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataGuildNameDefault),
      special_ability: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataSpecialAbilityDefault),
      skill_ids: zod
        .array(zod.string())
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataSkillIdsDefault),
      equipments: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['Equipment']),
                name: zod.string(),
                rarity: zod
                  .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                  .describe('裝備稀有度'),
                owner_id: zod
                  .union([zod.string(), zod.null()])
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneOwnerIdDefault,
                  ),
                character_class_req: zod
                  .union([
                    zod
                      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                      .describe('職業系統'),
                    zod.null(),
                  ])
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneCharacterClassReqDefault,
                  ),
                attack_bonus: zod
                  .number()
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneAttackBonusDefault,
                  ),
                defense_bonus: zod
                  .number()
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneDefenseBonusDefault,
                  ),
                special_effects: zod
                  .array(zod.string())
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneSpecialEffectsDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOnePriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemOneIconDefault,
                  ),
              })
              .describe('遊戲裝備'),
            zod
              .object({
                type: zod.enum(['Item']),
                name: zod.string(),
                description: zod
                  .string()
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemTwoDescriptionDefault,
                  ),
                price: zod
                  .number()
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemTwoPriceDefault,
                  ),
                icon: zod
                  .union([
                    zod.null(),
                    zod
                      .object({
                        file_id: zod.string().optional(),
                        size: zod.number().optional(),
                        content_type: zod.string().optional(),
                        data: zod.string().optional(),
                      })
                      .describe(
                        'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                      ),
                  ])
                  .default(
                    getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsItemTwoIconDefault,
                  ),
              })
              .describe('遊戲物品（裝備和消耗品的基類）'),
          ]),
        )
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataEquipmentsDefault),
      created_at: zod
        .string()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseDataCreatedAtDefault),
    })
    .optional()
    .describe('遊戲角色'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCharacterResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCharacterResourceIdGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudCharacterResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `character` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `character` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /character/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update character
 */
export const UpdateResourceV1AutocrudCharacterResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudCharacterResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudCharacterResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudCharacterResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudCharacterResourceIdPutBodyValueADXDefault = 12;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyLevelDefault = 1;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyHpDefault = 100;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyMpDefault = 50;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyAttackDefault = 10;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyDefenseDefault = 5;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyExperienceDefault = 0;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyGoldDefault = 100;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyGuildIdDefault = null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyGuildNameDefault = null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodySpecialAbilityDefault = null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodySkillIdsDefault = [];
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneOwnerIdDefault =
  null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneCharacterClassReqDefault =
  null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneAttackBonusDefault = 0;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneDefenseBonusDefault = 0;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneSpecialEffectsDefault =
  [];
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOnePriceDefault = 100;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneIconDefault = null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemTwoDescriptionDefault = ``;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemTwoPriceDefault = 100;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemTwoIconDefault = null;
export const updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsDefault = [];
export const updateResourceV1AutocrudCharacterResourceIdPutBodyCreatedAtDefault = `2026-03-28T17:34:51.079343`;

export const UpdateResourceV1AutocrudCharacterResourceIdPutBody = zod
  .object({
    name: zod.string(),
    character_class: zod
      .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
      .describe('職業系統'),
    valueAD__x: zod
      .union([zod.number(), zod.string()])
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodyValueADXDefault),
    level: zod.number().default(updateResourceV1AutocrudCharacterResourceIdPutBodyLevelDefault),
    hp: zod.number().default(updateResourceV1AutocrudCharacterResourceIdPutBodyHpDefault),
    mp: zod.number().default(updateResourceV1AutocrudCharacterResourceIdPutBodyMpDefault),
    attack: zod.number().default(updateResourceV1AutocrudCharacterResourceIdPutBodyAttackDefault),
    defense: zod.number().default(updateResourceV1AutocrudCharacterResourceIdPutBodyDefenseDefault),
    experience: zod
      .number()
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodyExperienceDefault),
    gold: zod.number().default(updateResourceV1AutocrudCharacterResourceIdPutBodyGoldDefault),
    guild_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodyGuildIdDefault),
    guild_name: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodyGuildNameDefault),
    special_ability: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodySpecialAbilityDefault),
    skill_ids: zod
      .array(zod.string())
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodySkillIdsDefault),
    equipments: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['Equipment']),
              name: zod.string(),
              rarity: zod
                .enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器'])
                .describe('裝備稀有度'),
              owner_id: zod
                .union([zod.string(), zod.null()])
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneOwnerIdDefault,
                ),
              character_class_req: zod
                .union([
                  zod
                    .enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師'])
                    .describe('職業系統'),
                  zod.null(),
                ])
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneCharacterClassReqDefault,
                ),
              attack_bonus: zod
                .number()
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneAttackBonusDefault,
                ),
              defense_bonus: zod
                .number()
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneDefenseBonusDefault,
                ),
              special_effects: zod
                .array(zod.string())
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneSpecialEffectsDefault,
                ),
              price: zod
                .number()
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOnePriceDefault,
                ),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemOneIconDefault,
                ),
            })
            .describe('遊戲裝備'),
          zod
            .object({
              type: zod.enum(['Item']),
              name: zod.string(),
              description: zod
                .string()
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemTwoDescriptionDefault,
                ),
              price: zod
                .number()
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemTwoPriceDefault,
                ),
              icon: zod
                .union([
                  zod.null(),
                  zod
                    .object({
                      file_id: zod.string().optional(),
                      size: zod.number().optional(),
                      content_type: zod.string().optional(),
                      data: zod.string().optional(),
                    })
                    .describe(
                      'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
                    ),
                ])
                .default(
                  updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsItemTwoIconDefault,
                ),
            })
            .describe('遊戲物品（裝備和消耗品的基類）'),
        ]),
      )
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodyEquipmentsDefault),
    created_at: zod
      .string()
      .default(updateResourceV1AutocrudCharacterResourceIdPutBodyCreatedAtDefault),
  })
  .describe('遊戲角色');

export const updateResourceV1AutocrudCharacterResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudCharacterResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudCharacterResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudCharacterResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudCharacterResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `character` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /character/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update character
 */
export const PatchResourceV1AutocrudCharacterResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudCharacterResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudCharacterResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudCharacterResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudCharacterResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudCharacterResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudCharacterResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudCharacterResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudCharacterResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudCharacterResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudCharacterResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudCharacterResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `character` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /character/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete character
 */
export const DeleteResourceV1AutocrudCharacterResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudCharacterResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudCharacterResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudCharacterResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudCharacterResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudCharacterResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `character` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /character/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch character to specific revision
 */
export const SwitchRevisionV1AutocrudCharacterResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudCharacterResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudCharacterResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudCharacterResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudCharacterResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        switchRevisionV1AutocrudCharacterResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `character` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete character
 */
export const PermanentlyDeleteResourceV1AutocrudCharacterResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudCharacterResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudCharacterResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudCharacterResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudCharacterResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudCharacterResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `character` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /character/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted character
 */
export const RestoreResourceV1AutocrudCharacterResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudCharacterResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudCharacterResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudCharacterResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudCharacterResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudCharacterResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `character` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /character/restore?limit=100` — Restore up to 100 deleted resources
- `POST /character/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted character
 */
export const batchRestoreV1AutocrudCharacterRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudCharacterRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudCharacterRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudCharacterRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudCharacterRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudCharacterRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudCharacterRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudCharacterRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudCharacterRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudCharacterRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudCharacterRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudCharacterRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudCharacterRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudCharacterRestorePostResponseItem,
);

/**
 * @summary Handle Http Get
 */
export const HandleHttpGetV1AutocrudGraphqlGetResponse = zod.unknown();

/**
 * @summary Handle Http Post
 */
export const HandleHttpPostV1AutocrudGraphqlPostResponse = zod.unknown();

/**
 * @summary Get blob content directly
 */
export const GetBlobDirectV1AutocrudBlobsFileIdGetParams = zod.object({
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Upload a file via multipart/form-data. Returns the blob metadata (`file_id`, `size`, `content_type`). Use the returned `file_id` in subsequent create/update requests to reference the uploaded binary without base64 encoding.
 * @summary Upload a file to the blob store
 */
export const UploadBlobV1AutocrudBlobsUploadPostBody = zod.object({
  file: zod.instanceof(File),
});

export const UploadBlobV1AutocrudBlobsUploadPostResponse = zod.unknown();

/**
 * Create a new upload session. Returns session metadata including `upload_id` and `upload_method`. For proxy uploads, PUT the file bytes to the `upload_url`.
 * @summary Create an upload session
 */
export const CreateUploadSessionV1AutocrudBlobsUploadSessionsPostBody = zod.object({
  content_type: zod.union([zod.string(), zod.null()]).optional(),
  size: zod.union([zod.number(), zod.null()]).optional(),
  total_parts: zod.union([zod.number(), zod.null()]).optional(),
});

export const CreateUploadSessionV1AutocrudBlobsUploadSessionsPostResponse = zod.unknown();

/**
 * @summary Get upload session status
 */
export const GetUploadSessionV1AutocrudBlobsUploadSessionsUploadIdGetParams = zod.object({
  upload_id: zod.string().describe('Upload session ID'),
});

export const GetUploadSessionV1AutocrudBlobsUploadSessionsUploadIdGetResponse = zod.unknown();

/**
 * Upload a numbered part for a proxy-mode upload session. May be called multiple times with different part numbers, potentially in parallel. Returns the current session state including `uploaded_size` and `parts_received`.
 * @summary Upload bytes for an upload session (proxy mode)
 */
export const UploadSessionContentV1AutocrudBlobsUploadSessionsUploadIdContentPutParams = zod.object(
  {
    upload_id: zod.string().describe('Upload session ID'),
  },
);

export const UploadSessionContentV1AutocrudBlobsUploadSessionsUploadIdContentPutQueryParams =
  zod.object({
    part_number: zod.number().min(1).describe('1-based part number for this chunk'),
  });

export const UploadSessionContentV1AutocrudBlobsUploadSessionsUploadIdContentPutBody = zod.object({
  file: zod.instanceof(File),
});

export const UploadSessionContentV1AutocrudBlobsUploadSessionsUploadIdContentPutResponse =
  zod.unknown();

/**
 * Commits buffered bytes to the blob store and returns the final `Binary` metadata (without raw data).
 * @summary Finalize an upload session
 */
export const FinalizeUploadSessionV1AutocrudBlobsUploadSessionsUploadIdFinalizePostParams =
  zod.object({
    upload_id: zod.string().describe('Upload session ID'),
  });

export const FinalizeUploadSessionV1AutocrudBlobsUploadSessionsUploadIdFinalizePostResponse =
  zod.unknown();

/**
 * @summary Abort an upload session
 */
export const AbortUploadSessionV1AutocrudBlobsUploadSessionsUploadIdAbortPostParams = zod.object({
  upload_id: zod.string().describe('Upload session ID'),
});

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudCharacterMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudCharacterMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudCharacterMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudCharacterMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `character` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /character/migrate/single/123` - Migrate resource 123
- `POST /character/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /character/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single character Resource
 */
export const MigrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const migrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudCharacterMigrateSingleResourceIdPostResponseErrorDefault,
      ),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `guild` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /guild/data` - Get first 10 resources (data only)
- `GET /guild/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /guild/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /guild/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List guild Data Only
 */
export const listResourcesDataV1AutocrudGuildDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudGuildDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudGuildDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudGuildDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudGuildDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudGuildDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudGuildDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudGuildDataGetResponseMemberCountDefault = 1;
export const listResourcesDataV1AutocrudGuildDataGetResponseLevelDefault = 1;
export const listResourcesDataV1AutocrudGuildDataGetResponseTreasuryDefault = 1000;
export const listResourcesDataV1AutocrudGuildDataGetResponseFoundedAtDefault = `2026-03-28T17:34:51.079514`;

export const ListResourcesDataV1AutocrudGuildDataGetResponseItem = zod
  .object({
    name: zod.string(),
    description: zod.string(),
    leader: zod.string(),
    member_count: zod
      .number()
      .default(listResourcesDataV1AutocrudGuildDataGetResponseMemberCountDefault),
    level: zod.number().default(listResourcesDataV1AutocrudGuildDataGetResponseLevelDefault),
    treasury: zod.number().default(listResourcesDataV1AutocrudGuildDataGetResponseTreasuryDefault),
    founded_at: zod
      .string()
      .default(listResourcesDataV1AutocrudGuildDataGetResponseFoundedAtDefault),
  })
  .describe('遊戲公會');
export const ListResourcesDataV1AutocrudGuildDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudGuildDataGetResponseItem,
);

/**
 * Retrieve a list of `guild` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /guild/meta` - Get metadata for first 10 resources
- `GET /guild/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /guild/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List guild Metadata Only
 */
export const listResourcesMetaV1AutocrudGuildMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudGuildMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudGuildMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudGuildMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudGuildMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudGuildMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudGuildMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudGuildMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudGuildMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudGuildMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudGuildMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudGuildMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudGuildMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudGuildMetaGetResponseItem,
);

/**
 * Retrieve a list of `guild` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /guild/revision-info` - Get current revision info for first 10 resources
- `GET /guild/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /guild/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List guild Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudGuildRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /guild` instead. Retrieve a list of `guild` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List guild Complete Information
 */
export const listResourcesFullV1AutocrudGuildFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudGuildFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudGuildFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudGuildFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudGuildFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudGuildFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudGuildFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudGuildFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudGuildFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudGuildFullGetResponseDataMemberCountDefault = 1;
export const listResourcesFullV1AutocrudGuildFullGetResponseDataLevelDefault = 1;
export const listResourcesFullV1AutocrudGuildFullGetResponseDataTreasuryDefault = 1000;
export const listResourcesFullV1AutocrudGuildFullGetResponseDataFoundedAtDefault = `2026-03-28T17:34:51.079514`;
export const listResourcesFullV1AutocrudGuildFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudGuildFullGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudGuildFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudGuildFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudGuildFullGetResponseItem = zod.object({
  data: zod
    .object({
      name: zod.string(),
      description: zod.string(),
      leader: zod.string(),
      member_count: zod
        .number()
        .default(listResourcesFullV1AutocrudGuildFullGetResponseDataMemberCountDefault),
      level: zod.number().default(listResourcesFullV1AutocrudGuildFullGetResponseDataLevelDefault),
      treasury: zod
        .number()
        .default(listResourcesFullV1AutocrudGuildFullGetResponseDataTreasuryDefault),
      founded_at: zod
        .string()
        .default(listResourcesFullV1AutocrudGuildFullGetResponseDataFoundedAtDefault),
    })
    .optional()
    .describe('遊戲公會'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudGuildFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudGuildFullGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudGuildFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudGuildFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudGuildFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudGuildFullGetResponseItem,
);

/**
 * Retrieve the count of `guild` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /guild/count` - Get total count of all resources
- `GET /guild/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count guild Resources
 */
export const getResourcesCountV1AutocrudGuildCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudGuildCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudGuildCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudGuildCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudGuildCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudGuildCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudGuildCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudGuildCountGetResponse = zod.number();

/**
 * Retrieve a list of `guild` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /guild` — full list (data + meta + revision_info)
- `GET /guild?returns=data` — data only
- `GET /guild?returns=data,meta` — data + meta, no revision_info
- `GET /guild?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List guild resources
 */
export const listResourcesV1AutocrudGuildGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudGuildGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudGuildGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudGuildGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudGuildGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudGuildGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudGuildGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudGuildGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudGuildGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudGuildGetResponseDataMemberCountDefault = 1;
export const listResourcesV1AutocrudGuildGetResponseDataLevelDefault = 1;
export const listResourcesV1AutocrudGuildGetResponseDataTreasuryDefault = 1000;
export const listResourcesV1AutocrudGuildGetResponseDataFoundedAtDefault = `2026-03-28T17:34:51.079514`;
export const listResourcesV1AutocrudGuildGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudGuildGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudGuildGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudGuildGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudGuildGetResponseItem = zod.object({
  data: zod
    .object({
      name: zod.string(),
      description: zod.string(),
      leader: zod.string(),
      member_count: zod
        .number()
        .default(listResourcesV1AutocrudGuildGetResponseDataMemberCountDefault),
      level: zod.number().default(listResourcesV1AutocrudGuildGetResponseDataLevelDefault),
      treasury: zod.number().default(listResourcesV1AutocrudGuildGetResponseDataTreasuryDefault),
      founded_at: zod.string().default(listResourcesV1AutocrudGuildGetResponseDataFoundedAtDefault),
    })
    .optional()
    .describe('遊戲公會'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGuildGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGuildGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGuildGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudGuildGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudGuildGetResponse = zod.array(
  ListResourcesV1AutocrudGuildGetResponseItem,
);

/**
 * Create a new `guild` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `guild` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /guild` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create guild
 */
export const createResourceV1AutocrudGuildPostBodyMemberCountDefault = 1;
export const createResourceV1AutocrudGuildPostBodyLevelDefault = 1;
export const createResourceV1AutocrudGuildPostBodyTreasuryDefault = 1000;
export const createResourceV1AutocrudGuildPostBodyFoundedAtDefault = `2026-03-28T17:34:51.079514`;

export const CreateResourceV1AutocrudGuildPostBody = zod
  .object({
    name: zod.string(),
    description: zod.string(),
    leader: zod.string(),
    member_count: zod.number().default(createResourceV1AutocrudGuildPostBodyMemberCountDefault),
    level: zod.number().default(createResourceV1AutocrudGuildPostBodyLevelDefault),
    treasury: zod.number().default(createResourceV1AutocrudGuildPostBodyTreasuryDefault),
    founded_at: zod.string().default(createResourceV1AutocrudGuildPostBodyFoundedAtDefault),
  })
  .describe('遊戲公會');

export const createResourceV1AutocrudGuildPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudGuildPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudGuildPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudGuildPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudGuildPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `guild` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /guild?limit=100` — Delete up to 100 resources
- `DELETE /guild?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete guild
 */
export const batchDeleteV1AutocrudGuildDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudGuildDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudGuildDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudGuildDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudGuildDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudGuildDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudGuildDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudGuildDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudGuildDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudGuildDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudGuildDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudGuildDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudGuildDeleteResponse = zod.array(
  BatchDeleteV1AutocrudGuildDeleteResponseItem,
);

/**
 * Export all (or filtered) **guild** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export guild data
 */
export const exportModelV1AutocrudGuildExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudGuildExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudGuildExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudGuildExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudGuildExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudGuildExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudGuildExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudGuildExportGetResponse = zod.unknown();

/**
 * Import **guild** resources from a ``.acbak`` archive.

The archive must contain a **guild** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import guild data
 */
export const importModelV1AutocrudGuildImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudGuildImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudGuildImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudGuildImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudGuildImportPostResponse = zod.record(zod.string(), zod.unknown());

/**
 * Deprecated: use `GET /guild/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get guild Meta by ID
 */
export const GetResourceMetaV1AutocrudGuildResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudGuildResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudGuildResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudGuildResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudGuildResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudGuildResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudGuildResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudGuildResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudGuildResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `guild` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /guild/123/revision-info` - Get current revision info
- `GET /guild/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get guild Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetParams = zod.object({
  resource_id: zod.string(),
});

export const GetResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudGuildResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /guild/{resource_id}` instead.

Retrieve complete information for a `guild` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete guild Information
 */
export const GetResourceFullV1AutocrudGuildResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudGuildResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudGuildResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudGuildResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudGuildResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudGuildResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataMemberCountDefault = 1;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataLevelDefault = 1;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataTreasuryDefault = 1000;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataFoundedAtDefault = `2026-03-28T17:34:51.079514`;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseMetaSchemaVersionDefault = null;
export const getResourceFullV1AutocrudGuildResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudGuildResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      name: zod.string(),
      description: zod.string(),
      leader: zod.string(),
      member_count: zod
        .number()
        .default(getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataMemberCountDefault),
      level: zod
        .number()
        .default(getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataLevelDefault),
      treasury: zod
        .number()
        .default(getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataTreasuryDefault),
      founded_at: zod
        .string()
        .default(getResourceFullV1AutocrudGuildResourceIdFullGetResponseDataFoundedAtDefault),
    })
    .optional()
    .describe('遊戲公會'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudGuildResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudGuildResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudGuildResourceIdFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudGuildResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `guild` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /guild/123/revision-list` - Get all revisions for resource 123
- `GET /guild/123/revision-list?limit=10&offset=20`
- `GET /guild/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /guild/123/revision-list?from_revision_id=rev123`
- `GET /guild/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get guild Revision History
 */
export const GetResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryLimitDefault),
    offset: zod
      .number()
      .default(getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryOffsetDefault),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponse = zod.object({
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
  revisions: zod.array(
    zod
      .object({
        uid: zod.uuid(),
        resource_id: zod.string(),
        revision_id: zod.string(),
        parent_revision_id: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
          ),
        parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
          ),
        data_hash: zod.string().optional(),
        status: zod.enum(['draft', 'stable']),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
      })
      .describe(
        'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
      ),
  ),
  total: zod
    .number()
    .default(getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseTotalDefault),
  has_more: zod
    .boolean()
    .default(getResourceRevisionListV1AutocrudGuildResourceIdRevisionListGetResponseHasMoreDefault),
});

/**
 * Retrieve only the data content of a `guild` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /guild/123/data` - Get current resource data only
- `GET /guild/123/data?revision_id=rev456` - Get specific revision data only
- `GET /guild/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get guild Data
 */
export const GetResourceDataV1AutocrudGuildResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudGuildResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudGuildResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudGuildResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudGuildResourceIdDataGetResponseMemberCountDefault = 1;
export const getResourceDataV1AutocrudGuildResourceIdDataGetResponseLevelDefault = 1;
export const getResourceDataV1AutocrudGuildResourceIdDataGetResponseTreasuryDefault = 1000;
export const getResourceDataV1AutocrudGuildResourceIdDataGetResponseFoundedAtDefault = `2026-03-28T17:34:51.079514`;

export const GetResourceDataV1AutocrudGuildResourceIdDataGetResponse = zod
  .object({
    name: zod.string(),
    description: zod.string(),
    leader: zod.string(),
    member_count: zod
      .number()
      .default(getResourceDataV1AutocrudGuildResourceIdDataGetResponseMemberCountDefault),
    level: zod
      .number()
      .default(getResourceDataV1AutocrudGuildResourceIdDataGetResponseLevelDefault),
    treasury: zod
      .number()
      .default(getResourceDataV1AutocrudGuildResourceIdDataGetResponseTreasuryDefault),
    founded_at: zod
      .string()
      .default(getResourceDataV1AutocrudGuildResourceIdDataGetResponseFoundedAtDefault),
  })
  .describe('遊戲公會');

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudGuildResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `guild` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /guild/123` — full response (data + meta + revision_info)
- `GET /guild/123?returns=data` — data only
- `GET /guild/123?returns=data,meta` — data + meta, no revision_info
- `GET /guild/123?returns=meta` — metadata only
- `GET /guild/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get guild resource
 */
export const GetResourceV1AutocrudGuildResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudGuildResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudGuildResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudGuildResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudGuildResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudGuildResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudGuildResourceIdGetResponseDataMemberCountDefault = 1;
export const getResourceV1AutocrudGuildResourceIdGetResponseDataLevelDefault = 1;
export const getResourceV1AutocrudGuildResourceIdGetResponseDataTreasuryDefault = 1000;
export const getResourceV1AutocrudGuildResourceIdGetResponseDataFoundedAtDefault = `2026-03-28T17:34:51.079514`;
export const getResourceV1AutocrudGuildResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudGuildResourceIdGetResponseRevisionInfoSchemaVersionDefault = null;
export const getResourceV1AutocrudGuildResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudGuildResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudGuildResourceIdGetResponse = zod.object({
  data: zod
    .object({
      name: zod.string(),
      description: zod.string(),
      leader: zod.string(),
      member_count: zod
        .number()
        .default(getResourceV1AutocrudGuildResourceIdGetResponseDataMemberCountDefault),
      level: zod.number().default(getResourceV1AutocrudGuildResourceIdGetResponseDataLevelDefault),
      treasury: zod
        .number()
        .default(getResourceV1AutocrudGuildResourceIdGetResponseDataTreasuryDefault),
      founded_at: zod
        .string()
        .default(getResourceV1AutocrudGuildResourceIdGetResponseDataFoundedAtDefault),
    })
    .optional()
    .describe('遊戲公會'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudGuildResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudGuildResourceIdGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudGuildResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudGuildResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `guild` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `guild` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /guild/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update guild
 */
export const UpdateResourceV1AutocrudGuildResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudGuildResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudGuildResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudGuildResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudGuildResourceIdPutBodyMemberCountDefault = 1;
export const updateResourceV1AutocrudGuildResourceIdPutBodyLevelDefault = 1;
export const updateResourceV1AutocrudGuildResourceIdPutBodyTreasuryDefault = 1000;
export const updateResourceV1AutocrudGuildResourceIdPutBodyFoundedAtDefault = `2026-03-28T17:34:51.079514`;

export const UpdateResourceV1AutocrudGuildResourceIdPutBody = zod
  .object({
    name: zod.string(),
    description: zod.string(),
    leader: zod.string(),
    member_count: zod
      .number()
      .default(updateResourceV1AutocrudGuildResourceIdPutBodyMemberCountDefault),
    level: zod.number().default(updateResourceV1AutocrudGuildResourceIdPutBodyLevelDefault),
    treasury: zod.number().default(updateResourceV1AutocrudGuildResourceIdPutBodyTreasuryDefault),
    founded_at: zod
      .string()
      .default(updateResourceV1AutocrudGuildResourceIdPutBodyFoundedAtDefault),
  })
  .describe('遊戲公會');

export const updateResourceV1AutocrudGuildResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudGuildResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudGuildResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudGuildResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudGuildResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `guild` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /guild/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update guild
 */
export const PatchResourceV1AutocrudGuildResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudGuildResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudGuildResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudGuildResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudGuildResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudGuildResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudGuildResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudGuildResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudGuildResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudGuildResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudGuildResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudGuildResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `guild` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /guild/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete guild
 */
export const DeleteResourceV1AutocrudGuildResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudGuildResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudGuildResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudGuildResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudGuildResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudGuildResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `guild` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /guild/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch guild to specific revision
 */
export const SwitchRevisionV1AutocrudGuildResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudGuildResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudGuildResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudGuildResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudGuildResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(switchRevisionV1AutocrudGuildResourceIdSwitchRevisionIdPostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `guild` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete guild
 */
export const PermanentlyDeleteResourceV1AutocrudGuildResourceIdPermanentlyDeleteParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const permanentlyDeleteResourceV1AutocrudGuildResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudGuildResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudGuildResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudGuildResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudGuildResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `guild` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /guild/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted guild
 */
export const RestoreResourceV1AutocrudGuildResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudGuildResourceIdRestorePostResponseSchemaVersionDefault = null;
export const restoreResourceV1AutocrudGuildResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudGuildResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudGuildResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudGuildResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `guild` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /guild/restore?limit=100` — Restore up to 100 deleted resources
- `POST /guild/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted guild
 */
export const batchRestoreV1AutocrudGuildRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudGuildRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudGuildRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudGuildRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudGuildRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudGuildRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudGuildRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudGuildRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudGuildRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudGuildRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudGuildRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudGuildRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudGuildRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudGuildRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudGuildMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudGuildMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudGuildMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudGuildMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudGuildMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudGuildMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudGuildMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudGuildMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudGuildMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudGuildMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `guild` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /guild/migrate/single/123` - Migrate resource 123
- `POST /guild/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /guild/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single guild Resource
 */
export const MigrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostParams = zod.object({
  resource_id: zod.string(),
});

export const migrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(migrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostQueryWriteBackDefault)
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(migrateSingleResourceV1AutocrudGuildMigrateSingleResourceIdPostResponseErrorDefault),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `skill` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /skill/data` - Get first 10 resources (data only)
- `GET /skill/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /skill/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /skill/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List skill Data Only
 */
export const listResourcesDataV1AutocrudSkillDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudSkillDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudSkillDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudSkillDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudSkillDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudSkillDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudSkillDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudSkillDataGetResponseDetailOneMpCostDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailOneCooldownSecondsDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailOneDamageDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailTwoBuffPercentageDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeMpCostDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeCooldownSecondsDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeDamageDefault = 0;
export const listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeAreaOfEffectDefault = false;
export const listResourcesDataV1AutocrudSkillDataGetResponseDescriptionDefault = ``;
export const listResourcesDataV1AutocrudSkillDataGetResponseRequiredLevelDefault = 1;
export const listResourcesDataV1AutocrudSkillDataGetResponseRequiredClassDefault = null;

export const ListResourcesDataV1AutocrudSkillDataGetResponseItem = zod
  .object({
    skname: zod.string(),
    detail: zod.union([
      zod
        .object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(listResourcesDataV1AutocrudSkillDataGetResponseDetailOneMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(
              listResourcesDataV1AutocrudSkillDataGetResponseDetailOneCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(listResourcesDataV1AutocrudSkillDataGetResponseDetailOneDamageDefault),
        })
        .describe('主動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(listResourcesDataV1AutocrudSkillDataGetResponseDetailTwoBuffPercentageDefault),
        })
        .describe('被動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(
              listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeDamageDefault),
          area_of_effect: zod
            .boolean()
            .default(listResourcesDataV1AutocrudSkillDataGetResponseDetailThreeAreaOfEffectDefault),
        })
        .describe('終極技能數據'),
    ]),
    description: zod
      .string()
      .default(listResourcesDataV1AutocrudSkillDataGetResponseDescriptionDefault),
    required_level: zod
      .number()
      .default(listResourcesDataV1AutocrudSkillDataGetResponseRequiredLevelDefault),
    required_class: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(listResourcesDataV1AutocrudSkillDataGetResponseRequiredClassDefault),
  })
  .describe('遊戲技能（使用 Union 區分技能類型）');
export const ListResourcesDataV1AutocrudSkillDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudSkillDataGetResponseItem,
);

/**
 * Retrieve a list of `skill` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /skill/meta` - Get metadata for first 10 resources
- `GET /skill/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /skill/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List skill Metadata Only
 */
export const listResourcesMetaV1AutocrudSkillMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudSkillMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudSkillMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudSkillMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudSkillMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudSkillMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudSkillMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudSkillMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudSkillMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudSkillMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudSkillMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudSkillMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudSkillMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudSkillMetaGetResponseItem,
);

/**
 * Retrieve a list of `skill` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /skill/revision-info` - Get current revision info for first 10 resources
- `GET /skill/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /skill/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List skill Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudSkillRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /skill` instead. Retrieve a list of `skill` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List skill Complete Information
 */
export const listResourcesFullV1AutocrudSkillFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudSkillFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudSkillFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudSkillFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudSkillFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudSkillFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudSkillFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudSkillFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailOneMpCostDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailOneCooldownSecondsDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailOneDamageDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailTwoBuffPercentageDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeMpCostDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeCooldownSecondsDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeDamageDefault = 0;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeAreaOfEffectDefault = false;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataDescriptionDefault = ``;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataRequiredLevelDefault = 1;
export const listResourcesFullV1AutocrudSkillFullGetResponseDataRequiredClassDefault = null;
export const listResourcesFullV1AutocrudSkillFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudSkillFullGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudSkillFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudSkillFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudSkillFullGetResponseItem = zod.object({
  data: zod
    .object({
      skname: zod.string(),
      detail: zod.union([
        zod
          .object({
            skill_type: zod.enum(['active']),
            mp_cost: zod
              .number()
              .default(listResourcesFullV1AutocrudSkillFullGetResponseDataDetailOneMpCostDefault),
            cooldown_seconds: zod
              .number()
              .default(
                listResourcesFullV1AutocrudSkillFullGetResponseDataDetailOneCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(listResourcesFullV1AutocrudSkillFullGetResponseDataDetailOneDamageDefault),
          })
          .describe('主動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['passive']),
            buff_percentage: zod
              .number()
              .default(
                listResourcesFullV1AutocrudSkillFullGetResponseDataDetailTwoBuffPercentageDefault,
              ),
          })
          .describe('被動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['ultimate']),
            mp_cost: zod
              .number()
              .default(listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeMpCostDefault),
            cooldown_seconds: zod
              .number()
              .default(
                listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeDamageDefault),
            area_of_effect: zod
              .boolean()
              .default(
                listResourcesFullV1AutocrudSkillFullGetResponseDataDetailThreeAreaOfEffectDefault,
              ),
          })
          .describe('終極技能數據'),
      ]),
      description: zod
        .string()
        .default(listResourcesFullV1AutocrudSkillFullGetResponseDataDescriptionDefault),
      required_level: zod
        .number()
        .default(listResourcesFullV1AutocrudSkillFullGetResponseDataRequiredLevelDefault),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(listResourcesFullV1AutocrudSkillFullGetResponseDataRequiredClassDefault),
    })
    .optional()
    .describe('遊戲技能（使用 Union 區分技能類型）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudSkillFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudSkillFullGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudSkillFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudSkillFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudSkillFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudSkillFullGetResponseItem,
);

/**
 * Retrieve the count of `skill` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /skill/count` - Get total count of all resources
- `GET /skill/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count skill Resources
 */
export const getResourcesCountV1AutocrudSkillCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudSkillCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudSkillCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudSkillCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudSkillCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudSkillCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudSkillCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudSkillCountGetResponse = zod.number();

/**
 * Retrieve a list of `skill` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /skill` — full list (data + meta + revision_info)
- `GET /skill?returns=data` — data only
- `GET /skill?returns=data,meta` — data + meta, no revision_info
- `GET /skill?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List skill resources
 */
export const listResourcesV1AutocrudSkillGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudSkillGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudSkillGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudSkillGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudSkillGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudSkillGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudSkillGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudSkillGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudSkillGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudSkillGetResponseDataDetailOneMpCostDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailOneCooldownSecondsDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailOneDamageDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailTwoBuffPercentageDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailThreeMpCostDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailThreeCooldownSecondsDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailThreeDamageDefault = 0;
export const listResourcesV1AutocrudSkillGetResponseDataDetailThreeAreaOfEffectDefault = false;
export const listResourcesV1AutocrudSkillGetResponseDataDescriptionDefault = ``;
export const listResourcesV1AutocrudSkillGetResponseDataRequiredLevelDefault = 1;
export const listResourcesV1AutocrudSkillGetResponseDataRequiredClassDefault = null;
export const listResourcesV1AutocrudSkillGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudSkillGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudSkillGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudSkillGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudSkillGetResponseItem = zod.object({
  data: zod
    .object({
      skname: zod.string(),
      detail: zod.union([
        zod
          .object({
            skill_type: zod.enum(['active']),
            mp_cost: zod
              .number()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailOneMpCostDefault),
            cooldown_seconds: zod
              .number()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailOneCooldownSecondsDefault),
            damage: zod
              .number()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailOneDamageDefault),
          })
          .describe('主動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['passive']),
            buff_percentage: zod
              .number()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailTwoBuffPercentageDefault),
          })
          .describe('被動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['ultimate']),
            mp_cost: zod
              .number()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailThreeMpCostDefault),
            cooldown_seconds: zod
              .number()
              .default(
                listResourcesV1AutocrudSkillGetResponseDataDetailThreeCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailThreeDamageDefault),
            area_of_effect: zod
              .boolean()
              .default(listResourcesV1AutocrudSkillGetResponseDataDetailThreeAreaOfEffectDefault),
          })
          .describe('終極技能數據'),
      ]),
      description: zod
        .string()
        .default(listResourcesV1AutocrudSkillGetResponseDataDescriptionDefault),
      required_level: zod
        .number()
        .default(listResourcesV1AutocrudSkillGetResponseDataRequiredLevelDefault),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(listResourcesV1AutocrudSkillGetResponseDataRequiredClassDefault),
    })
    .optional()
    .describe('遊戲技能（使用 Union 區分技能類型）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudSkillGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudSkillGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudSkillGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudSkillGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudSkillGetResponse = zod.array(
  ListResourcesV1AutocrudSkillGetResponseItem,
);

/**
 * Create a new `skill` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `skill` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /skill` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create skill
 */
export const createResourceV1AutocrudSkillPostBodyDetailOneMpCostDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailOneCooldownSecondsDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailOneDamageDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailTwoBuffPercentageDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailThreeMpCostDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailThreeCooldownSecondsDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailThreeDamageDefault = 0;
export const createResourceV1AutocrudSkillPostBodyDetailThreeAreaOfEffectDefault = false;
export const createResourceV1AutocrudSkillPostBodyDescriptionDefault = ``;
export const createResourceV1AutocrudSkillPostBodyRequiredLevelDefault = 1;
export const createResourceV1AutocrudSkillPostBodyRequiredClassDefault = null;

export const CreateResourceV1AutocrudSkillPostBody = zod
  .object({
    skname: zod.string(),
    detail: zod.union([
      zod
        .object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(createResourceV1AutocrudSkillPostBodyDetailOneMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(createResourceV1AutocrudSkillPostBodyDetailOneCooldownSecondsDefault),
          damage: zod.number().default(createResourceV1AutocrudSkillPostBodyDetailOneDamageDefault),
        })
        .describe('主動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(createResourceV1AutocrudSkillPostBodyDetailTwoBuffPercentageDefault),
        })
        .describe('被動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(createResourceV1AutocrudSkillPostBodyDetailThreeMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(createResourceV1AutocrudSkillPostBodyDetailThreeCooldownSecondsDefault),
          damage: zod
            .number()
            .default(createResourceV1AutocrudSkillPostBodyDetailThreeDamageDefault),
          area_of_effect: zod
            .boolean()
            .default(createResourceV1AutocrudSkillPostBodyDetailThreeAreaOfEffectDefault),
        })
        .describe('終極技能數據'),
    ]),
    description: zod.string().default(createResourceV1AutocrudSkillPostBodyDescriptionDefault),
    required_level: zod.number().default(createResourceV1AutocrudSkillPostBodyRequiredLevelDefault),
    required_class: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(createResourceV1AutocrudSkillPostBodyRequiredClassDefault),
  })
  .describe('遊戲技能（使用 Union 區分技能類型）');

export const createResourceV1AutocrudSkillPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudSkillPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudSkillPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudSkillPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudSkillPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `skill` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /skill?limit=100` — Delete up to 100 resources
- `DELETE /skill?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete skill
 */
export const batchDeleteV1AutocrudSkillDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudSkillDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudSkillDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudSkillDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudSkillDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudSkillDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudSkillDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudSkillDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudSkillDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudSkillDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudSkillDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudSkillDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudSkillDeleteResponse = zod.array(
  BatchDeleteV1AutocrudSkillDeleteResponseItem,
);

/**
 * Export all (or filtered) **skill** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export skill data
 */
export const exportModelV1AutocrudSkillExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudSkillExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudSkillExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudSkillExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudSkillExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudSkillExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudSkillExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudSkillExportGetResponse = zod.unknown();

/**
 * Import **skill** resources from a ``.acbak`` archive.

The archive must contain a **skill** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import skill data
 */
export const importModelV1AutocrudSkillImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudSkillImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudSkillImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudSkillImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudSkillImportPostResponse = zod.record(zod.string(), zod.unknown());

/**
 * Deprecated: use `GET /skill/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get skill Meta by ID
 */
export const GetResourceMetaV1AutocrudSkillResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudSkillResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudSkillResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudSkillResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudSkillResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudSkillResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudSkillResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudSkillResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudSkillResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `skill` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /skill/123/revision-info` - Get current revision info
- `GET /skill/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get skill Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetParams = zod.object({
  resource_id: zod.string(),
});

export const GetResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudSkillResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /skill/{resource_id}` instead.

Retrieve complete information for a `skill` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete skill Information
 */
export const GetResourceFullV1AutocrudSkillResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudSkillResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudSkillResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudSkillResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudSkillResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudSkillResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailOneMpCostDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailOneCooldownSecondsDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailOneDamageDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailTwoBuffPercentageDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeMpCostDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeCooldownSecondsDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeDamageDefault = 0;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeAreaOfEffectDefault = false;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDescriptionDefault = ``;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataRequiredLevelDefault = 1;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataRequiredClassDefault = null;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseMetaSchemaVersionDefault = null;
export const getResourceFullV1AutocrudSkillResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudSkillResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      skname: zod.string(),
      detail: zod.union([
        zod
          .object({
            skill_type: zod.enum(['active']),
            mp_cost: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailOneMpCostDefault,
              ),
            cooldown_seconds: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailOneCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailOneDamageDefault,
              ),
          })
          .describe('主動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['passive']),
            buff_percentage: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailTwoBuffPercentageDefault,
              ),
          })
          .describe('被動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['ultimate']),
            mp_cost: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeMpCostDefault,
              ),
            cooldown_seconds: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeDamageDefault,
              ),
            area_of_effect: zod
              .boolean()
              .default(
                getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDetailThreeAreaOfEffectDefault,
              ),
          })
          .describe('終極技能數據'),
      ]),
      description: zod
        .string()
        .default(getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataDescriptionDefault),
      required_level: zod
        .number()
        .default(getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataRequiredLevelDefault),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(getResourceFullV1AutocrudSkillResourceIdFullGetResponseDataRequiredClassDefault),
    })
    .optional()
    .describe('遊戲技能（使用 Union 區分技能類型）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudSkillResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudSkillResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudSkillResourceIdFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudSkillResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `skill` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /skill/123/revision-list` - Get all revisions for resource 123
- `GET /skill/123/revision-list?limit=10&offset=20`
- `GET /skill/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /skill/123/revision-list?from_revision_id=rev123`
- `GET /skill/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get skill Revision History
 */
export const GetResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryLimitDefault),
    offset: zod
      .number()
      .default(getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryOffsetDefault),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponse = zod.object({
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
  revisions: zod.array(
    zod
      .object({
        uid: zod.uuid(),
        resource_id: zod.string(),
        revision_id: zod.string(),
        parent_revision_id: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
          ),
        parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
          ),
        data_hash: zod.string().optional(),
        status: zod.enum(['draft', 'stable']),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
      })
      .describe(
        'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
      ),
  ),
  total: zod
    .number()
    .default(getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseTotalDefault),
  has_more: zod
    .boolean()
    .default(getResourceRevisionListV1AutocrudSkillResourceIdRevisionListGetResponseHasMoreDefault),
});

/**
 * Retrieve only the data content of a `skill` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /skill/123/data` - Get current resource data only
- `GET /skill/123/data?revision_id=rev456` - Get specific revision data only
- `GET /skill/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get skill Data
 */
export const GetResourceDataV1AutocrudSkillResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudSkillResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudSkillResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudSkillResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailOneMpCostDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailOneCooldownSecondsDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailOneDamageDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailTwoBuffPercentageDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeMpCostDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeCooldownSecondsDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeDamageDefault = 0;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeAreaOfEffectDefault = false;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseDescriptionDefault = ``;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseRequiredLevelDefault = 1;
export const getResourceDataV1AutocrudSkillResourceIdDataGetResponseRequiredClassDefault = null;

export const GetResourceDataV1AutocrudSkillResourceIdDataGetResponse = zod
  .object({
    skname: zod.string(),
    detail: zod.union([
      zod
        .object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailOneMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(
              getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailOneCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailOneDamageDefault),
        })
        .describe('主動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(
              getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailTwoBuffPercentageDefault,
            ),
        })
        .describe('被動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(
              getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeDamageDefault,
            ),
          area_of_effect: zod
            .boolean()
            .default(
              getResourceDataV1AutocrudSkillResourceIdDataGetResponseDetailThreeAreaOfEffectDefault,
            ),
        })
        .describe('終極技能數據'),
    ]),
    description: zod
      .string()
      .default(getResourceDataV1AutocrudSkillResourceIdDataGetResponseDescriptionDefault),
    required_level: zod
      .number()
      .default(getResourceDataV1AutocrudSkillResourceIdDataGetResponseRequiredLevelDefault),
    required_class: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(getResourceDataV1AutocrudSkillResourceIdDataGetResponseRequiredClassDefault),
  })
  .describe('遊戲技能（使用 Union 區分技能類型）');

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudSkillResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `skill` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /skill/123` — full response (data + meta + revision_info)
- `GET /skill/123?returns=data` — data only
- `GET /skill/123?returns=data,meta` — data + meta, no revision_info
- `GET /skill/123?returns=meta` — metadata only
- `GET /skill/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get skill resource
 */
export const GetResourceV1AutocrudSkillResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudSkillResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudSkillResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudSkillResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudSkillResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudSkillResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailOneMpCostDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailOneCooldownSecondsDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailOneDamageDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailTwoBuffPercentageDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeMpCostDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeCooldownSecondsDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeDamageDefault = 0;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeAreaOfEffectDefault = false;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataDescriptionDefault = ``;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataRequiredLevelDefault = 1;
export const getResourceV1AutocrudSkillResourceIdGetResponseDataRequiredClassDefault = null;
export const getResourceV1AutocrudSkillResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudSkillResourceIdGetResponseRevisionInfoSchemaVersionDefault = null;
export const getResourceV1AutocrudSkillResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudSkillResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudSkillResourceIdGetResponse = zod.object({
  data: zod
    .object({
      skname: zod.string(),
      detail: zod.union([
        zod
          .object({
            skill_type: zod.enum(['active']),
            mp_cost: zod
              .number()
              .default(getResourceV1AutocrudSkillResourceIdGetResponseDataDetailOneMpCostDefault),
            cooldown_seconds: zod
              .number()
              .default(
                getResourceV1AutocrudSkillResourceIdGetResponseDataDetailOneCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(getResourceV1AutocrudSkillResourceIdGetResponseDataDetailOneDamageDefault),
          })
          .describe('主動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['passive']),
            buff_percentage: zod
              .number()
              .default(
                getResourceV1AutocrudSkillResourceIdGetResponseDataDetailTwoBuffPercentageDefault,
              ),
          })
          .describe('被動技能數據'),
        zod
          .object({
            skill_type: zod.enum(['ultimate']),
            mp_cost: zod
              .number()
              .default(getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeMpCostDefault),
            cooldown_seconds: zod
              .number()
              .default(
                getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeCooldownSecondsDefault,
              ),
            damage: zod
              .number()
              .default(getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeDamageDefault),
            area_of_effect: zod
              .boolean()
              .default(
                getResourceV1AutocrudSkillResourceIdGetResponseDataDetailThreeAreaOfEffectDefault,
              ),
          })
          .describe('終極技能數據'),
      ]),
      description: zod
        .string()
        .default(getResourceV1AutocrudSkillResourceIdGetResponseDataDescriptionDefault),
      required_level: zod
        .number()
        .default(getResourceV1AutocrudSkillResourceIdGetResponseDataRequiredLevelDefault),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(getResourceV1AutocrudSkillResourceIdGetResponseDataRequiredClassDefault),
    })
    .optional()
    .describe('遊戲技能（使用 Union 區分技能類型）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudSkillResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudSkillResourceIdGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudSkillResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudSkillResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `skill` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `skill` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /skill/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update skill
 */
export const UpdateResourceV1AutocrudSkillResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudSkillResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudSkillResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudSkillResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailOneMpCostDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailOneCooldownSecondsDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailOneDamageDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailTwoBuffPercentageDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeMpCostDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeCooldownSecondsDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeDamageDefault = 0;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeAreaOfEffectDefault = false;
export const updateResourceV1AutocrudSkillResourceIdPutBodyDescriptionDefault = ``;
export const updateResourceV1AutocrudSkillResourceIdPutBodyRequiredLevelDefault = 1;
export const updateResourceV1AutocrudSkillResourceIdPutBodyRequiredClassDefault = null;

export const UpdateResourceV1AutocrudSkillResourceIdPutBody = zod
  .object({
    skname: zod.string(),
    detail: zod.union([
      zod
        .object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailOneMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailOneCooldownSecondsDefault),
          damage: zod
            .number()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailOneDamageDefault),
        })
        .describe('主動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailTwoBuffPercentageDefault),
        })
        .describe('被動技能數據'),
      zod
        .object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeMpCostDefault),
          cooldown_seconds: zod
            .number()
            .default(
              updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeDamageDefault),
          area_of_effect: zod
            .boolean()
            .default(updateResourceV1AutocrudSkillResourceIdPutBodyDetailThreeAreaOfEffectDefault),
        })
        .describe('終極技能數據'),
    ]),
    description: zod
      .string()
      .default(updateResourceV1AutocrudSkillResourceIdPutBodyDescriptionDefault),
    required_level: zod
      .number()
      .default(updateResourceV1AutocrudSkillResourceIdPutBodyRequiredLevelDefault),
    required_class: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(updateResourceV1AutocrudSkillResourceIdPutBodyRequiredClassDefault),
  })
  .describe('遊戲技能（使用 Union 區分技能類型）');

export const updateResourceV1AutocrudSkillResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudSkillResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudSkillResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudSkillResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudSkillResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `skill` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /skill/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update skill
 */
export const PatchResourceV1AutocrudSkillResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudSkillResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudSkillResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudSkillResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudSkillResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudSkillResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudSkillResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudSkillResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudSkillResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudSkillResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudSkillResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudSkillResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `skill` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /skill/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete skill
 */
export const DeleteResourceV1AutocrudSkillResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudSkillResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudSkillResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudSkillResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudSkillResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudSkillResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `skill` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /skill/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch skill to specific revision
 */
export const SwitchRevisionV1AutocrudSkillResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudSkillResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudSkillResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudSkillResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudSkillResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(switchRevisionV1AutocrudSkillResourceIdSwitchRevisionIdPostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `skill` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete skill
 */
export const PermanentlyDeleteResourceV1AutocrudSkillResourceIdPermanentlyDeleteParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const permanentlyDeleteResourceV1AutocrudSkillResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudSkillResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudSkillResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudSkillResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudSkillResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `skill` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /skill/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted skill
 */
export const RestoreResourceV1AutocrudSkillResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudSkillResourceIdRestorePostResponseSchemaVersionDefault = null;
export const restoreResourceV1AutocrudSkillResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudSkillResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudSkillResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudSkillResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `skill` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /skill/restore?limit=100` — Restore up to 100 deleted resources
- `POST /skill/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted skill
 */
export const batchRestoreV1AutocrudSkillRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudSkillRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudSkillRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudSkillRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudSkillRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudSkillRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudSkillRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudSkillRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudSkillRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudSkillRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudSkillRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudSkillRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudSkillRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudSkillRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudSkillMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudSkillMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudSkillMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudSkillMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudSkillMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudSkillMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudSkillMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudSkillMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudSkillMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudSkillMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `skill` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /skill/migrate/single/123` - Migrate resource 123
- `POST /skill/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /skill/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single skill Resource
 */
export const MigrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostParams = zod.object({
  resource_id: zod.string(),
});

export const migrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(migrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostQueryWriteBackDefault)
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(migrateSingleResourceV1AutocrudSkillMigrateSingleResourceIdPostResponseErrorDefault),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `equipment` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /equipment/data` - Get first 10 resources (data only)
- `GET /equipment/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /equipment/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /equipment/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List equipment Data Only
 */
export const listResourcesDataV1AutocrudEquipmentDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudEquipmentDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudEquipmentDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudEquipmentDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudEquipmentDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudEquipmentDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudEquipmentDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudEquipmentDataGetResponseOwnerIdDefault = null;
export const listResourcesDataV1AutocrudEquipmentDataGetResponseCharacterClassReqDefault = null;
export const listResourcesDataV1AutocrudEquipmentDataGetResponseAttackBonusDefault = 0;
export const listResourcesDataV1AutocrudEquipmentDataGetResponseDefenseBonusDefault = 0;
export const listResourcesDataV1AutocrudEquipmentDataGetResponseSpecialEffectsDefault = [];
export const listResourcesDataV1AutocrudEquipmentDataGetResponsePriceDefault = 100;
export const listResourcesDataV1AutocrudEquipmentDataGetResponseIconDefault = null;

export const ListResourcesDataV1AutocrudEquipmentDataGetResponseItem = zod
  .object({
    type: zod.enum(['Equipment']),
    name: zod.string(),
    rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
    owner_id: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudEquipmentDataGetResponseOwnerIdDefault),
    character_class_req: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(listResourcesDataV1AutocrudEquipmentDataGetResponseCharacterClassReqDefault),
    attack_bonus: zod
      .number()
      .default(listResourcesDataV1AutocrudEquipmentDataGetResponseAttackBonusDefault),
    defense_bonus: zod
      .number()
      .default(listResourcesDataV1AutocrudEquipmentDataGetResponseDefenseBonusDefault),
    special_effects: zod
      .array(zod.string())
      .default(listResourcesDataV1AutocrudEquipmentDataGetResponseSpecialEffectsDefault),
    price: zod.number().default(listResourcesDataV1AutocrudEquipmentDataGetResponsePriceDefault),
    icon: zod
      .union([
        zod.null(),
        zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
      ])
      .default(listResourcesDataV1AutocrudEquipmentDataGetResponseIconDefault),
  })
  .describe('遊戲裝備');
export const ListResourcesDataV1AutocrudEquipmentDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudEquipmentDataGetResponseItem,
);

/**
 * Retrieve a list of `equipment` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /equipment/meta` - Get metadata for first 10 resources
- `GET /equipment/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /equipment/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List equipment Metadata Only
 */
export const listResourcesMetaV1AutocrudEquipmentMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudEquipmentMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudEquipmentMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudEquipmentMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudEquipmentMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudEquipmentMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudEquipmentMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudEquipmentMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudEquipmentMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudEquipmentMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudEquipmentMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudEquipmentMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudEquipmentMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudEquipmentMetaGetResponseItem,
);

/**
 * Retrieve a list of `equipment` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /equipment/revision-info` - Get current revision info for first 10 resources
- `GET /equipment/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /equipment/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List equipment Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudEquipmentRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /equipment` instead. Retrieve a list of `equipment` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List equipment Complete Information
 */
export const listResourcesFullV1AutocrudEquipmentFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudEquipmentFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudEquipmentFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudEquipmentFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudEquipmentFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudEquipmentFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudEquipmentFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudEquipmentFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudEquipmentFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataOwnerIdDefault = null;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataCharacterClassReqDefault = null;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataAttackBonusDefault = 0;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataDefenseBonusDefault = 0;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataSpecialEffectsDefault = [];
export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataPriceDefault = 100;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseDataIconDefault = null;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudEquipmentFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudEquipmentFullGetResponseItem = zod.object({
  data: zod
    .object({
      type: zod.enum(['Equipment']),
      name: zod.string(),
      rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
      owner_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataOwnerIdDefault),
      character_class_req: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataCharacterClassReqDefault),
      attack_bonus: zod
        .number()
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataAttackBonusDefault),
      defense_bonus: zod
        .number()
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataDefenseBonusDefault),
      special_effects: zod
        .array(zod.string())
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataSpecialEffectsDefault),
      price: zod
        .number()
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataPriceDefault),
      icon: zod
        .union([
          zod.null(),
          zod
            .object({
              file_id: zod.string().optional(),
              size: zod.number().optional(),
              content_type: zod.string().optional(),
              data: zod.string().optional(),
            })
            .describe(
              'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
            ),
        ])
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseDataIconDefault),
    })
    .optional()
    .describe('遊戲裝備'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudEquipmentFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudEquipmentFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudEquipmentFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudEquipmentFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudEquipmentFullGetResponseItem,
);

/**
 * Retrieve the count of `equipment` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /equipment/count` - Get total count of all resources
- `GET /equipment/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count equipment Resources
 */
export const getResourcesCountV1AutocrudEquipmentCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudEquipmentCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudEquipmentCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudEquipmentCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudEquipmentCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudEquipmentCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudEquipmentCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudEquipmentCountGetResponse = zod.number();

/**
 * Retrieve a list of `equipment` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /equipment` — full list (data + meta + revision_info)
- `GET /equipment?returns=data` — data only
- `GET /equipment?returns=data,meta` — data + meta, no revision_info
- `GET /equipment?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List equipment resources
 */
export const listResourcesV1AutocrudEquipmentGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudEquipmentGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudEquipmentGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudEquipmentGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudEquipmentGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudEquipmentGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudEquipmentGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudEquipmentGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudEquipmentGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudEquipmentGetResponseDataOwnerIdDefault = null;
export const listResourcesV1AutocrudEquipmentGetResponseDataCharacterClassReqDefault = null;
export const listResourcesV1AutocrudEquipmentGetResponseDataAttackBonusDefault = 0;
export const listResourcesV1AutocrudEquipmentGetResponseDataDefenseBonusDefault = 0;
export const listResourcesV1AutocrudEquipmentGetResponseDataSpecialEffectsDefault = [];
export const listResourcesV1AutocrudEquipmentGetResponseDataPriceDefault = 100;
export const listResourcesV1AutocrudEquipmentGetResponseDataIconDefault = null;
export const listResourcesV1AutocrudEquipmentGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudEquipmentGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudEquipmentGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudEquipmentGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudEquipmentGetResponseItem = zod.object({
  data: zod
    .object({
      type: zod.enum(['Equipment']),
      name: zod.string(),
      rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
      owner_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudEquipmentGetResponseDataOwnerIdDefault),
      character_class_req: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(listResourcesV1AutocrudEquipmentGetResponseDataCharacterClassReqDefault),
      attack_bonus: zod
        .number()
        .default(listResourcesV1AutocrudEquipmentGetResponseDataAttackBonusDefault),
      defense_bonus: zod
        .number()
        .default(listResourcesV1AutocrudEquipmentGetResponseDataDefenseBonusDefault),
      special_effects: zod
        .array(zod.string())
        .default(listResourcesV1AutocrudEquipmentGetResponseDataSpecialEffectsDefault),
      price: zod.number().default(listResourcesV1AutocrudEquipmentGetResponseDataPriceDefault),
      icon: zod
        .union([
          zod.null(),
          zod
            .object({
              file_id: zod.string().optional(),
              size: zod.number().optional(),
              content_type: zod.string().optional(),
              data: zod.string().optional(),
            })
            .describe(
              'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
            ),
        ])
        .default(listResourcesV1AutocrudEquipmentGetResponseDataIconDefault),
    })
    .optional()
    .describe('遊戲裝備'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudEquipmentGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudEquipmentGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudEquipmentGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudEquipmentGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudEquipmentGetResponse = zod.array(
  ListResourcesV1AutocrudEquipmentGetResponseItem,
);

/**
 * Create a new `equipment` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `equipment` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /equipment` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create equipment
 */
export const createResourceV1AutocrudEquipmentPostBodyOwnerIdDefault = null;
export const createResourceV1AutocrudEquipmentPostBodyCharacterClassReqDefault = null;
export const createResourceV1AutocrudEquipmentPostBodyAttackBonusDefault = 0;
export const createResourceV1AutocrudEquipmentPostBodyDefenseBonusDefault = 0;
export const createResourceV1AutocrudEquipmentPostBodySpecialEffectsDefault = [];
export const createResourceV1AutocrudEquipmentPostBodyPriceDefault = 100;
export const createResourceV1AutocrudEquipmentPostBodyIconDefault = null;

export const CreateResourceV1AutocrudEquipmentPostBody = zod
  .object({
    type: zod.enum(['Equipment']),
    name: zod.string(),
    rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
    owner_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudEquipmentPostBodyOwnerIdDefault),
    character_class_req: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(createResourceV1AutocrudEquipmentPostBodyCharacterClassReqDefault),
    attack_bonus: zod.number().default(createResourceV1AutocrudEquipmentPostBodyAttackBonusDefault),
    defense_bonus: zod
      .number()
      .default(createResourceV1AutocrudEquipmentPostBodyDefenseBonusDefault),
    special_effects: zod
      .array(zod.string())
      .default(createResourceV1AutocrudEquipmentPostBodySpecialEffectsDefault),
    price: zod.number().default(createResourceV1AutocrudEquipmentPostBodyPriceDefault),
    icon: zod
      .union([
        zod.null(),
        zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
      ])
      .default(createResourceV1AutocrudEquipmentPostBodyIconDefault),
  })
  .describe('遊戲裝備');

export const createResourceV1AutocrudEquipmentPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudEquipmentPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudEquipmentPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudEquipmentPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudEquipmentPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `equipment` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /equipment?limit=100` — Delete up to 100 resources
- `DELETE /equipment?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete equipment
 */
export const batchDeleteV1AutocrudEquipmentDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudEquipmentDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudEquipmentDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudEquipmentDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudEquipmentDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudEquipmentDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudEquipmentDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudEquipmentDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudEquipmentDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudEquipmentDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudEquipmentDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudEquipmentDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudEquipmentDeleteResponse = zod.array(
  BatchDeleteV1AutocrudEquipmentDeleteResponseItem,
);

/**
 * Export all (or filtered) **equipment** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export equipment data
 */
export const exportModelV1AutocrudEquipmentExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudEquipmentExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudEquipmentExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudEquipmentExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudEquipmentExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudEquipmentExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudEquipmentExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudEquipmentExportGetResponse = zod.unknown();

/**
 * Import **equipment** resources from a ``.acbak`` archive.

The archive must contain a **equipment** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import equipment data
 */
export const importModelV1AutocrudEquipmentImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudEquipmentImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudEquipmentImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudEquipmentImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudEquipmentImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /equipment/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get equipment Meta by ID
 */
export const GetResourceMetaV1AutocrudEquipmentResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudEquipmentResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudEquipmentResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudEquipmentResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudEquipmentResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudEquipmentResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudEquipmentResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudEquipmentResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudEquipmentResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `equipment` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /equipment/123/revision-info` - Get current revision info
- `GET /equipment/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get equipment Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const GetResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudEquipmentResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /equipment/{resource_id}` instead.

Retrieve complete information for a `equipment` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete equipment Information
 */
export const GetResourceFullV1AutocrudEquipmentResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudEquipmentResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudEquipmentResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataOwnerIdDefault = null;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataCharacterClassReqDefault =
  null;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataAttackBonusDefault = 0;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataDefenseBonusDefault = 0;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataSpecialEffectsDefault =
  [];
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataPriceDefault = 100;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataIconDefault = null;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudEquipmentResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      type: zod.enum(['Equipment']),
      name: zod.string(),
      rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
      owner_id: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataOwnerIdDefault),
      character_class_req: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(
          getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataCharacterClassReqDefault,
        ),
      attack_bonus: zod
        .number()
        .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataAttackBonusDefault),
      defense_bonus: zod
        .number()
        .default(
          getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataDefenseBonusDefault,
        ),
      special_effects: zod
        .array(zod.string())
        .default(
          getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataSpecialEffectsDefault,
        ),
      price: zod
        .number()
        .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataPriceDefault),
      icon: zod
        .union([
          zod.null(),
          zod
            .object({
              file_id: zod.string().optional(),
              size: zod.number().optional(),
              content_type: zod.string().optional(),
              data: zod.string().optional(),
            })
            .describe(
              'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
            ),
        ])
        .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseDataIconDefault),
    })
    .optional()
    .describe('遊戲裝備'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudEquipmentResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `equipment` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /equipment/123/revision-list` - Get all revisions for resource 123
- `GET /equipment/123/revision-list?limit=10&offset=20`
- `GET /equipment/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /equipment/123/revision-list?from_revision_id=rev123`
- `GET /equipment/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get equipment Revision History
 */
export const GetResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryLimitDefault,
      ),
    offset: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryOffsetDefault,
      ),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponse =
  zod.object({
    meta: zod
      .object({
        current_revision_id: zod.string(),
        resource_id: zod.string(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
          ),
        total_revision_count: zod.number(),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
        is_deleted: zod
          .boolean()
          .default(
            getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseMetaIsDeletedDefault,
          ),
        indexed_data: zod.looseObject({}).optional(),
      })
      .describe(
        'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
      ),
    revisions: zod.array(
      zod
        .object({
          uid: zod.uuid(),
          resource_id: zod.string(),
          revision_id: zod.string(),
          parent_revision_id: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
            ),
          parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
          schema_version: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
            ),
          data_hash: zod.string().optional(),
          status: zod.enum(['draft', 'stable']),
          created_time: zod.string(),
          updated_time: zod.string(),
          created_by: zod.string(),
          updated_by: zod.string(),
        })
        .describe(
          'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
        ),
    ),
    total: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseTotalDefault,
      ),
    has_more: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudEquipmentResourceIdRevisionListGetResponseHasMoreDefault,
      ),
  });

/**
 * Retrieve only the data content of a `equipment` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /equipment/123/data` - Get current resource data only
- `GET /equipment/123/data?revision_id=rev456` - Get specific revision data only
- `GET /equipment/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get equipment Data
 */
export const GetResourceDataV1AutocrudEquipmentResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudEquipmentResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudEquipmentResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseOwnerIdDefault = null;
export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseCharacterClassReqDefault =
  null;
export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseAttackBonusDefault = 0;
export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseDefenseBonusDefault = 0;
export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseSpecialEffectsDefault = [];
export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponsePriceDefault = 100;
export const getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseIconDefault = null;

export const GetResourceDataV1AutocrudEquipmentResourceIdDataGetResponse = zod
  .object({
    type: zod.enum(['Equipment']),
    name: zod.string(),
    rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
    owner_id: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseOwnerIdDefault),
    character_class_req: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseCharacterClassReqDefault),
    attack_bonus: zod
      .number()
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseAttackBonusDefault),
    defense_bonus: zod
      .number()
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseDefenseBonusDefault),
    special_effects: zod
      .array(zod.string())
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseSpecialEffectsDefault),
    price: zod
      .number()
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponsePriceDefault),
    icon: zod
      .union([
        zod.null(),
        zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
      ])
      .default(getResourceDataV1AutocrudEquipmentResourceIdDataGetResponseIconDefault),
  })
  .describe('遊戲裝備');

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudEquipmentResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `equipment` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /equipment/123` — full response (data + meta + revision_info)
- `GET /equipment/123?returns=data` — data only
- `GET /equipment/123?returns=data,meta` — data + meta, no revision_info
- `GET /equipment/123?returns=meta` — metadata only
- `GET /equipment/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get equipment resource
 */
export const GetResourceV1AutocrudEquipmentResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudEquipmentResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudEquipmentResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudEquipmentResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudEquipmentResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudEquipmentResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataOwnerIdDefault = null;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataCharacterClassReqDefault = null;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataAttackBonusDefault = 0;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataDefenseBonusDefault = 0;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataSpecialEffectsDefault = [];
export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataPriceDefault = 100;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseDataIconDefault = null;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudEquipmentResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudEquipmentResourceIdGetResponse = zod.object({
  data: zod
    .object({
      type: zod.enum(['Equipment']),
      name: zod.string(),
      rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
      owner_id: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataOwnerIdDefault),
      character_class_req: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataCharacterClassReqDefault),
      attack_bonus: zod
        .number()
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataAttackBonusDefault),
      defense_bonus: zod
        .number()
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataDefenseBonusDefault),
      special_effects: zod
        .array(zod.string())
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataSpecialEffectsDefault),
      price: zod
        .number()
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataPriceDefault),
      icon: zod
        .union([
          zod.null(),
          zod
            .object({
              file_id: zod.string().optional(),
              size: zod.number().optional(),
              content_type: zod.string().optional(),
              data: zod.string().optional(),
            })
            .describe(
              'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
            ),
        ])
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseDataIconDefault),
    })
    .optional()
    .describe('遊戲裝備'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudEquipmentResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudEquipmentResourceIdGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudEquipmentResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `equipment` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `equipment` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /equipment/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update equipment
 */
export const UpdateResourceV1AutocrudEquipmentResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudEquipmentResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudEquipmentResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudEquipmentResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudEquipmentResourceIdPutBodyOwnerIdDefault = null;
export const updateResourceV1AutocrudEquipmentResourceIdPutBodyCharacterClassReqDefault = null;
export const updateResourceV1AutocrudEquipmentResourceIdPutBodyAttackBonusDefault = 0;
export const updateResourceV1AutocrudEquipmentResourceIdPutBodyDefenseBonusDefault = 0;
export const updateResourceV1AutocrudEquipmentResourceIdPutBodySpecialEffectsDefault = [];
export const updateResourceV1AutocrudEquipmentResourceIdPutBodyPriceDefault = 100;
export const updateResourceV1AutocrudEquipmentResourceIdPutBodyIconDefault = null;

export const UpdateResourceV1AutocrudEquipmentResourceIdPutBody = zod
  .object({
    type: zod.enum(['Equipment']),
    name: zod.string(),
    rarity: zod.enum(['傳奇', '史詩', '普通', '稀有', '🚀 AutoCRUD 神器']).describe('裝備稀有度'),
    owner_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudEquipmentResourceIdPutBodyOwnerIdDefault),
    character_class_req: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .default(updateResourceV1AutocrudEquipmentResourceIdPutBodyCharacterClassReqDefault),
    attack_bonus: zod
      .number()
      .default(updateResourceV1AutocrudEquipmentResourceIdPutBodyAttackBonusDefault),
    defense_bonus: zod
      .number()
      .default(updateResourceV1AutocrudEquipmentResourceIdPutBodyDefenseBonusDefault),
    special_effects: zod
      .array(zod.string())
      .default(updateResourceV1AutocrudEquipmentResourceIdPutBodySpecialEffectsDefault),
    price: zod.number().default(updateResourceV1AutocrudEquipmentResourceIdPutBodyPriceDefault),
    icon: zod
      .union([
        zod.null(),
        zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
      ])
      .default(updateResourceV1AutocrudEquipmentResourceIdPutBodyIconDefault),
  })
  .describe('遊戲裝備');

export const updateResourceV1AutocrudEquipmentResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudEquipmentResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudEquipmentResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudEquipmentResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudEquipmentResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `equipment` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /equipment/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update equipment
 */
export const PatchResourceV1AutocrudEquipmentResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudEquipmentResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudEquipmentResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudEquipmentResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudEquipmentResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudEquipmentResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudEquipmentResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudEquipmentResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudEquipmentResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudEquipmentResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudEquipmentResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudEquipmentResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `equipment` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /equipment/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete equipment
 */
export const DeleteResourceV1AutocrudEquipmentResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudEquipmentResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudEquipmentResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudEquipmentResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudEquipmentResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudEquipmentResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `equipment` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /equipment/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch equipment to specific revision
 */
export const SwitchRevisionV1AutocrudEquipmentResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudEquipmentResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudEquipmentResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudEquipmentResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudEquipmentResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        switchRevisionV1AutocrudEquipmentResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `equipment` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete equipment
 */
export const PermanentlyDeleteResourceV1AutocrudEquipmentResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudEquipmentResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudEquipmentResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudEquipmentResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudEquipmentResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudEquipmentResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `equipment` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /equipment/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted equipment
 */
export const RestoreResourceV1AutocrudEquipmentResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudEquipmentResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudEquipmentResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudEquipmentResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudEquipmentResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudEquipmentResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `equipment` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /equipment/restore?limit=100` — Restore up to 100 deleted resources
- `POST /equipment/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted equipment
 */
export const batchRestoreV1AutocrudEquipmentRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudEquipmentRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudEquipmentRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudEquipmentRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudEquipmentRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudEquipmentRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudEquipmentRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudEquipmentRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudEquipmentRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudEquipmentRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudEquipmentRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudEquipmentRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudEquipmentRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudEquipmentRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudEquipmentMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudEquipmentMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudEquipmentMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudEquipmentMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `equipment` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /equipment/migrate/single/123` - Migrate resource 123
- `POST /equipment/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /equipment/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single equipment Resource
 */
export const MigrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const migrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudEquipmentMigrateSingleResourceIdPostResponseErrorDefault,
      ),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `pet` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /pet/data` - Get first 10 resources (data only)
- `GET /pet/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /pet/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /pet/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List pet Data Only
 */
export const listResourcesDataV1AutocrudPetDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudPetDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudPetDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudPetDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudPetDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudPetDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudPetDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudPetDataGetResponseOneSpeedDefault = 10;
export const listResourcesDataV1AutocrudPetDataGetResponseOneStaminaDefault = 100;
export const listResourcesDataV1AutocrudPetDataGetResponseTwoLevelDefault = 1;
export const listResourcesDataV1AutocrudPetDataGetResponseTwoHpDefault = 100;
export const listResourcesDataV1AutocrudPetDataGetResponseTwoMpDefault = 50;
export const listResourcesDataV1AutocrudPetDataGetResponseTwoAttackDefault = 10;
export const listResourcesDataV1AutocrudPetDataGetResponseTwoDefenseDefault = 5;

export const ListResourcesDataV1AutocrudPetDataGetResponseItem = zod.union([
  zod
    .object({
      type: zod.enum(['Mount']),
      name: zod.string(),
      species: zod.string(),
      speed: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseOneSpeedDefault),
      stamina: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseOneStaminaDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的坐騎系統示例'),
  zod
    .object({
      type: zod.enum(['Dog']),
      name: zod.string(),
      breed: zod.string(),
      level: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseTwoLevelDefault),
      hp: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseTwoHpDefault),
      mp: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseTwoMpDefault),
      attack: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseTwoAttackDefault),
      defense: zod.number().default(listResourcesDataV1AutocrudPetDataGetResponseTwoDefenseDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的寵物系統示例'),
]);
export const ListResourcesDataV1AutocrudPetDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudPetDataGetResponseItem,
);

/**
 * Retrieve a list of `pet` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /pet/meta` - Get metadata for first 10 resources
- `GET /pet/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /pet/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List pet Metadata Only
 */
export const listResourcesMetaV1AutocrudPetMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudPetMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudPetMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudPetMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudPetMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudPetMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudPetMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudPetMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudPetMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudPetMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudPetMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudPetMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudPetMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudPetMetaGetResponseItem,
);

/**
 * Retrieve a list of `pet` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /pet/revision-info` - Get current revision info for first 10 resources
- `GET /pet/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /pet/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List pet Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudPetRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /pet` instead. Retrieve a list of `pet` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List pet Complete Information
 */
export const listResourcesFullV1AutocrudPetFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudPetFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudPetFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudPetFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudPetFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudPetFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudPetFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudPetFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudPetFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudPetFullGetResponseDataOneSpeedDefault = 10;
export const listResourcesFullV1AutocrudPetFullGetResponseDataOneStaminaDefault = 100;
export const listResourcesFullV1AutocrudPetFullGetResponseDataTwoLevelDefault = 1;
export const listResourcesFullV1AutocrudPetFullGetResponseDataTwoHpDefault = 100;
export const listResourcesFullV1AutocrudPetFullGetResponseDataTwoMpDefault = 50;
export const listResourcesFullV1AutocrudPetFullGetResponseDataTwoAttackDefault = 10;
export const listResourcesFullV1AutocrudPetFullGetResponseDataTwoDefenseDefault = 5;
export const listResourcesFullV1AutocrudPetFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudPetFullGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudPetFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudPetFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudPetFullGetResponseItem = zod.object({
  data: zod
    .union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod
            .number()
            .default(listResourcesFullV1AutocrudPetFullGetResponseDataOneSpeedDefault),
          stamina: zod
            .number()
            .default(listResourcesFullV1AutocrudPetFullGetResponseDataOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod
            .number()
            .default(listResourcesFullV1AutocrudPetFullGetResponseDataTwoLevelDefault),
          hp: zod.number().default(listResourcesFullV1AutocrudPetFullGetResponseDataTwoHpDefault),
          mp: zod.number().default(listResourcesFullV1AutocrudPetFullGetResponseDataTwoMpDefault),
          attack: zod
            .number()
            .default(listResourcesFullV1AutocrudPetFullGetResponseDataTwoAttackDefault),
          defense: zod
            .number()
            .default(listResourcesFullV1AutocrudPetFullGetResponseDataTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ])
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetFullGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetFullGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudPetFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudPetFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudPetFullGetResponseItem,
);

/**
 * Retrieve the count of `pet` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /pet/count` - Get total count of all resources
- `GET /pet/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count pet Resources
 */
export const getResourcesCountV1AutocrudPetCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudPetCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudPetCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudPetCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudPetCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudPetCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudPetCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudPetCountGetResponse = zod.number();

/**
 * Retrieve a list of `pet` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /pet` — full list (data + meta + revision_info)
- `GET /pet?returns=data` — data only
- `GET /pet?returns=data,meta` — data + meta, no revision_info
- `GET /pet?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List pet resources
 */
export const listResourcesV1AutocrudPetGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudPetGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudPetGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudPetGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudPetGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudPetGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudPetGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudPetGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudPetGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudPetGetResponseDataOneSpeedDefault = 10;
export const listResourcesV1AutocrudPetGetResponseDataOneStaminaDefault = 100;
export const listResourcesV1AutocrudPetGetResponseDataTwoLevelDefault = 1;
export const listResourcesV1AutocrudPetGetResponseDataTwoHpDefault = 100;
export const listResourcesV1AutocrudPetGetResponseDataTwoMpDefault = 50;
export const listResourcesV1AutocrudPetGetResponseDataTwoAttackDefault = 10;
export const listResourcesV1AutocrudPetGetResponseDataTwoDefenseDefault = 5;
export const listResourcesV1AutocrudPetGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudPetGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudPetGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudPetGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudPetGetResponseItem = zod.object({
  data: zod
    .union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod.number().default(listResourcesV1AutocrudPetGetResponseDataOneSpeedDefault),
          stamina: zod.number().default(listResourcesV1AutocrudPetGetResponseDataOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod.number().default(listResourcesV1AutocrudPetGetResponseDataTwoLevelDefault),
          hp: zod.number().default(listResourcesV1AutocrudPetGetResponseDataTwoHpDefault),
          mp: zod.number().default(listResourcesV1AutocrudPetGetResponseDataTwoMpDefault),
          attack: zod.number().default(listResourcesV1AutocrudPetGetResponseDataTwoAttackDefault),
          defense: zod.number().default(listResourcesV1AutocrudPetGetResponseDataTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ])
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod.boolean().default(listResourcesV1AutocrudPetGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudPetGetResponse = zod.array(
  ListResourcesV1AutocrudPetGetResponseItem,
);

/**
 * Create a new `pet` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `pet` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /pet` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create pet
 */
export const createResourceV1AutocrudPetPostBodyOneSpeedDefault = 10;
export const createResourceV1AutocrudPetPostBodyOneStaminaDefault = 100;
export const createResourceV1AutocrudPetPostBodyTwoLevelDefault = 1;
export const createResourceV1AutocrudPetPostBodyTwoHpDefault = 100;
export const createResourceV1AutocrudPetPostBodyTwoMpDefault = 50;
export const createResourceV1AutocrudPetPostBodyTwoAttackDefault = 10;
export const createResourceV1AutocrudPetPostBodyTwoDefenseDefault = 5;

export const CreateResourceV1AutocrudPetPostBody = zod.union([
  zod
    .object({
      type: zod.enum(['Mount']),
      name: zod.string(),
      species: zod.string(),
      speed: zod.number().default(createResourceV1AutocrudPetPostBodyOneSpeedDefault),
      stamina: zod.number().default(createResourceV1AutocrudPetPostBodyOneStaminaDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的坐騎系統示例'),
  zod
    .object({
      type: zod.enum(['Dog']),
      name: zod.string(),
      breed: zod.string(),
      level: zod.number().default(createResourceV1AutocrudPetPostBodyTwoLevelDefault),
      hp: zod.number().default(createResourceV1AutocrudPetPostBodyTwoHpDefault),
      mp: zod.number().default(createResourceV1AutocrudPetPostBodyTwoMpDefault),
      attack: zod.number().default(createResourceV1AutocrudPetPostBodyTwoAttackDefault),
      defense: zod.number().default(createResourceV1AutocrudPetPostBodyTwoDefenseDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的寵物系統示例'),
]);

export const createResourceV1AutocrudPetPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudPetPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudPetPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudPetPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudPetPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `pet` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /pet?limit=100` — Delete up to 100 resources
- `DELETE /pet?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete pet
 */
export const batchDeleteV1AutocrudPetDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudPetDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudPetDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudPetDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudPetDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudPetDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudPetDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudPetDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudPetDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudPetDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudPetDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudPetDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudPetDeleteResponse = zod.array(
  BatchDeleteV1AutocrudPetDeleteResponseItem,
);

/**
 * Export all (or filtered) **pet** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export pet data
 */
export const exportModelV1AutocrudPetExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudPetExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudPetExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudPetExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudPetExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudPetExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudPetExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudPetExportGetResponse = zod.unknown();

/**
 * Import **pet** resources from a ``.acbak`` archive.

The archive must contain a **pet** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import pet data
 */
export const importModelV1AutocrudPetImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudPetImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudPetImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudPetImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudPetImportPostResponse = zod.record(zod.string(), zod.unknown());

/**
 * Deprecated: use `GET /pet/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get pet Meta by ID
 */
export const GetResourceMetaV1AutocrudPetResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudPetResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudPetResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudPetResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudPetResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudPetResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudPetResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudPetResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudPetResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `pet` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /pet/123/revision-info` - Get current revision info
- `GET /pet/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get pet Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetParams = zod.object({
  resource_id: zod.string(),
});

export const GetResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
});

export const getResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudPetResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /pet/{resource_id}` instead.

Retrieve complete information for a `pet` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete pet Information
 */
export const GetResourceFullV1AutocrudPetResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudPetResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudPetResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudPetResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudPetResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudPetResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataOneSpeedDefault = 10;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataOneStaminaDefault = 100;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoLevelDefault = 1;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoHpDefault = 100;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoMpDefault = 50;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoAttackDefault = 10;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoDefenseDefault = 5;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseMetaSchemaVersionDefault = null;
export const getResourceFullV1AutocrudPetResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudPetResourceIdFullGetResponse = zod.object({
  data: zod
    .union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataOneSpeedDefault),
          stamina: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoLevelDefault),
          hp: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoHpDefault),
          mp: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoMpDefault),
          attack: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoAttackDefault),
          defense: zod
            .number()
            .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseDataTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ])
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudPetResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `pet` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /pet/123/revision-list` - Get all revisions for resource 123
- `GET /pet/123/revision-list?limit=10&offset=20`
- `GET /pet/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /pet/123/revision-list?from_revision_id=rev123`
- `GET /pet/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get pet Revision History
 */
export const GetResourceRevisionListV1AutocrudPetResourceIdRevisionListGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryParams = zod.object({
  limit: zod
    .number()
    .default(getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryLimitDefault),
  offset: zod
    .number()
    .default(getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryOffsetDefault),
  created_time_start: zod.union([zod.string(), zod.null()]).optional(),
  created_time_end: zod.union([zod.string(), zod.null()]).optional(),
  from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
  chain_only: zod
    .boolean()
    .default(getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryChainOnlyDefault),
  sort: zod
    .string()
    .default(getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQuerySortDefault),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe(
      "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
    ),
  include_deleted: zod
    .boolean()
    .default(
      getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetQueryIncludeDeletedDefault,
    )
    .describe('If true, return revision list even for soft-deleted resources'),
});

export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponse = zod.object({
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
  revisions: zod.array(
    zod
      .object({
        uid: zod.uuid(),
        resource_id: zod.string(),
        revision_id: zod.string(),
        parent_revision_id: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
          ),
        parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
          ),
        data_hash: zod.string().optional(),
        status: zod.enum(['draft', 'stable']),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
      })
      .describe(
        'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
      ),
  ),
  total: zod
    .number()
    .default(getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseTotalDefault),
  has_more: zod
    .boolean()
    .default(getResourceRevisionListV1AutocrudPetResourceIdRevisionListGetResponseHasMoreDefault),
});

/**
 * Retrieve only the data content of a `pet` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /pet/123/data` - Get current resource data only
- `GET /pet/123/data?revision_id=rev456` - Get specific revision data only
- `GET /pet/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get pet Data
 */
export const GetResourceDataV1AutocrudPetResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudPetResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudPetResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudPetResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudPetResourceIdDataGetResponseOneSpeedDefault = 10;
export const getResourceDataV1AutocrudPetResourceIdDataGetResponseOneStaminaDefault = 100;
export const getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoLevelDefault = 1;
export const getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoHpDefault = 100;
export const getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoMpDefault = 50;
export const getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoAttackDefault = 10;
export const getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoDefenseDefault = 5;

export const GetResourceDataV1AutocrudPetResourceIdDataGetResponse = zod.union([
  zod
    .object({
      type: zod.enum(['Mount']),
      name: zod.string(),
      species: zod.string(),
      speed: zod
        .number()
        .default(getResourceDataV1AutocrudPetResourceIdDataGetResponseOneSpeedDefault),
      stamina: zod
        .number()
        .default(getResourceDataV1AutocrudPetResourceIdDataGetResponseOneStaminaDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的坐騎系統示例'),
  zod
    .object({
      type: zod.enum(['Dog']),
      name: zod.string(),
      breed: zod.string(),
      level: zod
        .number()
        .default(getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoLevelDefault),
      hp: zod.number().default(getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoHpDefault),
      mp: zod.number().default(getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoMpDefault),
      attack: zod
        .number()
        .default(getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoAttackDefault),
      defense: zod
        .number()
        .default(getResourceDataV1AutocrudPetResourceIdDataGetResponseTwoDefenseDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的寵物系統示例'),
]);

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudPetResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `pet` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /pet/123` — full response (data + meta + revision_info)
- `GET /pet/123?returns=data` — data only
- `GET /pet/123?returns=data,meta` — data + meta, no revision_info
- `GET /pet/123?returns=meta` — metadata only
- `GET /pet/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get pet resource
 */
export const GetResourceV1AutocrudPetResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudPetResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudPetResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudPetResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudPetResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudPetResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudPetResourceIdGetResponseDataOneSpeedDefault = 10;
export const getResourceV1AutocrudPetResourceIdGetResponseDataOneStaminaDefault = 100;
export const getResourceV1AutocrudPetResourceIdGetResponseDataTwoLevelDefault = 1;
export const getResourceV1AutocrudPetResourceIdGetResponseDataTwoHpDefault = 100;
export const getResourceV1AutocrudPetResourceIdGetResponseDataTwoMpDefault = 50;
export const getResourceV1AutocrudPetResourceIdGetResponseDataTwoAttackDefault = 10;
export const getResourceV1AutocrudPetResourceIdGetResponseDataTwoDefenseDefault = 5;
export const getResourceV1AutocrudPetResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudPetResourceIdGetResponseRevisionInfoSchemaVersionDefault = null;
export const getResourceV1AutocrudPetResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudPetResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudPetResourceIdGetResponse = zod.object({
  data: zod
    .union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod
            .number()
            .default(getResourceV1AutocrudPetResourceIdGetResponseDataOneSpeedDefault),
          stamina: zod
            .number()
            .default(getResourceV1AutocrudPetResourceIdGetResponseDataOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod
            .number()
            .default(getResourceV1AutocrudPetResourceIdGetResponseDataTwoLevelDefault),
          hp: zod.number().default(getResourceV1AutocrudPetResourceIdGetResponseDataTwoHpDefault),
          mp: zod.number().default(getResourceV1AutocrudPetResourceIdGetResponseDataTwoMpDefault),
          attack: zod
            .number()
            .default(getResourceV1AutocrudPetResourceIdGetResponseDataTwoAttackDefault),
          defense: zod
            .number()
            .default(getResourceV1AutocrudPetResourceIdGetResponseDataTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ])
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetResourceIdGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetResourceIdGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudPetResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `pet` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `pet` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /pet/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update pet
 */
export const UpdateResourceV1AutocrudPetResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudPetResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudPetResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudPetResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudPetResourceIdPutBodyOneSpeedDefault = 10;
export const updateResourceV1AutocrudPetResourceIdPutBodyOneStaminaDefault = 100;
export const updateResourceV1AutocrudPetResourceIdPutBodyTwoLevelDefault = 1;
export const updateResourceV1AutocrudPetResourceIdPutBodyTwoHpDefault = 100;
export const updateResourceV1AutocrudPetResourceIdPutBodyTwoMpDefault = 50;
export const updateResourceV1AutocrudPetResourceIdPutBodyTwoAttackDefault = 10;
export const updateResourceV1AutocrudPetResourceIdPutBodyTwoDefenseDefault = 5;

export const UpdateResourceV1AutocrudPetResourceIdPutBody = zod.union([
  zod
    .object({
      type: zod.enum(['Mount']),
      name: zod.string(),
      species: zod.string(),
      speed: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyOneSpeedDefault),
      stamina: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyOneStaminaDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的坐騎系統示例'),
  zod
    .object({
      type: zod.enum(['Dog']),
      name: zod.string(),
      breed: zod.string(),
      level: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyTwoLevelDefault),
      hp: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyTwoHpDefault),
      mp: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyTwoMpDefault),
      attack: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyTwoAttackDefault),
      defense: zod.number().default(updateResourceV1AutocrudPetResourceIdPutBodyTwoDefenseDefault),
      owner_id: zod.string(),
    })
    .describe('遊戲中的寵物系統示例'),
]);

export const updateResourceV1AutocrudPetResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudPetResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudPetResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudPetResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudPetResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `pet` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /pet/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update pet
 */
export const PatchResourceV1AutocrudPetResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudPetResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudPetResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudPetResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudPetResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudPetResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudPetResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudPetResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudPetResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudPetResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudPetResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudPetResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `pet` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /pet/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete pet
 */
export const DeleteResourceV1AutocrudPetResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudPetResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudPetResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudPetResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudPetResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudPetResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `pet` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /pet/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch pet to specific revision
 */
export const SwitchRevisionV1AutocrudPetResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudPetResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudPetResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudPetResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudPetResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(switchRevisionV1AutocrudPetResourceIdSwitchRevisionIdPostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `pet` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete pet
 */
export const PermanentlyDeleteResourceV1AutocrudPetResourceIdPermanentlyDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const permanentlyDeleteResourceV1AutocrudPetResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudPetResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudPetResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudPetResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudPetResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `pet` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /pet/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted pet
 */
export const RestoreResourceV1AutocrudPetResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudPetResourceIdRestorePostResponseSchemaVersionDefault = null;
export const restoreResourceV1AutocrudPetResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudPetResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudPetResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudPetResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `pet` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /pet/restore?limit=100` — Restore up to 100 deleted resources
- `POST /pet/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted pet
 */
export const batchRestoreV1AutocrudPetRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudPetRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudPetRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudPetRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudPetRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudPetRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudPetRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudPetRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudPetRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudPetRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudPetRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchRestoreV1AutocrudPetRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudPetRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudPetRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudPetMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudPetMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudPetMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudPetMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudPetMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudPetMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudPetMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudPetMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudPetMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudPetMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudPetMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudPetMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudPetMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudPetMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudPetMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudPetMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `pet` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /pet/migrate/single/123` - Migrate resource 123
- `POST /pet/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /pet/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single pet Resource
 */
export const MigrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostParams = zod.object({
  resource_id: zod.string(),
});

export const migrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostQueryParams = zod.object({
  write_back: zod
    .boolean()
    .default(migrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostQueryWriteBackDefault)
    .describe('Whether to write migrated data back to storage'),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
});

export const migrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(migrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostResponseMessageDefault),
    error: zod
      .union([zod.string(), zod.null()])
      .default(migrateSingleResourceV1AutocrudPetMigrateSingleResourceIdPostResponseErrorDefault),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `pet-job` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /pet-job/data` - Get first 10 resources (data only)
- `GET /pet-job/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /pet-job/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /pet-job/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List pet-job Data Only
 */
export const listResourcesDataV1AutocrudPetJobDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudPetJobDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudPetJobDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudPetJobDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudPetJobDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudPetJobDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudPetJobDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadOneSpeedDefault = 10;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadOneStaminaDefault = 100;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoLevelDefault = 1;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoHpDefault = 100;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoMpDefault = 50;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoAttackDefault = 10;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoDefenseDefault = 5;
export const listResourcesDataV1AutocrudPetJobDataGetResponseStatusDefault = `pending`;
export const listResourcesDataV1AutocrudPetJobDataGetResponseErrmsgDefault = null;
export const listResourcesDataV1AutocrudPetJobDataGetResponseArtifactDefault = null;
export const listResourcesDataV1AutocrudPetJobDataGetResponseRetriesDefault = 0;
export const listResourcesDataV1AutocrudPetJobDataGetResponseMaxRetriesDefault = null;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicIntervalSecondsDefault = null;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicMaxRunsDefault = null;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicRunsDefault = 0;
export const listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesDataV1AutocrudPetJobDataGetResponseLastHeartbeatAtDefault = null;

export const ListResourcesDataV1AutocrudPetJobDataGetResponseItem = zod
  .object({
    payload: zod.union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadOneSpeedDefault),
          stamina: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoLevelDefault),
          hp: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoHpDefault),
          mp: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoMpDefault),
          attack: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoAttackDefault),
          defense: zod
            .number()
            .default(listResourcesDataV1AutocrudPetJobDataGetResponsePayloadTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ]),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponseStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponseErrmsgDefault),
    artifact: zod.null().default(listResourcesDataV1AutocrudPetJobDataGetResponseArtifactDefault),
    retries: zod.number().default(listResourcesDataV1AutocrudPetJobDataGetResponseRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponseMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicIntervalSecondsDefault),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponsePeriodicInitialDelaySecondsDefault),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudPetJobDataGetResponseLastHeartbeatAtDefault),
  })
  .describe(
    'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
  );
export const ListResourcesDataV1AutocrudPetJobDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudPetJobDataGetResponseItem,
);

/**
 * Retrieve a list of `pet-job` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /pet-job/meta` - Get metadata for first 10 resources
- `GET /pet-job/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /pet-job/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List pet-job Metadata Only
 */
export const listResourcesMetaV1AutocrudPetJobMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudPetJobMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudPetJobMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudPetJobMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudPetJobMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudPetJobMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudPetJobMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudPetJobMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudPetJobMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudPetJobMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudPetJobMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudPetJobMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudPetJobMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudPetJobMetaGetResponseItem,
);

/**
 * Retrieve a list of `pet-job` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /pet-job/revision-info` - Get current revision info for first 10 resources
- `GET /pet-job/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /pet-job/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List pet-job Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudPetJobRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /pet-job` instead. Retrieve a list of `pet-job` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List pet-job Complete Information
 */
export const listResourcesFullV1AutocrudPetJobFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudPetJobFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudPetJobFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudPetJobFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudPetJobFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudPetJobFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudPetJobFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudPetJobFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudPetJobFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadOneSpeedDefault = 10;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadOneStaminaDefault = 100;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoLevelDefault = 1;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoHpDefault = 100;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoMpDefault = 50;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoAttackDefault = 10;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoDefenseDefault = 5;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataStatusDefault = `pending`;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataErrmsgDefault = null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataArtifactDefault = null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataRetriesDefault = 0;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataMaxRetriesDefault = null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicMaxRunsDefault = null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseDataLastHeartbeatAtDefault = null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudPetJobFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudPetJobFullGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.union([
        zod
          .object({
            type: zod.enum(['Mount']),
            name: zod.string(),
            species: zod.string(),
            speed: zod
              .number()
              .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadOneSpeedDefault),
            stamina: zod
              .number()
              .default(
                listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadOneStaminaDefault,
              ),
            owner_id: zod.string(),
          })
          .describe('遊戲中的坐騎系統示例'),
        zod
          .object({
            type: zod.enum(['Dog']),
            name: zod.string(),
            breed: zod.string(),
            level: zod
              .number()
              .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoLevelDefault),
            hp: zod
              .number()
              .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoHpDefault),
            mp: zod
              .number()
              .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoMpDefault),
            attack: zod
              .number()
              .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoAttackDefault),
            defense: zod
              .number()
              .default(
                listResourcesFullV1AutocrudPetJobFullGetResponseDataPayloadTwoDefenseDefault,
              ),
            owner_id: zod.string(),
          })
          .describe('遊戲中的寵物系統示例'),
      ]),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataErrmsgDefault),
      artifact: zod
        .null()
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudPetJobFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseDataLastHeartbeatAtDefault),
    })
    .optional()
    .describe(
      'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudPetJobFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudPetJobFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudPetJobFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudPetJobFullGetResponseItem,
);

/**
 * Retrieve the count of `pet-job` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /pet-job/count` - Get total count of all resources
- `GET /pet-job/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count pet-job Resources
 */
export const getResourcesCountV1AutocrudPetJobCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudPetJobCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudPetJobCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudPetJobCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudPetJobCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudPetJobCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudPetJobCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudPetJobCountGetResponse = zod.number();

/**
 * Retrieve a list of `pet-job` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /pet-job` — full list (data + meta + revision_info)
- `GET /pet-job?returns=data` — data only
- `GET /pet-job?returns=data,meta` — data + meta, no revision_info
- `GET /pet-job?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List pet-job resources
 */
export const listResourcesV1AutocrudPetJobGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudPetJobGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudPetJobGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudPetJobGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudPetJobGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudPetJobGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudPetJobGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudPetJobGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudPetJobGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudPetJobGetResponseDataPayloadOneSpeedDefault = 10;
export const listResourcesV1AutocrudPetJobGetResponseDataPayloadOneStaminaDefault = 100;
export const listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoLevelDefault = 1;
export const listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoHpDefault = 100;
export const listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoMpDefault = 50;
export const listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoAttackDefault = 10;
export const listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoDefenseDefault = 5;
export const listResourcesV1AutocrudPetJobGetResponseDataStatusDefault = `pending`;
export const listResourcesV1AutocrudPetJobGetResponseDataErrmsgDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseDataArtifactDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseDataRetriesDefault = 0;
export const listResourcesV1AutocrudPetJobGetResponseDataMaxRetriesDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseDataPeriodicIntervalSecondsDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseDataPeriodicMaxRunsDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesV1AutocrudPetJobGetResponseDataPeriodicInitialDelaySecondsDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseDataLastHeartbeatAtDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudPetJobGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudPetJobGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.union([
        zod
          .object({
            type: zod.enum(['Mount']),
            name: zod.string(),
            species: zod.string(),
            speed: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadOneSpeedDefault),
            stamina: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadOneStaminaDefault),
            owner_id: zod.string(),
          })
          .describe('遊戲中的坐騎系統示例'),
        zod
          .object({
            type: zod.enum(['Dog']),
            name: zod.string(),
            breed: zod.string(),
            level: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoLevelDefault),
            hp: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoHpDefault),
            mp: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoMpDefault),
            attack: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoAttackDefault),
            defense: zod
              .number()
              .default(listResourcesV1AutocrudPetJobGetResponseDataPayloadTwoDefenseDefault),
            owner_id: zod.string(),
          })
          .describe('遊戲中的寵物系統示例'),
      ]),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesV1AutocrudPetJobGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseDataErrmsgDefault),
      artifact: zod.null().default(listResourcesV1AutocrudPetJobGetResponseDataArtifactDefault),
      retries: zod.number().default(listResourcesV1AutocrudPetJobGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseDataPeriodicIntervalSecondsDefault),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(listResourcesV1AutocrudPetJobGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseDataPeriodicInitialDelaySecondsDefault),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseDataLastHeartbeatAtDefault),
    })
    .optional()
    .describe(
      'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudPetJobGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudPetJobGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudPetJobGetResponse = zod.array(
  ListResourcesV1AutocrudPetJobGetResponseItem,
);

/**
 * Create a new `pet-job` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `pet-job` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /pet-job` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create pet-job
 */
export const createResourceV1AutocrudPetJobPostBodyPayloadOneSpeedDefault = 10;
export const createResourceV1AutocrudPetJobPostBodyPayloadOneStaminaDefault = 100;
export const createResourceV1AutocrudPetJobPostBodyPayloadTwoLevelDefault = 1;
export const createResourceV1AutocrudPetJobPostBodyPayloadTwoHpDefault = 100;
export const createResourceV1AutocrudPetJobPostBodyPayloadTwoMpDefault = 50;
export const createResourceV1AutocrudPetJobPostBodyPayloadTwoAttackDefault = 10;
export const createResourceV1AutocrudPetJobPostBodyPayloadTwoDefenseDefault = 5;
export const createResourceV1AutocrudPetJobPostBodyStatusDefault = `pending`;
export const createResourceV1AutocrudPetJobPostBodyErrmsgDefault = null;
export const createResourceV1AutocrudPetJobPostBodyArtifactDefault = null;
export const createResourceV1AutocrudPetJobPostBodyRetriesDefault = 0;
export const createResourceV1AutocrudPetJobPostBodyMaxRetriesDefault = null;
export const createResourceV1AutocrudPetJobPostBodyPeriodicIntervalSecondsDefault = null;
export const createResourceV1AutocrudPetJobPostBodyPeriodicMaxRunsDefault = null;
export const createResourceV1AutocrudPetJobPostBodyPeriodicRunsDefault = 0;
export const createResourceV1AutocrudPetJobPostBodyPeriodicInitialDelaySecondsDefault = null;
export const createResourceV1AutocrudPetJobPostBodyLastHeartbeatAtDefault = null;

export const CreateResourceV1AutocrudPetJobPostBody = zod
  .object({
    payload: zod.union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod.number().default(createResourceV1AutocrudPetJobPostBodyPayloadOneSpeedDefault),
          stamina: zod
            .number()
            .default(createResourceV1AutocrudPetJobPostBodyPayloadOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod.number().default(createResourceV1AutocrudPetJobPostBodyPayloadTwoLevelDefault),
          hp: zod.number().default(createResourceV1AutocrudPetJobPostBodyPayloadTwoHpDefault),
          mp: zod.number().default(createResourceV1AutocrudPetJobPostBodyPayloadTwoMpDefault),
          attack: zod
            .number()
            .default(createResourceV1AutocrudPetJobPostBodyPayloadTwoAttackDefault),
          defense: zod
            .number()
            .default(createResourceV1AutocrudPetJobPostBodyPayloadTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ]),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(createResourceV1AutocrudPetJobPostBodyStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostBodyErrmsgDefault),
    artifact: zod.null().default(createResourceV1AutocrudPetJobPostBodyArtifactDefault),
    retries: zod.number().default(createResourceV1AutocrudPetJobPostBodyRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostBodyMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostBodyPeriodicIntervalSecondsDefault),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostBodyPeriodicMaxRunsDefault),
    periodic_runs: zod.number().default(createResourceV1AutocrudPetJobPostBodyPeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostBodyPeriodicInitialDelaySecondsDefault),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostBodyLastHeartbeatAtDefault),
  })
  .describe(
    'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
  );

export const createResourceV1AutocrudPetJobPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudPetJobPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudPetJobPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudPetJobPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `pet-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /pet-job?limit=100` — Delete up to 100 resources
- `DELETE /pet-job?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete pet-job
 */
export const batchDeleteV1AutocrudPetJobDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudPetJobDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudPetJobDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudPetJobDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudPetJobDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudPetJobDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudPetJobDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudPetJobDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudPetJobDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudPetJobDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudPetJobDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudPetJobDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudPetJobDeleteResponse = zod.array(
  BatchDeleteV1AutocrudPetJobDeleteResponseItem,
);

/**
 * Export all (or filtered) **pet-job** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export pet-job data
 */
export const exportModelV1AutocrudPetJobExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudPetJobExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudPetJobExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudPetJobExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudPetJobExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudPetJobExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudPetJobExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudPetJobExportGetResponse = zod.unknown();

/**
 * Import **pet-job** resources from a ``.acbak`` archive.

The archive must contain a **pet-job** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import pet-job data
 */
export const importModelV1AutocrudPetJobImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudPetJobImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudPetJobImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudPetJobImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudPetJobImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /pet-job/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get pet-job Meta by ID
 */
export const GetResourceMetaV1AutocrudPetJobResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudPetJobResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudPetJobResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudPetJobResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudPetJobResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudPetJobResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudPetJobResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudPetJobResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudPetJobResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `pet-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /pet-job/123/revision-info` - Get current revision info
- `GET /pet-job/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get pet-job Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetParams = zod.object({
  resource_id: zod.string(),
});

export const GetResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudPetJobResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /pet-job/{resource_id}` instead.

Retrieve complete information for a `pet-job` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete pet-job Information
 */
export const GetResourceFullV1AutocrudPetJobResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudPetJobResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudPetJobResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudPetJobResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudPetJobResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadOneSpeedDefault = 10;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadOneStaminaDefault = 100;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoLevelDefault = 1;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoHpDefault = 100;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoMpDefault = 50;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoAttackDefault = 10;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoDefenseDefault = 5;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataStatusDefault = `pending`;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataErrmsgDefault = null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataArtifactDefault = null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataRetriesDefault = 0;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataMaxRetriesDefault = null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicRunsDefault = 0;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudPetJobResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudPetJobResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.union([
        zod
          .object({
            type: zod.enum(['Mount']),
            name: zod.string(),
            species: zod.string(),
            speed: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadOneSpeedDefault,
              ),
            stamina: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadOneStaminaDefault,
              ),
            owner_id: zod.string(),
          })
          .describe('遊戲中的坐騎系統示例'),
        zod
          .object({
            type: zod.enum(['Dog']),
            name: zod.string(),
            breed: zod.string(),
            level: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoLevelDefault,
              ),
            hp: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoHpDefault,
              ),
            mp: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoMpDefault,
              ),
            attack: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoAttackDefault,
              ),
            defense: zod
              .number()
              .default(
                getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPayloadTwoDefenseDefault,
              ),
            owner_id: zod.string(),
          })
          .describe('遊戲中的寵物系統示例'),
      ]),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataErrmsgDefault),
      artifact: zod
        .null()
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetJobResourceIdFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional()
    .describe(
      'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetJobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudPetJobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudPetJobResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `pet-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /pet-job/123/revision-list` - Get all revisions for resource 123
- `GET /pet-job/123/revision-list?limit=10&offset=20`
- `GET /pet-job/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /pet-job/123/revision-list?from_revision_id=rev123`
- `GET /pet-job/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get pet-job Revision History
 */
export const GetResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryLimitDefault),
    offset: zod
      .number()
      .default(getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryOffsetDefault),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponse = zod.object({
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
  revisions: zod.array(
    zod
      .object({
        uid: zod.uuid(),
        resource_id: zod.string(),
        revision_id: zod.string(),
        parent_revision_id: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
          ),
        parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
          ),
        data_hash: zod.string().optional(),
        status: zod.enum(['draft', 'stable']),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
      })
      .describe(
        'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
      ),
  ),
  total: zod
    .number()
    .default(getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseTotalDefault),
  has_more: zod
    .boolean()
    .default(
      getResourceRevisionListV1AutocrudPetJobResourceIdRevisionListGetResponseHasMoreDefault,
    ),
});

/**
 * Retrieve only the data content of a `pet-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /pet-job/123/data` - Get current resource data only
- `GET /pet-job/123/data?revision_id=rev456` - Get specific revision data only
- `GET /pet-job/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get pet-job Data
 */
export const GetResourceDataV1AutocrudPetJobResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudPetJobResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudPetJobResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudPetJobResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadOneSpeedDefault = 10;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadOneStaminaDefault = 100;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoLevelDefault = 1;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoHpDefault = 100;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoMpDefault = 50;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoAttackDefault = 10;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoDefenseDefault = 5;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponseStatusDefault = `pending`;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponseErrmsgDefault = null;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponseArtifactDefault = null;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponseRetriesDefault = 0;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponseMaxRetriesDefault = null;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicMaxRunsDefault = null;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicRunsDefault = 0;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const getResourceDataV1AutocrudPetJobResourceIdDataGetResponseLastHeartbeatAtDefault = null;

export const GetResourceDataV1AutocrudPetJobResourceIdDataGetResponse = zod
  .object({
    payload: zod.union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod
            .number()
            .default(
              getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadOneSpeedDefault,
            ),
          stamina: zod
            .number()
            .default(
              getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadOneStaminaDefault,
            ),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod
            .number()
            .default(
              getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoLevelDefault,
            ),
          hp: zod
            .number()
            .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoHpDefault),
          mp: zod
            .number()
            .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoMpDefault),
          attack: zod
            .number()
            .default(
              getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoAttackDefault,
            ),
          defense: zod
            .number()
            .default(
              getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePayloadTwoDefenseDefault,
            ),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ]),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponseStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponseErrmsgDefault),
    artifact: zod
      .null()
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponseArtifactDefault),
    retries: zod
      .number()
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponseRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponseMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(
        getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicIntervalSecondsDefault,
      ),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(
        getResourceDataV1AutocrudPetJobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault,
      ),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudPetJobResourceIdDataGetResponseLastHeartbeatAtDefault),
  })
  .describe(
    'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
  );

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudPetJobResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `pet-job` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /pet-job/123` — full response (data + meta + revision_info)
- `GET /pet-job/123?returns=data` — data only
- `GET /pet-job/123?returns=data,meta` — data + meta, no revision_info
- `GET /pet-job/123?returns=meta` — metadata only
- `GET /pet-job/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get pet-job resource
 */
export const GetResourceV1AutocrudPetJobResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudPetJobResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudPetJobResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudPetJobResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudPetJobResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudPetJobResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadOneSpeedDefault = 10;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadOneStaminaDefault = 100;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoLevelDefault = 1;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoHpDefault = 100;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoMpDefault = 50;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoAttackDefault = 10;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoDefenseDefault = 5;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataStatusDefault = `pending`;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataErrmsgDefault = null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataArtifactDefault = null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataRetriesDefault = 0;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataMaxRetriesDefault = null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicMaxRunsDefault = null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicRunsDefault = 0;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseDataLastHeartbeatAtDefault = null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudPetJobResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudPetJobResourceIdGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.union([
        zod
          .object({
            type: zod.enum(['Mount']),
            name: zod.string(),
            species: zod.string(),
            speed: zod
              .number()
              .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadOneSpeedDefault),
            stamina: zod
              .number()
              .default(
                getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadOneStaminaDefault,
              ),
            owner_id: zod.string(),
          })
          .describe('遊戲中的坐騎系統示例'),
        zod
          .object({
            type: zod.enum(['Dog']),
            name: zod.string(),
            breed: zod.string(),
            level: zod
              .number()
              .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoLevelDefault),
            hp: zod
              .number()
              .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoHpDefault),
            mp: zod
              .number()
              .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoMpDefault),
            attack: zod
              .number()
              .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoAttackDefault),
            defense: zod
              .number()
              .default(
                getResourceV1AutocrudPetJobResourceIdGetResponseDataPayloadTwoDefenseDefault,
              ),
            owner_id: zod.string(),
          })
          .describe('遊戲中的寵物系統示例'),
      ]),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataErrmsgDefault),
      artifact: zod
        .null()
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudPetJobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseDataLastHeartbeatAtDefault),
    })
    .optional()
    .describe(
      'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudPetJobResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudPetJobResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `pet-job` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `pet-job` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /pet-job/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update pet-job
 */
export const UpdateResourceV1AutocrudPetJobResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudPetJobResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudPetJobResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudPetJobResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadOneSpeedDefault = 10;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadOneStaminaDefault = 100;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoLevelDefault = 1;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoHpDefault = 100;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoMpDefault = 50;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoAttackDefault = 10;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoDefenseDefault = 5;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyStatusDefault = `pending`;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyErrmsgDefault = null;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyArtifactDefault = null;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyRetriesDefault = 0;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyMaxRetriesDefault = null;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicIntervalSecondsDefault = null;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicMaxRunsDefault = null;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicRunsDefault = 0;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicInitialDelaySecondsDefault =
  null;
export const updateResourceV1AutocrudPetJobResourceIdPutBodyLastHeartbeatAtDefault = null;

export const UpdateResourceV1AutocrudPetJobResourceIdPutBody = zod
  .object({
    payload: zod.union([
      zod
        .object({
          type: zod.enum(['Mount']),
          name: zod.string(),
          species: zod.string(),
          speed: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadOneSpeedDefault),
          stamina: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadOneStaminaDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的坐騎系統示例'),
      zod
        .object({
          type: zod.enum(['Dog']),
          name: zod.string(),
          breed: zod.string(),
          level: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoLevelDefault),
          hp: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoHpDefault),
          mp: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoMpDefault),
          attack: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoAttackDefault),
          defense: zod
            .number()
            .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPayloadTwoDefenseDefault),
          owner_id: zod.string(),
        })
        .describe('遊戲中的寵物系統示例'),
    ]),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyErrmsgDefault),
    artifact: zod.null().default(updateResourceV1AutocrudPetJobResourceIdPutBodyArtifactDefault),
    retries: zod.number().default(updateResourceV1AutocrudPetJobResourceIdPutBodyRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicIntervalSecondsDefault),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyPeriodicInitialDelaySecondsDefault),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutBodyLastHeartbeatAtDefault),
  })
  .describe(
    'A job wrapping a payload ``T`` with optional artifact type ``D``.\n\nThe second type parameter ``D`` defaults to ``None`` so existing\n``Job[T]`` usage is fully backward-compatible.\n\nAttributes:\n    payload: The input data for the job.\n    status: Current processing status.\n    errmsg: Error or result message after processing.\n    artifact: Optional typed output produced by the job handler.\n    retries: Number of times the job has been retried.',
  );

export const updateResourceV1AutocrudPetJobResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudPetJobResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudPetJobResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudPetJobResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `pet-job` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /pet-job/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update pet-job
 */
export const PatchResourceV1AutocrudPetJobResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudPetJobResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudPetJobResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudPetJobResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudPetJobResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudPetJobResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudPetJobResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudPetJobResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudPetJobResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudPetJobResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudPetJobResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudPetJobResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `pet-job` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /pet-job/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete pet-job
 */
export const DeleteResourceV1AutocrudPetJobResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudPetJobResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudPetJobResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudPetJobResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudPetJobResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudPetJobResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `pet-job` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /pet-job/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch pet-job to specific revision
 */
export const SwitchRevisionV1AutocrudPetJobResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudPetJobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudPetJobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudPetJobResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudPetJobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        switchRevisionV1AutocrudPetJobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `pet-job` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete pet-job
 */
export const PermanentlyDeleteResourceV1AutocrudPetJobResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudPetJobResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudPetJobResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudPetJobResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudPetJobResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudPetJobResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `pet-job` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /pet-job/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted pet-job
 */
export const RestoreResourceV1AutocrudPetJobResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudPetJobResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudPetJobResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudPetJobResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudPetJobResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudPetJobResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `pet-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /pet-job/restore?limit=100` — Restore up to 100 deleted resources
- `POST /pet-job/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted pet-job
 */
export const batchRestoreV1AutocrudPetJobRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudPetJobRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudPetJobRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudPetJobRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudPetJobRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudPetJobRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudPetJobRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudPetJobRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudPetJobRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudPetJobRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudPetJobRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudPetJobRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudPetJobRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudPetJobRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudPetJobMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudPetJobMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudPetJobMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudPetJobMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `pet-job` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /pet-job/migrate/single/123` - Migrate resource 123
- `POST /pet-job/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /pet-job/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single pet-job Resource
 */
export const MigrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostParams = zod.object({
  resource_id: zod.string(),
});

export const migrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudPetJobMigrateSingleResourceIdPostResponseErrorDefault,
      ),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `quest` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /quest/data` - Get first 10 resources (data only)
- `GET /quest/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /quest/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /quest/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List quest Data Only
 */
export const listResourcesDataV1AutocrudQuestDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudQuestDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudQuestDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudQuestDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudQuestDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudQuestDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudQuestDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudQuestDataGetResponseDescriptionDefault = ``;
export const listResourcesDataV1AutocrudQuestDataGetResponseLevelRequirementDefault = 1;
export const listResourcesDataV1AutocrudQuestDataGetResponseDifficultyDefault = `normal`;
export const listResourcesDataV1AutocrudQuestDataGetResponseQuestConfigDefault = {};
export const listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemOneQuantityDefault = 1;
export const listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemOneExtraPropertiesDefault =
  {};
export const listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemTwoAmountDefault = 100;
export const listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemThreeExpDefault = 100;
export const listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemThreeBonusConfigDefault = {};
export const listResourcesDataV1AutocrudQuestDataGetResponseRewardsDefault = [];

export const ListResourcesDataV1AutocrudQuestDataGetResponseItem = zod
  .object({
    title: zod.string(),
    description: zod
      .string()
      .default(listResourcesDataV1AutocrudQuestDataGetResponseDescriptionDefault),
    level_requirement: zod
      .number()
      .default(listResourcesDataV1AutocrudQuestDataGetResponseLevelRequirementDefault),
    difficulty: zod
      .string()
      .default(listResourcesDataV1AutocrudQuestDataGetResponseDifficultyDefault),
    quest_config: zod
      .looseObject({})
      .default(listResourcesDataV1AutocrudQuestDataGetResponseQuestConfigDefault),
    rewards: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['QuestRewardItem']),
              item_name: zod.string(),
              quantity: zod
                .number()
                .default(
                  listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemOneQuantityDefault,
                ),
              extra_properties: zod
                .looseObject({})
                .default(
                  listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemOneExtraPropertiesDefault,
                ),
            })
            .describe(
              '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
          zod
            .object({
              type: zod.enum(['QuestRewardGold']),
              amount: zod
                .number()
                .default(
                  listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemTwoAmountDefault,
                ),
            })
            .describe('任務獎勵：金幣'),
          zod
            .object({
              type: zod.enum(['QuestRewardExp']),
              exp: zod
                .number()
                .default(listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemThreeExpDefault),
              bonus_config: zod
                .looseObject({})
                .default(
                  listResourcesDataV1AutocrudQuestDataGetResponseRewardsItemThreeBonusConfigDefault,
                ),
            })
            .describe(
              '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
        ]),
      )
      .default(listResourcesDataV1AutocrudQuestDataGetResponseRewardsDefault),
  })
  .describe(
    '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
  );
export const ListResourcesDataV1AutocrudQuestDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudQuestDataGetResponseItem,
);

/**
 * Retrieve a list of `quest` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /quest/meta` - Get metadata for first 10 resources
- `GET /quest/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /quest/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List quest Metadata Only
 */
export const listResourcesMetaV1AutocrudQuestMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudQuestMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudQuestMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudQuestMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudQuestMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudQuestMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudQuestMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudQuestMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudQuestMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudQuestMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudQuestMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudQuestMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudQuestMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudQuestMetaGetResponseItem,
);

/**
 * Retrieve a list of `quest` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /quest/revision-info` - Get current revision info for first 10 resources
- `GET /quest/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /quest/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List quest Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudQuestRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /quest` instead. Retrieve a list of `quest` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List quest Complete Information
 */
export const listResourcesFullV1AutocrudQuestFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudQuestFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudQuestFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudQuestFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudQuestFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudQuestFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudQuestFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudQuestFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudQuestFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudQuestFullGetResponseDataDescriptionDefault = ``;
export const listResourcesFullV1AutocrudQuestFullGetResponseDataLevelRequirementDefault = 1;
export const listResourcesFullV1AutocrudQuestFullGetResponseDataDifficultyDefault = `normal`;
export const listResourcesFullV1AutocrudQuestFullGetResponseDataQuestConfigDefault = {};
export const listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemOneQuantityDefault = 1;
export const listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemOneExtraPropertiesDefault =
  {};
export const listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemTwoAmountDefault = 100;
export const listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemThreeExpDefault = 100;
export const listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemThreeBonusConfigDefault =
  {};
export const listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsDefault = [];
export const listResourcesFullV1AutocrudQuestFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudQuestFullGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudQuestFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudQuestFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudQuestFullGetResponseItem = zod.object({
  data: zod
    .object({
      title: zod.string(),
      description: zod
        .string()
        .default(listResourcesFullV1AutocrudQuestFullGetResponseDataDescriptionDefault),
      level_requirement: zod
        .number()
        .default(listResourcesFullV1AutocrudQuestFullGetResponseDataLevelRequirementDefault),
      difficulty: zod
        .string()
        .default(listResourcesFullV1AutocrudQuestFullGetResponseDataDifficultyDefault),
      quest_config: zod
        .looseObject({})
        .default(listResourcesFullV1AutocrudQuestFullGetResponseDataQuestConfigDefault),
      rewards: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['QuestRewardItem']),
                item_name: zod.string(),
                quantity: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemOneQuantityDefault,
                  ),
                extra_properties: zod
                  .looseObject({})
                  .default(
                    listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemOneExtraPropertiesDefault,
                  ),
              })
              .describe(
                '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
            zod
              .object({
                type: zod.enum(['QuestRewardGold']),
                amount: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemTwoAmountDefault,
                  ),
              })
              .describe('任務獎勵：金幣'),
            zod
              .object({
                type: zod.enum(['QuestRewardExp']),
                exp: zod
                  .number()
                  .default(
                    listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemThreeExpDefault,
                  ),
                bonus_config: zod
                  .looseObject({})
                  .default(
                    listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsItemThreeBonusConfigDefault,
                  ),
              })
              .describe(
                '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
          ]),
        )
        .default(listResourcesFullV1AutocrudQuestFullGetResponseDataRewardsDefault),
    })
    .optional()
    .describe(
      '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudQuestFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudQuestFullGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudQuestFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudQuestFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudQuestFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudQuestFullGetResponseItem,
);

/**
 * Retrieve the count of `quest` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /quest/count` - Get total count of all resources
- `GET /quest/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count quest Resources
 */
export const getResourcesCountV1AutocrudQuestCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudQuestCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudQuestCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudQuestCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudQuestCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudQuestCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudQuestCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudQuestCountGetResponse = zod.number();

/**
 * Retrieve a list of `quest` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /quest` — full list (data + meta + revision_info)
- `GET /quest?returns=data` — data only
- `GET /quest?returns=data,meta` — data + meta, no revision_info
- `GET /quest?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List quest resources
 */
export const listResourcesV1AutocrudQuestGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudQuestGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudQuestGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudQuestGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudQuestGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudQuestGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudQuestGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudQuestGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudQuestGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudQuestGetResponseDataDescriptionDefault = ``;
export const listResourcesV1AutocrudQuestGetResponseDataLevelRequirementDefault = 1;
export const listResourcesV1AutocrudQuestGetResponseDataDifficultyDefault = `normal`;
export const listResourcesV1AutocrudQuestGetResponseDataQuestConfigDefault = {};
export const listResourcesV1AutocrudQuestGetResponseDataRewardsItemOneQuantityDefault = 1;
export const listResourcesV1AutocrudQuestGetResponseDataRewardsItemOneExtraPropertiesDefault = {};
export const listResourcesV1AutocrudQuestGetResponseDataRewardsItemTwoAmountDefault = 100;
export const listResourcesV1AutocrudQuestGetResponseDataRewardsItemThreeExpDefault = 100;
export const listResourcesV1AutocrudQuestGetResponseDataRewardsItemThreeBonusConfigDefault = {};
export const listResourcesV1AutocrudQuestGetResponseDataRewardsDefault = [];
export const listResourcesV1AutocrudQuestGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudQuestGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudQuestGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudQuestGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudQuestGetResponseItem = zod.object({
  data: zod
    .object({
      title: zod.string(),
      description: zod
        .string()
        .default(listResourcesV1AutocrudQuestGetResponseDataDescriptionDefault),
      level_requirement: zod
        .number()
        .default(listResourcesV1AutocrudQuestGetResponseDataLevelRequirementDefault),
      difficulty: zod
        .string()
        .default(listResourcesV1AutocrudQuestGetResponseDataDifficultyDefault),
      quest_config: zod
        .looseObject({})
        .default(listResourcesV1AutocrudQuestGetResponseDataQuestConfigDefault),
      rewards: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['QuestRewardItem']),
                item_name: zod.string(),
                quantity: zod
                  .number()
                  .default(
                    listResourcesV1AutocrudQuestGetResponseDataRewardsItemOneQuantityDefault,
                  ),
                extra_properties: zod
                  .looseObject({})
                  .default(
                    listResourcesV1AutocrudQuestGetResponseDataRewardsItemOneExtraPropertiesDefault,
                  ),
              })
              .describe(
                '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
            zod
              .object({
                type: zod.enum(['QuestRewardGold']),
                amount: zod
                  .number()
                  .default(listResourcesV1AutocrudQuestGetResponseDataRewardsItemTwoAmountDefault),
              })
              .describe('任務獎勵：金幣'),
            zod
              .object({
                type: zod.enum(['QuestRewardExp']),
                exp: zod
                  .number()
                  .default(listResourcesV1AutocrudQuestGetResponseDataRewardsItemThreeExpDefault),
                bonus_config: zod
                  .looseObject({})
                  .default(
                    listResourcesV1AutocrudQuestGetResponseDataRewardsItemThreeBonusConfigDefault,
                  ),
              })
              .describe(
                '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
          ]),
        )
        .default(listResourcesV1AutocrudQuestGetResponseDataRewardsDefault),
    })
    .optional()
    .describe(
      '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudQuestGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudQuestGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudQuestGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudQuestGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudQuestGetResponse = zod.array(
  ListResourcesV1AutocrudQuestGetResponseItem,
);

/**
 * Create a new `quest` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `quest` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /quest` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create quest
 */
export const createResourceV1AutocrudQuestPostBodyDescriptionDefault = ``;
export const createResourceV1AutocrudQuestPostBodyLevelRequirementDefault = 1;
export const createResourceV1AutocrudQuestPostBodyDifficultyDefault = `normal`;
export const createResourceV1AutocrudQuestPostBodyQuestConfigDefault = {};
export const createResourceV1AutocrudQuestPostBodyRewardsItemOneQuantityDefault = 1;
export const createResourceV1AutocrudQuestPostBodyRewardsItemOneExtraPropertiesDefault = {};
export const createResourceV1AutocrudQuestPostBodyRewardsItemTwoAmountDefault = 100;
export const createResourceV1AutocrudQuestPostBodyRewardsItemThreeExpDefault = 100;
export const createResourceV1AutocrudQuestPostBodyRewardsItemThreeBonusConfigDefault = {};
export const createResourceV1AutocrudQuestPostBodyRewardsDefault = [];

export const CreateResourceV1AutocrudQuestPostBody = zod
  .object({
    title: zod.string(),
    description: zod.string().default(createResourceV1AutocrudQuestPostBodyDescriptionDefault),
    level_requirement: zod
      .number()
      .default(createResourceV1AutocrudQuestPostBodyLevelRequirementDefault),
    difficulty: zod.string().default(createResourceV1AutocrudQuestPostBodyDifficultyDefault),
    quest_config: zod
      .looseObject({})
      .default(createResourceV1AutocrudQuestPostBodyQuestConfigDefault),
    rewards: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['QuestRewardItem']),
              item_name: zod.string(),
              quantity: zod
                .number()
                .default(createResourceV1AutocrudQuestPostBodyRewardsItemOneQuantityDefault),
              extra_properties: zod
                .looseObject({})
                .default(createResourceV1AutocrudQuestPostBodyRewardsItemOneExtraPropertiesDefault),
            })
            .describe(
              '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
          zod
            .object({
              type: zod.enum(['QuestRewardGold']),
              amount: zod
                .number()
                .default(createResourceV1AutocrudQuestPostBodyRewardsItemTwoAmountDefault),
            })
            .describe('任務獎勵：金幣'),
          zod
            .object({
              type: zod.enum(['QuestRewardExp']),
              exp: zod
                .number()
                .default(createResourceV1AutocrudQuestPostBodyRewardsItemThreeExpDefault),
              bonus_config: zod
                .looseObject({})
                .default(createResourceV1AutocrudQuestPostBodyRewardsItemThreeBonusConfigDefault),
            })
            .describe(
              '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
        ]),
      )
      .default(createResourceV1AutocrudQuestPostBodyRewardsDefault),
  })
  .describe(
    '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
  );

export const createResourceV1AutocrudQuestPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudQuestPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudQuestPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudQuestPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudQuestPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `quest` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /quest?limit=100` — Delete up to 100 resources
- `DELETE /quest?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete quest
 */
export const batchDeleteV1AutocrudQuestDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudQuestDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudQuestDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudQuestDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudQuestDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudQuestDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudQuestDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudQuestDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudQuestDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudQuestDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudQuestDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudQuestDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudQuestDeleteResponse = zod.array(
  BatchDeleteV1AutocrudQuestDeleteResponseItem,
);

/**
 * Export all (or filtered) **quest** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export quest data
 */
export const exportModelV1AutocrudQuestExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudQuestExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudQuestExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudQuestExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudQuestExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudQuestExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudQuestExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudQuestExportGetResponse = zod.unknown();

/**
 * Import **quest** resources from a ``.acbak`` archive.

The archive must contain a **quest** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import quest data
 */
export const importModelV1AutocrudQuestImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudQuestImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudQuestImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudQuestImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudQuestImportPostResponse = zod.record(zod.string(), zod.unknown());

/**
 * Deprecated: use `GET /quest/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get quest Meta by ID
 */
export const GetResourceMetaV1AutocrudQuestResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudQuestResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudQuestResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudQuestResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudQuestResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudQuestResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudQuestResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudQuestResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudQuestResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `quest` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /quest/123/revision-info` - Get current revision info
- `GET /quest/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get quest Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetParams = zod.object({
  resource_id: zod.string(),
});

export const GetResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudQuestResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /quest/{resource_id}` instead.

Retrieve complete information for a `quest` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete quest Information
 */
export const GetResourceFullV1AutocrudQuestResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudQuestResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudQuestResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudQuestResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudQuestResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudQuestResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataDescriptionDefault = ``;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataLevelRequirementDefault = 1;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataDifficultyDefault = `normal`;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataQuestConfigDefault = {};
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemOneQuantityDefault = 1;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemOneExtraPropertiesDefault =
  {};
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemTwoAmountDefault = 100;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemThreeExpDefault = 100;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemThreeBonusConfigDefault =
  {};
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsDefault = [];
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseMetaSchemaVersionDefault = null;
export const getResourceFullV1AutocrudQuestResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudQuestResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      title: zod.string(),
      description: zod
        .string()
        .default(getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataDescriptionDefault),
      level_requirement: zod
        .number()
        .default(
          getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataLevelRequirementDefault,
        ),
      difficulty: zod
        .string()
        .default(getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataDifficultyDefault),
      quest_config: zod
        .looseObject({})
        .default(getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataQuestConfigDefault),
      rewards: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['QuestRewardItem']),
                item_name: zod.string(),
                quantity: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemOneQuantityDefault,
                  ),
                extra_properties: zod
                  .looseObject({})
                  .default(
                    getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemOneExtraPropertiesDefault,
                  ),
              })
              .describe(
                '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
            zod
              .object({
                type: zod.enum(['QuestRewardGold']),
                amount: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemTwoAmountDefault,
                  ),
              })
              .describe('任務獎勵：金幣'),
            zod
              .object({
                type: zod.enum(['QuestRewardExp']),
                exp: zod
                  .number()
                  .default(
                    getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemThreeExpDefault,
                  ),
                bonus_config: zod
                  .looseObject({})
                  .default(
                    getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsItemThreeBonusConfigDefault,
                  ),
              })
              .describe(
                '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
          ]),
        )
        .default(getResourceFullV1AutocrudQuestResourceIdFullGetResponseDataRewardsDefault),
    })
    .optional()
    .describe(
      '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudQuestResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudQuestResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudQuestResourceIdFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudQuestResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `quest` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /quest/123/revision-list` - Get all revisions for resource 123
- `GET /quest/123/revision-list?limit=10&offset=20`
- `GET /quest/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /quest/123/revision-list?from_revision_id=rev123`
- `GET /quest/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get quest Revision History
 */
export const GetResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryLimitDefault),
    offset: zod
      .number()
      .default(getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryOffsetDefault),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponse = zod.object({
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
  revisions: zod.array(
    zod
      .object({
        uid: zod.uuid(),
        resource_id: zod.string(),
        revision_id: zod.string(),
        parent_revision_id: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
          ),
        parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
          ),
        data_hash: zod.string().optional(),
        status: zod.enum(['draft', 'stable']),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
      })
      .describe(
        'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
      ),
  ),
  total: zod
    .number()
    .default(getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseTotalDefault),
  has_more: zod
    .boolean()
    .default(getResourceRevisionListV1AutocrudQuestResourceIdRevisionListGetResponseHasMoreDefault),
});

/**
 * Retrieve only the data content of a `quest` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /quest/123/data` - Get current resource data only
- `GET /quest/123/data?revision_id=rev456` - Get specific revision data only
- `GET /quest/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get quest Data
 */
export const GetResourceDataV1AutocrudQuestResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudQuestResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudQuestResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudQuestResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseDescriptionDefault = ``;
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseLevelRequirementDefault = 1;
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseDifficultyDefault = `normal`;
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseQuestConfigDefault = {};
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemOneQuantityDefault = 1;
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemOneExtraPropertiesDefault =
  {};
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemTwoAmountDefault = 100;
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemThreeExpDefault = 100;
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemThreeBonusConfigDefault =
  {};
export const getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsDefault = [];

export const GetResourceDataV1AutocrudQuestResourceIdDataGetResponse = zod
  .object({
    title: zod.string(),
    description: zod
      .string()
      .default(getResourceDataV1AutocrudQuestResourceIdDataGetResponseDescriptionDefault),
    level_requirement: zod
      .number()
      .default(getResourceDataV1AutocrudQuestResourceIdDataGetResponseLevelRequirementDefault),
    difficulty: zod
      .string()
      .default(getResourceDataV1AutocrudQuestResourceIdDataGetResponseDifficultyDefault),
    quest_config: zod
      .looseObject({})
      .default(getResourceDataV1AutocrudQuestResourceIdDataGetResponseQuestConfigDefault),
    rewards: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['QuestRewardItem']),
              item_name: zod.string(),
              quantity: zod
                .number()
                .default(
                  getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemOneQuantityDefault,
                ),
              extra_properties: zod
                .looseObject({})
                .default(
                  getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemOneExtraPropertiesDefault,
                ),
            })
            .describe(
              '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
          zod
            .object({
              type: zod.enum(['QuestRewardGold']),
              amount: zod
                .number()
                .default(
                  getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemTwoAmountDefault,
                ),
            })
            .describe('任務獎勵：金幣'),
          zod
            .object({
              type: zod.enum(['QuestRewardExp']),
              exp: zod
                .number()
                .default(
                  getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemThreeExpDefault,
                ),
              bonus_config: zod
                .looseObject({})
                .default(
                  getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsItemThreeBonusConfigDefault,
                ),
            })
            .describe(
              '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
        ]),
      )
      .default(getResourceDataV1AutocrudQuestResourceIdDataGetResponseRewardsDefault),
  })
  .describe(
    '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
  );

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudQuestResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `quest` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /quest/123` — full response (data + meta + revision_info)
- `GET /quest/123?returns=data` — data only
- `GET /quest/123?returns=data,meta` — data + meta, no revision_info
- `GET /quest/123?returns=meta` — metadata only
- `GET /quest/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get quest resource
 */
export const GetResourceV1AutocrudQuestResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudQuestResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudQuestResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudQuestResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudQuestResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudQuestResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudQuestResourceIdGetResponseDataDescriptionDefault = ``;
export const getResourceV1AutocrudQuestResourceIdGetResponseDataLevelRequirementDefault = 1;
export const getResourceV1AutocrudQuestResourceIdGetResponseDataDifficultyDefault = `normal`;
export const getResourceV1AutocrudQuestResourceIdGetResponseDataQuestConfigDefault = {};
export const getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemOneQuantityDefault = 1;
export const getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemOneExtraPropertiesDefault =
  {};
export const getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemTwoAmountDefault = 100;
export const getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemThreeExpDefault = 100;
export const getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemThreeBonusConfigDefault =
  {};
export const getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsDefault = [];
export const getResourceV1AutocrudQuestResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudQuestResourceIdGetResponseRevisionInfoSchemaVersionDefault = null;
export const getResourceV1AutocrudQuestResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudQuestResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudQuestResourceIdGetResponse = zod.object({
  data: zod
    .object({
      title: zod.string(),
      description: zod
        .string()
        .default(getResourceV1AutocrudQuestResourceIdGetResponseDataDescriptionDefault),
      level_requirement: zod
        .number()
        .default(getResourceV1AutocrudQuestResourceIdGetResponseDataLevelRequirementDefault),
      difficulty: zod
        .string()
        .default(getResourceV1AutocrudQuestResourceIdGetResponseDataDifficultyDefault),
      quest_config: zod
        .looseObject({})
        .default(getResourceV1AutocrudQuestResourceIdGetResponseDataQuestConfigDefault),
      rewards: zod
        .array(
          zod.union([
            zod
              .object({
                type: zod.enum(['QuestRewardItem']),
                item_name: zod.string(),
                quantity: zod
                  .number()
                  .default(
                    getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemOneQuantityDefault,
                  ),
                extra_properties: zod
                  .looseObject({})
                  .default(
                    getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemOneExtraPropertiesDefault,
                  ),
              })
              .describe(
                '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
            zod
              .object({
                type: zod.enum(['QuestRewardGold']),
                amount: zod
                  .number()
                  .default(
                    getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemTwoAmountDefault,
                  ),
              })
              .describe('任務獎勵：金幣'),
            zod
              .object({
                type: zod.enum(['QuestRewardExp']),
                exp: zod
                  .number()
                  .default(
                    getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemThreeExpDefault,
                  ),
                bonus_config: zod
                  .looseObject({})
                  .default(
                    getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsItemThreeBonusConfigDefault,
                  ),
              })
              .describe(
                '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
              ),
          ]),
        )
        .default(getResourceV1AutocrudQuestResourceIdGetResponseDataRewardsDefault),
    })
    .optional()
    .describe(
      '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
    ),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudQuestResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudQuestResourceIdGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudQuestResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudQuestResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `quest` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `quest` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /quest/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update quest
 */
export const UpdateResourceV1AutocrudQuestResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudQuestResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudQuestResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudQuestResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudQuestResourceIdPutBodyDescriptionDefault = ``;
export const updateResourceV1AutocrudQuestResourceIdPutBodyLevelRequirementDefault = 1;
export const updateResourceV1AutocrudQuestResourceIdPutBodyDifficultyDefault = `normal`;
export const updateResourceV1AutocrudQuestResourceIdPutBodyQuestConfigDefault = {};
export const updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemOneQuantityDefault = 1;
export const updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemOneExtraPropertiesDefault =
  {};
export const updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemTwoAmountDefault = 100;
export const updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemThreeExpDefault = 100;
export const updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemThreeBonusConfigDefault = {};
export const updateResourceV1AutocrudQuestResourceIdPutBodyRewardsDefault = [];

export const UpdateResourceV1AutocrudQuestResourceIdPutBody = zod
  .object({
    title: zod.string(),
    description: zod
      .string()
      .default(updateResourceV1AutocrudQuestResourceIdPutBodyDescriptionDefault),
    level_requirement: zod
      .number()
      .default(updateResourceV1AutocrudQuestResourceIdPutBodyLevelRequirementDefault),
    difficulty: zod
      .string()
      .default(updateResourceV1AutocrudQuestResourceIdPutBodyDifficultyDefault),
    quest_config: zod
      .looseObject({})
      .default(updateResourceV1AutocrudQuestResourceIdPutBodyQuestConfigDefault),
    rewards: zod
      .array(
        zod.union([
          zod
            .object({
              type: zod.enum(['QuestRewardItem']),
              item_name: zod.string(),
              quantity: zod
                .number()
                .default(
                  updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemOneQuantityDefault,
                ),
              extra_properties: zod
                .looseObject({})
                .default(
                  updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemOneExtraPropertiesDefault,
                ),
            })
            .describe(
              '任務獎勵：物品\n\n包含 extra_properties (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
          zod
            .object({
              type: zod.enum(['QuestRewardGold']),
              amount: zod
                .number()
                .default(updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemTwoAmountDefault),
            })
            .describe('任務獎勵：金幣'),
          zod
            .object({
              type: zod.enum(['QuestRewardExp']),
              exp: zod
                .number()
                .default(updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemThreeExpDefault),
              bonus_config: zod
                .looseObject({})
                .default(
                  updateResourceV1AutocrudQuestResourceIdPutBodyRewardsItemThreeBonusConfigDefault,
                ),
            })
            .describe(
              '任務獎勵：經驗值\n\n包含 bonus_config (dict) 子欄位，\n在 Union 表單中會以 Monaco JSON 編輯器呈現。',
            ),
        ]),
      )
      .default(updateResourceV1AutocrudQuestResourceIdPutBodyRewardsDefault),
  })
  .describe(
    '遊戲任務\n\n展示新功能：\n- quest_config (dict) → 在 create\/edit 表單中使用 Monaco JSON 編輯器\n- rewards (list[Union]) → 陣列中的 Union 子欄位正確處理，不再顯示 [object Object]\n- Union 變體 (QuestRewardItem, QuestRewardExp) 中的 dict 子欄位也使用 Monaco 編輯器',
  );

export const updateResourceV1AutocrudQuestResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudQuestResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudQuestResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudQuestResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudQuestResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `quest` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /quest/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update quest
 */
export const PatchResourceV1AutocrudQuestResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudQuestResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudQuestResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudQuestResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudQuestResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudQuestResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudQuestResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudQuestResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudQuestResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudQuestResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudQuestResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudQuestResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `quest` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /quest/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete quest
 */
export const DeleteResourceV1AutocrudQuestResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudQuestResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudQuestResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudQuestResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudQuestResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudQuestResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `quest` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /quest/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch quest to specific revision
 */
export const SwitchRevisionV1AutocrudQuestResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudQuestResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudQuestResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudQuestResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudQuestResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(switchRevisionV1AutocrudQuestResourceIdSwitchRevisionIdPostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * **Permanently** delete a `quest` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete quest
 */
export const PermanentlyDeleteResourceV1AutocrudQuestResourceIdPermanentlyDeleteParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const permanentlyDeleteResourceV1AutocrudQuestResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudQuestResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudQuestResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudQuestResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudQuestResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `quest` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /quest/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted quest
 */
export const RestoreResourceV1AutocrudQuestResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudQuestResourceIdRestorePostResponseSchemaVersionDefault = null;
export const restoreResourceV1AutocrudQuestResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudQuestResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudQuestResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudQuestResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `quest` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /quest/restore?limit=100` — Restore up to 100 deleted resources
- `POST /quest/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted quest
 */
export const batchRestoreV1AutocrudQuestRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudQuestRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudQuestRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudQuestRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudQuestRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudQuestRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudQuestRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudQuestRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudQuestRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudQuestRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudQuestRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudQuestRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudQuestRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudQuestRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudQuestMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudQuestMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudQuestMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudQuestMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudQuestMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudQuestMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudQuestMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudQuestMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudQuestMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudQuestMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `quest` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /quest/migrate/single/123` - Migrate resource 123
- `POST /quest/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /quest/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single quest Resource
 */
export const MigrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostParams = zod.object({
  resource_id: zod.string(),
});

export const migrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(migrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostQueryWriteBackDefault)
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(migrateSingleResourceV1AutocrudQuestMigrateSingleResourceIdPostResponseErrorDefault),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `game-event` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /game-event/data` - Get first 10 resources (data only)
- `GET /game-event/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /game-event/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /game-event/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List game-event Data Only
 */
export const listResourcesDataV1AutocrudGameEventDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudGameEventDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudGameEventDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudGameEventDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudGameEventDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudGameEventDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudGameEventDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudGameEventDataGetResponsePayloadRewardGoldDefault = 0;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePayloadRewardExpDefault = 0;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePayloadExtraDataDefault = {};
export const listResourcesDataV1AutocrudGameEventDataGetResponsePayloadEventBodyDefault = null;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePayloadEventXDefault = null;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePayloadExtraValuesDefault = [];
export const listResourcesDataV1AutocrudGameEventDataGetResponseStatusDefault = `pending`;
export const listResourcesDataV1AutocrudGameEventDataGetResponseErrmsgDefault = null;
export const listResourcesDataV1AutocrudGameEventDataGetResponseArtifactDefault = null;
export const listResourcesDataV1AutocrudGameEventDataGetResponseRetriesDefault = 0;
export const listResourcesDataV1AutocrudGameEventDataGetResponseMaxRetriesDefault = null;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicMaxRunsDefault = null;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicRunsDefault = 0;
export const listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesDataV1AutocrudGameEventDataGetResponseLastHeartbeatAtDefault = null;

export const ListResourcesDataV1AutocrudGameEventDataGetResponseItem = zod
  .object({
    payload: zod
      .object({
        event_type: zod
          .enum([
            'daily_login',
            'equipment_enhance',
            'guild_reward',
            'level_up',
            'quest_complete',
            'raid_boss',
            'server_maintenance',
          ])
          .describe('遊戲事件類型'),
        character_name: zod.string(),
        character_id: zod.union([zod.string(), zod.null()]),
        description: zod.string(),
        reward_gold: zod
          .number()
          .default(listResourcesDataV1AutocrudGameEventDataGetResponsePayloadRewardGoldDefault),
        reward_exp: zod
          .number()
          .default(listResourcesDataV1AutocrudGameEventDataGetResponsePayloadRewardExpDefault),
        extra_data: zod
          .looseObject({})
          .default(listResourcesDataV1AutocrudGameEventDataGetResponsePayloadExtraDataDefault),
        event_body: zod
          .union([
            zod.null(),
            zod.union([
              zod
                .object({
                  type: zod.enum(['EventBodyA']),
                  extra_info_a: zod.string(),
                  extra_value_a: zod.number(),
                })
                .describe('事件類型 A 的專屬數據'),
              zod
                .object({
                  type: zod.enum(['EventBodyB']),
                  some_field: zod.string(),
                  cooldown_seconds: zod.number(),
                })
                .describe('事件類型 B 的專屬數據'),
            ]),
          ])
          .default(listResourcesDataV1AutocrudGameEventDataGetResponsePayloadEventBodyDefault),
        event_x: zod
          .union([
            zod.null(),
            zod
              .object({
                type: zod.enum(['EventBodyX']),
                good: zod.string(),
                great: zod.number(),
              })
              .describe('事件類型 X 的專屬數據'),
          ])
          .default(listResourcesDataV1AutocrudGameEventDataGetResponsePayloadEventXDefault),
        extra_values: zod
          .array(zod.any())
          .default(listResourcesDataV1AutocrudGameEventDataGetResponsePayloadExtraValuesDefault),
      })
      .describe('遊戲事件載荷數據'),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponseStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponseErrmsgDefault),
    artifact: zod
      .union([
        zod.null(),
        zod
          .object({
            process_times: zod.number(),
          })
          .describe('遊戲事件載荷數據'),
      ])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponseArtifactDefault),
    retries: zod
      .number()
      .default(listResourcesDataV1AutocrudGameEventDataGetResponseRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponseMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicIntervalSecondsDefault),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(
        listResourcesDataV1AutocrudGameEventDataGetResponsePeriodicInitialDelaySecondsDefault,
      ),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesDataV1AutocrudGameEventDataGetResponseLastHeartbeatAtDefault),
  })
  .describe('遊戲事件任務（使用 Message Queue 處理）');
export const ListResourcesDataV1AutocrudGameEventDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudGameEventDataGetResponseItem,
);

/**
 * Retrieve a list of `game-event` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /game-event/meta` - Get metadata for first 10 resources
- `GET /game-event/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /game-event/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List game-event Metadata Only
 */
export const listResourcesMetaV1AutocrudGameEventMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudGameEventMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudGameEventMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudGameEventMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudGameEventMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudGameEventMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudGameEventMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudGameEventMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudGameEventMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudGameEventMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudGameEventMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudGameEventMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudGameEventMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudGameEventMetaGetResponseItem,
);

/**
 * Retrieve a list of `game-event` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /game-event/revision-info` - Get current revision info for first 10 resources
- `GET /game-event/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /game-event/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List game-event Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudGameEventRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /game-event` instead. Retrieve a list of `game-event` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List game-event Complete Information
 */
export const listResourcesFullV1AutocrudGameEventFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudGameEventFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudGameEventFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudGameEventFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudGameEventFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudGameEventFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudGameEventFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudGameEventFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudGameEventFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadRewardGoldDefault = 0;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadRewardExpDefault = 0;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadExtraDataDefault = {};
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadEventBodyDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadEventXDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadExtraValuesDefault = [];
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataStatusDefault = `pending`;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataErrmsgDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataArtifactDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataRetriesDefault = 0;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataMaxRetriesDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicMaxRunsDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseDataLastHeartbeatAtDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudGameEventFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudGameEventFullGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod
        .object({
          event_type: zod
            .enum([
              'daily_login',
              'equipment_enhance',
              'guild_reward',
              'level_up',
              'quest_complete',
              'raid_boss',
              'server_maintenance',
            ])
            .describe('遊戲事件類型'),
          character_name: zod.string(),
          character_id: zod.union([zod.string(), zod.null()]),
          description: zod.string(),
          reward_gold: zod
            .number()
            .default(
              listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadRewardGoldDefault,
            ),
          reward_exp: zod
            .number()
            .default(
              listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadRewardExpDefault,
            ),
          extra_data: zod
            .looseObject({})
            .default(
              listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadExtraDataDefault,
            ),
          event_body: zod
            .union([
              zod.null(),
              zod.union([
                zod
                  .object({
                    type: zod.enum(['EventBodyA']),
                    extra_info_a: zod.string(),
                    extra_value_a: zod.number(),
                  })
                  .describe('事件類型 A 的專屬數據'),
                zod
                  .object({
                    type: zod.enum(['EventBodyB']),
                    some_field: zod.string(),
                    cooldown_seconds: zod.number(),
                  })
                  .describe('事件類型 B 的專屬數據'),
              ]),
            ])
            .default(
              listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadEventBodyDefault,
            ),
          event_x: zod
            .union([
              zod.null(),
              zod
                .object({
                  type: zod.enum(['EventBodyX']),
                  good: zod.string(),
                  great: zod.number(),
                })
                .describe('事件類型 X 的專屬數據'),
            ])
            .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadEventXDefault),
          extra_values: zod
            .array(zod.any())
            .default(
              listResourcesFullV1AutocrudGameEventFullGetResponseDataPayloadExtraValuesDefault,
            ),
        })
        .describe('遊戲事件載荷數據'),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataErrmsgDefault),
      artifact: zod
        .union([
          zod.null(),
          zod
            .object({
              process_times: zod.number(),
            })
            .describe('遊戲事件載荷數據'),
        ])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudGameEventFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseDataLastHeartbeatAtDefault),
    })
    .optional()
    .describe('遊戲事件任務（使用 Message Queue 處理）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudGameEventFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudGameEventFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudGameEventFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudGameEventFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudGameEventFullGetResponseItem,
);

/**
 * Retrieve the count of `game-event` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /game-event/count` - Get total count of all resources
- `GET /game-event/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count game-event Resources
 */
export const getResourcesCountV1AutocrudGameEventCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudGameEventCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudGameEventCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudGameEventCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudGameEventCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudGameEventCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudGameEventCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudGameEventCountGetResponse = zod.number();

/**
 * Retrieve a list of `game-event` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /game-event` — full list (data + meta + revision_info)
- `GET /game-event?returns=data` — data only
- `GET /game-event?returns=data,meta` — data + meta, no revision_info
- `GET /game-event?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List game-event resources
 */
export const listResourcesV1AutocrudGameEventGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudGameEventGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudGameEventGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudGameEventGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudGameEventGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudGameEventGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudGameEventGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudGameEventGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudGameEventGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudGameEventGetResponseDataPayloadRewardGoldDefault = 0;
export const listResourcesV1AutocrudGameEventGetResponseDataPayloadRewardExpDefault = 0;
export const listResourcesV1AutocrudGameEventGetResponseDataPayloadExtraDataDefault = {};
export const listResourcesV1AutocrudGameEventGetResponseDataPayloadEventBodyDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataPayloadEventXDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataPayloadExtraValuesDefault = [];
export const listResourcesV1AutocrudGameEventGetResponseDataStatusDefault = `pending`;
export const listResourcesV1AutocrudGameEventGetResponseDataErrmsgDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataArtifactDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataRetriesDefault = 0;
export const listResourcesV1AutocrudGameEventGetResponseDataMaxRetriesDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataPeriodicIntervalSecondsDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataPeriodicMaxRunsDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesV1AutocrudGameEventGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesV1AutocrudGameEventGetResponseDataLastHeartbeatAtDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseRevisionInfoParentRevisionIdDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudGameEventGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudGameEventGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod
        .object({
          event_type: zod
            .enum([
              'daily_login',
              'equipment_enhance',
              'guild_reward',
              'level_up',
              'quest_complete',
              'raid_boss',
              'server_maintenance',
            ])
            .describe('遊戲事件類型'),
          character_name: zod.string(),
          character_id: zod.union([zod.string(), zod.null()]),
          description: zod.string(),
          reward_gold: zod
            .number()
            .default(listResourcesV1AutocrudGameEventGetResponseDataPayloadRewardGoldDefault),
          reward_exp: zod
            .number()
            .default(listResourcesV1AutocrudGameEventGetResponseDataPayloadRewardExpDefault),
          extra_data: zod
            .looseObject({})
            .default(listResourcesV1AutocrudGameEventGetResponseDataPayloadExtraDataDefault),
          event_body: zod
            .union([
              zod.null(),
              zod.union([
                zod
                  .object({
                    type: zod.enum(['EventBodyA']),
                    extra_info_a: zod.string(),
                    extra_value_a: zod.number(),
                  })
                  .describe('事件類型 A 的專屬數據'),
                zod
                  .object({
                    type: zod.enum(['EventBodyB']),
                    some_field: zod.string(),
                    cooldown_seconds: zod.number(),
                  })
                  .describe('事件類型 B 的專屬數據'),
              ]),
            ])
            .default(listResourcesV1AutocrudGameEventGetResponseDataPayloadEventBodyDefault),
          event_x: zod
            .union([
              zod.null(),
              zod
                .object({
                  type: zod.enum(['EventBodyX']),
                  good: zod.string(),
                  great: zod.number(),
                })
                .describe('事件類型 X 的專屬數據'),
            ])
            .default(listResourcesV1AutocrudGameEventGetResponseDataPayloadEventXDefault),
          extra_values: zod
            .array(zod.any())
            .default(listResourcesV1AutocrudGameEventGetResponseDataPayloadExtraValuesDefault),
        })
        .describe('遊戲事件載荷數據'),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesV1AutocrudGameEventGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseDataErrmsgDefault),
      artifact: zod
        .union([
          zod.null(),
          zod
            .object({
              process_times: zod.number(),
            })
            .describe('遊戲事件載荷數據'),
        ])
        .default(listResourcesV1AutocrudGameEventGetResponseDataArtifactDefault),
      retries: zod.number().default(listResourcesV1AutocrudGameEventGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseDataPeriodicIntervalSecondsDefault),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(listResourcesV1AutocrudGameEventGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseDataPeriodicInitialDelaySecondsDefault),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseDataLastHeartbeatAtDefault),
    })
    .optional()
    .describe('遊戲事件任務（使用 Message Queue 處理）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudGameEventGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudGameEventGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudGameEventGetResponse = zod.array(
  ListResourcesV1AutocrudGameEventGetResponseItem,
);

/**
 * Create a new `game-event` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `game-event` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /game-event` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create game-event
 */
export const createResourceV1AutocrudGameEventPostBodyPayloadRewardGoldDefault = 0;
export const createResourceV1AutocrudGameEventPostBodyPayloadRewardExpDefault = 0;
export const createResourceV1AutocrudGameEventPostBodyPayloadExtraDataDefault = {};
export const createResourceV1AutocrudGameEventPostBodyPayloadEventBodyDefault = null;
export const createResourceV1AutocrudGameEventPostBodyPayloadEventXDefault = null;
export const createResourceV1AutocrudGameEventPostBodyPayloadExtraValuesDefault = [];
export const createResourceV1AutocrudGameEventPostBodyStatusDefault = `pending`;
export const createResourceV1AutocrudGameEventPostBodyErrmsgDefault = null;
export const createResourceV1AutocrudGameEventPostBodyArtifactDefault = null;
export const createResourceV1AutocrudGameEventPostBodyRetriesDefault = 0;
export const createResourceV1AutocrudGameEventPostBodyMaxRetriesDefault = null;
export const createResourceV1AutocrudGameEventPostBodyPeriodicIntervalSecondsDefault = null;
export const createResourceV1AutocrudGameEventPostBodyPeriodicMaxRunsDefault = null;
export const createResourceV1AutocrudGameEventPostBodyPeriodicRunsDefault = 0;
export const createResourceV1AutocrudGameEventPostBodyPeriodicInitialDelaySecondsDefault = null;
export const createResourceV1AutocrudGameEventPostBodyLastHeartbeatAtDefault = null;

export const CreateResourceV1AutocrudGameEventPostBody = zod
  .object({
    payload: zod
      .object({
        event_type: zod
          .enum([
            'daily_login',
            'equipment_enhance',
            'guild_reward',
            'level_up',
            'quest_complete',
            'raid_boss',
            'server_maintenance',
          ])
          .describe('遊戲事件類型'),
        character_name: zod.string(),
        character_id: zod.union([zod.string(), zod.null()]),
        description: zod.string(),
        reward_gold: zod
          .number()
          .default(createResourceV1AutocrudGameEventPostBodyPayloadRewardGoldDefault),
        reward_exp: zod
          .number()
          .default(createResourceV1AutocrudGameEventPostBodyPayloadRewardExpDefault),
        extra_data: zod
          .looseObject({})
          .default(createResourceV1AutocrudGameEventPostBodyPayloadExtraDataDefault),
        event_body: zod
          .union([
            zod.null(),
            zod.union([
              zod
                .object({
                  type: zod.enum(['EventBodyA']),
                  extra_info_a: zod.string(),
                  extra_value_a: zod.number(),
                })
                .describe('事件類型 A 的專屬數據'),
              zod
                .object({
                  type: zod.enum(['EventBodyB']),
                  some_field: zod.string(),
                  cooldown_seconds: zod.number(),
                })
                .describe('事件類型 B 的專屬數據'),
            ]),
          ])
          .default(createResourceV1AutocrudGameEventPostBodyPayloadEventBodyDefault),
        event_x: zod
          .union([
            zod.null(),
            zod
              .object({
                type: zod.enum(['EventBodyX']),
                good: zod.string(),
                great: zod.number(),
              })
              .describe('事件類型 X 的專屬數據'),
          ])
          .default(createResourceV1AutocrudGameEventPostBodyPayloadEventXDefault),
        extra_values: zod
          .array(zod.any())
          .default(createResourceV1AutocrudGameEventPostBodyPayloadExtraValuesDefault),
      })
      .describe('遊戲事件載荷數據'),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(createResourceV1AutocrudGameEventPostBodyStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostBodyErrmsgDefault),
    artifact: zod
      .union([
        zod.null(),
        zod
          .object({
            process_times: zod.number(),
          })
          .describe('遊戲事件載荷數據'),
      ])
      .default(createResourceV1AutocrudGameEventPostBodyArtifactDefault),
    retries: zod.number().default(createResourceV1AutocrudGameEventPostBodyRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostBodyMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostBodyPeriodicIntervalSecondsDefault),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostBodyPeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(createResourceV1AutocrudGameEventPostBodyPeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostBodyPeriodicInitialDelaySecondsDefault),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostBodyLastHeartbeatAtDefault),
  })
  .describe('遊戲事件任務（使用 Message Queue 處理）');

export const createResourceV1AutocrudGameEventPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudGameEventPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudGameEventPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudGameEventPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `game-event` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /game-event?limit=100` — Delete up to 100 resources
- `DELETE /game-event?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete game-event
 */
export const batchDeleteV1AutocrudGameEventDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudGameEventDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudGameEventDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudGameEventDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudGameEventDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudGameEventDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudGameEventDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudGameEventDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudGameEventDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudGameEventDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudGameEventDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod.boolean().default(batchDeleteV1AutocrudGameEventDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudGameEventDeleteResponse = zod.array(
  BatchDeleteV1AutocrudGameEventDeleteResponseItem,
);

/**
 * Export all (or filtered) **game-event** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export game-event data
 */
export const exportModelV1AutocrudGameEventExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudGameEventExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudGameEventExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudGameEventExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudGameEventExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudGameEventExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudGameEventExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudGameEventExportGetResponse = zod.unknown();

/**
 * Import **game-event** resources from a ``.acbak`` archive.

The archive must contain a **game-event** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import game-event data
 */
export const importModelV1AutocrudGameEventImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudGameEventImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudGameEventImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudGameEventImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudGameEventImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /game-event/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get game-event Meta by ID
 */
export const GetResourceMetaV1AutocrudGameEventResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudGameEventResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudGameEventResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudGameEventResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudGameEventResourceIdMetaGetResponseSchemaVersionDefault = null;
export const getResourceMetaV1AutocrudGameEventResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudGameEventResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudGameEventResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudGameEventResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `game-event` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /game-event/123/revision-info` - Get current revision info
- `GET /game-event/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get game-event Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const GetResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudGameEventResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /game-event/{resource_id}` instead.

Retrieve complete information for a `game-event` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete game-event Information
 */
export const GetResourceFullV1AutocrudGameEventResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudGameEventResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudGameEventResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudGameEventResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudGameEventResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadRewardGoldDefault = 0;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadRewardExpDefault = 0;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadExtraDataDefault =
  {};
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadEventBodyDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadEventXDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadExtraValuesDefault =
  [];
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataStatusDefault = `pending`;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataErrmsgDefault = null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataArtifactDefault = null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataRetriesDefault = 0;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataMaxRetriesDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicRunsDefault = 0;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudGameEventResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudGameEventResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      payload: zod
        .object({
          event_type: zod
            .enum([
              'daily_login',
              'equipment_enhance',
              'guild_reward',
              'level_up',
              'quest_complete',
              'raid_boss',
              'server_maintenance',
            ])
            .describe('遊戲事件類型'),
          character_name: zod.string(),
          character_id: zod.union([zod.string(), zod.null()]),
          description: zod.string(),
          reward_gold: zod
            .number()
            .default(
              getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadRewardGoldDefault,
            ),
          reward_exp: zod
            .number()
            .default(
              getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadRewardExpDefault,
            ),
          extra_data: zod
            .looseObject({})
            .default(
              getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadExtraDataDefault,
            ),
          event_body: zod
            .union([
              zod.null(),
              zod.union([
                zod
                  .object({
                    type: zod.enum(['EventBodyA']),
                    extra_info_a: zod.string(),
                    extra_value_a: zod.number(),
                  })
                  .describe('事件類型 A 的專屬數據'),
                zod
                  .object({
                    type: zod.enum(['EventBodyB']),
                    some_field: zod.string(),
                    cooldown_seconds: zod.number(),
                  })
                  .describe('事件類型 B 的專屬數據'),
              ]),
            ])
            .default(
              getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadEventBodyDefault,
            ),
          event_x: zod
            .union([
              zod.null(),
              zod
                .object({
                  type: zod.enum(['EventBodyX']),
                  good: zod.string(),
                  great: zod.number(),
                })
                .describe('事件類型 X 的專屬數據'),
            ])
            .default(
              getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadEventXDefault,
            ),
          extra_values: zod
            .array(zod.any())
            .default(
              getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPayloadExtraValuesDefault,
            ),
        })
        .describe('遊戲事件載荷數據'),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataErrmsgDefault),
      artifact: zod
        .union([
          zod.null(),
          zod
            .object({
              process_times: zod.number(),
            })
            .describe('遊戲事件載荷數據'),
        ])
        .default(getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional()
    .describe('遊戲事件任務（使用 Message Queue 處理）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudGameEventResourceIdFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudGameEventResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `game-event` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /game-event/123/revision-list` - Get all revisions for resource 123
- `GET /game-event/123/revision-list?limit=10&offset=20`
- `GET /game-event/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /game-event/123/revision-list?from_revision_id=rev123`
- `GET /game-event/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get game-event Revision History
 */
export const GetResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryLimitDefault,
      ),
    offset: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryOffsetDefault,
      ),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQuerySortDefault),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponse =
  zod.object({
    meta: zod
      .object({
        current_revision_id: zod.string(),
        resource_id: zod.string(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
          ),
        total_revision_count: zod.number(),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
        is_deleted: zod
          .boolean()
          .default(
            getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseMetaIsDeletedDefault,
          ),
        indexed_data: zod.looseObject({}).optional(),
      })
      .describe(
        'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
      ),
    revisions: zod.array(
      zod
        .object({
          uid: zod.uuid(),
          resource_id: zod.string(),
          revision_id: zod.string(),
          parent_revision_id: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
            ),
          parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
          schema_version: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
            ),
          data_hash: zod.string().optional(),
          status: zod.enum(['draft', 'stable']),
          created_time: zod.string(),
          updated_time: zod.string(),
          created_by: zod.string(),
          updated_by: zod.string(),
        })
        .describe(
          'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
        ),
    ),
    total: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseTotalDefault,
      ),
    has_more: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudGameEventResourceIdRevisionListGetResponseHasMoreDefault,
      ),
  });

/**
 * Retrieve only the data content of a `game-event` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /game-event/123/data` - Get current resource data only
- `GET /game-event/123/data?revision_id=rev456` - Get specific revision data only
- `GET /game-event/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get game-event Data
 */
export const GetResourceDataV1AutocrudGameEventResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudGameEventResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudGameEventResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudGameEventResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadRewardGoldDefault = 0;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadRewardExpDefault = 0;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadExtraDataDefault =
  {};
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadEventBodyDefault =
  null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadEventXDefault = null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadExtraValuesDefault =
  [];
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponseStatusDefault = `pending`;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponseErrmsgDefault = null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponseArtifactDefault = null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponseRetriesDefault = 0;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponseMaxRetriesDefault = null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicMaxRunsDefault =
  null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicRunsDefault = 0;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const getResourceDataV1AutocrudGameEventResourceIdDataGetResponseLastHeartbeatAtDefault =
  null;

export const GetResourceDataV1AutocrudGameEventResourceIdDataGetResponse = zod
  .object({
    payload: zod
      .object({
        event_type: zod
          .enum([
            'daily_login',
            'equipment_enhance',
            'guild_reward',
            'level_up',
            'quest_complete',
            'raid_boss',
            'server_maintenance',
          ])
          .describe('遊戲事件類型'),
        character_name: zod.string(),
        character_id: zod.union([zod.string(), zod.null()]),
        description: zod.string(),
        reward_gold: zod
          .number()
          .default(
            getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadRewardGoldDefault,
          ),
        reward_exp: zod
          .number()
          .default(
            getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadRewardExpDefault,
          ),
        extra_data: zod
          .looseObject({})
          .default(
            getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadExtraDataDefault,
          ),
        event_body: zod
          .union([
            zod.null(),
            zod.union([
              zod
                .object({
                  type: zod.enum(['EventBodyA']),
                  extra_info_a: zod.string(),
                  extra_value_a: zod.number(),
                })
                .describe('事件類型 A 的專屬數據'),
              zod
                .object({
                  type: zod.enum(['EventBodyB']),
                  some_field: zod.string(),
                  cooldown_seconds: zod.number(),
                })
                .describe('事件類型 B 的專屬數據'),
            ]),
          ])
          .default(
            getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadEventBodyDefault,
          ),
        event_x: zod
          .union([
            zod.null(),
            zod
              .object({
                type: zod.enum(['EventBodyX']),
                good: zod.string(),
                great: zod.number(),
              })
              .describe('事件類型 X 的專屬數據'),
          ])
          .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadEventXDefault),
        extra_values: zod
          .array(zod.any())
          .default(
            getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePayloadExtraValuesDefault,
          ),
      })
      .describe('遊戲事件載荷數據'),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponseStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponseErrmsgDefault),
    artifact: zod
      .union([
        zod.null(),
        zod
          .object({
            process_times: zod.number(),
          })
          .describe('遊戲事件載荷數據'),
      ])
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponseArtifactDefault),
    retries: zod
      .number()
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponseRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponseMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(
        getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicIntervalSecondsDefault,
      ),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(
        getResourceDataV1AutocrudGameEventResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault,
      ),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(getResourceDataV1AutocrudGameEventResourceIdDataGetResponseLastHeartbeatAtDefault),
  })
  .describe('遊戲事件任務（使用 Message Queue 處理）');

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudGameEventResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `game-event` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /game-event/123` — full response (data + meta + revision_info)
- `GET /game-event/123?returns=data` — data only
- `GET /game-event/123?returns=data,meta` — data + meta, no revision_info
- `GET /game-event/123?returns=meta` — metadata only
- `GET /game-event/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get game-event resource
 */
export const GetResourceV1AutocrudGameEventResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudGameEventResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudGameEventResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudGameEventResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudGameEventResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudGameEventResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadRewardGoldDefault = 0;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadRewardExpDefault = 0;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadExtraDataDefault = {};
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadEventBodyDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadEventXDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadExtraValuesDefault = [];
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataStatusDefault = `pending`;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataErrmsgDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataArtifactDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataRetriesDefault = 0;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataMaxRetriesDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicMaxRunsDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicRunsDefault = 0;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseDataLastHeartbeatAtDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudGameEventResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudGameEventResourceIdGetResponse = zod.object({
  data: zod
    .object({
      payload: zod
        .object({
          event_type: zod
            .enum([
              'daily_login',
              'equipment_enhance',
              'guild_reward',
              'level_up',
              'quest_complete',
              'raid_boss',
              'server_maintenance',
            ])
            .describe('遊戲事件類型'),
          character_name: zod.string(),
          character_id: zod.union([zod.string(), zod.null()]),
          description: zod.string(),
          reward_gold: zod
            .number()
            .default(
              getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadRewardGoldDefault,
            ),
          reward_exp: zod
            .number()
            .default(
              getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadRewardExpDefault,
            ),
          extra_data: zod
            .looseObject({})
            .default(
              getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadExtraDataDefault,
            ),
          event_body: zod
            .union([
              zod.null(),
              zod.union([
                zod
                  .object({
                    type: zod.enum(['EventBodyA']),
                    extra_info_a: zod.string(),
                    extra_value_a: zod.number(),
                  })
                  .describe('事件類型 A 的專屬數據'),
                zod
                  .object({
                    type: zod.enum(['EventBodyB']),
                    some_field: zod.string(),
                    cooldown_seconds: zod.number(),
                  })
                  .describe('事件類型 B 的專屬數據'),
              ]),
            ])
            .default(
              getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadEventBodyDefault,
            ),
          event_x: zod
            .union([
              zod.null(),
              zod
                .object({
                  type: zod.enum(['EventBodyX']),
                  good: zod.string(),
                  great: zod.number(),
                })
                .describe('事件類型 X 的專屬數據'),
            ])
            .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadEventXDefault),
          extra_values: zod
            .array(zod.any())
            .default(
              getResourceV1AutocrudGameEventResourceIdGetResponseDataPayloadExtraValuesDefault,
            ),
        })
        .describe('遊戲事件載荷數據'),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataErrmsgDefault),
      artifact: zod
        .union([
          zod.null(),
          zod
            .object({
              process_times: zod.number(),
            })
            .describe('遊戲事件載荷數據'),
        ])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudGameEventResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseDataLastHeartbeatAtDefault),
    })
    .optional()
    .describe('遊戲事件任務（使用 Message Queue 處理）'),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudGameEventResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudGameEventResourceIdGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudGameEventResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `game-event` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `game-event` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /game-event/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update game-event
 */
export const UpdateResourceV1AutocrudGameEventResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudGameEventResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudGameEventResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudGameEventResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadRewardGoldDefault = 0;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadRewardExpDefault = 0;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadExtraDataDefault = {};
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadEventBodyDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadEventXDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadExtraValuesDefault = [];
export const updateResourceV1AutocrudGameEventResourceIdPutBodyStatusDefault = `pending`;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyErrmsgDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyArtifactDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyRetriesDefault = 0;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyMaxRetriesDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicIntervalSecondsDefault =
  null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicMaxRunsDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicRunsDefault = 0;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicInitialDelaySecondsDefault =
  null;
export const updateResourceV1AutocrudGameEventResourceIdPutBodyLastHeartbeatAtDefault = null;

export const UpdateResourceV1AutocrudGameEventResourceIdPutBody = zod
  .object({
    payload: zod
      .object({
        event_type: zod
          .enum([
            'daily_login',
            'equipment_enhance',
            'guild_reward',
            'level_up',
            'quest_complete',
            'raid_boss',
            'server_maintenance',
          ])
          .describe('遊戲事件類型'),
        character_name: zod.string(),
        character_id: zod.union([zod.string(), zod.null()]),
        description: zod.string(),
        reward_gold: zod
          .number()
          .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadRewardGoldDefault),
        reward_exp: zod
          .number()
          .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadRewardExpDefault),
        extra_data: zod
          .looseObject({})
          .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadExtraDataDefault),
        event_body: zod
          .union([
            zod.null(),
            zod.union([
              zod
                .object({
                  type: zod.enum(['EventBodyA']),
                  extra_info_a: zod.string(),
                  extra_value_a: zod.number(),
                })
                .describe('事件類型 A 的專屬數據'),
              zod
                .object({
                  type: zod.enum(['EventBodyB']),
                  some_field: zod.string(),
                  cooldown_seconds: zod.number(),
                })
                .describe('事件類型 B 的專屬數據'),
            ]),
          ])
          .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadEventBodyDefault),
        event_x: zod
          .union([
            zod.null(),
            zod
              .object({
                type: zod.enum(['EventBodyX']),
                good: zod.string(),
                great: zod.number(),
              })
              .describe('事件類型 X 的專屬數據'),
          ])
          .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadEventXDefault),
        extra_values: zod
          .array(zod.any())
          .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPayloadExtraValuesDefault),
      })
      .describe('遊戲事件載荷數據'),
    status: zod
      .enum(['completed', 'failed', 'pending', 'processing'])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyStatusDefault),
    errmsg: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyErrmsgDefault),
    artifact: zod
      .union([
        zod.null(),
        zod
          .object({
            process_times: zod.number(),
          })
          .describe('遊戲事件載荷數據'),
      ])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyArtifactDefault),
    retries: zod.number().default(updateResourceV1AutocrudGameEventResourceIdPutBodyRetriesDefault),
    max_retries: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyMaxRetriesDefault),
    periodic_interval_seconds: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicIntervalSecondsDefault),
    periodic_max_runs: zod
      .union([zod.number(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicMaxRunsDefault),
    periodic_runs: zod
      .number()
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicRunsDefault),
    periodic_initial_delay_seconds: zod
      .union([zod.number(), zod.null()])
      .default(
        updateResourceV1AutocrudGameEventResourceIdPutBodyPeriodicInitialDelaySecondsDefault,
      ),
    last_heartbeat_at: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutBodyLastHeartbeatAtDefault),
  })
  .describe('遊戲事件任務（使用 Message Queue 處理）');

export const updateResourceV1AutocrudGameEventResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudGameEventResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudGameEventResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudGameEventResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `game-event` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /game-event/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update game-event
 */
export const PatchResourceV1AutocrudGameEventResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudGameEventResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudGameEventResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudGameEventResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudGameEventResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudGameEventResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudGameEventResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudGameEventResourceIdPatchResponseParentRevisionIdDefault = null;
export const patchResourceV1AutocrudGameEventResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudGameEventResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudGameEventResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudGameEventResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `game-event` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /game-event/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete game-event
 */
export const DeleteResourceV1AutocrudGameEventResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudGameEventResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudGameEventResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudGameEventResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudGameEventResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudGameEventResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `game-event` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /game-event/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch game-event to specific revision
 */
export const SwitchRevisionV1AutocrudGameEventResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudGameEventResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudGameEventResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudGameEventResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudGameEventResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        switchRevisionV1AutocrudGameEventResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Re-enqueue a completed or failed `game-event` job.

Resets the job status to `pending`, clears `retries`, `errmsg`,
and `artifact`, then places the job back into the message queue
for processing.  The original `payload` is preserved.

**Allowed source statuses:** `completed`, `failed`.
Jobs that are `pending` or `processing` cannot be rerun.

**Response:** Returns the new revision info after the reset.
 * @summary Rerun a game-event job
 */
export const RerunJobV1AutocrudGameEventResourceIdRerunPostParams = zod.object({
  resource_id: zod.string(),
});

export const rerunJobV1AutocrudGameEventResourceIdRerunPostResponseParentRevisionIdDefault = null;
export const rerunJobV1AutocrudGameEventResourceIdRerunPostResponseSchemaVersionDefault = null;

export const RerunJobV1AutocrudGameEventResourceIdRerunPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(rerunJobV1AutocrudGameEventResourceIdRerunPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(rerunJobV1AutocrudGameEventResourceIdRerunPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Retrieve the execution log of a `game-event` job.

Returns the log as plain text (``text/plain``).  If no logs
have been recorded (e.g. the job hasn't started yet or no
blob store is configured), returns HTTP 204 No Content.
 * @summary Get logs for a game-event job
 */
export const GetJobLogsV1AutocrudGameEventResourceIdLogsGetParams = zod.object({
  resource_id: zod.string(),
});

/**
 * **Permanently** delete a `game-event` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete game-event
 */
export const PermanentlyDeleteResourceV1AutocrudGameEventResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudGameEventResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudGameEventResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudGameEventResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudGameEventResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudGameEventResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `game-event` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /game-event/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted game-event
 */
export const RestoreResourceV1AutocrudGameEventResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudGameEventResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudGameEventResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudGameEventResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(restoreResourceV1AutocrudGameEventResourceIdRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudGameEventResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `game-event` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /game-event/restore?limit=100` — Restore up to 100 deleted resources
- `POST /game-event/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted game-event
 */
export const batchRestoreV1AutocrudGameEventRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudGameEventRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudGameEventRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudGameEventRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudGameEventRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudGameEventRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudGameEventRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudGameEventRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudGameEventRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudGameEventRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudGameEventRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudGameEventRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudGameEventRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudGameEventRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudGameEventMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudGameEventMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(executeMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(executeMigrateResourcesV1AutocrudGameEventMigrateExecutePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const ExecuteMigrateResourcesV1AutocrudGameEventMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `game-event` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /game-event/migrate/single/123` - Migrate resource 123
- `POST /game-event/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /game-event/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single game-event Resource
 */
export const MigrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostParams = zod.object(
  {
    resource_id: zod.string(),
  },
);

export const migrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudGameEventMigrateSingleResourceIdPostResponseErrorDefault,
      ),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `new-char1-job` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /new-char1-job/data` - Get first 10 resources (data only)
- `GET /new-char1-job/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /new-char1-job/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /new-char1-job/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List new-char1-job Data Only
 */
export const listResourcesDataV1AutocrudNewChar1JobDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudNewChar1JobDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudNewChar1JobDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudNewChar1JobDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudNewChar1JobDataGetResponseStatusDefault = `pending`;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponseErrmsgDefault = null;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponseArtifactDefault = null;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponseRetriesDefault = 0;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponseMaxRetriesDefault = null;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicMaxRunsDefault = null;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicRunsDefault = 0;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesDataV1AutocrudNewChar1JobDataGetResponseLastHeartbeatAtDefault = null;

export const ListResourcesDataV1AutocrudNewChar1JobDataGetResponseItem = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponseStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponseErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponseArtifactDefault),
  retries: zod
    .number()
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponseRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponseMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicIntervalSecondsDefault),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudNewChar1JobDataGetResponsePeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(listResourcesDataV1AutocrudNewChar1JobDataGetResponseLastHeartbeatAtDefault),
});
export const ListResourcesDataV1AutocrudNewChar1JobDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudNewChar1JobDataGetResponseItem,
);

/**
 * Retrieve a list of `new-char1-job` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /new-char1-job/meta` - Get metadata for first 10 resources
- `GET /new-char1-job/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /new-char1-job/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List new-char1-job Metadata Only
 */
export const listResourcesMetaV1AutocrudNewChar1JobMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudNewChar1JobMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudNewChar1JobMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudNewChar1JobMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudNewChar1JobMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudNewChar1JobMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudNewChar1JobMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudNewChar1JobMetaGetResponseSchemaVersionDefault = null;
export const listResourcesMetaV1AutocrudNewChar1JobMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudNewChar1JobMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(listResourcesMetaV1AutocrudNewChar1JobMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudNewChar1JobMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudNewChar1JobMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudNewChar1JobMetaGetResponseItem,
);

/**
 * Retrieve a list of `new-char1-job` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /new-char1-job/revision-info` - Get current revision info for first 10 resources
- `GET /new-char1-job/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /new-char1-job/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List new-char1-job Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponseItem = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );
export const ListResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponse = zod.array(
  ListResourcesRevisionInfoV1AutocrudNewChar1JobRevisionInfoGetResponseItem,
);

/**
 * Deprecated: use `GET /new-char1-job` instead. Retrieve a list of `new-char1-job` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List new-char1-job Complete Information
 */
export const listResourcesFullV1AutocrudNewChar1JobFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudNewChar1JobFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudNewChar1JobFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudNewChar1JobFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudNewChar1JobFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudNewChar1JobFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudNewChar1JobFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudNewChar1JobFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudNewChar1JobFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataStatusDefault = `pending`;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataErrmsgDefault = null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataArtifactDefault = null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataRetriesDefault = 0;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataMaxRetriesDefault = null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicMaxRunsDefault = null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataLastHeartbeatAtDefault = null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseMetaSchemaVersionDefault = null;
export const listResourcesFullV1AutocrudNewChar1JobFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudNewChar1JobFullGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseDataLastHeartbeatAtDefault),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudNewChar1JobFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudNewChar1JobFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesFullV1AutocrudNewChar1JobFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudNewChar1JobFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudNewChar1JobFullGetResponseItem,
);

/**
 * Retrieve the count of `new-char1-job` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /new-char1-job/count` - Get total count of all resources
- `GET /new-char1-job/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count new-char1-job Resources
 */
export const getResourcesCountV1AutocrudNewChar1JobCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudNewChar1JobCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudNewChar1JobCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudNewChar1JobCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudNewChar1JobCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudNewChar1JobCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudNewChar1JobCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudNewChar1JobCountGetResponse = zod.number();

/**
 * Retrieve a list of `new-char1-job` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /new-char1-job` — full list (data + meta + revision_info)
- `GET /new-char1-job?returns=data` — data only
- `GET /new-char1-job?returns=data,meta` — data + meta, no revision_info
- `GET /new-char1-job?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List new-char1-job resources
 */
export const listResourcesV1AutocrudNewChar1JobGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudNewChar1JobGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudNewChar1JobGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudNewChar1JobGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudNewChar1JobGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudNewChar1JobGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudNewChar1JobGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudNewChar1JobGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudNewChar1JobGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudNewChar1JobGetResponseDataStatusDefault = `pending`;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataErrmsgDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataArtifactDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataRetriesDefault = 0;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataMaxRetriesDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicIntervalSecondsDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicMaxRunsDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesV1AutocrudNewChar1JobGetResponseDataLastHeartbeatAtDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesV1AutocrudNewChar1JobGetResponseRevisionInfoSchemaVersionDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseMetaSchemaVersionDefault = null;
export const listResourcesV1AutocrudNewChar1JobGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudNewChar1JobGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicIntervalSecondsDefault),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudNewChar1JobGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseDataLastHeartbeatAtDefault),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseRevisionInfoParentRevisionIdDefault),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseRevisionInfoSchemaVersionDefault),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudNewChar1JobGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudNewChar1JobGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudNewChar1JobGetResponse = zod.array(
  ListResourcesV1AutocrudNewChar1JobGetResponseItem,
);

/**
 * Create a new `new-char1-job` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `new-char1-job` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /new-char1-job` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create new-char1-job
 */
export const createResourceV1AutocrudNewChar1JobPostBodyStatusDefault = `pending`;
export const createResourceV1AutocrudNewChar1JobPostBodyErrmsgDefault = null;
export const createResourceV1AutocrudNewChar1JobPostBodyArtifactDefault = null;
export const createResourceV1AutocrudNewChar1JobPostBodyRetriesDefault = 0;
export const createResourceV1AutocrudNewChar1JobPostBodyMaxRetriesDefault = null;
export const createResourceV1AutocrudNewChar1JobPostBodyPeriodicIntervalSecondsDefault = null;
export const createResourceV1AutocrudNewChar1JobPostBodyPeriodicMaxRunsDefault = null;
export const createResourceV1AutocrudNewChar1JobPostBodyPeriodicRunsDefault = 0;
export const createResourceV1AutocrudNewChar1JobPostBodyPeriodicInitialDelaySecondsDefault = null;
export const createResourceV1AutocrudNewChar1JobPostBodyLastHeartbeatAtDefault = null;

export const CreateResourceV1AutocrudNewChar1JobPostBody = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(createResourceV1AutocrudNewChar1JobPostBodyStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyArtifactDefault),
  retries: zod.number().default(createResourceV1AutocrudNewChar1JobPostBodyRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyPeriodicIntervalSecondsDefault),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyPeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(createResourceV1AutocrudNewChar1JobPostBodyPeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyPeriodicInitialDelaySecondsDefault),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(createResourceV1AutocrudNewChar1JobPostBodyLastHeartbeatAtDefault),
});

export const createResourceV1AutocrudNewChar1JobPostResponseParentRevisionIdDefault = null;
export const createResourceV1AutocrudNewChar1JobPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudNewChar1JobPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudNewChar1JobPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudNewChar1JobPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `new-char1-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /new-char1-job?limit=100` — Delete up to 100 resources
- `DELETE /new-char1-job?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete new-char1-job
 */
export const batchDeleteV1AutocrudNewChar1JobDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudNewChar1JobDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudNewChar1JobDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudNewChar1JobDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudNewChar1JobDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudNewChar1JobDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudNewChar1JobDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudNewChar1JobDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudNewChar1JobDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudNewChar1JobDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudNewChar1JobDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchDeleteV1AutocrudNewChar1JobDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudNewChar1JobDeleteResponse = zod.array(
  BatchDeleteV1AutocrudNewChar1JobDeleteResponseItem,
);

/**
 * Export all (or filtered) **new-char1-job** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export new-char1-job data
 */
export const exportModelV1AutocrudNewChar1JobExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudNewChar1JobExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudNewChar1JobExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudNewChar1JobExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudNewChar1JobExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudNewChar1JobExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudNewChar1JobExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudNewChar1JobExportGetResponse = zod.unknown();

/**
 * Import **new-char1-job** resources from a ``.acbak`` archive.

The archive must contain a **new-char1-job** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import new-char1-job data
 */
export const importModelV1AutocrudNewChar1JobImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudNewChar1JobImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudNewChar1JobImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudNewChar1JobImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudNewChar1JobImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /new-char1-job/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get new-char1-job Meta by ID
 */
export const GetResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetQueryParams = zod.object({
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
  include_deleted: zod
    .boolean()
    .default(getResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetQueryIncludeDeletedDefault)
    .describe('If true, return metadata even for soft-deleted resources'),
});

export const getResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetResponseSchemaVersionDefault =
  null;
export const getResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(getResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(getResourceMetaV1AutocrudNewChar1JobResourceIdMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `new-char1-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /new-char1-job/123/revision-info` - Get current revision info
- `GET /new-char1-job/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get new-char1-job Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetParams =
  zod.object({
    resource_id: zod.string(),
  });

export const GetResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceRevisionInfoV1AutocrudNewChar1JobResourceIdRevisionInfoGetResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Deprecated: use `GET /new-char1-job/{resource_id}` instead.

Retrieve complete information for a `new-char1-job` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete new-char1-job Information
 */
export const GetResourceFullV1AutocrudNewChar1JobResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudNewChar1JobResourceIdFullGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataStatusDefault = `pending`;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataErrmsgDefault = null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataArtifactDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataRetriesDefault = 0;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataMaxRetriesDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicRunsDefault = 0;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceFullV1AutocrudNewChar1JobResourceIdFullGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `new-char1-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /new-char1-job/123/revision-list` - Get all revisions for resource 123
- `GET /new-char1-job/123/revision-list?limit=10&offset=20`
- `GET /new-char1-job/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /new-char1-job/123/revision-list?from_revision_id=rev123`
- `GET /new-char1-job/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get new-char1-job Revision History
 */
export const GetResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetParams =
  zod.object({
    resource_id: zod.string(),
  });

export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryLimitDefault,
      ),
    offset: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryOffsetDefault,
      ),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQuerySortDefault,
      ),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponse =
  zod.object({
    meta: zod
      .object({
        current_revision_id: zod.string(),
        resource_id: zod.string(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
          ),
        total_revision_count: zod.number(),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
        is_deleted: zod
          .boolean()
          .default(
            getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseMetaIsDeletedDefault,
          ),
        indexed_data: zod.looseObject({}).optional(),
      })
      .describe(
        'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
      ),
    revisions: zod.array(
      zod
        .object({
          uid: zod.uuid(),
          resource_id: zod.string(),
          revision_id: zod.string(),
          parent_revision_id: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
            ),
          parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
          schema_version: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
            ),
          data_hash: zod.string().optional(),
          status: zod.enum(['draft', 'stable']),
          created_time: zod.string(),
          updated_time: zod.string(),
          created_by: zod.string(),
          updated_by: zod.string(),
        })
        .describe(
          'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
        ),
    ),
    total: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseTotalDefault,
      ),
    has_more: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudNewChar1JobResourceIdRevisionListGetResponseHasMoreDefault,
      ),
  });

/**
 * Retrieve only the data content of a `new-char1-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /new-char1-job/123/data` - Get current resource data only
- `GET /new-char1-job/123/data?revision_id=rev456` - Get specific revision data only
- `GET /new-char1-job/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get new-char1-job Data
 */
export const GetResourceDataV1AutocrudNewChar1JobResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudNewChar1JobResourceIdDataGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
});

export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseStatusDefault = `pending`;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseErrmsgDefault = null;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseArtifactDefault = null;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseRetriesDefault = 0;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseMaxRetriesDefault = null;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicMaxRunsDefault =
  null;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicRunsDefault = 0;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseLastHeartbeatAtDefault =
  null;

export const GetResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponse = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseArtifactDefault),
  retries: zod
    .number()
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(getResourceDataV1AutocrudNewChar1JobResourceIdDataGetResponseLastHeartbeatAtDefault),
});

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudNewChar1JobResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `new-char1-job` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /new-char1-job/123` — full response (data + meta + revision_info)
- `GET /new-char1-job/123?returns=data` — data only
- `GET /new-char1-job/123?returns=data,meta` — data + meta, no revision_info
- `GET /new-char1-job/123?returns=meta` — metadata only
- `GET /new-char1-job/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get new-char1-job resource
 */
export const GetResourceV1AutocrudNewChar1JobResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudNewChar1JobResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudNewChar1JobResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudNewChar1JobResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudNewChar1JobResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudNewChar1JobResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataStatusDefault = `pending`;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataErrmsgDefault = null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataArtifactDefault = null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataRetriesDefault = 0;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataMaxRetriesDefault = null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicMaxRunsDefault = null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicRunsDefault = 0;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataLastHeartbeatAtDefault = null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseMetaSchemaVersionDefault = null;
export const getResourceV1AutocrudNewChar1JobResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudNewChar1JobResourceIdGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicMaxRunsDefault),
      periodic_runs: zod
        .number()
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseDataLastHeartbeatAtDefault),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudNewChar1JobResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudNewChar1JobResourceIdGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(getResourceV1AutocrudNewChar1JobResourceIdGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `new-char1-job` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `new-char1-job` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /new-char1-job/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update new-char1-job
 */
export const UpdateResourceV1AutocrudNewChar1JobResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudNewChar1JobResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudNewChar1JobResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyStatusDefault = `pending`;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyErrmsgDefault = null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyArtifactDefault = null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyRetriesDefault = 0;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyMaxRetriesDefault = null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicIntervalSecondsDefault =
  null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicMaxRunsDefault = null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicRunsDefault = 0;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicInitialDelaySecondsDefault =
  null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutBodyLastHeartbeatAtDefault = null;

export const UpdateResourceV1AutocrudNewChar1JobResourceIdPutBody = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyArtifactDefault),
  retries: zod.number().default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicIntervalSecondsDefault),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      updateResourceV1AutocrudNewChar1JobResourceIdPutBodyPeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(updateResourceV1AutocrudNewChar1JobResourceIdPutBodyLastHeartbeatAtDefault),
});

export const updateResourceV1AutocrudNewChar1JobResourceIdPutResponseParentRevisionIdDefault = null;
export const updateResourceV1AutocrudNewChar1JobResourceIdPutResponseSchemaVersionDefault = null;

export const UpdateResourceV1AutocrudNewChar1JobResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudNewChar1JobResourceIdPutResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(updateResourceV1AutocrudNewChar1JobResourceIdPutResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `new-char1-job` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /new-char1-job/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update new-char1-job
 */
export const PatchResourceV1AutocrudNewChar1JobResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudNewChar1JobResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudNewChar1JobResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudNewChar1JobResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudNewChar1JobResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudNewChar1JobResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudNewChar1JobResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudNewChar1JobResourceIdPatchResponseParentRevisionIdDefault =
  null;
export const patchResourceV1AutocrudNewChar1JobResourceIdPatchResponseSchemaVersionDefault = null;

export const PatchResourceV1AutocrudNewChar1JobResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudNewChar1JobResourceIdPatchResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(patchResourceV1AutocrudNewChar1JobResourceIdPatchResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `new-char1-job` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /new-char1-job/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete new-char1-job
 */
export const DeleteResourceV1AutocrudNewChar1JobResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudNewChar1JobResourceIdDeleteResponseSchemaVersionDefault = null;
export const deleteResourceV1AutocrudNewChar1JobResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudNewChar1JobResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(deleteResourceV1AutocrudNewChar1JobResourceIdDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(deleteResourceV1AutocrudNewChar1JobResourceIdDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `new-char1-job` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /new-char1-job/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch new-char1-job to specific revision
 */
export const SwitchRevisionV1AutocrudNewChar1JobResourceIdSwitchRevisionIdPostParams = zod.object({
  resource_id: zod.string(),
  revision_id: zod.string(),
});

export const switchRevisionV1AutocrudNewChar1JobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudNewChar1JobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudNewChar1JobResourceIdSwitchRevisionIdPostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        switchRevisionV1AutocrudNewChar1JobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        switchRevisionV1AutocrudNewChar1JobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Re-enqueue a completed or failed `new-char1-job` job.

Resets the job status to `pending`, clears `retries`, `errmsg`,
and `artifact`, then places the job back into the message queue
for processing.  The original `payload` is preserved.

**Allowed source statuses:** `completed`, `failed`.
Jobs that are `pending` or `processing` cannot be rerun.

**Response:** Returns the new revision info after the reset.
 * @summary Rerun a new-char1-job job
 */
export const RerunJobV1AutocrudNewChar1JobResourceIdRerunPostParams = zod.object({
  resource_id: zod.string(),
});

export const rerunJobV1AutocrudNewChar1JobResourceIdRerunPostResponseParentRevisionIdDefault = null;
export const rerunJobV1AutocrudNewChar1JobResourceIdRerunPostResponseSchemaVersionDefault = null;

export const RerunJobV1AutocrudNewChar1JobResourceIdRerunPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(rerunJobV1AutocrudNewChar1JobResourceIdRerunPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(rerunJobV1AutocrudNewChar1JobResourceIdRerunPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Retrieve the execution log of a `new-char1-job` job.

Returns the log as plain text (``text/plain``).  If no logs
have been recorded (e.g. the job hasn't started yet or no
blob store is configured), returns HTTP 204 No Content.
 * @summary Get logs for a new-char1-job job
 */
export const GetJobLogsV1AutocrudNewChar1JobResourceIdLogsGetParams = zod.object({
  resource_id: zod.string(),
});

/**
 * **Permanently** delete a `new-char1-job` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete new-char1-job
 */
export const PermanentlyDeleteResourceV1AutocrudNewChar1JobResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudNewChar1JobResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudNewChar1JobResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudNewChar1JobResourceIdPermanentlyDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        permanentlyDeleteResourceV1AutocrudNewChar1JobResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        permanentlyDeleteResourceV1AutocrudNewChar1JobResourceIdPermanentlyDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Restore a previously deleted `new-char1-job` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /new-char1-job/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted new-char1-job
 */
export const RestoreResourceV1AutocrudNewChar1JobResourceIdRestorePostParams = zod.object({
  resource_id: zod.string(),
});

export const restoreResourceV1AutocrudNewChar1JobResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudNewChar1JobResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudNewChar1JobResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        restoreResourceV1AutocrudNewChar1JobResourceIdRestorePostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(restoreResourceV1AutocrudNewChar1JobResourceIdRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `new-char1-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /new-char1-job/restore?limit=100` — Restore up to 100 deleted resources
- `POST /new-char1-job/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted new-char1-job
 */
export const batchRestoreV1AutocrudNewChar1JobRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudNewChar1JobRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudNewChar1JobRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudNewChar1JobRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudNewChar1JobRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudNewChar1JobRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudNewChar1JobRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudNewChar1JobRestorePostResponseSchemaVersionDefault = null;
export const batchRestoreV1AutocrudNewChar1JobRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudNewChar1JobRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudNewChar1JobRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudNewChar1JobRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudNewChar1JobRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudNewChar1JobRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(testMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(testMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(testMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
    ),
});

export const TestMigrateResourcesV1AutocrudNewChar1JobMigrateTestPostResponse = zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryParams = zod.object(
  {
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(executeMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryIsDeletedDefault)
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(executeMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryLimitDefault)
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(executeMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostQueryOffsetDefault)
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
      ),
  },
);

export const ExecuteMigrateResourcesV1AutocrudNewChar1JobMigrateExecutePostResponse = zod.unknown();

/**
 * Migrate a single `new-char1-job` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /new-char1-job/migrate/single/123` - Migrate resource 123
- `POST /new-char1-job/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /new-char1-job/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single new-char1-job Resource
 */
export const MigrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostParams =
  zod.object({
    resource_id: zod.string(),
  });

export const migrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostResponse = zod
  .object({
    resource_id: zod.string(),
    status: zod.string(),
    message: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostResponseMessageDefault,
      ),
    error: zod
      .union([zod.string(), zod.null()])
      .default(
        migrateSingleResourceV1AutocrudNewChar1JobMigrateSingleResourceIdPostResponseErrorDefault,
      ),
  })
  .describe('遷移進度訊息');

/**
 * Retrieve a list of `create-new-character2-job` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /create-new-character2-job/data` - Get first 10 resources (data only)
- `GET /create-new-character2-job/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /create-new-character2-job/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /create-new-character2-job/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List create-new-character2-job Data Only
 */
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseStatusDefault = `pending`;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseErrmsgDefault = null;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseArtifactDefault = null;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseRetriesDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseMaxRetriesDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicMaxRunsDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicRunsDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseLastHeartbeatAtDefault =
  null;

export const ListResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseItem = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseArtifactDefault),
  retries: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicMaxRunsDefault,
    ),
  periodic_runs: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponsePeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseLastHeartbeatAtDefault,
    ),
});
export const ListResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudCreateNewCharacter2JobDataGetResponseItem,
);

/**
 * Retrieve a list of `create-new-character2-job` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /create-new-character2-job/meta` - Get metadata for first 10 resources
- `GET /create-new-character2-job/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /create-new-character2-job/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List create-new-character2-job Metadata Only
 */
export const listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponseSchemaVersionDefault =
  null;
export const listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudCreateNewCharacter2JobMetaGetResponseItem,
);

/**
 * Retrieve a list of `create-new-character2-job` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /create-new-character2-job/revision-info` - Get current revision info for first 10 resources
- `GET /create-new-character2-job/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /create-new-character2-job/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List create-new-character2-job Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryParams =
  zod.object({
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryIsDeletedDefault,
      )
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(
        listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryLimitDefault,
      )
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(
        listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetQueryOffsetDefault,
      )
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  });

export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponseItem =
  zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponseParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponseSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    );
export const ListResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponse =
  zod.array(ListResourcesRevisionInfoV1AutocrudCreateNewCharacter2JobRevisionInfoGetResponseItem);

/**
 * Deprecated: use `GET /create-new-character2-job` instead. Retrieve a list of `create-new-character2-job` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List create-new-character2-job Complete Information
 */
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataStatusDefault = `pending`;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataErrmsgDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataArtifactDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataRetriesDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataMaxRetriesDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseMetaSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataArtifactDefault,
        ),
      retries: zod
        .number()
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataRetriesDefault,
        ),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudCreateNewCharacter2JobFullGetResponseItem,
);

/**
 * Retrieve the count of `create-new-character2-job` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /create-new-character2-job/count` - Get total count of all resources
- `GET /create-new-character2-job/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count create-new-character2-job Resources
 */
export const getResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudCreateNewCharacter2JobCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudCreateNewCharacter2JobCountGetResponse = zod.number();

/**
 * Retrieve a list of `create-new-character2-job` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /create-new-character2-job` — full list (data + meta + revision_info)
- `GET /create-new-character2-job?returns=data` — data only
- `GET /create-new-character2-job?returns=data,meta` — data + meta, no revision_info
- `GET /create-new-character2-job?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List create-new-character2-job resources
 */
export const listResourcesV1AutocrudCreateNewCharacter2JobGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudCreateNewCharacter2JobGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudCreateNewCharacter2JobGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudCreateNewCharacter2JobGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudCreateNewCharacter2JobGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudCreateNewCharacter2JobGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataStatusDefault = `pending`;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataErrmsgDefault = null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataArtifactDefault = null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataRetriesDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataMaxRetriesDefault = null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicMaxRunsDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataLastHeartbeatAtDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseMetaSchemaVersionDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter2JobGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudCreateNewCharacter2JobGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter2JobGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter2JobGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter2JobGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudCreateNewCharacter2JobGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudCreateNewCharacter2JobGetResponse = zod.array(
  ListResourcesV1AutocrudCreateNewCharacter2JobGetResponseItem,
);

/**
 * Create a new `create-new-character2-job` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `create-new-character2-job` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /create-new-character2-job` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create create-new-character2-job
 */
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyStatusDefault = `pending`;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyErrmsgDefault = null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyArtifactDefault = null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyRetriesDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyMaxRetriesDefault = null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicIntervalSecondsDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicMaxRunsDefault = null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicRunsDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicInitialDelaySecondsDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostBodyLastHeartbeatAtDefault = null;

export const CreateResourceV1AutocrudCreateNewCharacter2JobPostBody = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyArtifactDefault),
  retries: zod
    .number()
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicIntervalSecondsDefault),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      createResourceV1AutocrudCreateNewCharacter2JobPostBodyPeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter2JobPostBodyLastHeartbeatAtDefault),
});

export const createResourceV1AutocrudCreateNewCharacter2JobPostResponseParentRevisionIdDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter2JobPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudCreateNewCharacter2JobPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCreateNewCharacter2JobPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCreateNewCharacter2JobPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `create-new-character2-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /create-new-character2-job?limit=100` — Delete up to 100 resources
- `DELETE /create-new-character2-job?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete create-new-character2-job
 */
export const batchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudCreateNewCharacter2JobDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponse = zod.array(
  BatchDeleteV1AutocrudCreateNewCharacter2JobDeleteResponseItem,
);

/**
 * Export all (or filtered) **create-new-character2-job** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export create-new-character2-job data
 */
export const exportModelV1AutocrudCreateNewCharacter2JobExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudCreateNewCharacter2JobExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudCreateNewCharacter2JobExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudCreateNewCharacter2JobExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudCreateNewCharacter2JobExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudCreateNewCharacter2JobExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudCreateNewCharacter2JobExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudCreateNewCharacter2JobExportGetResponse = zod.unknown();

/**
 * Import **create-new-character2-job** resources from a ``.acbak`` archive.

The archive must contain a **create-new-character2-job** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import create-new-character2-job data
 */
export const importModelV1AutocrudCreateNewCharacter2JobImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudCreateNewCharacter2JobImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudCreateNewCharacter2JobImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudCreateNewCharacter2JobImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudCreateNewCharacter2JobImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /create-new-character2-job/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get create-new-character2-job Meta by ID
 */
export const GetResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetQueryParams =
  zod.object({
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
    include_deleted: zod
      .boolean()
      .default(
        getResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return metadata even for soft-deleted resources'),
  });

export const getResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetResponseSchemaVersionDefault =
  null;
export const getResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        getResourceMetaV1AutocrudCreateNewCharacter2JobResourceIdMetaGetResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `create-new-character2-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /create-new-character2-job/123/revision-info` - Get current revision info
- `GET /create-new-character2-job/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get create-new-character2-job Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetParams =
  zod.object({
    resource_id: zod.string(),
  });

export const GetResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetResponse =
  zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionInfoV1AutocrudCreateNewCharacter2JobResourceIdRevisionInfoGetResponseSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    );

/**
 * Deprecated: use `GET /create-new-character2-job/{resource_id}` instead.

Retrieve complete information for a `create-new-character2-job` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete create-new-character2-job Information
 */
export const GetResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    include_deleted: zod
      .boolean()
      .default(
        getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return data even for soft-deleted resources'),
    returns: zod
      .string()
      .default(getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetQueryReturnsDefault)
      .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
  });

export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataStatusDefault = `pending`;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataErrmsgDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataArtifactDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataRetriesDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataMaxRetriesDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicRunsDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataStatusDefault,
        ),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataErrmsgDefault,
        ),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataArtifactDefault,
        ),
      retries: zod
        .number()
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataRetriesDefault,
        ),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceFullV1AutocrudCreateNewCharacter2JobResourceIdFullGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `create-new-character2-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /create-new-character2-job/123/revision-list` - Get all revisions for resource 123
- `GET /create-new-character2-job/123/revision-list?limit=10&offset=20`
- `GET /create-new-character2-job/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /create-new-character2-job/123/revision-list?from_revision_id=rev123`
- `GET /create-new-character2-job/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get create-new-character2-job Revision History
 */
export const GetResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetParams =
  zod.object({
    resource_id: zod.string(),
  });

export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryLimitDefault,
      ),
    offset: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryOffsetDefault,
      ),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQuerySortDefault,
      ),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponse =
  zod.object({
    meta: zod
      .object({
        current_revision_id: zod.string(),
        resource_id: zod.string(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
          ),
        total_revision_count: zod.number(),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
        is_deleted: zod
          .boolean()
          .default(
            getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseMetaIsDeletedDefault,
          ),
        indexed_data: zod.looseObject({}).optional(),
      })
      .describe(
        'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
      ),
    revisions: zod.array(
      zod
        .object({
          uid: zod.uuid(),
          resource_id: zod.string(),
          revision_id: zod.string(),
          parent_revision_id: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
            ),
          parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
          schema_version: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
            ),
          data_hash: zod.string().optional(),
          status: zod.enum(['draft', 'stable']),
          created_time: zod.string(),
          updated_time: zod.string(),
          created_by: zod.string(),
          updated_by: zod.string(),
        })
        .describe(
          'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
        ),
    ),
    total: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseTotalDefault,
      ),
    has_more: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter2JobResourceIdRevisionListGetResponseHasMoreDefault,
      ),
  });

/**
 * Retrieve only the data content of a `create-new-character2-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /create-new-character2-job/123/data` - Get current resource data only
- `GET /create-new-character2-job/123/data?revision_id=rev456` - Get specific revision data only
- `GET /create-new-character2-job/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get create-new-character2-job Data
 */
export const GetResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    include_deleted: zod
      .boolean()
      .default(
        getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return data even for soft-deleted resources'),
  });

export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseStatusDefault = `pending`;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseErrmsgDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseArtifactDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseRetriesDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseMaxRetriesDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicMaxRunsDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicRunsDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseLastHeartbeatAtDefault =
  null;

export const GetResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponse = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseArtifactDefault,
    ),
  retries: zod
    .number()
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseRetriesDefault,
    ),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseMaxRetriesDefault,
    ),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicMaxRunsDefault,
    ),
  periodic_runs: zod
    .number()
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicRunsDefault,
    ),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter2JobResourceIdDataGetResponseLastHeartbeatAtDefault,
    ),
});

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudCreateNewCharacter2JobResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `create-new-character2-job` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /create-new-character2-job/123` — full response (data + meta + revision_info)
- `GET /create-new-character2-job/123?returns=data` — data only
- `GET /create-new-character2-job/123?returns=data,meta` — data + meta, no revision_info
- `GET /create-new-character2-job/123?returns=meta` — metadata only
- `GET /create-new-character2-job/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get create-new-character2-job resource
 */
export const GetResourceV1AutocrudCreateNewCharacter2JobResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudCreateNewCharacter2JobResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataStatusDefault = `pending`;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataErrmsgDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataArtifactDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataRetriesDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataMaxRetriesDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicRunsDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.object({
        name: zod.string(),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataArtifactDefault,
        ),
      retries: zod
        .number()
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataRetriesDefault,
        ),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceV1AutocrudCreateNewCharacter2JobResourceIdGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `create-new-character2-job` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `create-new-character2-job` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /create-new-character2-job/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update create-new-character2-job
 */
export const UpdateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyStatusDefault = `pending`;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyErrmsgDefault = null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyArtifactDefault = null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyRetriesDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyMaxRetriesDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicIntervalSecondsDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicMaxRunsDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicRunsDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicInitialDelaySecondsDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyLastHeartbeatAtDefault =
  null;

export const UpdateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBody = zod.object({
  payload: zod.object({
    name: zod.string(),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyArtifactDefault),
  retries: zod
    .number()
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyPeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutBodyLastHeartbeatAtDefault),
});

export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutResponseParentRevisionIdDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutResponseSchemaVersionDefault =
  null;

export const UpdateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        updateResourceV1AutocrudCreateNewCharacter2JobResourceIdPutResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `create-new-character2-job` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /create-new-character2-job/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update create-new-character2-job
 */
export const PatchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchResponseParentRevisionIdDefault =
  null;
export const patchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchResponseSchemaVersionDefault =
  null;

export const PatchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        patchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        patchResourceV1AutocrudCreateNewCharacter2JobResourceIdPatchResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `create-new-character2-job` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /create-new-character2-job/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete create-new-character2-job
 */
export const DeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudCreateNewCharacter2JobResourceIdDeleteResponseSchemaVersionDefault =
  null;
export const deleteResourceV1AutocrudCreateNewCharacter2JobResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        deleteResourceV1AutocrudCreateNewCharacter2JobResourceIdDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        deleteResourceV1AutocrudCreateNewCharacter2JobResourceIdDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `create-new-character2-job` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /create-new-character2-job/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch create-new-character2-job to specific revision
 */
export const SwitchRevisionV1AutocrudCreateNewCharacter2JobResourceIdSwitchRevisionIdPostParams =
  zod.object({
    resource_id: zod.string(),
    revision_id: zod.string(),
  });

export const switchRevisionV1AutocrudCreateNewCharacter2JobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudCreateNewCharacter2JobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudCreateNewCharacter2JobResourceIdSwitchRevisionIdPostResponse =
  zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          switchRevisionV1AutocrudCreateNewCharacter2JobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          switchRevisionV1AutocrudCreateNewCharacter2JobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    );

/**
 * Re-enqueue a completed or failed `create-new-character2-job` job.

Resets the job status to `pending`, clears `retries`, `errmsg`,
and `artifact`, then places the job back into the message queue
for processing.  The original `payload` is preserved.

**Allowed source statuses:** `completed`, `failed`.
Jobs that are `pending` or `processing` cannot be rerun.

**Response:** Returns the new revision info after the reset.
 * @summary Rerun a create-new-character2-job job
 */
export const RerunJobV1AutocrudCreateNewCharacter2JobResourceIdRerunPostParams = zod.object({
  resource_id: zod.string(),
});

export const rerunJobV1AutocrudCreateNewCharacter2JobResourceIdRerunPostResponseParentRevisionIdDefault =
  null;
export const rerunJobV1AutocrudCreateNewCharacter2JobResourceIdRerunPostResponseSchemaVersionDefault =
  null;

export const RerunJobV1AutocrudCreateNewCharacter2JobResourceIdRerunPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        rerunJobV1AutocrudCreateNewCharacter2JobResourceIdRerunPostResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        rerunJobV1AutocrudCreateNewCharacter2JobResourceIdRerunPostResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Retrieve the execution log of a `create-new-character2-job` job.

Returns the log as plain text (``text/plain``).  If no logs
have been recorded (e.g. the job hasn't started yet or no
blob store is configured), returns HTTP 204 No Content.
 * @summary Get logs for a create-new-character2-job job
 */
export const GetJobLogsV1AutocrudCreateNewCharacter2JobResourceIdLogsGetParams = zod.object({
  resource_id: zod.string(),
});

/**
 * **Permanently** delete a `create-new-character2-job` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete create-new-character2-job
 */
export const PermanentlyDeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdPermanentlyDeleteResponse =
  zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          permanentlyDeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          permanentlyDeleteResourceV1AutocrudCreateNewCharacter2JobResourceIdPermanentlyDeleteResponseIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    );

/**
 * Restore a previously deleted `create-new-character2-job` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /create-new-character2-job/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted create-new-character2-job
 */
export const RestoreResourceV1AutocrudCreateNewCharacter2JobResourceIdRestorePostParams =
  zod.object({
    resource_id: zod.string(),
  });

export const restoreResourceV1AutocrudCreateNewCharacter2JobResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudCreateNewCharacter2JobResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudCreateNewCharacter2JobResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        restoreResourceV1AutocrudCreateNewCharacter2JobResourceIdRestorePostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        restoreResourceV1AutocrudCreateNewCharacter2JobResourceIdRestorePostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `create-new-character2-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /create-new-character2-job/restore?limit=100` — Restore up to 100 deleted resources
- `POST /create-new-character2-job/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted create-new-character2-job
 */
export const batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponseSchemaVersionDefault =
  null;
export const batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudCreateNewCharacter2JobRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryParams =
  zod.object({
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(
        testMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryIsDeletedDefault,
      )
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(testMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryLimitDefault)
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(
        testMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostQueryOffsetDefault,
      )
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
      ),
  });

export const TestMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateTestPostResponse =
  zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryParams =
  zod.object({
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(
        executeMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryIsDeletedDefault,
      )
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(
        executeMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryLimitDefault,
      )
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(
        executeMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostQueryOffsetDefault,
      )
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
      ),
  });

export const ExecuteMigrateResourcesV1AutocrudCreateNewCharacter2JobMigrateExecutePostResponse =
  zod.unknown();

/**
 * Migrate a single `create-new-character2-job` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /create-new-character2-job/migrate/single/123` - Migrate resource 123
- `POST /create-new-character2-job/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /create-new-character2-job/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single create-new-character2-job Resource
 */
export const MigrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostParams =
  zod.object({
    resource_id: zod.string(),
  });

export const migrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostResponse =
  zod
    .object({
      resource_id: zod.string(),
      status: zod.string(),
      message: zod
        .union([zod.string(), zod.null()])
        .default(
          migrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostResponseMessageDefault,
        ),
      error: zod
        .union([zod.string(), zod.null()])
        .default(
          migrateSingleResourceV1AutocrudCreateNewCharacter2JobMigrateSingleResourceIdPostResponseErrorDefault,
        ),
    })
    .describe('遷移進度訊息');

/**
 * Retrieve a list of `create-new-character4-job` resources returning only the data content.

**Response Format:**
- Returns only the resource data for each item (most lightweight option)
- Excludes metadata and revision information
- Ideal for applications that only need the core resource content

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "department", "operator": "eq", "value": "Engineering"}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "created_time", "direction": "+"}, {"type": "data", "field_path": "name", "direction": "-"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Partial Response:**
- `partial`: List of fields to retrieve (e.g. '/field1', '/nested/field2')
- Useful for reducing payload size when only specific fields are needed

**Performance Benefits:**
- Minimal response payload size
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content only

**Examples:**
- `GET /create-new-character4-job/data` - Get first 10 resources (data only)
- `GET /create-new-character4-job/data?limit=20&offset=40` - Get resources 41-60 (data only)
- `GET /create-new-character4-job/data?is_deleted=false&limit=5` - Get 5 non-deleted resources (data only)
- `GET /create-new-character4-job/data?partial=/name&partial=/email` - Get specific fields for all resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List create-new-character4-job Data Only
 */
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryIsDeletedDefault = false;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryLimitDefault = 10;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryOffsetDefault = 0;

export const ListResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadZFilenameDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailOneMpCostDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailOneCooldownSecondsDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailOneDamageDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailTwoBuffPercentageDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeMpCostDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeCooldownSecondsDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeDamageDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeAreaOfEffectDefault = false;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDescriptionDefault = ``;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFRequiredLevelDefault = 1;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFRequiredClassDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseStatusDefault = `pending`;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseErrmsgDefault = null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseArtifactDefault = null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseRetriesDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseMaxRetriesDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicMaxRunsDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicRunsDefault = 0;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseLastHeartbeatAtDefault =
  null;

export const ListResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseItem = zod.object({
  payload: zod.object({
    x: zod.union([zod.number(), zod.string()]),
    y: zod.string(),
    name: zod.string(),
    z: zod
      .object({
        binary: zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
        filename: zod
          .union([zod.string(), zod.null()])
          .default(
            listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadZFilenameDefault,
          ),
      })
      .describe(
        "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
      ),
    f: zod.object({
      skname: zod.string(),
      detail: zod.union([
        zod.object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailOneMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailOneCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailOneDamageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailTwoBuffPercentageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeDamageDefault,
            ),
          area_of_effect: zod
            .boolean()
            .default(
              listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDetailThreeAreaOfEffectDefault,
            ),
        }),
      ]),
      description: zod
        .string()
        .default(
          listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFDescriptionDefault,
        ),
      required_level: zod
        .number()
        .default(
          listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFRequiredLevelDefault,
        ),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(
          listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePayloadFRequiredClassDefault,
        ),
    }),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseArtifactDefault),
  retries: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicMaxRunsDefault,
    ),
  periodic_runs: zod
    .number()
    .default(listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponsePeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(
      listResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseLastHeartbeatAtDefault,
    ),
});
export const ListResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponse = zod.array(
  ListResourcesDataV1AutocrudCreateNewCharacter4JobDataGetResponseItem,
);

/**
 * Retrieve a list of `create-new-character4-job` resources returning only the metadata.

**Response Format:**
- Returns only resource metadata for each item
- Excludes actual data content and revision information
- Ideal for browsing resource overviews and management operations

**Metadata Includes:**
- `resource_id`: Unique identifier of the resource
- `current_revision_id`: ID of the current active revision
- `total_revision_count`: Total number of revisions
- `created_time` / `updated_time`: Timestamps
- `created_by` / `updated_by`: User information
- `is_deleted`: Deletion status
- `schema_version`: Schema version information

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "age", "operator": "gt", "value": 25}]`

**Sorting Options:**
- Use `sorts` parameter to specify sorting criteria
- Format: JSON array of sort objects
- Each sort object has: `type`, `direction`, and either `key` (for meta) or `field_path` (for data)
- Sort types: `meta` (for metadata fields), `data` (for data content fields)
- Directions: `+` (ascending), `-` (descending)
- Meta sort keys: `created_time`, `updated_time`, `resource_id`
- Example: `[{"type": "meta", "key": "updated_time", "direction": "-"}, {"type": "data", "field_path": "department", "direction": "+"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Resource management and administration
- Audit trail analysis
- Bulk operations planning
- System monitoring and statistics

**Examples:**
- `GET /create-new-character4-job/meta` - Get metadata for first 10 resources
- `GET /create-new-character4-job/meta?is_deleted=true` - Get metadata for deleted resources
- `GET /create-new-character4-job/meta?created_bys=admin&limit=50` - Get metadata for admin-created resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List create-new-character4-job Metadata Only
 */
export const listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryIsDeletedDefault = false;
export const listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryLimitDefault = 10;
export const listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryOffsetDefault = 0;

export const ListResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponseSchemaVersionDefault =
  null;
export const listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponseIsDeletedDefault = false;

export const ListResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(listResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const ListResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponse = zod.array(
  ListResourcesMetaV1AutocrudCreateNewCharacter4JobMetaGetResponseItem,
);

/**
 * Retrieve a list of `create-new-character4-job` resources returning only the current revision information.

**Response Format:**
- Returns only revision information for the current revision of each resource
- Excludes actual data content and resource metadata
- Focuses on version control and revision tracking information

**Revision Info Includes:**
- `uid`: Unique identifier for this revision
- `resource_id`: ID of the parent resource
- `revision_id`: The revision identifier
- `parent_revision_id`: ID of the parent revision (if any)
- `schema_version`: Schema version used for this revision
- `data_hash`: Hash of the resource data for integrity checking
- `status`: Current status of the revision (draft/stable)

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "status", "operator": "eq", "value": "active"}]`

**Pagination:**
- `limit`: Maximum number of results to return (default: 10)
- `offset`: Number of results to skip for pagination (default: 0)

**Use Cases:**
- Version control system integration
- Data integrity verification through hashes
- Revision status monitoring
- Change tracking and audit trails

**Examples:**
- `GET /create-new-character4-job/revision-info` - Get current revision info for first 10 resources
- `GET /create-new-character4-job/revision-info?limit=100` - Get revision info for first 100 resources
- `GET /create-new-character4-job/revision-info?updated_bys=editor` - Get revision info for editor-modified resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @deprecated
 * @summary List create-new-character4-job Current Revision Info
 */
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryIsDeletedDefault = false;
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryLimitDefault = 10;
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryOffsetDefault = 0;

export const ListResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryParams =
  zod.object({
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(
        listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryIsDeletedDefault,
      )
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(
        listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryLimitDefault,
      )
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(
        listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetQueryOffsetDefault,
      )
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  });

export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const ListResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponseItem =
  zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponseParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponseSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    );
export const ListResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponse =
  zod.array(ListResourcesRevisionInfoV1AutocrudCreateNewCharacter4JobRevisionInfoGetResponseItem);

/**
 * Deprecated: use `GET /create-new-character4-job` instead. Retrieve a list of `create-new-character4-job` resources with complete information including data, metadata, and revision info.
 * @deprecated
 * @summary List create-new-character4-job Complete Information
 */
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryIsDeletedDefault = false;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryLimitDefault = 10;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryOffsetDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadZFilenameDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailOneMpCostDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailOneCooldownSecondsDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailOneDamageDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailTwoBuffPercentageDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeMpCostDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeCooldownSecondsDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeDamageDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeAreaOfEffectDefault = false;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDescriptionDefault = ``;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFRequiredLevelDefault = 1;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFRequiredClassDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataStatusDefault = `pending`;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataErrmsgDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataArtifactDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataRetriesDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataMaxRetriesDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseMetaSchemaVersionDefault =
  null;
export const listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseMetaIsDeletedDefault = false;

export const ListResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.object({
        x: zod.union([zod.number(), zod.string()]),
        y: zod.string(),
        name: zod.string(),
        z: zod
          .object({
            binary: zod
              .object({
                file_id: zod.string().optional(),
                size: zod.number().optional(),
                content_type: zod.string().optional(),
                data: zod.string().optional(),
              })
              .describe(
                'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
              ),
            filename: zod
              .union([zod.string(), zod.null()])
              .default(
                listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadZFilenameDefault,
              ),
          })
          .describe(
            "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
          ),
        f: zod.object({
          skname: zod.string(),
          detail: zod.union([
            zod.object({
              skill_type: zod.enum(['active']),
              mp_cost: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailOneMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailOneCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailOneDamageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['passive']),
              buff_percentage: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailTwoBuffPercentageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['ultimate']),
              mp_cost: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeDamageDefault,
                ),
              area_of_effect: zod
                .boolean()
                .default(
                  listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDetailThreeAreaOfEffectDefault,
                ),
            }),
          ]),
          description: zod
            .string()
            .default(
              listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFDescriptionDefault,
            ),
          required_level: zod
            .number()
            .default(
              listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFRequiredLevelDefault,
            ),
          required_class: zod
            .union([
              zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
              zod.null(),
            ])
            .default(
              listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPayloadFRequiredClassDefault,
            ),
        }),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataArtifactDefault,
        ),
      retries: zod
        .number()
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataRetriesDefault,
        ),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          listResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponse = zod.array(
  ListResourcesFullV1AutocrudCreateNewCharacter4JobFullGetResponseItem,
);

/**
 * Retrieve the count of `create-new-character4-job` resources matching the search criteria.

**Response Format:**
- Returns a single integer representing the count of matching resources.

**Filtering Options:**
- `is_deleted`: Filter by deletion status (true/false)
- `created_time_start/end`: Filter by creation time range (ISO format)
- `updated_time_start/end`: Filter by update time range (ISO format)
- `created_bys`: Filter by resource creators (list of usernames)
- `updated_bys`: Filter by resource updaters (list of usernames)
- `data_conditions`: Filter by data content (JSON format)
- `conditions`: Filter by meta fields or data content (JSON format)

**General Filtering:**
- Use `conditions` parameter to filter by metadata fields or data content
- Format: JSON array of condition objects
- Attributes: `field_path`, `operator`, `value`
- Meta fields: `resource_id`, `is_deleted`, `created_time`, `updated_time`, `created_by`, `updated_by`
- Example: `[{"field_path": "resource_id", "operator": "starts_with", "value": "user-"}]`

**Data Filtering:**
- Use `data_conditions` parameter to filter resources by their data content
- Format: JSON array of condition objects
- Each condition has: `field_path`, `operator`, `value`
- Supported operators: `eq`, `ne`, `gt`, `lt`, `gte`, `lte`, `contains`, `starts_with`, `ends_with`, `in`, `not_in`
- Example: `[{"field_path": "name", "operator": "contains", "value": "project"}]`

**Use Cases:**
- Getting total number of resources for pagination calculations
- Statistical analysis
- Checking existence of resources matching criteria

**Examples:**
- `GET /create-new-character4-job/count` - Get total count of all resources
- `GET /create-new-character4-job/count?is_deleted=false` - Get count of active resources

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary Count create-new-character4-job Resources
 */
export const getResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryIsDeletedDefault = false;
export const getResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryLimitDefault = 10;
export const getResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryOffsetDefault = 0;

export const GetResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(getResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(getResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(getResourcesCountV1AutocrudCreateNewCharacter4JobCountGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const GetResourcesCountV1AutocrudCreateNewCharacter4JobCountGetResponse = zod.number();

/**
 * Retrieve a list of `create-new-character4-job` resources.

Use the `returns` query parameter to control which sections are included in each item.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `limit` / `offset`: Pagination controls.
- `partial` / `partial[]`: Partial field selection.
- All standard filtering and sorting parameters.

**Examples:**
- `GET /create-new-character4-job` — full list (data + meta + revision_info)
- `GET /create-new-character4-job?returns=data` — data only
- `GET /create-new-character4-job?returns=data,meta` — data + meta, no revision_info
- `GET /create-new-character4-job?limit=20&offset=40` — pagination

**Error Responses:**
- `400`: Bad request - Invalid query parameters or search error
 * @summary List create-new-character4-job resources
 */
export const listResourcesV1AutocrudCreateNewCharacter4JobGetQueryIsDeletedDefault = false;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetQueryLimitDefault = 10;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetQueryOffsetDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetQueryReturnsDefault = `data,revision_info,meta`;

export const ListResourcesV1AutocrudCreateNewCharacter4JobGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(listResourcesV1AutocrudCreateNewCharacter4JobGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(listResourcesV1AutocrudCreateNewCharacter4JobGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(listResourcesV1AutocrudCreateNewCharacter4JobGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  returns: zod
    .string()
    .default(listResourcesV1AutocrudCreateNewCharacter4JobGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadZFilenameDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailOneMpCostDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailOneCooldownSecondsDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailOneDamageDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailTwoBuffPercentageDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeMpCostDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeCooldownSecondsDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeDamageDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeAreaOfEffectDefault = false;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDescriptionDefault = ``;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFRequiredLevelDefault = 1;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFRequiredClassDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataStatusDefault = `pending`;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataErrmsgDefault = null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataArtifactDefault = null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataRetriesDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataMaxRetriesDefault = null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicMaxRunsDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicRunsDefault = 0;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataLastHeartbeatAtDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseMetaSchemaVersionDefault =
  null;
export const listResourcesV1AutocrudCreateNewCharacter4JobGetResponseMetaIsDeletedDefault = false;

export const ListResourcesV1AutocrudCreateNewCharacter4JobGetResponseItem = zod.object({
  data: zod
    .object({
      payload: zod.object({
        x: zod.union([zod.number(), zod.string()]),
        y: zod.string(),
        name: zod.string(),
        z: zod
          .object({
            binary: zod
              .object({
                file_id: zod.string().optional(),
                size: zod.number().optional(),
                content_type: zod.string().optional(),
                data: zod.string().optional(),
              })
              .describe(
                'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
              ),
            filename: zod
              .union([zod.string(), zod.null()])
              .default(
                listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadZFilenameDefault,
              ),
          })
          .describe(
            "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
          ),
        f: zod.object({
          skname: zod.string(),
          detail: zod.union([
            zod.object({
              skill_type: zod.enum(['active']),
              mp_cost: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailOneMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailOneCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailOneDamageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['passive']),
              buff_percentage: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailTwoBuffPercentageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['ultimate']),
              mp_cost: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeDamageDefault,
                ),
              area_of_effect: zod
                .boolean()
                .default(
                  listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDetailThreeAreaOfEffectDefault,
                ),
            }),
          ]),
          description: zod
            .string()
            .default(
              listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFDescriptionDefault,
            ),
          required_level: zod
            .number()
            .default(
              listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFRequiredLevelDefault,
            ),
          required_class: zod
            .union([
              zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
              zod.null(),
            ])
            .default(
              listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPayloadFRequiredClassDefault,
            ),
        }),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataArtifactDefault),
      retries: zod
        .number()
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataRetriesDefault),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataMaxRetriesDefault),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicRunsDefault),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter4JobGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter4JobGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          listResourcesV1AutocrudCreateNewCharacter4JobGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseMetaSchemaVersionDefault),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(listResourcesV1AutocrudCreateNewCharacter4JobGetResponseMetaIsDeletedDefault),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});
export const ListResourcesV1AutocrudCreateNewCharacter4JobGetResponse = zod.array(
  ListResourcesV1AutocrudCreateNewCharacter4JobGetResponseItem,
);

/**
 * Create a new `create-new-character4-job` resource.

**Request Body:**
- Send the resource data as JSON in the request body
- The data will be validated against the `create-new-character4-job` schema

**Response:**
- Returns revision information for the newly created resource
- Includes `resource_id` and `revision_id` for tracking
- All resources are version-controlled from creation

**Examples:**
- `POST /create-new-character4-job` with JSON body - Create new resource
- Response includes resource and revision identifiers

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - General creation error
 * @summary Create create-new-character4-job
 */
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadZFilenameDefault = null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailOneMpCostDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailOneCooldownSecondsDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailOneDamageDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailTwoBuffPercentageDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeMpCostDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeCooldownSecondsDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeDamageDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeAreaOfEffectDefault = false;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDescriptionDefault = ``;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFRequiredLevelDefault = 1;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFRequiredClassDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyStatusDefault = `pending`;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyErrmsgDefault = null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyArtifactDefault = null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyRetriesDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyMaxRetriesDefault = null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicIntervalSecondsDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicMaxRunsDefault = null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicRunsDefault = 0;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicInitialDelaySecondsDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostBodyLastHeartbeatAtDefault = null;

export const CreateResourceV1AutocrudCreateNewCharacter4JobPostBody = zod.object({
  payload: zod.object({
    x: zod.union([zod.number(), zod.string()]),
    y: zod.string(),
    name: zod.string(),
    z: zod
      .object({
        binary: zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
        filename: zod
          .union([zod.string(), zod.null()])
          .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadZFilenameDefault),
      })
      .describe(
        "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
      ),
    f: zod.object({
      skname: zod.string(),
      detail: zod.union([
        zod.object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailOneMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailOneCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailOneDamageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailTwoBuffPercentageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeDamageDefault,
            ),
          area_of_effect: zod
            .boolean()
            .default(
              createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDetailThreeAreaOfEffectDefault,
            ),
        }),
      ]),
      description: zod
        .string()
        .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFDescriptionDefault),
      required_level: zod
        .number()
        .default(
          createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFRequiredLevelDefault,
        ),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(
          createResourceV1AutocrudCreateNewCharacter4JobPostBodyPayloadFRequiredClassDefault,
        ),
    }),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyArtifactDefault),
  retries: zod
    .number()
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicIntervalSecondsDefault),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      createResourceV1AutocrudCreateNewCharacter4JobPostBodyPeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(createResourceV1AutocrudCreateNewCharacter4JobPostBodyLastHeartbeatAtDefault),
});

export const createResourceV1AutocrudCreateNewCharacter4JobPostResponseParentRevisionIdDefault =
  null;
export const createResourceV1AutocrudCreateNewCharacter4JobPostResponseSchemaVersionDefault = null;

export const CreateResourceV1AutocrudCreateNewCharacter4JobPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCreateNewCharacter4JobPostResponseParentRevisionIdDefault),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(createResourceV1AutocrudCreateNewCharacter4JobPostResponseSchemaVersionDefault),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Batch delete `create-new-character4-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `false`** — only non-deleted resources are targeted
- Use `data_conditions` to filter specific resources for deletion
- Use `limit` to control the maximum number of resources to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the batch restore endpoint

**Response:**
- Returns a list of `ResourceMeta` for all deleted resources
- Each entry will have `is_deleted` set to `true`
- Empty list if no resources match the query

**Examples:**
- `DELETE /create-new-character4-job?limit=100` — Delete up to 100 resources
- `DELETE /create-new-character4-job?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Delete resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or deletion error
 * @summary Batch delete create-new-character4-job
 */
export const batchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryIsDeletedDefault = false;
export const batchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryLimitDefault = 10;
export const batchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryOffsetDefault = 0;

export const BatchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchDeleteV1AutocrudCreateNewCharacter4JobDeleteQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponseSchemaVersionDefault = null;
export const batchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponseIsDeletedDefault = false;

export const BatchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponse = zod.array(
  BatchDeleteV1AutocrudCreateNewCharacter4JobDeleteResponseItem,
);

/**
 * Export all (or filtered) **create-new-character4-job** resources as a
streaming ``.acbak`` archive.

Supports the same query parameters as the search endpoint
(``qb``, ``is_deleted``, time ranges, etc.) to filter
which resources are included.
 * @summary Export create-new-character4-job data
 */
export const exportModelV1AutocrudCreateNewCharacter4JobExportGetQueryIsDeletedDefault = false;
export const exportModelV1AutocrudCreateNewCharacter4JobExportGetQueryLimitDefault = 10;
export const exportModelV1AutocrudCreateNewCharacter4JobExportGetQueryOffsetDefault = 0;

export const ExportModelV1AutocrudCreateNewCharacter4JobExportGetQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(exportModelV1AutocrudCreateNewCharacter4JobExportGetQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(exportModelV1AutocrudCreateNewCharacter4JobExportGetQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(exportModelV1AutocrudCreateNewCharacter4JobExportGetQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const ExportModelV1AutocrudCreateNewCharacter4JobExportGetResponse = zod.unknown();

/**
 * Import **create-new-character4-job** resources from a ``.acbak`` archive.

The archive must contain a **create-new-character4-job** model section.
Use ``on_duplicate`` to control behaviour when a resource ID
already exists.
 * @summary Import create-new-character4-job data
 */
export const importModelV1AutocrudCreateNewCharacter4JobImportPostQueryOnDuplicateDefault = `overwrite`;

export const ImportModelV1AutocrudCreateNewCharacter4JobImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(importModelV1AutocrudCreateNewCharacter4JobImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const ImportModelV1AutocrudCreateNewCharacter4JobImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const ImportModelV1AutocrudCreateNewCharacter4JobImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

/**
 * Deprecated: use `GET /create-new-character4-job/{resource_id}?returns=meta` instead.
 * @deprecated
 * @summary Get create-new-character4-job Meta by ID
 */
export const GetResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetQueryIncludeDeletedDefault = false;

export const GetResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetQueryParams =
  zod.object({
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of meta fields to retrieve (e.g. '\/resource_id', '\/created_time')"),
    include_deleted: zod
      .boolean()
      .default(
        getResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return metadata even for soft-deleted resources'),
  });

export const getResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetResponseSchemaVersionDefault =
  null;
export const getResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetResponseIsDeletedDefault = false;

export const GetResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        getResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        getResourceMetaV1AutocrudCreateNewCharacter4JobResourceIdMetaGetResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Retrieve revision information for a specific `create-new-character4-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision

**Response:**
- Returns detailed revision information including:
  - `uid`: Unique identifier for this revision
  - `revision_id`: The revision identifier
  - `parent_revision_id`: ID of the parent revision (if any)
  - `schema_version`: Schema version used for this revision
  - `data_hash`: Hash of the resource data
  - `status`: Current status of the revision

**Use Cases:**
- Get metadata about a specific revision
- Track revision lineage and relationships
- Verify data integrity through hash checking
- Monitor revision status changes

**Examples:**
- `GET /create-new-character4-job/123/revision-info` - Get current revision info
- `GET /create-new-character4-job/123/revision-info?revision_id=rev456` - Get specific revision info

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get create-new-character4-job Revision Info
 */
export const GetResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetParams =
  zod.object({
    resource_id: zod.string(),
  });

export const GetResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of revision info fields to retrieve (e.g. '\/revision_id', '\/status')"),
  });

export const getResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetResponseParentRevisionIdDefault =
  null;
export const getResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetResponseSchemaVersionDefault =
  null;

export const GetResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetResponse =
  zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetResponseParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceRevisionInfoV1AutocrudCreateNewCharacter4JobResourceIdRevisionInfoGetResponseSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    );

/**
 * Deprecated: use `GET /create-new-character4-job/{resource_id}` instead.

Retrieve complete information for a `create-new-character4-job` resource including data, metadata, and revision info.

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve
- `partial` (optional): List of fields to retrieve
- `returns`: Comma-separated fields to return (data, revision_info, meta)

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get Complete create-new-character4-job Information
 */
export const GetResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetQueryIncludeDeletedDefault = false;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    include_deleted: zod
      .boolean()
      .default(
        getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return data even for soft-deleted resources'),
    returns: zod
      .string()
      .default(getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetQueryReturnsDefault)
      .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
  });

export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadZFilenameDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailOneMpCostDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailOneCooldownSecondsDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailOneDamageDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailTwoBuffPercentageDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeMpCostDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeCooldownSecondsDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeDamageDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeAreaOfEffectDefault = false;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDescriptionDefault = ``;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFRequiredLevelDefault = 1;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFRequiredClassDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataStatusDefault = `pending`;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataErrmsgDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataArtifactDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataRetriesDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataMaxRetriesDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicRunsDefault = 0;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseMetaIsDeletedDefault = false;

export const GetResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.object({
        x: zod.union([zod.number(), zod.string()]),
        y: zod.string(),
        name: zod.string(),
        z: zod
          .object({
            binary: zod
              .object({
                file_id: zod.string().optional(),
                size: zod.number().optional(),
                content_type: zod.string().optional(),
                data: zod.string().optional(),
              })
              .describe(
                'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
              ),
            filename: zod
              .union([zod.string(), zod.null()])
              .default(
                getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadZFilenameDefault,
              ),
          })
          .describe(
            "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
          ),
        f: zod.object({
          skname: zod.string(),
          detail: zod.union([
            zod.object({
              skill_type: zod.enum(['active']),
              mp_cost: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailOneMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailOneCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailOneDamageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['passive']),
              buff_percentage: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailTwoBuffPercentageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['ultimate']),
              mp_cost: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeDamageDefault,
                ),
              area_of_effect: zod
                .boolean()
                .default(
                  getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDetailThreeAreaOfEffectDefault,
                ),
            }),
          ]),
          description: zod
            .string()
            .default(
              getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFDescriptionDefault,
            ),
          required_level: zod
            .number()
            .default(
              getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFRequiredLevelDefault,
            ),
          required_class: zod
            .union([
              zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
              zod.null(),
            ])
            .default(
              getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPayloadFRequiredClassDefault,
            ),
        }),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataStatusDefault,
        ),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataErrmsgDefault,
        ),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataArtifactDefault,
        ),
      retries: zod
        .number()
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataRetriesDefault,
        ),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceFullV1AutocrudCreateNewCharacter4JobResourceIdFullGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Retrieve the complete revision history for a `create-new-character4-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Response:**
- Returns resource metadata and complete revision history including:
  - `meta`: Current resource metadata
  - `revisions`: Array of all revision information objects
    - Each revision includes uid, revision_id, parent_revision_id, schema_version, data_hash, and status
                    - `total`: Total number of revisions matching the query (before limit)
                    - `has_more`: Whether more revisions are available beyond the returned list

                **Query Parameters:**
                - `limit` (default 10): Maximum number of revisions to return
                - `offset` (default 0): Number of revisions to skip
                - `sort`: `created_time` or `-created_time` (default `-created_time`)
                - `created_time_start`: ISO datetime lower bound (inclusive)
                - `created_time_end`: ISO datetime upper bound (inclusive)
                - `from_revision_id`: Start listing from this revision_id (inclusive)
                - `chain_only`: Return only the parent chain from current revision

**Use Cases:**
- View complete change history of a resource
- Audit trail and compliance tracking
- Understanding resource evolution over time
- Selecting specific revisions for comparison or restoration

**Version Control Benefits:**
- Complete chronological history of all changes
- Parent-child relationships between revisions
- Data integrity verification through hashes
- Status tracking for each revision

**Examples:**
- `GET /create-new-character4-job/123/revision-list` - Get all revisions for resource 123
- `GET /create-new-character4-job/123/revision-list?limit=10&offset=20`
- `GET /create-new-character4-job/123/revision-list?created_time_start=2025-01-01T00:00:00`
- `GET /create-new-character4-job/123/revision-list?from_revision_id=rev123`
- `GET /create-new-character4-job/123/revision-list?chain_only=true`
- Response includes metadata and array of revision information

**Error Responses:**
- `404`: Resource not found
 * @summary Get create-new-character4-job Revision History
 */
export const GetResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetParams =
  zod.object({
    resource_id: zod.string(),
  });

export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryLimitDefault = 10;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryOffsetDefault = 0;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryChainOnlyDefault = false;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQuerySortDefault = `-created_time`;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryIncludeDeletedDefault = false;

export const GetResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryParams =
  zod.object({
    limit: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryLimitDefault,
      ),
    offset: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryOffsetDefault,
      ),
    created_time_start: zod.union([zod.string(), zod.null()]).optional(),
    created_time_end: zod.union([zod.string(), zod.null()]).optional(),
    from_revision_id: zod.union([zod.string(), zod.null()]).optional(),
    chain_only: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryChainOnlyDefault,
      ),
    sort: zod
      .string()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQuerySortDefault,
      ),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe(
        "List of fields to retrieve (e.g. '\/revision_id', '\/status', '\/meta\/resource_id')",
      ),
    include_deleted: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return revision list even for soft-deleted resources'),
  });

export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseMetaIsDeletedDefault = false;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault =
  null;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault =
  null;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseTotalDefault = 0;
export const getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseHasMoreDefault = false;

export const GetResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponse =
  zod.object({
    meta: zod
      .object({
        current_revision_id: zod.string(),
        resource_id: zod.string(),
        schema_version: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseMetaSchemaVersionDefault,
          ),
        total_revision_count: zod.number(),
        created_time: zod.string(),
        updated_time: zod.string(),
        created_by: zod.string(),
        updated_by: zod.string(),
        is_deleted: zod
          .boolean()
          .default(
            getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseMetaIsDeletedDefault,
          ),
        indexed_data: zod.looseObject({}).optional(),
      })
      .describe(
        'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
      ),
    revisions: zod.array(
      zod
        .object({
          uid: zod.uuid(),
          resource_id: zod.string(),
          revision_id: zod.string(),
          parent_revision_id: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseRevisionsItemParentRevisionIdDefault,
            ),
          parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
          schema_version: zod
            .union([zod.string(), zod.null()])
            .default(
              getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseRevisionsItemSchemaVersionDefault,
            ),
          data_hash: zod.string().optional(),
          status: zod.enum(['draft', 'stable']),
          created_time: zod.string(),
          updated_time: zod.string(),
          created_by: zod.string(),
          updated_by: zod.string(),
        })
        .describe(
          'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
        ),
    ),
    total: zod
      .number()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseTotalDefault,
      ),
    has_more: zod
      .boolean()
      .default(
        getResourceRevisionListV1AutocrudCreateNewCharacter4JobResourceIdRevisionListGetResponseHasMoreDefault,
      ),
  });

/**
 * Retrieve only the data content of a `create-new-character4-job` resource.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource

**Query Parameters:**
- `revision_id` (optional): Specific revision ID to retrieve. If not provided, returns the current revision
- `partial` (optional): List of fields to retrieve (e.g. '/field1', '/nested/field2')

**Response:**
- Returns only the resource data without metadata or revision information
- The response format matches the original resource schema
- Most lightweight option for retrieving resource content

**Use Cases:**
- Simple data retrieval when metadata is not needed
- Efficient resource content access
- Integration with external systems that only need the data
- Lightweight API calls to minimize response size
- Fetching only necessary data for UI components (using partial)

**Performance Benefits:**
- Minimal response payload
- Faster response times
- Reduced bandwidth usage
- Direct access to resource content

**Examples:**
- `GET /create-new-character4-job/123/data` - Get current resource data only
- `GET /create-new-character4-job/123/data?revision_id=rev456` - Get specific revision data only
- `GET /create-new-character4-job/123/data?partial=/name&partial=/email` - Get specific fields

**Error Responses:**
- `404`: Resource or revision not found
 * @deprecated
 * @summary Get create-new-character4-job Data
 */
export const GetResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetQueryIncludeDeletedDefault = false;

export const GetResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetQueryParams =
  zod.object({
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    include_deleted: zod
      .boolean()
      .default(
        getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetQueryIncludeDeletedDefault,
      )
      .describe('If true, return data even for soft-deleted resources'),
  });

export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadZFilenameDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailOneMpCostDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailOneCooldownSecondsDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailOneDamageDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailTwoBuffPercentageDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeMpCostDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeCooldownSecondsDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeDamageDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeAreaOfEffectDefault = false;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDescriptionDefault = ``;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFRequiredLevelDefault = 1;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFRequiredClassDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseStatusDefault = `pending`;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseErrmsgDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseArtifactDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseRetriesDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseMaxRetriesDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicIntervalSecondsDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicMaxRunsDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicRunsDefault = 0;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault =
  null;
export const getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseLastHeartbeatAtDefault =
  null;

export const GetResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponse = zod.object({
  payload: zod.object({
    x: zod.union([zod.number(), zod.string()]),
    y: zod.string(),
    name: zod.string(),
    z: zod
      .object({
        binary: zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
        filename: zod
          .union([zod.string(), zod.null()])
          .default(
            getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadZFilenameDefault,
          ),
      })
      .describe(
        "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
      ),
    f: zod.object({
      skname: zod.string(),
      detail: zod.union([
        zod.object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailOneMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailOneCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailOneDamageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailTwoBuffPercentageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeDamageDefault,
            ),
          area_of_effect: zod
            .boolean()
            .default(
              getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDetailThreeAreaOfEffectDefault,
            ),
        }),
      ]),
      description: zod
        .string()
        .default(
          getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFDescriptionDefault,
        ),
      required_level: zod
        .number()
        .default(
          getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFRequiredLevelDefault,
        ),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(
          getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePayloadFRequiredClassDefault,
        ),
    }),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseArtifactDefault,
    ),
  retries: zod
    .number()
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseRetriesDefault,
    ),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseMaxRetriesDefault,
    ),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicMaxRunsDefault,
    ),
  periodic_runs: zod
    .number()
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicRunsDefault,
    ),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponsePeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(
      getResourceDataV1AutocrudCreateNewCharacter4JobResourceIdDataGetResponseLastHeartbeatAtDefault,
    ),
});

/**
 * @summary Get blob content
 */
export const GetBlobV1AutocrudCreateNewCharacter4JobResourceIdBlobsFileIdGetParams = zod.object({
  resource_id: zod.string().describe('Resource ID'),
  file_id: zod.string().describe('File ID of the blob'),
});

/**
 * Retrieve a `create-new-character4-job` resource by ID.

Use the `returns` query parameter to control which sections are included in the response.
By default all sections are returned: `data`, `revision_info`, `meta`.

**Query Parameters:**
- `returns` (default `"data,revision_info,meta"`): Comma-separated list of sections to include.
  Allowed values: `data`, `revision_info`, `meta`.
- `revision_id` (optional): Specific revision ID to retrieve.
- `partial` / `partial[]` (optional): List of fields for partial response.

**Examples:**
- `GET /create-new-character4-job/123` — full response (data + meta + revision_info)
- `GET /create-new-character4-job/123?returns=data` — data only
- `GET /create-new-character4-job/123?returns=data,meta` — data + meta, no revision_info
- `GET /create-new-character4-job/123?returns=meta` — metadata only
- `GET /create-new-character4-job/123?partial=/name&partial=/email` — partial data fields

**Error Responses:**
- `404`: Resource or revision not found
 * @summary Get create-new-character4-job resource
 */
export const GetResourceV1AutocrudCreateNewCharacter4JobResourceIdGetParams = zod.object({
  resource_id: zod.string(),
});

export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetQueryIncludeDeletedDefault = false;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetQueryReturnsDefault = `data,revision_info,meta`;

export const GetResourceV1AutocrudCreateNewCharacter4JobResourceIdGetQueryParams = zod.object({
  revision_id: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Specific revision ID to retrieve. If not provided, returns the current revision'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
  include_deleted: zod
    .boolean()
    .default(getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetQueryIncludeDeletedDefault)
    .describe('If true, return data even for soft-deleted resources'),
  returns: zod
    .string()
    .default(getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetQueryReturnsDefault)
    .describe('Fields to return, comma-separated. Options: data, revision_info, meta'),
});

export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadZFilenameDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailOneMpCostDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailOneCooldownSecondsDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailOneDamageDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailTwoBuffPercentageDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeMpCostDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeCooldownSecondsDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeDamageDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeAreaOfEffectDefault = false;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDescriptionDefault = ``;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFRequiredLevelDefault = 1;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFRequiredClassDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataStatusDefault = `pending`;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataErrmsgDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataArtifactDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataRetriesDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataMaxRetriesDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicIntervalSecondsDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicMaxRunsDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicRunsDefault = 0;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataLastHeartbeatAtDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseRevisionInfoParentRevisionIdDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseRevisionInfoSchemaVersionDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseMetaSchemaVersionDefault =
  null;
export const getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseMetaIsDeletedDefault = false;

export const GetResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponse = zod.object({
  data: zod
    .object({
      payload: zod.object({
        x: zod.union([zod.number(), zod.string()]),
        y: zod.string(),
        name: zod.string(),
        z: zod
          .object({
            binary: zod
              .object({
                file_id: zod.string().optional(),
                size: zod.number().optional(),
                content_type: zod.string().optional(),
                data: zod.string().optional(),
              })
              .describe(
                'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
              ),
            filename: zod
              .union([zod.string(), zod.null()])
              .default(
                getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadZFilenameDefault,
              ),
          })
          .describe(
            "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
          ),
        f: zod.object({
          skname: zod.string(),
          detail: zod.union([
            zod.object({
              skill_type: zod.enum(['active']),
              mp_cost: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailOneMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailOneCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailOneDamageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['passive']),
              buff_percentage: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailTwoBuffPercentageDefault,
                ),
            }),
            zod.object({
              skill_type: zod.enum(['ultimate']),
              mp_cost: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeMpCostDefault,
                ),
              cooldown_seconds: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeCooldownSecondsDefault,
                ),
              damage: zod
                .number()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeDamageDefault,
                ),
              area_of_effect: zod
                .boolean()
                .default(
                  getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDetailThreeAreaOfEffectDefault,
                ),
            }),
          ]),
          description: zod
            .string()
            .default(
              getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFDescriptionDefault,
            ),
          required_level: zod
            .number()
            .default(
              getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFRequiredLevelDefault,
            ),
          required_class: zod
            .union([
              zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
              zod.null(),
            ])
            .default(
              getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPayloadFRequiredClassDefault,
            ),
        }),
      }),
      status: zod
        .enum(['completed', 'failed', 'pending', 'processing'])
        .default(getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataStatusDefault),
      errmsg: zod
        .union([zod.string(), zod.null()])
        .default(getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataErrmsgDefault),
      artifact: zod
        .union([zod.looseObject({}), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataArtifactDefault,
        ),
      retries: zod
        .number()
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataRetriesDefault,
        ),
      max_retries: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataMaxRetriesDefault,
        ),
      periodic_interval_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicIntervalSecondsDefault,
        ),
      periodic_max_runs: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicMaxRunsDefault,
        ),
      periodic_runs: zod
        .number()
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicRunsDefault,
        ),
      periodic_initial_delay_seconds: zod
        .union([zod.number(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataPeriodicInitialDelaySecondsDefault,
        ),
      last_heartbeat_at: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseDataLastHeartbeatAtDefault,
        ),
    })
    .optional(),
  revision_info: zod
    .object({
      uid: zod.uuid(),
      resource_id: zod.string(),
      revision_id: zod.string(),
      parent_revision_id: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseRevisionInfoParentRevisionIdDefault,
        ),
      parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseRevisionInfoSchemaVersionDefault,
        ),
      data_hash: zod.string().optional(),
      status: zod.enum(['draft', 'stable']),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
    })
    .optional()
    .describe(
      'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
    ),
  meta: zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseMetaSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          getResourceV1AutocrudCreateNewCharacter4JobResourceIdGetResponseMetaIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .optional()
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    ),
});

/**
 * Update an existing `create-new-character4-job` resource by replacing it entirely.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to update

**Request Body:**
- Send the complete updated resource data as JSON
- The data will be validated against the `create-new-character4-job` schema
- This is a full replacement update (PUT semantics)

**Response:**
- Returns revision information for the updated resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each update creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across updates

**Examples:**
- `PUT /create-new-character4-job/123` with JSON body - Update resource with ID 123
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error - Invalid data format or missing required fields
- `400`: Bad request - Resource not found or update error
- `404`: Resource does not exist
 * @summary Update create-new-character4-job
 */
export const UpdateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutParams = zod.object({
  resource_id: zod.string(),
});

export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutQueryModeDefault = `update`;

export const UpdateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutQueryModeDefault),
});

export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadZFilenameDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailOneMpCostDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailOneCooldownSecondsDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailOneDamageDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailTwoBuffPercentageDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeMpCostDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeCooldownSecondsDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeDamageDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeAreaOfEffectDefault = false;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDescriptionDefault = ``;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFRequiredLevelDefault = 1;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFRequiredClassDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyStatusDefault = `pending`;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyErrmsgDefault = null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyArtifactDefault = null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyRetriesDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyMaxRetriesDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicIntervalSecondsDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicMaxRunsDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicRunsDefault = 0;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicInitialDelaySecondsDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyLastHeartbeatAtDefault =
  null;

export const UpdateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBody = zod.object({
  payload: zod.object({
    x: zod.union([zod.number(), zod.string()]),
    y: zod.string(),
    name: zod.string(),
    z: zod
      .object({
        binary: zod
          .object({
            file_id: zod.string().optional(),
            size: zod.number().optional(),
            content_type: zod.string().optional(),
            data: zod.string().optional(),
          })
          .describe(
            'A wrapper for binary data that handles storage optimization.\n\nWhen creating a resource, you can populate the `data` field with bytes.\nThe system will automatically extract it, store it in the blob store,\nand populate `file_id` (which is the hash of the content) and `size`.\nThe `data` field will be cleared in the stored resource.',
          ),
        filename: zod
          .union([zod.string(), zod.null()])
          .default(
            updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadZFilenameDefault,
          ),
      })
      .describe(
        "Serialisable surrogate for ``fastapi.UploadFile`` in Job payloads.\n\nUses :class:`~autocrud.types.Binary` to carry the file content and\nmetadata (``data``, ``content_type``, ``size``), plus an extra\n``filename`` field that ``Binary`` does not have.\n\nAt \*\*endpoint\*\* time the wrapper reads the incoming file and stores its\ncontent in the ``binary`` field.  At \*\*job-execution\*\* time the\nframework reconstructs a real ``UploadFile`` from these fields before\ncalling the user's handler.",
      ),
    f: zod.object({
      skname: zod.string(),
      detail: zod.union([
        zod.object({
          skill_type: zod.enum(['active']),
          mp_cost: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailOneMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailOneCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailOneDamageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['passive']),
          buff_percentage: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailTwoBuffPercentageDefault,
            ),
        }),
        zod.object({
          skill_type: zod.enum(['ultimate']),
          mp_cost: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeMpCostDefault,
            ),
          cooldown_seconds: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeCooldownSecondsDefault,
            ),
          damage: zod
            .number()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeDamageDefault,
            ),
          area_of_effect: zod
            .boolean()
            .default(
              updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDetailThreeAreaOfEffectDefault,
            ),
        }),
      ]),
      description: zod
        .string()
        .default(
          updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFDescriptionDefault,
        ),
      required_level: zod
        .number()
        .default(
          updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFRequiredLevelDefault,
        ),
      required_class: zod
        .union([
          zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
          zod.null(),
        ])
        .default(
          updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPayloadFRequiredClassDefault,
        ),
    }),
  }),
  status: zod
    .enum(['completed', 'failed', 'pending', 'processing'])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyStatusDefault),
  errmsg: zod
    .union([zod.string(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyErrmsgDefault),
  artifact: zod
    .union([zod.looseObject({}), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyArtifactDefault),
  retries: zod
    .number()
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyRetriesDefault),
  max_retries: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyMaxRetriesDefault),
  periodic_interval_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicIntervalSecondsDefault,
    ),
  periodic_max_runs: zod
    .union([zod.number(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicMaxRunsDefault),
  periodic_runs: zod
    .number()
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicRunsDefault),
  periodic_initial_delay_seconds: zod
    .union([zod.number(), zod.null()])
    .default(
      updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyPeriodicInitialDelaySecondsDefault,
    ),
  last_heartbeat_at: zod
    .union([zod.string(), zod.null()])
    .default(updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutBodyLastHeartbeatAtDefault),
});

export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutResponseParentRevisionIdDefault =
  null;
export const updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutResponseSchemaVersionDefault =
  null;

export const UpdateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        updateResourceV1AutocrudCreateNewCharacter4JobResourceIdPutResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Partially update a `create-new-character4-job` resource using JSON Patch operations.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to patch

**Request Body:**
- Send JSON Patch operations as an array of patch objects
- Each patch operation should follow RFC 6902 JSON Patch specification
- Supports operations: `add`, `remove`, `replace`, `move`, `copy`, `test`

**JSON Patch Format:**
```json
[
{"op": "replace", "path": "/field_name", "value": "new_value"},
{"op": "add", "path": "/new_field", "value": "field_value"},
{"op": "remove", "path": "/unwanted_field"}
]
```

**Response:**
- Returns revision information for the patched resource
- Includes new `revision_id` and maintains `resource_id`
- Creates a new version while preserving revision history

**Version Control:**
- Each patch creates a new revision
- Previous versions remain accessible via revision history
- Original resource ID is preserved across patches

**Examples:**
- `PATCH /create-new-character4-job/123` with JSON Patch array - Apply patches to resource
- Response includes updated revision information

**Error Responses:**
- `422`: Validation error (schema/type validation or custom validator)
- `409`: Conflict - unique constraint violation
- `400`: Bad request (invalid patch operations, resource not found, permission denied, or other patch failures)
 * @summary Partially update create-new-character4-job
 */
export const PatchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchParams = zod.object({
  resource_id: zod.string(),
});

export const patchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchQueryModeDefault = `update`;

export const PatchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchQueryParams = zod.object({
  change_status: zod.union([zod.enum(['draft', 'stable']), zod.null()]).optional(),
  mode: zod
    .enum(['update', 'modify'])
    .default(patchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchQueryModeDefault),
});

export const PatchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchBodyItem = zod.union([
  zod.object({
    op: zod.enum(['add']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['remove']),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['replace']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['move']),
    from: zod.string(),
    path: zod.string(),
  }),
  zod.object({
    op: zod.enum(['test']),
    path: zod.string(),
    value: zod.unknown(),
  }),
  zod.object({
    op: zod.enum(['copy']),
    from: zod.string(),
    path: zod.string(),
  }),
]);
export const PatchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchBody = zod.array(
  PatchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchBodyItem,
);

export const patchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchResponseParentRevisionIdDefault =
  null;
export const patchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchResponseSchemaVersionDefault =
  null;

export const PatchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        patchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        patchResourceV1AutocrudCreateNewCharacter4JobResourceIdPatchResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Delete a `create-new-character4-job` resource by marking it as deleted.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to delete

**Soft Delete:**
- Resources are marked as deleted rather than permanently removed
- Deleted resources can be restored using the restore endpoint
- All revision history is preserved after deletion

**Response:**
- Returns updated resource metadata
- The `is_deleted` field will be set to `true`
- Includes updated timestamp and user information

**Version Control:**
- Deletion creates a new revision in the resource history
- Previous versions remain accessible for audit purposes
- The resource can be restored to any previous revision

**Examples:**
- `DELETE /create-new-character4-job/123` - Mark resource with ID 123 as deleted
- Response shows updated metadata with deletion status

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
- `404`: Resource does not exist
 * @summary Delete create-new-character4-job
 */
export const DeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdDeleteParams = zod.object({
  resource_id: zod.string(),
});

export const deleteResourceV1AutocrudCreateNewCharacter4JobResourceIdDeleteResponseSchemaVersionDefault =
  null;
export const deleteResourceV1AutocrudCreateNewCharacter4JobResourceIdDeleteResponseIsDeletedDefault = false;

export const DeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdDeleteResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        deleteResourceV1AutocrudCreateNewCharacter4JobResourceIdDeleteResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        deleteResourceV1AutocrudCreateNewCharacter4JobResourceIdDeleteResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Switch a `create-new-character4-job` resource to a specific revision, making it the current active version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource
- `revision_id`: The specific revision ID to switch to

**Version Control Operation:**
- Changes the current active revision of the resource
- The specified revision becomes the new "current" version
- All previous revisions remain preserved in history
- Does not create a new revision, just changes the pointer

**Response:**
- Returns confirmation with resource and revision information
- Includes the new `current_revision_id`
- Provides success message confirming the switch

**Use Cases:**
- Roll back to a previous version of a resource
- Restore a specific revision as the current version
- Undo recent changes by switching to an earlier revision
- Switch between different versions for testing or comparison

**Examples:**
- `POST /create-new-character4-job/123/switch/rev456` - Switch resource 123 to revision rev456
- Response confirms the successful revision switch

**Error Responses:**
- `400`: Bad request - Invalid revision ID or switch operation failed
- `404`: Resource or revision does not exist

**Note:** This operation changes which revision is considered "current" but does not modify the revision history.
 * @summary Switch create-new-character4-job to specific revision
 */
export const SwitchRevisionV1AutocrudCreateNewCharacter4JobResourceIdSwitchRevisionIdPostParams =
  zod.object({
    resource_id: zod.string(),
    revision_id: zod.string(),
  });

export const switchRevisionV1AutocrudCreateNewCharacter4JobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault =
  null;
export const switchRevisionV1AutocrudCreateNewCharacter4JobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault = false;

export const SwitchRevisionV1AutocrudCreateNewCharacter4JobResourceIdSwitchRevisionIdPostResponse =
  zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          switchRevisionV1AutocrudCreateNewCharacter4JobResourceIdSwitchRevisionIdPostResponseSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          switchRevisionV1AutocrudCreateNewCharacter4JobResourceIdSwitchRevisionIdPostResponseIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    );

/**
 * Re-enqueue a completed or failed `create-new-character4-job` job.

Resets the job status to `pending`, clears `retries`, `errmsg`,
and `artifact`, then places the job back into the message queue
for processing.  The original `payload` is preserved.

**Allowed source statuses:** `completed`, `failed`.
Jobs that are `pending` or `processing` cannot be rerun.

**Response:** Returns the new revision info after the reset.
 * @summary Rerun a create-new-character4-job job
 */
export const RerunJobV1AutocrudCreateNewCharacter4JobResourceIdRerunPostParams = zod.object({
  resource_id: zod.string(),
});

export const rerunJobV1AutocrudCreateNewCharacter4JobResourceIdRerunPostResponseParentRevisionIdDefault =
  null;
export const rerunJobV1AutocrudCreateNewCharacter4JobResourceIdRerunPostResponseSchemaVersionDefault =
  null;

export const RerunJobV1AutocrudCreateNewCharacter4JobResourceIdRerunPostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        rerunJobV1AutocrudCreateNewCharacter4JobResourceIdRerunPostResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        rerunJobV1AutocrudCreateNewCharacter4JobResourceIdRerunPostResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * Retrieve the execution log of a `create-new-character4-job` job.

Returns the log as plain text (``text/plain``).  If no logs
have been recorded (e.g. the job hasn't started yet or no
blob store is configured), returns HTTP 204 No Content.
 * @summary Get logs for a create-new-character4-job job
 */
export const GetJobLogsV1AutocrudCreateNewCharacter4JobResourceIdLogsGetParams = zod.object({
  resource_id: zod.string(),
});

/**
 * **Permanently** delete a `create-new-character4-job` resource and all its revision data.

**⚠️ WARNING: This operation is irreversible!**

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to permanently delete

**Permanent Delete:**
- Physically removes the resource metadata from storage
- Physically removes all revision data from storage
- Cannot be undone — the resource and all its history are lost forever
- Works on both active and soft-deleted resources

**Response:**
- Returns the resource metadata as it was before deletion

**Error Responses:**
- `400`: Bad request - Resource not found or deletion error
 * @summary Permanently delete create-new-character4-job
 */
export const PermanentlyDeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdPermanentlyDeleteParams =
  zod.object({
    resource_id: zod.string(),
  });

export const permanentlyDeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdPermanentlyDeleteResponseSchemaVersionDefault =
  null;
export const permanentlyDeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdPermanentlyDeleteResponseIsDeletedDefault = false;

export const PermanentlyDeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdPermanentlyDeleteResponse =
  zod
    .object({
      current_revision_id: zod.string(),
      resource_id: zod.string(),
      schema_version: zod
        .union([zod.string(), zod.null()])
        .default(
          permanentlyDeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdPermanentlyDeleteResponseSchemaVersionDefault,
        ),
      total_revision_count: zod.number(),
      created_time: zod.string(),
      updated_time: zod.string(),
      created_by: zod.string(),
      updated_by: zod.string(),
      is_deleted: zod
        .boolean()
        .default(
          permanentlyDeleteResourceV1AutocrudCreateNewCharacter4JobResourceIdPermanentlyDeleteResponseIsDeletedDefault,
        ),
      indexed_data: zod.looseObject({}).optional(),
    })
    .describe(
      'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
    );

/**
 * Restore a previously deleted `create-new-character4-job` resource, making it active again.

**Path Parameters:**
- `resource_id`: The unique identifier of the deleted resource to restore

**Restore Operation:**
- Unmarks a soft-deleted resource, making it active again
- Changes the `is_deleted` status from `true` to `false`
- All revision history remains intact during restoration
- The resource becomes accessible through normal operations again

**Response:**
- Returns confirmation with resource metadata
- Includes updated `is_deleted` status (will be `false`)
- Shows current `revision_id` and resource information
- Provides success message confirming the restoration

**Use Cases:**
- Recover accidentally deleted resources
- Restore resources that were soft-deleted for temporary removal
- Undo deletion operations without losing data or history
- Reactivate archived resources for continued use

**Examples:**
- `POST /create-new-character4-job/123/restore` - Restore deleted resource with ID 123
- Response shows updated metadata with `is_deleted: false`

**Error Responses:**
- `400`: Bad request - Resource is not deleted or restore operation failed
- `404`: Resource does not exist

**Note:** Only works with soft-deleted resources. The resource must exist and be marked as deleted to be restored.
 * @summary Restore deleted create-new-character4-job
 */
export const RestoreResourceV1AutocrudCreateNewCharacter4JobResourceIdRestorePostParams =
  zod.object({
    resource_id: zod.string(),
  });

export const restoreResourceV1AutocrudCreateNewCharacter4JobResourceIdRestorePostResponseSchemaVersionDefault =
  null;
export const restoreResourceV1AutocrudCreateNewCharacter4JobResourceIdRestorePostResponseIsDeletedDefault = false;

export const RestoreResourceV1AutocrudCreateNewCharacter4JobResourceIdRestorePostResponse = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        restoreResourceV1AutocrudCreateNewCharacter4JobResourceIdRestorePostResponseSchemaVersionDefault,
      ),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(
        restoreResourceV1AutocrudCreateNewCharacter4JobResourceIdRestorePostResponseIsDeletedDefault,
      ),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );

/**
 * Batch restore previously deleted `create-new-character4-job` resources matching the given query conditions.

**Query Parameters:**
- Uses the same search parameters as the list endpoint
- `is_deleted` parameter is **forced to `true`** — only deleted resources are targeted
- Use `data_conditions` to filter specific resources for restoration
- Use `limit` to control the maximum number of resources to restore

**Restore Operation:**
- Unmarks soft-deleted resources, making them active again
- All revision history remains intact during restoration

**Response:**
- Returns a list of `ResourceMeta` for all restored resources
- Each entry will have `is_deleted` set to `false`
- Empty list if no resources match the query

**Examples:**
- `POST /create-new-character4-job/restore?limit=100` — Restore up to 100 deleted resources
- `POST /create-new-character4-job/restore?data_conditions=[{"field_path":"age","operator":"gt","value":25}]` — Restore deleted resources with age > 25

**Error Responses:**
- `400`: Bad request — Invalid query parameters or restore error
 * @summary Batch restore deleted create-new-character4-job
 */
export const batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryIsDeletedDefault = false;
export const batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryLimitDefault = 10;
export const batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryOffsetDefault = 0;

export const BatchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryParams = zod.object({
  qb: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
    ),
  is_deleted: zod
    .union([zod.boolean(), zod.null()])
    .default(batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryIsDeletedDefault)
    .describe('Filter by deletion status'),
  created_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time start (ISO format)'),
  created_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by created time end (ISO format)'),
  updated_time_start: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time start (ISO format)'),
  updated_time_end: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe('Filter by updated time end (ISO format)'),
  created_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by creators'),
  updated_bys: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Filter by updaters'),
  data_conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
    ),
  conditions: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
    ),
  sorts: zod
    .union([zod.string(), zod.null()])
    .optional()
    .describe(
      'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
    ),
  limit: zod
    .number()
    .default(batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryLimitDefault)
    .describe('Maximum number of results'),
  offset: zod
    .number()
    .default(batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostQueryOffsetDefault)
    .describe('Number of results to skip'),
  partial: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
});

export const batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponseSchemaVersionDefault =
  null;
export const batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponseIsDeletedDefault = false;

export const BatchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponseItem = zod
  .object({
    current_revision_id: zod.string(),
    resource_id: zod.string(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponseSchemaVersionDefault),
    total_revision_count: zod.number(),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
    is_deleted: zod
      .boolean()
      .default(batchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponseIsDeletedDefault),
    indexed_data: zod.looseObject({}).optional(),
  })
  .describe(
    'Metadata about a resource, including its current revision and status.\n\nThis class provides essential information about a resource without including\nthe full data content.',
  );
export const BatchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponse = zod.array(
  BatchRestoreV1AutocrudCreateNewCharacter4JobRestorePostResponseItem,
);

/**
 * Test migration for resources with real-time progress updates via http streaming.
No data will be written back to storage - memory-only testing.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to test:
  - Omit: test current revision only (default)
  - `"all"`: test every revision of each resource
  - A specific revision ID: test only that revision
 * @summary Test Migrate Resources
 */
export const testMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryIsDeletedDefault = false;
export const testMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryLimitDefault = 10;
export const testMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryOffsetDefault = 0;

export const TestMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryParams =
  zod.object({
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(
        testMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryIsDeletedDefault,
      )
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(testMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryLimitDefault)
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(
        testMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostQueryOffsetDefault,
      )
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
      ),
  });

export const TestMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateTestPostResponse =
  zod.unknown();

/**
 * Execute migration for resources with real-time progress updates via http streaming.

**Query Parameters:**
- `revision_id` (optional): Controls which revisions to migrate:
  - Omit: migrate current revision only (default)
  - `"all"`: migrate every revision of each resource
  - A specific revision ID: migrate only that revision
 * @summary Execute Migrate Resources
 */
export const executeMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryIsDeletedDefault = false;
export const executeMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryLimitDefault = 10;
export const executeMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryOffsetDefault = 0;

export const ExecuteMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryParams =
  zod.object({
    qb: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        "Query Builder expression. Example: \"QB['foo'] == 123\" or \"QB['age'].gt(18) & QB['status'].eq('active')\"",
      ),
    is_deleted: zod
      .union([zod.boolean(), zod.null()])
      .default(
        executeMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryIsDeletedDefault,
      )
      .describe('Filter by deletion status'),
    created_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time start (ISO format)'),
    created_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by created time end (ISO format)'),
    updated_time_start: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time start (ISO format)'),
    updated_time_end: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Filter by updated time end (ISO format)'),
    created_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by creators'),
    updated_bys: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe('Filter by updaters'),
    data_conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Data filter conditions in JSON format. Example: \'[{\"field_path\": \"department\", \"operator\": \"eq\", \"value\": \"Engineering\"}]\'',
      ),
    conditions: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'General filter conditions in JSON format for meta fields or data. Example: \'[{\"field_path\": \"resource_id\", \"operator\": \"starts_with\", \"value\": \"user-\"}]\'',
      ),
    sorts: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Sort conditions in JSON format. Example: \'[{\"type\": \"meta\", \"key\": \"created_time\", \"direction\": \"+\"}, {\"type\": \"data\", \"field_path\": \"name\", \"direction\": \"-\"}]\'',
      ),
    limit: zod
      .number()
      .default(
        executeMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryLimitDefault,
      )
      .describe('Maximum number of results'),
    offset: zod
      .number()
      .default(
        executeMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostQueryOffsetDefault,
      )
      .describe('Number of results to skip'),
    partial: zod
      .union([zod.array(zod.string()), zod.null()])
      .optional()
      .describe("List of fields to retrieve (e.g. '\/field1', '\/nested\/field2')"),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe(
        'Revision scope: omit for current revision, \"all\" for every revision, or a specific revision ID.',
      ),
  });

export const ExecuteMigrateResourcesV1AutocrudCreateNewCharacter4JobMigrateExecutePostResponse =
  zod.unknown();

/**
 * Migrate a single `create-new-character4-job` resource to the current schema version.

**Path Parameters:**
- `resource_id`: The unique identifier of the resource to migrate

**Query Parameters:**
- `write_back` (optional, default=true): Whether to write migrated data back to storage
- `revision_id` (optional): A specific revision to migrate.
  When omitted the current revision is migrated.

**Response:**
- Returns migration progress for the single resource:
  - `resource_id`: The resource that was migrated
  - `status`: Migration status (success/failed/skipped)
  - `message`: Success message or additional info
  - `error`: Error message if migration failed

**Use Cases:**
- Migrate specific resource after schema update
- Migrate an older revision so it can be switched to
- Fix individual resource migration issues
- Test migration on single resource
- Manual resource upgrade

**Examples:**
- `POST /create-new-character4-job/migrate/single/123` - Migrate resource 123
- `POST /create-new-character4-job/migrate/single/123?revision_id=123:1` - Migrate specific revision
- `POST /create-new-character4-job/migrate/single/123?write_back=false` - Test migrate resource 123

**Error Responses:**
- `404`: Resource not found
- `400`: Migration failed
 * @summary Migrate Single create-new-character4-job Resource
 */
export const MigrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostParams =
  zod.object({
    resource_id: zod.string(),
  });

export const migrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostQueryWriteBackDefault = true;

export const MigrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostQueryParams =
  zod.object({
    write_back: zod
      .boolean()
      .default(
        migrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostQueryWriteBackDefault,
      )
      .describe('Whether to write migrated data back to storage'),
    revision_id: zod
      .union([zod.string(), zod.null()])
      .optional()
      .describe('Specific revision ID to migrate. When omitted the current revision is migrated.'),
  });

export const migrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostResponseMessageDefault =
  null;
export const migrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostResponseErrorDefault =
  null;

export const MigrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostResponse =
  zod
    .object({
      resource_id: zod.string(),
      status: zod.string(),
      message: zod
        .union([zod.string(), zod.null()])
        .default(
          migrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostResponseMessageDefault,
        ),
      error: zod
        .union([zod.string(), zod.null()])
        .default(
          migrateSingleResourceV1AutocrudCreateNewCharacter4JobMigrateSingleResourceIdPostResponseErrorDefault,
        ),
    })
    .describe('遷移進度訊息');

/**
 * @summary New Character0 (character)
 */
export const createNewCharacter0V1AutocrudCharacterCreateNewCharacter0PostResponseParentRevisionIdDefault =
  null;
export const createNewCharacter0V1AutocrudCharacterCreateNewCharacter0PostResponseSchemaVersionDefault =
  null;

export const CreateNewCharacter0V1AutocrudCharacterCreateNewCharacter0PostResponse = zod
  .object({
    uid: zod.uuid(),
    resource_id: zod.string(),
    revision_id: zod.string(),
    parent_revision_id: zod
      .union([zod.string(), zod.null()])
      .default(
        createNewCharacter0V1AutocrudCharacterCreateNewCharacter0PostResponseParentRevisionIdDefault,
      ),
    parent_schema_version: zod.union([zod.string(), zod.null()]).optional(),
    schema_version: zod
      .union([zod.string(), zod.null()])
      .default(
        createNewCharacter0V1AutocrudCharacterCreateNewCharacter0PostResponseSchemaVersionDefault,
      ),
    data_hash: zod.string().optional(),
    status: zod.enum(['draft', 'stable']),
    created_time: zod.string(),
    updated_time: zod.string(),
    created_by: zod.string(),
    updated_by: zod.string(),
  })
  .describe(
    'Metadata about a specific revision of a resource.\n\nThis class contains essential information about a particular revision,',
  );

/**
 * @summary New Character1 (character)
 */
export const CreateNewCharacter1V1AutocrudCharacterNameNewPostParams = zod.object({
  name: zod.string(),
});

/**
 * @summary New Character2 (character)
 */
export const CreateNewCharacter2V1AutocrudCharacterCreateNewCharacter2PostQueryParams = zod.object({
  name: zod.string(),
});

/**
 * @summary New Character3 (character)
 */

export const CreateNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostQueryParams = zod.object({
  x: zod.union([zod.number(), zod.string()]),
  y: zod.url().min(1),
});

export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneSkillTypeDefault = `active`;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneMpCostDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneCooldownSecondsDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneDamageDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailTwoSkillTypeDefault = `passive`;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailTwoBuffPercentageDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeSkillTypeDefault = `ultimate`;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeMpCostDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeCooldownSecondsDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeDamageDefault = 0;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeAreaOfEffectDefault = false;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDescriptionDefault = ``;
export const createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFRequiredLevelDefault = 1;

export const CreateNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBody = zod.object({
  name: zod.string(),
  z: zod.instanceof(File),
  f: zod.object({
    skname: zod.string(),
    detail: zod.union([
      zod.object({
        skill_type: zod
          .literal('active')
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneSkillTypeDefault,
          ),
        mp_cost: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneMpCostDefault,
          ),
        cooldown_seconds: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneCooldownSecondsDefault,
          ),
        damage: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailOneDamageDefault,
          ),
      }),
      zod.object({
        skill_type: zod
          .literal('passive')
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailTwoSkillTypeDefault,
          ),
        buff_percentage: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailTwoBuffPercentageDefault,
          ),
      }),
      zod.object({
        skill_type: zod
          .literal('ultimate')
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeSkillTypeDefault,
          ),
        mp_cost: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeMpCostDefault,
          ),
        cooldown_seconds: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeCooldownSecondsDefault,
          ),
        damage: zod
          .number()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeDamageDefault,
          ),
        area_of_effect: zod
          .boolean()
          .default(
            createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDetailThreeAreaOfEffectDefault,
          ),
      }),
    ]),
    description: zod
      .string()
      .default(
        createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFDescriptionDefault,
      ),
    required_level: zod
      .number()
      .default(
        createNewCharacter4V1AutocrudCharacterCreateNewCharacter4PostBodyFRequiredLevelDefault,
      ),
    required_class: zod
      .union([
        zod.enum(['⚔️ 戰士', '🏹 弓箭手', '💾 數據守護者', '🔮 法師']).describe('職業系統'),
        zod.null(),
      ])
      .optional(),
  }),
});

/**
 * @summary New Character0 (character)
 */
export const UpdateCharNameV1AutocrudCharacterResourceIdUpdateCharNamePostParams = zod.object({
  resource_id: zod.string(),
});

/**
 * Find all resources that reference a specific `guild` resource via Ref-annotated fields.  Results are grouped by source model and field.
 * @summary List referrers of a guild resource
 */
export const ListReferrersV1AutocrudGuildResourceIdReferrersGetParams = zod.object({
  resource_id: zod.string(),
});

export const ListReferrersV1AutocrudGuildResourceIdReferrersGetResponseItem = zod.record(
  zod.string(),
  zod.unknown(),
);
export const ListReferrersV1AutocrudGuildResourceIdReferrersGetResponse = zod.array(
  ListReferrersV1AutocrudGuildResourceIdReferrersGetResponseItem,
);

/**
 * Find all resources that reference a specific `skill` resource via Ref-annotated fields.  Results are grouped by source model and field.
 * @summary List referrers of a skill resource
 */
export const ListReferrersV1AutocrudSkillResourceIdReferrersGetParams = zod.object({
  resource_id: zod.string(),
});

export const ListReferrersV1AutocrudSkillResourceIdReferrersGetResponseItem = zod.record(
  zod.string(),
  zod.unknown(),
);
export const ListReferrersV1AutocrudSkillResourceIdReferrersGetResponse = zod.array(
  ListReferrersV1AutocrudSkillResourceIdReferrersGetResponseItem,
);

/**
 * Find all resources that reference a specific `character` resource via Ref-annotated fields.  Results are grouped by source model and field.
 * @summary List referrers of a character resource
 */
export const ListReferrersV1AutocrudCharacterResourceIdReferrersGetParams = zod.object({
  resource_id: zod.string(),
});

export const ListReferrersV1AutocrudCharacterResourceIdReferrersGetResponseItem = zod.record(
  zod.string(),
  zod.unknown(),
);
export const ListReferrersV1AutocrudCharacterResourceIdReferrersGetResponse = zod.array(
  ListReferrersV1AutocrudCharacterResourceIdReferrersGetResponseItem,
);

/**
 * Returns the complete relationship graph discovered from Ref / RefRevision annotations across all registered models.
 * @summary List all resource relationships
 */
export const ListRelationshipsV1AutocrudRelationshipsGetResponseItem = zod.record(
  zod.string(),
  zod.unknown(),
);
export const ListRelationshipsV1AutocrudRelationshipsGetResponse = zod.array(
  ListRelationshipsV1AutocrudRelationshipsGetResponseItem,
);

/**
 * Download a `.acbak` archive containing all registered models.  Optionally pass `models` query parameter to restrict which models are exported.
 * @summary Export all models
 */
export const GlobalExportV1AutocrudBackupExportGetQueryParams = zod.object({
  models: zod
    .union([zod.array(zod.string()), zod.null()])
    .optional()
    .describe('Model names to include.  When omitted all registered models are exported.'),
});

/**
 * Upload a `.acbak` archive.  All model sections found in the archive will be loaded into the corresponding resource managers.  Use `on_duplicate` to control the duplicate handling strategy.
 * @summary Import from archive
 */
export const globalImportV1AutocrudBackupImportPostQueryOnDuplicateDefault = `overwrite`;

export const GlobalImportV1AutocrudBackupImportPostQueryParams = zod.object({
  on_duplicate: zod
    .string()
    .default(globalImportV1AutocrudBackupImportPostQueryOnDuplicateDefault)
    .describe('Strategy: overwrite | skip | raise_error'),
});

export const GlobalImportV1AutocrudBackupImportPostBody = zod.object({
  file: zod.instanceof(File).describe('.acbak archive file'),
});

export const GlobalImportV1AutocrudBackupImportPostResponse = zod.record(
  zod.string(),
  zod.unknown(),
);

// ── Resource type aliases (generated by AutoCRUD) ──────────────────────────
// Orval "zod" client only produces Zod const schemas; these type aliases
// allow route and API files to import properly-named TypeScript types.

export type Character = Record<string, unknown>;
export type CreateNewCharacter2CharacterJob = Record<string, unknown>;
export type CreateNewCharacter4CharacterJob = Record<string, unknown>;
export type Equipment = Record<string, unknown>;
export type GameEvent = Record<string, unknown>;
export type Guild = Record<string, unknown>;
export type Job___main___Mount_____main___Dog__NoneType_ = Record<string, unknown>;
export type NewCharacterJob = Record<string, unknown>;
export type Pet = Record<string, unknown>;
export type Quest = Record<string, unknown>;
export type Skill = Record<string, unknown>;
