/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import * as zod from 'zod'; /** * @summary RPC method for searching cases. */ export const SearchCasesQueryParams = zod.object({ page: zod.number().optional().describe('Page number for pagination.'), size: zod.number().optional().describe('Number of results per page.'), q: zod.string().optional().describe('General query string.'), ids: zod .array(zod.string()) .optional() .describe('List of specific case IDs to retrieve.'), sort: zod.string().optional().describe('Sorting criteria (e.g., field:asc).'), fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the response.'), filters: zod .array(zod.string()) .optional() .describe('Key-value pairs for additional filtering.'), contactId: zod .string() .optional() .describe('Contact ID for filtering cases.'), qin: zod .string() .optional() .describe("Specify which fields to apply 'q' to."), filtersV1: zod .string() .optional() .describe('Updated filters with CEL syntax.'), }); export const searchCasesResponseItemsItemRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const searchCasesResponseItemsItemSourceTypeDefault = `TYPE_UNSPECIFIED`; export const SearchCasesResponse = zod .object({ items: zod .array( zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe( 'Optional relation to the associated case.', ), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe( 'Creation timestamp (in milliseconds since Unix epoch).', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod .string() .optional() .describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod .string() .optional() .describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default( searchCasesResponseItemsItemRelatedDataItemRelationTypeDefault, ) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(searchCasesResponseItemsItemSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe( 'Last update timestamp (in milliseconds since Unix epoch).', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod .number() .optional() .describe('Version number of the case.'), }) .describe('Message representing a case.'), ) .optional() .describe('List of cases.'), next: zod .boolean() .optional() .describe('Flag indicating if there are more pages.'), page: zod.string().optional().describe('Current page number.'), }) .describe('Response message containing a list of cases.'); /** * @summary RPC method for creating a new case. */ export const CreateCaseQueryParams = zod.object({ fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the response.'), disableTrigger: zod .boolean() .optional() .describe( 'Indicates whether to disable the trigger after the application execution.\nDefault is false (trigger **will** be executed).\nSet to true to explicitly prevent the trigger from running (e.g., when called from another trigger or internal flow).\nто\n[WTEL-7055]', ), }); export const createCaseBodyRelatedItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const CreateCaseBody = zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Optional assignee ID.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Optional close information.'), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Optional close reason.'), closeResult: zod .string() .optional() .describe('Optional close information.'), contactInfo: zod .string() .optional() .describe('Optional contact information.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), description: zod .string() .optional() .describe('Optional description of the case.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Optional group ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Required impacted user ID (default: reporter).'), links: zod .array( zod.object({ etag: zod.string().optional(), name: zod.string().optional(), url: zod.string().optional(), userId: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe( 'Optional creator / updater ID. Use this to explicitly set the case creator / updater instead of deriving it from the auth token.', ), }), ) .optional() .describe('List of links attached to the case.'), priority: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Optional priority level.'), rating: zod.string().optional().describe('API-only rating information.'), ratingComment: zod .string() .optional() .describe('API-only rating information.'), related: zod .array( zod .object({ etag: zod.string().optional().describe('Etag of the related case.'), relatedTo: zod .string() .optional() .describe('Identifier of the related case.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default(createCaseBodyRelatedItemRelationTypeDefault) .describe('Type of relation (e.g., duplicate, linked).'), }) .describe('Structure for related cases input when creating a case.'), ) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Required reporter ID (if empty, anonymous contact).'), service: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Service ID (affects many other readonly fields).'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Initial case status (default from lookup or UI).'), statusCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), subject: zod.string().optional().describe('Required subject of the case.'), userId: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe( 'Optional creator / updater ID. Use this to explicitly set the case creator / updater instead of deriving it from the auth token.', ), }) .describe('Input structure for creating a new case.'); export const createCaseResponseRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const createCaseResponseSourceTypeDefault = `TYPE_UNSPECIFIED`; export const CreateCaseResponse = zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe('Optional relation to the associated case.'), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe('Timestamp (in milliseconds) of the last update.'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe('Creation timestamp (in milliseconds since Unix epoch).'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod.string().optional().describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod.string().optional().describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default(createCaseResponseRelatedDataItemRelationTypeDefault) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe('Timestamp (in milliseconds) of the last update.'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(createCaseResponseSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe('Last update timestamp (in milliseconds since Unix epoch).'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod.number().optional().describe('Version number of the case.'), }) .describe('Message representing a case.'); /** * @summary RPC method for exporting cases to CSV or XLSX format (server-side streaming). */ export const ExportCasesQueryParams = zod.object({ q: zod.string().optional(), ids: zod.array(zod.string()).optional(), sort: zod.string().optional(), fields: zod.array(zod.string()).optional(), filters: zod.array(zod.string()).optional(), contactId: zod.string().optional(), qin: zod.string().optional(), filtersV1: zod.string().optional(), format: zod.string().optional(), separator: zod.string().optional(), }); export const ExportCasesResponse = zod.object({ error: zod .object({ code: zod.number().optional(), details: zod .array( zod.object({ '@type': zod.string().optional(), }), ) .optional(), message: zod.string().optional(), }) .optional(), result: zod .object({ data: zod.string().optional(), }) .optional(), }); /** * @summary RPC method for deleting an existing case by its etag. */ export const DeleteCaseParams = zod.object({ etag: zod.string().describe('Unique etag identifier of the case.'), }); export const DeleteCaseQueryParams = zod.object({ fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the deleted case response.'), }); export const deleteCaseResponseRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const deleteCaseResponseSourceTypeDefault = `TYPE_UNSPECIFIED`; export const DeleteCaseResponse = zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe('Optional relation to the associated case.'), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe('Timestamp (in milliseconds) of the last update.'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe('Creation timestamp (in milliseconds since Unix epoch).'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod.string().optional().describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod.string().optional().describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default(deleteCaseResponseRelatedDataItemRelationTypeDefault) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe('Timestamp (in milliseconds) of the last update.'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(deleteCaseResponseSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe('Last update timestamp (in milliseconds since Unix epoch).'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod.number().optional().describe('Version number of the case.'), }) .describe('Message representing a case.'); /** * @summary RPC method to retrieve a specific case by its etag identifier. */ export const LocateCaseParams = zod.object({ etag: zod.string().describe('Unique etag identifier of the case.'), }); export const LocateCaseQueryParams = zod.object({ fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the response.'), }); export const locateCaseResponseRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const locateCaseResponseSourceTypeDefault = `TYPE_UNSPECIFIED`; export const LocateCaseResponse = zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe('Optional relation to the associated case.'), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe('Timestamp (in milliseconds) of the last update.'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe('Creation timestamp (in milliseconds since Unix epoch).'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod.string().optional().describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod.string().optional().describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default(locateCaseResponseRelatedDataItemRelationTypeDefault) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe('Timestamp (in milliseconds) of the last update.'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(locateCaseResponseSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe('Last update timestamp (in milliseconds since Unix epoch).'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod.number().optional().describe('Version number of the case.'), }) .describe('Message representing a case.'); /** * @summary RPC method for updating an existing case. */ export const UpdateCase2Params = zod.object({ 'input.etag': zod.string(), }); export const UpdateCase2QueryParams = zod.object({ xJsonMask: zod .array(zod.string()) .optional() .describe('List of JSON fields to update.'), fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the response.'), disableTrigger: zod .boolean() .optional() .describe( 'Indicates whether to disable the trigger after the application execution.\nDefault is false (trigger **will** be executed).\nSet to true to explicitly prevent the trigger from running (e.g., when called from another trigger or internal flow).\n\n[WTEL-7055]', ), }); export const UpdateCase2Body = zod.object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeResult: zod.string().optional(), contactInfo: zod.string().optional(), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), priority: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), rating: zod.string().optional(), ratingComment: zod.string().optional(), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), service: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional(), subject: zod.string().optional(), userId: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe( 'Optional creator / updater ID. Use this to explicitly set the case creator / updater instead of deriving it from the auth token.', ), }); export const updateCase2ResponseCaseRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const updateCase2ResponseCaseSourceTypeDefault = `TYPE_UNSPECIFIED`; export const UpdateCase2Response = zod.object({ case: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe('Optional relation to the associated case.'), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe('Creation timestamp (in milliseconds since Unix epoch).'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod.string().optional().describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod.string().optional().describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default( updateCase2ResponseCaseRelatedDataItemRelationTypeDefault, ) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(updateCase2ResponseCaseSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe('Last update timestamp (in milliseconds since Unix epoch).'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod.number().optional().describe('Version number of the case.'), }) .optional() .describe('Message representing a case.'), changes: zod .array( zod.object({ field: zod.string().optional(), newValue: zod.unknown().optional(), oldValue: zod.unknown().optional(), }), ) .optional(), }); /** * @summary RPC method for updating an existing case. */ export const UpdateCaseParams = zod.object({ 'input.etag': zod.string(), }); export const UpdateCaseQueryParams = zod.object({ xJsonMask: zod .array(zod.string()) .optional() .describe('List of JSON fields to update.'), fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the response.'), disableTrigger: zod .boolean() .optional() .describe( 'Indicates whether to disable the trigger after the application execution.\nDefault is false (trigger **will** be executed).\nSet to true to explicitly prevent the trigger from running (e.g., when called from another trigger or internal flow).\n\n[WTEL-7055]', ), }); export const UpdateCaseBody = zod.object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeResult: zod.string().optional(), contactInfo: zod.string().optional(), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), priority: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), rating: zod.string().optional(), ratingComment: zod.string().optional(), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), service: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional(), subject: zod.string().optional(), userId: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe( 'Optional creator / updater ID. Use this to explicitly set the case creator / updater instead of deriving it from the auth token.', ), }); export const updateCaseResponseCaseRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const updateCaseResponseCaseSourceTypeDefault = `TYPE_UNSPECIFIED`; export const UpdateCaseResponse = zod.object({ case: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe('Optional relation to the associated case.'), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe('Creation timestamp (in milliseconds since Unix epoch).'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod.string().optional().describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod.string().optional().describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default( updateCaseResponseCaseRelatedDataItemRelationTypeDefault, ) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(updateCaseResponseCaseSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe('Last update timestamp (in milliseconds since Unix epoch).'), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod.number().optional().describe('Version number of the case.'), }) .optional() .describe('Message representing a case.'), changes: zod .array( zod.object({ field: zod.string().optional(), newValue: zod.unknown().optional(), oldValue: zod.unknown().optional(), }), ) .optional(), }); /** * @summary RPC method for searching cases. */ export const SearchCases2Params = zod.object({ contact_id: zod.string().describe('Contact ID for filtering cases.'), }); export const SearchCases2QueryParams = zod.object({ page: zod.number().optional().describe('Page number for pagination.'), size: zod.number().optional().describe('Number of results per page.'), q: zod.string().optional().describe('General query string.'), ids: zod .array(zod.string()) .optional() .describe('List of specific case IDs to retrieve.'), sort: zod.string().optional().describe('Sorting criteria (e.g., field:asc).'), fields: zod .array(zod.string()) .optional() .describe('List of fields to include in the response.'), filters: zod .array(zod.string()) .optional() .describe('Key-value pairs for additional filtering.'), qin: zod .string() .optional() .describe("Specify which fields to apply 'q' to."), filtersV1: zod .string() .optional() .describe('Updated filters with CEL syntax.'), }); export const searchCases2ResponseItemsItemRelatedDataItemRelationTypeDefault = `RELATION_TYPE_UNSPECIFIED`; export const searchCases2ResponseItemsItemSourceTypeDefault = `TYPE_UNSPECIFIED`; export const SearchCases2Response = zod .object({ items: zod .array( zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Assignee responsible for resolving the case.'), author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Author or reporter of the case.'), closeReason: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), closeReasonGroup: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Close reason group, immutable once set.'), closeResult: zod.string().optional(), comments: zod .object({ items: zod .array( zod .object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Contact-author of the comment.'), canEdit: zod .boolean() .optional() .describe( 'Indicates if the comment can be edited by current user.', ), caseId: zod .string() .optional() .describe( 'Optional relation to the associated case.', ), createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the comment was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the comment.'), edited: zod .boolean() .optional() .describe( 'Indicates if the comment was edited; true if created_at < updated_at.', ), etag: zod.string().optional(), id: zod .string() .optional() .describe( 'Main identifier for read, update, and delete operations.', ), roleIds: zod.array(zod.string()).optional(), text: zod .string() .optional() .describe('The content of the comment.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the comment.'), ver: zod .number() .optional() .describe( 'Version number of the comment, used for concurrency control.', ), }) .describe('Represents a comment associated with a case.'), ) .optional() .describe('List of comments on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of comments on the case.'), contactInfo: zod .string() .optional() .describe('Contact information for the case.'), createdAt: zod .string() .optional() .describe( 'Creation timestamp (in milliseconds since Unix epoch).', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Creator of the case.'), custom: zod .looseObject({}) .optional() .describe('Custom data extension fields ..'), dc: zod.string().optional(), description: zod .string() .optional() .describe('Detailed description of the case.'), differenceInReaction: zod.string().optional(), differenceInResolve: zod.string().optional(), etag: zod.string().optional().describe('Unique etag identifier.'), files: zod .object({ items: zod .array( zod .object({ createdAt: zod .string() .optional() .describe('Creation timestamp in Unix milliseconds.'), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Creator of the file.'), id: zod .string() .optional() .describe('Storage file ID.'), mime: zod .string() .optional() .describe('MIME type of the file.'), name: zod.string().optional().describe('File name.'), size: zod .string() .optional() .describe('File size in bytes.'), source: zod.string().optional(), url: zod.string().optional(), }) .describe('Metadata for a file associated with a case.'), ) .optional() .describe('List of case files.'), next: zod .boolean() .optional() .describe('Indicator if there is a next page.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of attached files.'), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional() .describe('Group associated with the case.'), id: zod.string().optional().describe('Unique case ID.'), impacted: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Impacted contact (defaults to reporter if null).'), links: zod .object({ items: zod .array( zod.object({ author: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), url: zod.string().optional(), ver: zod.number().optional(), }), ) .optional(), next: zod.boolean().optional(), page: zod.string().optional(), }) .optional() .describe('List of attached links.'), name: zod .string() .optional() .describe('Name of the case (may serve as an ID in docs).'), plannedReactionAt: zod .string() .optional() .describe('Planned reaction time (in milliseconds).'), plannedResolveAt: zod .string() .optional() .describe('Planned resolution time (in milliseconds).'), priority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe('Priority level of the case.'), rating: zod.string().optional(), ratingComment: zod.string().optional(), reactedAt: zod.string().optional(), related: zod .object({ data: zod .array( zod .object({ createdAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of when the relation was created.', ), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who created the relation.'), etag: zod .string() .optional() .describe('Etag for the related case entity.'), id: zod .string() .optional() .describe('Unique identifier for the related case.'), primaryCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Primary case details.'), relatedCase: zod .object({ color: zod.string().optional(), etag: zod.string().optional(), id: zod.string().optional(), name: zod.string().optional(), subject: zod.string().optional(), ver: zod.number().optional(), }) .optional() .describe('Related case details.'), relationType: zod .enum([ 'RELATION_TYPE_UNSPECIFIED', 'DUPLICATES', 'IS_DUPLICATED_BY', 'BLOCKS', 'IS_BLOCKED_BY', 'CAUSES', 'IS_CAUSED_BY', 'IS_CHILD_OF', 'IS_PARENT_OF', 'RELATES_TO', ]) .default( searchCases2ResponseItemsItemRelatedDataItemRelationTypeDefault, ) .describe('Relation type between cases.'), updatedAt: zod .string() .optional() .describe( 'Timestamp (in milliseconds) of the last update.', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('User who last updated the relation.'), ver: zod .number() .optional() .describe( 'Version number of the related case, used for concurrency control.', ), }) .describe( 'Represents a related case with its relationship details.', ), ) .optional() .describe('List of related cases on the current page.'), next: zod .boolean() .optional() .describe('Flag to indicate if more pages are available.'), page: zod.string().optional().describe('Current page number.'), }) .optional() .describe('List of related cases.'), reporter: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Reporter of the issue (null if anonymous).'), resolvedAt: zod.string().optional(), roleIds: zod.array(zod.string()).optional(), service: zod .object({ assignee: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), catalogId: zod.string().optional(), code: zod.string().optional(), createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), defaultPriority: zod .object({ color: zod.string(), createdAt: zod.string(), createdBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), description: zod.string().optional(), id: zod.string(), name: zod.string(), updatedAt: zod.string(), updatedBy: zod.object({ id: zod.string().optional(), name: zod.string().optional(), }), }) .optional() .describe( 'Priority message represents a priority entity with metadata.', ), description: zod.string().optional(), group: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod.string().optional(), }) .optional(), id: zod.string().optional(), name: zod.string().optional(), rootId: zod.string().optional(), searched: zod.boolean().optional(), service: zod.array(zod.unknown()).optional(), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), state: zod.boolean().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Service associated with the case.'), sla: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('SLA associated with the case.'), slaCondition: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('List of SLA conditions.'), source: zod .object({ id: zod.string().optional(), name: zod.string().optional(), type: zod .enum([ 'TYPE_UNSPECIFIED', 'CALL', 'CHAT', 'SOCIAL_MEDIA', 'EMAIL', 'API', 'MANUAL', ]) .default(searchCases2ResponseItemsItemSourceTypeDefault) .describe( 'Represents a source type for the source entity.\n\n - TYPE_UNSPECIFIED: Unspecified source type.\n - CALL: Phone call source type.\n - CHAT: Chat source type.\n - SOCIAL_MEDIA: Social media source type.\n - EMAIL: Email source type.\n - API: API source type.\n - MANUAL: Manual source type.', ), }) .optional() .describe('Source of the case.'), status: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Current status of the case.'), statusCondition: zod .object({ createdAt: zod.string().optional(), createdBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), description: zod.string().optional(), final: zod.boolean().optional(), id: zod.string().optional(), initial: zod.boolean().optional(), name: zod.string().optional(), statusId: zod.string().optional(), updatedAt: zod.string().optional(), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional(), }) .optional() .describe('Status condition from status lookup.'), subject: zod.string().optional().describe('Subject of the case.'), updatedAt: zod .string() .optional() .describe( 'Last update timestamp (in milliseconds since Unix epoch).', ), updatedBy: zod .object({ id: zod.string().optional(), name: zod.string().optional(), }) .optional() .describe('Last updater of the case.'), ver: zod .number() .optional() .describe('Version number of the case.'), }) .describe('Message representing a case.'), ) .optional() .describe('List of cases.'), next: zod .boolean() .optional() .describe('Flag indicating if there are more pages.'), page: zod.string().optional().describe('Current page number.'), }) .describe('Response message containing a list of cases.');