diff --git a/src/resources/MachineLearning/CaseClassificationConfiguration/CaseClassificationConfigurationInterfaces.ts b/src/resources/MachineLearning/CaseClassificationConfiguration/CaseClassificationConfigurationInterfaces.ts index e735e8f98..0ea16a2ef 100644 --- a/src/resources/MachineLearning/CaseClassificationConfiguration/CaseClassificationConfigurationInterfaces.ts +++ b/src/resources/MachineLearning/CaseClassificationConfiguration/CaseClassificationConfigurationInterfaces.ts @@ -128,7 +128,30 @@ export interface CaseClassificationDocumentGroupPreview { numberOfValidDocuments: number; } -export interface CaseClassificationContentFieldsParams { +export interface CaseClassificationContentFieldsAdvancedMode { + /** + * The query to use when building the model. + */ + advancedQuery: string; + /** + * The case creation date range for the cases the model will use. + */ + caseExtractionPeriod?: never; + /** + * An array of filtering conditions. + */ + caseFilterConditions?: never; + /** + * The field value to use as language. + */ + languageField?: never; + /** + * The names of the sources that contain the cases that the model will use. + */ + sources?: never; +} + +export interface CaseClassificationContentFieldsStandardMode { /** * The case creation date range for the cases the model will use. */ @@ -145,8 +168,16 @@ export interface CaseClassificationContentFieldsParams { * The names of the sources that contain the cases that the model will use. */ sources: string[]; + /** + * The query to use when building the model. + */ + advancedQuery?: never; } +export type CaseClassificationContentFieldsParams = + | CaseClassificationContentFieldsStandardMode + | CaseClassificationContentFieldsAdvancedMode; + export interface CaseClassificationContentField { name: string; } diff --git a/src/resources/MachineLearning/CaseClassificationConfiguration/tests/CaseClassificationConfiguration.spec.ts b/src/resources/MachineLearning/CaseClassificationConfiguration/tests/CaseClassificationConfiguration.spec.ts index 317536d8a..d594486c0 100644 --- a/src/resources/MachineLearning/CaseClassificationConfiguration/tests/CaseClassificationConfiguration.spec.ts +++ b/src/resources/MachineLearning/CaseClassificationConfiguration/tests/CaseClassificationConfiguration.spec.ts @@ -140,6 +140,15 @@ describe('CaseClassificationConfiguration', () => { expect(api.post).toHaveBeenCalledTimes(1); expect(api.post).toHaveBeenCalledWith(CaseClassificationConfiguration.fieldsUrl, params); }); + + it('should make a POST call to retrieve valid content field candidates for the Case Classification model configuration with an advancedQuery', () => { + const params = {advancedQuery: "@source='some source'"}; + + ccConfig.fields(params); + + expect(api.post).toHaveBeenCalledTimes(1); + expect(api.post).toHaveBeenCalledWith(CaseClassificationConfiguration.fieldsUrl, params); + }); }); describe('preview', () => {