diff --git a/assistant/v1.ts b/assistant/v1.ts index 4fae583223..d1f8d5e61d 100644 --- a/assistant/v1.ts +++ b/assistant/v1.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -55,7 +55,7 @@ class AssistantV1 extends BaseService { * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD * format. The current version is `2021-11-27`. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -154,11 +154,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'message' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'message'); const parameters = { options: { @@ -224,11 +220,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'bulkClassify' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'bulkClassify'); const parameters = { options: { @@ -295,11 +287,7 @@ class AssistantV1 extends BaseService { 'include_audit': _params.includeAudit, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listWorkspaces' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listWorkspaces'); const parameters = { options: { @@ -383,11 +371,7 @@ class AssistantV1 extends BaseService { 'include_audit': _params.includeAudit, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createWorkspace' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createWorkspace'); const parameters = { options: { @@ -452,11 +436,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getWorkspace' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getWorkspace'); const parameters = { options: { @@ -554,11 +534,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateWorkspace' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateWorkspace'); const parameters = { options: { @@ -613,11 +589,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteWorkspace' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteWorkspace'); const parameters = { options: { @@ -700,11 +672,7 @@ class AssistantV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createWorkspaceAsync' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createWorkspaceAsync'); const parameters = { options: { @@ -801,11 +769,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateWorkspaceAsync' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateWorkspaceAsync'); const parameters = { options: { @@ -874,11 +838,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'exportWorkspaceAsync' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'exportWorkspaceAsync'); const parameters = { options: { @@ -952,11 +912,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listIntents' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listIntents'); const parameters = { options: { @@ -1027,11 +983,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createIntent' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createIntent'); const parameters = { options: { @@ -1095,11 +1047,7 @@ class AssistantV1 extends BaseService { 'intent': _params.intent, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getIntent' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getIntent'); const parameters = { options: { @@ -1182,11 +1130,7 @@ class AssistantV1 extends BaseService { 'intent': _params.intent, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateIntent' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateIntent'); const parameters = { options: { @@ -1243,11 +1187,7 @@ class AssistantV1 extends BaseService { 'intent': _params.intent, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteIntent' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteIntent'); const parameters = { options: { @@ -1319,11 +1259,7 @@ class AssistantV1 extends BaseService { 'intent': _params.intent, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listExamples' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listExamples'); const parameters = { options: { @@ -1394,11 +1330,7 @@ class AssistantV1 extends BaseService { 'intent': _params.intent, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createExample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createExample'); const parameters = { options: { @@ -1460,11 +1392,7 @@ class AssistantV1 extends BaseService { 'text': _params.text, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getExample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getExample'); const parameters = { options: { @@ -1537,11 +1465,7 @@ class AssistantV1 extends BaseService { 'text': _params.text, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateExample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateExample'); const parameters = { options: { @@ -1600,11 +1524,7 @@ class AssistantV1 extends BaseService { 'text': _params.text, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteExample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteExample'); const parameters = { options: { @@ -1674,11 +1594,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCounterexamples' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listCounterexamples'); const parameters = { options: { @@ -1745,11 +1661,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createCounterexample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createCounterexample'); const parameters = { options: { @@ -1809,11 +1721,7 @@ class AssistantV1 extends BaseService { 'text': _params.text, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCounterexample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getCounterexample'); const parameters = { options: { @@ -1879,11 +1787,7 @@ class AssistantV1 extends BaseService { 'text': _params.text, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateCounterexample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateCounterexample'); const parameters = { options: { @@ -1940,11 +1844,7 @@ class AssistantV1 extends BaseService { 'text': _params.text, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCounterexample' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCounterexample'); const parameters = { options: { @@ -2018,11 +1918,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listEntities' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listEntities'); const parameters = { options: { @@ -2098,11 +1994,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createEntity' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createEntity'); const parameters = { options: { @@ -2166,11 +2058,7 @@ class AssistantV1 extends BaseService { 'entity': _params.entity, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getEntity' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getEntity'); const parameters = { options: { @@ -2257,11 +2145,7 @@ class AssistantV1 extends BaseService { 'entity': _params.entity, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateEntity' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateEntity'); const parameters = { options: { @@ -2318,11 +2202,7 @@ class AssistantV1 extends BaseService { 'entity': _params.entity, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteEntity' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteEntity'); const parameters = { options: { @@ -2388,11 +2268,7 @@ class AssistantV1 extends BaseService { 'entity': _params.entity, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listMentions' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listMentions'); const parameters = { options: { @@ -2468,11 +2344,7 @@ class AssistantV1 extends BaseService { 'entity': _params.entity, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listValues' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listValues'); const parameters = { options: { @@ -2556,11 +2428,7 @@ class AssistantV1 extends BaseService { 'entity': _params.entity, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createValue' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createValue'); const parameters = { options: { @@ -2626,11 +2494,7 @@ class AssistantV1 extends BaseService { 'value': _params.value, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getValue' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getValue'); const parameters = { options: { @@ -2725,11 +2589,7 @@ class AssistantV1 extends BaseService { 'value': _params.value, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateValue' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateValue'); const parameters = { options: { @@ -2788,11 +2648,7 @@ class AssistantV1 extends BaseService { 'value': _params.value, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteValue' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteValue'); const parameters = { options: { @@ -2866,11 +2722,7 @@ class AssistantV1 extends BaseService { 'value': _params.value, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listSynonyms' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listSynonyms'); const parameters = { options: { @@ -2940,11 +2792,7 @@ class AssistantV1 extends BaseService { 'value': _params.value, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createSynonym' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createSynonym'); const parameters = { options: { @@ -3008,11 +2856,7 @@ class AssistantV1 extends BaseService { 'synonym': _params.synonym, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getSynonym' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getSynonym'); const parameters = { options: { @@ -3085,11 +2929,7 @@ class AssistantV1 extends BaseService { 'synonym': _params.synonym, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateSynonym' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSynonym'); const parameters = { options: { @@ -3150,11 +2990,7 @@ class AssistantV1 extends BaseService { 'synonym': _params.synonym, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteSynonym' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteSynonym'); const parameters = { options: { @@ -3224,11 +3060,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listDialogNodes' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listDialogNodes'); const parameters = { options: { @@ -3346,11 +3178,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createDialogNode' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'createDialogNode'); const parameters = { options: { @@ -3410,11 +3238,7 @@ class AssistantV1 extends BaseService { 'dialog_node': _params.dialogNode, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getDialogNode' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'getDialogNode'); const parameters = { options: { @@ -3535,11 +3359,7 @@ class AssistantV1 extends BaseService { 'dialog_node': _params.dialogNode, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateDialogNode' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'updateDialogNode'); const parameters = { options: { @@ -3596,11 +3416,7 @@ class AssistantV1 extends BaseService { 'dialog_node': _params.dialogNode, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteDialogNode' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteDialogNode'); const parameters = { options: { @@ -3673,11 +3489,7 @@ class AssistantV1 extends BaseService { 'workspace_id': _params.workspaceId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listLogs' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listLogs'); const parameters = { options: { @@ -3742,11 +3554,7 @@ class AssistantV1 extends BaseService { 'cursor': _params.cursor, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listAllLogs' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'listAllLogs'); const parameters = { options: { @@ -3808,11 +3616,7 @@ class AssistantV1 extends BaseService { 'customer_id': _params.customerId, }; - const sdkHeaders = getSdkHeaders( - AssistantV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteUserData' - ); + const sdkHeaders = getSdkHeaders(AssistantV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteUserData'); const parameters = { options: { @@ -5281,7 +5085,7 @@ namespace AssistantV1 { /** Any metadata related to the entity value. */ metadata?: JsonObject; /** Specifies the type of entity value. */ - type?: string; + type?: CreateValue.Constants.Type | string; /** An array of synonyms for the entity value. A value can specify either synonyms or patterns (depending on the * value type), but not both. A synonym must conform to the following resrictions: * - It cannot contain carriage return, newline, or tab characters. @@ -5299,6 +5103,15 @@ namespace AssistantV1 { /** The timestamp for the most recent update to the object. */ updated?: string; } + export namespace CreateValue { + export namespace Constants { + /** Specifies the type of entity value. */ + export enum Type { + SYNONYMS = 'synonyms', + PATTERNS = 'patterns', + } + } + } /** DialogNode. */ export interface DialogNode { @@ -5339,19 +5152,19 @@ namespace AssistantV1 { */ title?: string; /** How the dialog node is processed. */ - type?: string; + type?: DialogNode.Constants.Type | string; /** How an `event_handler` node is processed. */ - event_name?: string; + event_name?: DialogNode.Constants.EventName | string; /** The location in the dialog context where output is stored. */ variable?: string; /** An array of objects describing any actions to be invoked by the dialog node. */ actions?: DialogNodeAction[]; /** Whether this top-level dialog node can be digressed into. */ - digress_in?: string; + digress_in?: DialogNode.Constants.DigressIn | string; /** Whether this dialog node can be returned to after a digression. */ - digress_out?: string; + digress_out?: DialogNode.Constants.DigressOut | string; /** Whether the user can digress to top-level nodes while filling out slots. */ - digress_out_slots?: string; + digress_out_slots?: DialogNode.Constants.DigressOutSlots | string; /** A label that can be displayed externally to describe the purpose of the node to users. If set, this label is * used to identify the node in disambiguation responses (overriding the value of the **title** property). */ @@ -5367,13 +5180,56 @@ namespace AssistantV1 { /** The timestamp for the most recent update to the object. */ updated?: string; } + export namespace DialogNode { + export namespace Constants { + /** How the dialog node is processed. */ + export enum Type { + STANDARD = 'standard', + EVENT_HANDLER = 'event_handler', + FRAME = 'frame', + SLOT = 'slot', + RESPONSE_CONDITION = 'response_condition', + FOLDER = 'folder', + } + /** How an `event_handler` node is processed. */ + export enum EventName { + FOCUS = 'focus', + INPUT = 'input', + FILLED = 'filled', + VALIDATE = 'validate', + FILLED_MULTIPLE = 'filled_multiple', + GENERIC = 'generic', + NOMATCH = 'nomatch', + NOMATCH_RESPONSES_DEPLETED = 'nomatch_responses_depleted', + DIGRESSION_RETURN_PROMPT = 'digression_return_prompt', + } + /** Whether this top-level dialog node can be digressed into. */ + export enum DigressIn { + NOT_AVAILABLE = 'not_available', + RETURNS = 'returns', + DOES_NOT_RETURN = 'does_not_return', + } + /** Whether this dialog node can be returned to after a digression. */ + export enum DigressOut { + ALLOW_RETURNING = 'allow_returning', + ALLOW_ALL = 'allow_all', + ALLOW_ALL_NEVER_RETURN = 'allow_all_never_return', + } + /** Whether the user can digress to top-level nodes while filling out slots. */ + export enum DigressOutSlots { + NOT_ALLOWED = 'not_allowed', + ALLOW_RETURNING = 'allow_returning', + ALLOW_ALL = 'allow_all', + } + } + } /** DialogNodeAction. */ export interface DialogNodeAction { /** The name of the action. */ name: string; /** The type of action to invoke. */ - type?: string; + type?: DialogNodeAction.Constants.Type | string; /** A map of key/value pairs to be provided to the action. */ parameters?: JsonObject; /** The location in the dialog context where the result of the action is stored. */ @@ -5381,6 +5237,18 @@ namespace AssistantV1 { /** The name of the context variable that the client application will use to pass in credentials for the action. */ credentials?: string; } + export namespace DialogNodeAction { + export namespace Constants { + /** The type of action to invoke. */ + export enum Type { + CLIENT = 'client', + SERVER = 'server', + CLOUD_FUNCTION = 'cloud_function', + WEB_ACTION = 'web_action', + WEBHOOK = 'webhook', + } + } + } /** An array of dialog nodes. */ export interface DialogNodeCollection { @@ -5422,11 +5290,31 @@ namespace AssistantV1 { * - `skip_all_slots` * If you specify `jump_to`, then you must also specify a value for the `dialog_node` property. */ - behavior: string; + behavior: DialogNodeNextStep.Constants.Behavior | string; /** The unique ID of the dialog node to process next. This parameter is required if **behavior**=`jump_to`. */ dialog_node?: string; /** Which part of the dialog node to process next. */ - selector?: string; + selector?: DialogNodeNextStep.Constants.Selector | string; + } + export namespace DialogNodeNextStep { + export namespace Constants { + /** What happens after the dialog node completes. The valid values depend on the node type: - The following values are valid for any node: - `get_user_input` - `skip_user_input` - `jump_to` - If the node is of type `event_handler` and its parent node is of type `slot` or `frame`, additional values are also valid: - if **event_name**=`filled` and the type of the parent node is `slot`: - `reprompt` - `skip_all_slots` - if **event_name**=`nomatch` and the type of the parent node is `slot`: - `reprompt` - `skip_slot` - `skip_all_slots` - if **event_name**=`generic` and the type of the parent node is `frame`: - `reprompt` - `skip_slot` - `skip_all_slots` If you specify `jump_to`, then you must also specify a value for the `dialog_node` property. */ + export enum Behavior { + GET_USER_INPUT = 'get_user_input', + SKIP_USER_INPUT = 'skip_user_input', + JUMP_TO = 'jump_to', + REPROMPT = 'reprompt', + SKIP_SLOT = 'skip_slot', + SKIP_ALL_SLOTS = 'skip_all_slots', + } + /** Which part of the dialog node to process next. */ + export enum Selector { + CONDITION = 'condition', + CLIENT = 'client', + USER_INPUT = 'user_input', + BODY = 'body', + } + } } /** The output of the dialog node. For more information about how to specify dialog node output, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses). */ @@ -5676,7 +5564,7 @@ namespace AssistantV1 { /** Log message details. */ export interface LogMessage { /** The severity of the log message. */ - level: string; + level: LogMessage.Constants.Level | string; /** The text of the log message. */ msg: string; /** A code that indicates the category to which the error message belongs. */ @@ -5684,14 +5572,32 @@ namespace AssistantV1 { /** An object that identifies the dialog element that generated the error message. */ source?: LogMessageSource; } + export namespace LogMessage { + export namespace Constants { + /** The severity of the log message. */ + export enum Level { + INFO = 'info', + ERROR = 'error', + WARN = 'warn', + } + } + } /** An object that identifies the dialog element that generated the error message. */ export interface LogMessageSource { /** A string that indicates the type of dialog element that generated the error message. */ - type?: string; + type?: LogMessageSource.Constants.Type | string; /** The unique identifier of the dialog node that generated the error message. */ dialog_node?: string; } + export namespace LogMessageSource { + export namespace Constants { + /** A string that indicates the type of dialog element that generated the error message. */ + export enum Type { + DIALOG_NODE = 'dialog_node', + } + } + } /** The pagination data for the returned objects. For more information about using pagination, see [Pagination](#pagination). */ export interface LogPagination { @@ -5867,7 +5773,21 @@ namespace AssistantV1 { * * **Note:** On IBM Cloud Pak for Data, only `chat` is supported. */ - channel?: string; + channel?: ResponseGenericChannel.Constants.Channel | string; + } + export namespace ResponseGenericChannel { + export namespace Constants { + /** A channel for which the response is intended. **Note:** On IBM Cloud Pak for Data, only `chat` is supported. */ + export enum Channel { + CHAT = 'chat', + FACEBOOK = 'facebook', + INTERCOM = 'intercom', + SLACK = 'slack', + TEXT_MESSAGING = 'text_messaging', + VOICE_TELEPHONY = 'voice_telephony', + WHATSAPP = 'whatsapp', + } + } } /** A term from the request that was identified as an entity. */ @@ -5926,7 +5846,7 @@ namespace AssistantV1 { */ festival?: string; /** The precision or duration of a time range specified by a recognized `@sys-time` or `@sys-date` entity. */ - granularity?: string; + granularity?: RuntimeEntityInterpretation.Constants.Granularity | string; /** A unique identifier used to associate multiple recognized `@sys-date`, `@sys-time`, or `@sys-number` * entities that are recognized as a range of values in the user's input (for example, `from July 4 until July 14` * or `from 20 to 25`). @@ -5999,11 +5919,42 @@ namespace AssistantV1 { /** A recognized time zone mentioned as part of a time value (for example, `EST`). */ timezone?: string; } + export namespace RuntimeEntityInterpretation { + export namespace Constants { + /** The precision or duration of a time range specified by a recognized `@sys-time` or `@sys-date` entity. */ + export enum Granularity { + DAY = 'day', + FORTNIGHT = 'fortnight', + HOUR = 'hour', + INSTANT = 'instant', + MINUTE = 'minute', + MONTH = 'month', + QUARTER = 'quarter', + SECOND = 'second', + WEEK = 'week', + WEEKEND = 'weekend', + YEAR = 'year', + } + } + } /** An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the workspace. */ export interface RuntimeEntityRole { /** The relationship of the entity to the range. */ - type?: string; + type?: RuntimeEntityRole.Constants.Type | string; + } + export namespace RuntimeEntityRole { + export namespace Constants { + /** The relationship of the entity to the range. */ + export enum Type { + DATE_FROM = 'date_from', + DATE_TO = 'date_to', + NUMBER_FROM = 'number_from', + NUMBER_TO = 'number_to', + TIME_FROM = 'time_from', + TIME_TO = 'time_to', + } + } } /** An intent identified in the user input. */ @@ -6059,7 +6010,7 @@ namespace AssistantV1 { /** Any metadata related to the entity value. */ metadata?: JsonObject; /** Specifies the type of entity value. */ - type: string; + type: Value.Constants.Type | string; /** An array of synonyms for the entity value. A value can specify either synonyms or patterns (depending on the * value type), but not both. A synonym must conform to the following resrictions: * - It cannot contain carriage return, newline, or tab characters. @@ -6077,6 +6028,15 @@ namespace AssistantV1 { /** The timestamp for the most recent update to the object. */ updated?: string; } + export namespace Value { + export namespace Constants { + /** Specifies the type of entity value. */ + export enum Type { + SYNONYMS = 'synonyms', + PATTERNS = 'patterns', + } + } + } /** ValueCollection. */ export interface ValueCollection { @@ -6140,7 +6100,7 @@ namespace AssistantV1 { * - **Processing**: An asynchronous operation has not yet completed. * - **Training**: The workspace is training based on new data such as intents or examples. */ - status?: string; + status?: Workspace.Constants.Status | string; /** An array of messages about errors that caused an asynchronous operation to fail. */ status_errors?: StatusError[]; webhooks?: Webhook[]; @@ -6154,6 +6114,19 @@ namespace AssistantV1 { */ counts?: WorkspaceCounts; } + export namespace Workspace { + export namespace Constants { + /** The current status of the workspace: - **Available**: The workspace is available and ready to process messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** property for more information about the cause of the failure. - **Non Existent**: The workspace does not exist. - **Processing**: An asynchronous operation has not yet completed. - **Training**: The workspace is training based on new data such as intents or examples. */ + export enum Status { + AVAILABLE = 'Available', + FAILED = 'Failed', + NON_EXISTENT = 'Non Existent', + PROCESSING = 'Processing', + TRAINING = 'Training', + UNAVAILABLE = 'Unavailable', + } + } + } /** WorkspaceCollection. */ export interface WorkspaceCollection { @@ -6214,7 +6187,7 @@ namespace AssistantV1 { /** The sensitivity of the disambiguation feature to intent detection uncertainty. Higher sensitivity means that * the disambiguation feature is triggered more often and includes more choices. */ - sensitivity?: string; + sensitivity?: WorkspaceSystemSettingsDisambiguation.Constants.Sensitivity | string; /** Whether the order in which disambiguation suggestions are presented should be randomized (but still * influenced by relative confidence). */ @@ -6224,6 +6197,19 @@ namespace AssistantV1 { /** For internal use only. */ suggestion_text_policy?: string; } + export namespace WorkspaceSystemSettingsDisambiguation { + export namespace Constants { + /** The sensitivity of the disambiguation feature to intent detection uncertainty. Higher sensitivity means that the disambiguation feature is triggered more often and includes more choices. */ + export enum Sensitivity { + AUTO = 'auto', + HIGH = 'high', + MEDIUM_HIGH = 'medium_high', + MEDIUM = 'medium', + MEDIUM_LOW = 'medium_low', + LOW = 'low', + } + } + } /** Workspace settings related to the version of the training algorithms currently used by the skill. */ export interface WorkspaceSystemSettingsNlp { @@ -6367,12 +6353,21 @@ namespace AssistantV1 { /** An optional description to show with the response. */ description?: string; /** The preferred type of control to display, if supported by the channel. */ - preference?: string; + preference?: DialogNodeOutputGenericDialogNodeOutputResponseTypeOption.Constants.Preference | string; /** An array of objects describing the options from which the user can choose. You can include up to 20 options. */ options: DialogNodeOutputOptionsElement[]; /** An array of objects specifying channels for which the response is intended. */ channels?: ResponseGenericChannel[]; } + export namespace DialogNodeOutputGenericDialogNodeOutputResponseTypeOption { + export namespace Constants { + /** The preferred type of control to display, if supported by the channel. */ + export enum Preference { + DROPDOWN = 'dropdown', + BUTTON = 'button', + } + } + } /** DialogNodeOutputGenericDialogNodeOutputResponseTypePause. */ export interface DialogNodeOutputGenericDialogNodeOutputResponseTypePause extends DialogNodeOutputGeneric { @@ -6405,7 +6400,7 @@ namespace AssistantV1 { */ query: string; /** The type of the search query. */ - query_type: string; + query_type: DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill.Constants.QueryType | string; /** An optional filter that narrows the set of documents to be searched. For more information, see the * [Discovery service documentation]([Discovery service * documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-parameters#filter). @@ -6416,6 +6411,15 @@ namespace AssistantV1 { /** An array of objects specifying channels for which the response is intended. */ channels?: ResponseGenericChannel[]; } + export namespace DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill { + export namespace Constants { + /** The type of the search query. */ + export enum QueryType { + NATURAL_LANGUAGE = 'natural_language', + DISCOVERY_QUERY_LANGUAGE = 'discovery_query_language', + } + } + } /** DialogNodeOutputGenericDialogNodeOutputResponseTypeText. */ export interface DialogNodeOutputGenericDialogNodeOutputResponseTypeText extends DialogNodeOutputGeneric { @@ -6426,12 +6430,22 @@ namespace AssistantV1 { /** A list of one or more objects defining text responses. */ values: DialogNodeOutputTextValuesElement[]; /** How a response is selected from the list, if more than one response is specified. */ - selection_policy?: string; + selection_policy?: DialogNodeOutputGenericDialogNodeOutputResponseTypeText.Constants.SelectionPolicy | string; /** The delimiter to use as a separator between responses when `selection_policy`=`multiline`. */ delimiter?: string; /** An array of objects specifying channels for which the response is intended. */ channels?: ResponseGenericChannel[]; } + export namespace DialogNodeOutputGenericDialogNodeOutputResponseTypeText { + export namespace Constants { + /** How a response is selected from the list, if more than one response is specified. */ + export enum SelectionPolicy { + SEQUENTIAL = 'sequential', + RANDOM = 'random', + MULTILINE = 'multiline', + } + } + } /** DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined. */ export interface DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined extends DialogNodeOutputGeneric { @@ -6594,7 +6608,7 @@ namespace AssistantV1 { /** The description to show with the response. */ description?: string; /** The preferred type of control to display. */ - preference?: string; + preference?: RuntimeResponseGenericRuntimeResponseTypeOption.Constants.Preference | string; /** An array of objects describing the options from which the user can choose. */ options: DialogNodeOutputOptionsElement[]; /** An array of objects specifying channels for which the response is intended. If **channels** is present, the @@ -6602,6 +6616,15 @@ namespace AssistantV1 { */ channels?: ResponseGenericChannel[]; } + export namespace RuntimeResponseGenericRuntimeResponseTypeOption { + export namespace Constants { + /** The preferred type of control to display. */ + export enum Preference { + DROPDOWN = 'dropdown', + BUTTON = 'button', + } + } + } /** RuntimeResponseGenericRuntimeResponseTypePause. */ export interface RuntimeResponseGenericRuntimeResponseTypePause extends RuntimeResponseGeneric { diff --git a/assistant/v2.ts b/assistant/v2.ts index 65456681dc..fe7f5a6bf9 100644 --- a/assistant/v2.ts +++ b/assistant/v2.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -56,7 +56,7 @@ class AssistantV2 extends BaseService { * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD * format. The current version is `2021-11-27`. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -127,11 +127,7 @@ class AssistantV2 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createAssistant' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'createAssistant'); const parameters = { options: { @@ -196,11 +192,7 @@ class AssistantV2 extends BaseService { 'include_audit': _params.includeAudit, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listAssistants' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'listAssistants'); const parameters = { options: { @@ -264,11 +256,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteAssistant' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteAssistant'); const parameters = { options: { @@ -343,11 +331,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createSession' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'createSession'); const parameters = { options: { @@ -415,11 +399,7 @@ class AssistantV2 extends BaseService { 'session_id': _params.sessionId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteSession' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteSession'); const parameters = { options: { @@ -508,11 +488,7 @@ class AssistantV2 extends BaseService { 'session_id': _params.sessionId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'message' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'message'); const parameters = { options: { @@ -598,11 +574,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'messageStateless' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'messageStateless'); const parameters = { options: { @@ -670,11 +642,7 @@ class AssistantV2 extends BaseService { 'skill_id': _params.skillId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'bulkClassify' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'bulkClassify'); const parameters = { options: { @@ -759,11 +727,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listLogs' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'listLogs'); const parameters = { options: { @@ -826,11 +790,7 @@ class AssistantV2 extends BaseService { 'customer_id': _params.customerId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteUserData' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteUserData'); const parameters = { options: { @@ -911,11 +871,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listEnvironments' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'listEnvironments'); const parameters = { options: { @@ -988,11 +944,7 @@ class AssistantV2 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getEnvironment' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'getEnvironment'); const parameters = { options: { @@ -1074,11 +1026,7 @@ class AssistantV2 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateEnvironment' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'updateEnvironment'); const parameters = { options: { @@ -1154,11 +1102,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createRelease' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'createRelease'); const parameters = { options: { @@ -1240,11 +1184,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listReleases' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'listReleases'); const parameters = { options: { @@ -1318,11 +1258,7 @@ class AssistantV2 extends BaseService { 'release': _params.release, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getRelease' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'getRelease'); const parameters = { options: { @@ -1389,11 +1325,7 @@ class AssistantV2 extends BaseService { 'release': _params.release, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteRelease' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteRelease'); const parameters = { options: { @@ -1469,11 +1401,7 @@ class AssistantV2 extends BaseService { 'release': _params.release, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deployRelease' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'deployRelease'); const parameters = { options: { @@ -1546,11 +1474,7 @@ class AssistantV2 extends BaseService { 'skill_id': _params.skillId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getSkill' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'getSkill'); const parameters = { options: { @@ -1637,11 +1561,7 @@ class AssistantV2 extends BaseService { 'skill_id': _params.skillId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateSkill' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'updateSkill'); const parameters = { options: { @@ -1723,11 +1643,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'exportSkills' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'exportSkills'); const parameters = { options: { @@ -1811,11 +1727,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'importSkills' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'importSkills'); const parameters = { options: { @@ -1882,11 +1794,7 @@ class AssistantV2 extends BaseService { 'assistant_id': _params.assistantId, }; - const sdkHeaders = getSdkHeaders( - AssistantV2.DEFAULT_SERVICE_NAME, - 'v2', - 'importSkillsStatus' - ); + const sdkHeaders = getSdkHeaders(AssistantV2.DEFAULT_SERVICE_NAME, 'v2', 'importSkillsStatus'); const parameters = { options: { @@ -2552,7 +2460,17 @@ namespace AssistantV2 { /** The skill ID of the skill. */ skill_id: string; /** The type of the skill. */ - type?: string; + type?: AssistantSkill.Constants.Type | string; + } + export namespace AssistantSkill { + export namespace Constants { + /** The type of the skill. */ + export enum Type { + DIALOG = 'dialog', + ACTION = 'action', + SEARCH = 'search', + } + } } /** Status information about the skills for the assistant. Included in responses only if **status**=`Available`. */ @@ -2631,7 +2549,7 @@ namespace AssistantV2 { /** Dialog log message details. */ export interface DialogLogMessage { /** The severity of the log message. */ - level: string; + level: DialogLogMessage.Constants.Level | string; /** The text of the log message. */ message: string; /** A code that indicates the category to which the error message belongs. */ @@ -2639,13 +2557,23 @@ namespace AssistantV2 { /** An object that identifies the dialog element that generated the error message. */ source?: LogMessageSource; } + export namespace DialogLogMessage { + export namespace Constants { + /** The severity of the log message. */ + export enum Level { + INFO = 'info', + ERROR = 'error', + WARN = 'warn', + } + } + } /** DialogNodeAction. */ export interface DialogNodeAction { /** The name of the action. */ name: string; /** The type of action to invoke. */ - type?: string; + type?: DialogNodeAction.Constants.Type | string; /** A map of key/value pairs to be provided to the action. */ parameters?: JsonObject; /** The location in the dialog context where the result of the action is stored. */ @@ -2653,6 +2581,17 @@ namespace AssistantV2 { /** The name of the context variable that the client application will use to pass in credentials for the action. */ credentials?: string; } + export namespace DialogNodeAction { + export namespace Constants { + /** The type of action to invoke. */ + export enum Type { + CLIENT = 'client', + SERVER = 'server', + WEB_ACTION = 'web-action', + CLOUD_FUNCTION = 'cloud-function', + } + } + } /** Routing or other contextual information to be used by target service desk systems. */ export interface DialogNodeOutputConnectToAgentTransferInfo { @@ -2759,7 +2698,17 @@ namespace AssistantV2 { /** The type of the environment. All environments other than the draft and live environments have the type * `staging`. */ - environment?: string; + environment?: EnvironmentReference.Constants.Environment | string; + } + export namespace EnvironmentReference { + export namespace Constants { + /** The type of the environment. All environments other than the draft and live environments have the type `staging`. */ + export enum Environment { + DRAFT = 'draft', + LIVE = 'live', + STAGING = 'staging', + } + } } /** EnvironmentSkill. */ @@ -2767,7 +2716,7 @@ namespace AssistantV2 { /** The skill ID of the skill. */ skill_id: string; /** The type of the skill. */ - type?: string; + type?: EnvironmentSkill.Constants.Type | string; /** Whether the skill is disabled. A disabled skill in the draft environment does not handle any messages at run * time, and it is not included in saved releases. */ @@ -2779,6 +2728,16 @@ namespace AssistantV2 { */ skill_reference?: string; } + export namespace EnvironmentSkill { + export namespace Constants { + /** The type of the skill. */ + export enum Type { + DIALOG = 'dialog', + ACTION = 'action', + SEARCH = 'search', + } + } + } /** IntegrationReference. */ export interface IntegrationReference { @@ -2891,7 +2850,7 @@ namespace AssistantV2 { * * This property is included only if the new system entities are enabled for the skill. */ - locale?: string; + locale?: MessageContextGlobalSystem.Constants.Locale | string; /** The base time for interpreting any relative time mentions in the user input. The specified time overrides * the current server time, and is used to calculate times mentioned in relative terms such as `now` or `tomorrow`. * This can be useful for simulating past or future times for testing purposes, or when analyzing documents such as @@ -2921,6 +2880,28 @@ namespace AssistantV2 { /** For internal use only. */ skip_user_input?: boolean; } + export namespace MessageContextGlobalSystem { + export namespace Constants { + /** The language code for localization in the user input. The specified locale overrides the default for the assistant, and is used for interpreting entity values in user input such as date values. For example, `04/03/2018` might be interpreted either as April 3 or March 4, depending on the locale. This property is included only if the new system entities are enabled for the skill. */ + export enum Locale { + EN_US = 'en-us', + EN_CA = 'en-ca', + EN_GB = 'en-gb', + AR_AR = 'ar-ar', + CS_CZ = 'cs-cz', + DE_DE = 'de-de', + ES_ES = 'es-es', + FR_FR = 'fr-fr', + IT_IT = 'it-it', + JA_JP = 'ja-jp', + KO_KR = 'ko-kr', + NL_NL = 'nl-nl', + PT_BR = 'pt-br', + ZH_CN = 'zh-cn', + ZH_TW = 'zh-tw', + } + } + } /** Context variables that are used by the action skill. */ export interface MessageContextSkillAction { @@ -2987,7 +2968,7 @@ namespace AssistantV2 { * * **Note:** A `search` message results in an error if no search skill is configured for the assistant. */ - message_type?: string; + message_type?: MessageInput.Constants.MessageType | string; /** The text of the user input. This string cannot contain carriage return, newline, or tab characters. */ text?: string; /** Intents to use when evaluating the user input. Include intents from the previous response to continue using @@ -3013,6 +2994,15 @@ namespace AssistantV2 { /** Optional properties that control how the assistant responds. */ options?: MessageInputOptions; } + export namespace MessageInput { + export namespace Constants { + /** The type of the message: - `text`: The user input is processed normally by the assistant. - `search`: Only search results are returned. (Any dialog or action skill is bypassed.) **Note:** A `search` message results in an error if no search skill is configured for the assistant. */ + export enum MessageType { + TEXT = 'text', + SEARCH = 'search', + } + } + } /** A reference to a media file to be sent as an attachment with the message. */ export interface MessageInputAttachment { @@ -3097,7 +3087,7 @@ namespace AssistantV2 { * * **Note:** A `search` message results in an error if no search skill is configured for the assistant. */ - message_type?: string; + message_type?: MessageInputStateless.Constants.MessageType | string; /** The text of the user input. This string cannot contain carriage return, newline, or tab characters. */ text?: string; /** Intents to use when evaluating the user input. Include intents from the previous response to continue using @@ -3123,6 +3113,15 @@ namespace AssistantV2 { /** Optional properties that control how the assistant responds. */ options?: MessageInputOptionsStateless; } + export namespace MessageInputStateless { + export namespace Constants { + /** The type of the message: - `text`: The user input is processed normally by the assistant. - `search`: Only search results are returned. (Any dialog or action skill is bypassed.) **Note:** A `search` message results in an error if no search skill is configured for the assistant. */ + export enum MessageType { + TEXT = 'text', + SEARCH = 'search', + } + } + } /** Assistant output to be rendered or processed by the client. */ export interface MessageOutput { @@ -3159,7 +3158,7 @@ namespace AssistantV2 { /** When `branch_exited` is set to `true` by the assistant, the `branch_exited_reason` specifies whether the * dialog completed by itself or got interrupted. */ - branch_exited_reason?: string; + branch_exited_reason?: MessageOutputDebug.Constants.BranchExitedReason | string; /** An array of objects containing detailed diagnostic information about dialog nodes and actions that were * visited during processing of the input message. * @@ -3167,6 +3166,15 @@ namespace AssistantV2 { */ turn_events?: MessageOutputDebugTurnEvent[]; } + export namespace MessageOutputDebug { + export namespace Constants { + /** When `branch_exited` is set to `true` by the assistant, the `branch_exited_reason` specifies whether the dialog completed by itself or got interrupted. */ + export enum BranchExitedReason { + COMPLETED = 'completed', + FALLBACK = 'fallback', + } + } + } /** MessageOutputDebugTurnEvent. */ export interface MessageOutputDebugTurnEvent { @@ -3286,12 +3294,22 @@ namespace AssistantV2 { * - **Failed**: An asynchronous publish operation has failed. * - **Processing**: An asynchronous publish operation has not yet completed. */ - status?: string; + status?: Release.Constants.Status | string; /** The timestamp for creation of the object. */ created?: string; /** The timestamp for the most recent update to the object. */ updated?: string; } + export namespace Release { + export namespace Constants { + /** The current status of the release: - **Available**: The release is available for deployment. - **Failed**: An asynchronous publish operation has failed. - **Processing**: An asynchronous publish operation has not yet completed. */ + export enum Status { + AVAILABLE = 'Available', + FAILED = 'Failed', + PROCESSING = 'Processing', + } + } + } /** ReleaseCollection. */ export interface ReleaseCollection { @@ -3314,10 +3332,20 @@ namespace AssistantV2 { /** The skill ID of the skill. */ skill_id: string; /** The type of the skill. */ - type?: string; + type?: ReleaseSkill.Constants.Type | string; /** The name of the skill snapshot that is saved as part of the release (for example, `draft` or `1`). */ snapshot?: string; } + export namespace ReleaseSkill { + export namespace Constants { + /** The type of the skill. */ + export enum Type { + DIALOG = 'dialog', + ACTION = 'action', + SEARCH = 'search', + } + } + } /** An optional object containing analytics data. Currently, this data is used only for events sent to the Segment extension. */ export interface RequestAnalytics { @@ -3398,7 +3426,7 @@ namespace AssistantV2 { */ festival?: string; /** The precision or duration of a time range specified by a recognized `@sys-time` or `@sys-date` entity. */ - granularity?: string; + granularity?: RuntimeEntityInterpretation.Constants.Granularity | string; /** A unique identifier used to associate multiple recognized `@sys-date`, `@sys-time`, or `@sys-number` * entities that are recognized as a range of values in the user's input (for example, `from July 4 until July 14` * or `from 20 to 25`). @@ -3471,11 +3499,42 @@ namespace AssistantV2 { /** A recognized time zone mentioned as part of a time value (for example, `EST`). */ timezone?: string; } + export namespace RuntimeEntityInterpretation { + export namespace Constants { + /** The precision or duration of a time range specified by a recognized `@sys-time` or `@sys-date` entity. */ + export enum Granularity { + DAY = 'day', + FORTNIGHT = 'fortnight', + HOUR = 'hour', + INSTANT = 'instant', + MINUTE = 'minute', + MONTH = 'month', + QUARTER = 'quarter', + SECOND = 'second', + WEEK = 'week', + WEEKEND = 'weekend', + YEAR = 'year', + } + } + } /** An object describing the role played by a system entity that is specifies the beginning or end of a range recognized in the user input. This property is included only if the new system entities are enabled for the skill. */ export interface RuntimeEntityRole { /** The relationship of the entity to the range. */ - type?: string; + type?: RuntimeEntityRole.Constants.Type | string; + } + export namespace RuntimeEntityRole { + export namespace Constants { + /** The relationship of the entity to the range. */ + export enum Type { + DATE_FROM = 'date_from', + DATE_TO = 'date_to', + NUMBER_FROM = 'number_from', + NUMBER_TO = 'number_to', + TIME_FROM = 'time_from', + TIME_TO = 'time_to', + } + } } /** An intent identified in the user input. */ @@ -3676,7 +3735,7 @@ namespace AssistantV2 { * - **Processing**: An asynchronous operation has not yet completed. * - **Training**: The skill is training based on new data. */ - status?: string; + status?: Skill.Constants.Status | string; /** An array of messages about errors that caused an asynchronous operation to fail. Included only if * **status**=`Failed`. */ @@ -3708,7 +3767,26 @@ namespace AssistantV2 { /** The language of the skill. */ language: string; /** The type of skill. */ - type: string; + type: Skill.Constants.Type | string; + } + export namespace Skill { + export namespace Constants { + /** The current status of the skill: - **Available**: The skill is available and ready to process messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** property for more information about the cause of the failure. - **Non Existent**: The skill does not exist. - **Processing**: An asynchronous operation has not yet completed. - **Training**: The skill is training based on new data. */ + export enum Status { + AVAILABLE = 'Available', + FAILED = 'Failed', + NON_EXISTENT = 'Non Existent', + PROCESSING = 'Processing', + TRAINING = 'Training', + UNAVAILABLE = 'Unavailable', + } + /** The type of skill. */ + export enum Type { + ACTION = 'action', + DIALOG = 'dialog', + SEARCH = 'search', + } + } } /** SkillImport. */ @@ -3729,7 +3807,7 @@ namespace AssistantV2 { * - **Processing**: An asynchronous operation has not yet completed. * - **Training**: The skill is training based on new data. */ - status?: string; + status?: SkillImport.Constants.Status | string; /** An array of messages about errors that caused an asynchronous operation to fail. Included only if * **status**=`Failed`. */ @@ -3761,7 +3839,26 @@ namespace AssistantV2 { /** The language of the skill. */ language: string; /** The type of skill. */ - type: string; + type: SkillImport.Constants.Type | string; + } + export namespace SkillImport { + export namespace Constants { + /** The current status of the skill: - **Available**: The skill is available and ready to process messages. - **Failed**: An asynchronous operation has failed. See the **status_errors** property for more information about the cause of the failure. - **Non Existent**: The skill does not exist. - **Processing**: An asynchronous operation has not yet completed. - **Training**: The skill is training based on new data. */ + export enum Status { + AVAILABLE = 'Available', + FAILED = 'Failed', + NON_EXISTENT = 'Non Existent', + PROCESSING = 'Processing', + TRAINING = 'Training', + UNAVAILABLE = 'Unavailable', + } + /** The type of skill. */ + export enum Type { + ACTION = 'action', + DIALOG = 'dialog', + SEARCH = 'search', + } + } } /** SkillsAsyncRequestStatus. */ @@ -3775,7 +3872,7 @@ namespace AssistantV2 { * the cause of the failure. * - `Processing`: An asynchronous operation has not yet completed. */ - status?: string; + status?: SkillsAsyncRequestStatus.Constants.Status | string; /** The description of the failed asynchronous operation. Included only if **status**=`Failed`. */ status_description?: string; /** An array of messages about errors that caused an asynchronous operation to fail. Included only if @@ -3783,6 +3880,17 @@ namespace AssistantV2 { */ status_errors?: StatusError[]; } + export namespace SkillsAsyncRequestStatus { + export namespace Constants { + /** The current status of the asynchronous operation: - `Available`: An asynchronous export is available. - `Completed`: An asynchronous import operation has completed successfully. - `Failed`: An asynchronous operation has failed. See the **status_errors** property for more information about the cause of the failure. - `Processing`: An asynchronous operation has not yet completed. */ + export enum Status { + AVAILABLE = 'Available', + COMPLETED = 'Completed', + FAILED = 'Failed', + PROCESSING = 'Processing', + } + } + } /** SkillsExport. */ export interface SkillsExport { @@ -3803,7 +3911,7 @@ namespace AssistantV2 { /** TurnEventActionSource. */ export interface TurnEventActionSource { /** The type of turn event. */ - type?: string; + type?: TurnEventActionSource.Constants.Type | string; /** An action that was visited during processing of the message. */ action?: string; /** The title of the action. */ @@ -3811,18 +3919,34 @@ namespace AssistantV2 { /** The condition that triggered the dialog node. */ condition?: string; } + export namespace TurnEventActionSource { + export namespace Constants { + /** The type of turn event. */ + export enum Type { + ACTION = 'action', + } + } + } /** TurnEventCalloutCallout. */ export interface TurnEventCalloutCallout { /** The type of callout. Currently, the only supported value is `integration_interaction` (for calls to * extensions). */ - type?: string; + type?: TurnEventCalloutCallout.Constants.Type | string; /** For internal use only. */ internal?: JsonObject; /** The name of the variable where the callout result is stored. */ result_variable?: string; } + export namespace TurnEventCalloutCallout { + export namespace Constants { + /** The type of callout. Currently, the only supported value is `integration_interaction` (for calls to extensions). */ + export enum Type { + INTEGRATION_INTERACTION = 'integration_interaction', + } + } + } /** TurnEventCalloutError. */ export interface TurnEventCalloutError { @@ -3833,7 +3957,7 @@ namespace AssistantV2 { /** TurnEventNodeSource. */ export interface TurnEventNodeSource { /** The type of turn event. */ - type?: string; + type?: TurnEventNodeSource.Constants.Type | string; /** A dialog node that was visited during processing of the input message. */ dialog_node?: string; /** The title of the dialog node. */ @@ -3841,6 +3965,14 @@ namespace AssistantV2 { /** The condition that triggered the dialog node. */ condition?: string; } + export namespace TurnEventNodeSource { + export namespace Constants { + /** The type of turn event. */ + export enum Type { + DIALOG_NODE = 'dialog_node', + } + } + } /** TurnEventSearchError. */ export interface TurnEventSearchError { @@ -3894,12 +4026,31 @@ namespace AssistantV2 { /** The time when the action started processing the message. */ action_start_time?: string; /** The type of condition (if any) that is defined for the action. */ - condition_type?: string; + condition_type?: MessageOutputDebugTurnEventTurnEventActionFinished.Constants.ConditionType | string; /** The reason the action finished processing. */ - reason?: string; + reason?: MessageOutputDebugTurnEventTurnEventActionFinished.Constants.Reason | string; /** The state of all action variables at the time the action finished. */ action_variables?: JsonObject; } + export namespace MessageOutputDebugTurnEventTurnEventActionFinished { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + /** The reason the action finished processing. */ + export enum Reason { + ALL_STEPS_DONE = 'all_steps_done', + NO_STEPS_VISITED = 'no_steps_visited', + ENDED_BY_STEP = 'ended_by_step', + CONNECT_TO_AGENT = 'connect_to_agent', + MAX_RETRIES_REACHED = 'max_retries_reached', + FALLBACK = 'fallback', + } + } + } /** MessageOutputDebugTurnEventTurnEventActionVisited. */ export interface MessageOutputDebugTurnEventTurnEventActionVisited extends MessageOutputDebugTurnEvent { @@ -3909,14 +4060,36 @@ namespace AssistantV2 { /** The time when the action started processing the message. */ action_start_time?: string; /** The type of condition (if any) that is defined for the action. */ - condition_type?: string; + condition_type?: MessageOutputDebugTurnEventTurnEventActionVisited.Constants.ConditionType | string; /** The reason the action was visited. */ - reason?: string; + reason?: MessageOutputDebugTurnEventTurnEventActionVisited.Constants.Reason | string; /** The variable where the result of the call to the action is stored. Included only if * **reason**=`subaction_return`. */ result_variable?: string; } + export namespace MessageOutputDebugTurnEventTurnEventActionVisited { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + /** The reason the action was visited. */ + export enum Reason { + INTENT = 'intent', + INVOKE_SUBACTION = 'invoke_subaction', + SUBACTION_RETURN = 'subaction_return', + INVOKE_EXTERNAL = 'invoke_external', + TOPIC_SWITCH = 'topic_switch', + TOPIC_RETURN = 'topic_return', + AGENT_REQUESTED = 'agent_requested', + STEP_VALIDATION_FAILED = 'step_validation_failed', + NO_ACTION_MATCHES = 'no_action_matches', + } + } + } /** MessageOutputDebugTurnEventTurnEventCallout. */ export interface MessageOutputDebugTurnEventTurnEventCallout extends MessageOutputDebugTurnEvent { @@ -3942,7 +4115,20 @@ namespace AssistantV2 { event?: string; source?: TurnEventNodeSource; /** The reason the dialog node was visited. */ - reason?: string; + reason?: MessageOutputDebugTurnEventTurnEventNodeVisited.Constants.Reason | string; + } + export namespace MessageOutputDebugTurnEventTurnEventNodeVisited { + export namespace Constants { + /** The reason the dialog node was visited. */ + export enum Reason { + WELCOME = 'welcome', + BRANCH_START = 'branch_start', + TOPIC_SWITCH = 'topic_switch', + TOPIC_RETURN = 'topic_return', + TOPIC_SWITCH_WITHOUT_RETURN = 'topic_switch_without_return', + JUMP = 'jump', + } + } } /** MessageOutputDebugTurnEventTurnEventSearch. */ @@ -3959,7 +4145,7 @@ namespace AssistantV2 { event?: string; source?: TurnEventActionSource; /** The type of condition (if any) that is defined for the action. */ - condition_type?: string; + condition_type?: MessageOutputDebugTurnEventTurnEventStepAnswered.Constants.ConditionType | string; /** The time when the action started processing the message. */ action_start_time?: string; /** Whether the step was answered in response to a prompt from the assistant. If this property is `false`, the @@ -3967,6 +4153,16 @@ namespace AssistantV2 { */ prompted?: boolean; } + export namespace MessageOutputDebugTurnEventTurnEventStepAnswered { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + } + } /** MessageOutputDebugTurnEventTurnEventStepVisited. */ export interface MessageOutputDebugTurnEventTurnEventStepVisited extends MessageOutputDebugTurnEvent { @@ -3974,12 +4170,22 @@ namespace AssistantV2 { event?: string; source?: TurnEventActionSource; /** The type of condition (if any) that is defined for the action. */ - condition_type?: string; + condition_type?: MessageOutputDebugTurnEventTurnEventStepVisited.Constants.ConditionType | string; /** The time when the action started processing the message. */ action_start_time?: string; /** Whether the step collects a customer response. */ has_question?: boolean; } + export namespace MessageOutputDebugTurnEventTurnEventStepVisited { + export namespace Constants { + /** The type of condition (if any) that is defined for the action. */ + export enum ConditionType { + USER_DEFINED = 'user_defined', + WELCOME = 'welcome', + ANYTHING_ELSE = 'anything_else', + } + } + } /** RuntimeResponseGenericRuntimeResponseTypeAudio. */ export interface RuntimeResponseGenericRuntimeResponseTypeAudio extends RuntimeResponseGeneric { @@ -4110,7 +4316,7 @@ namespace AssistantV2 { /** The description to show with the the response. */ description?: string; /** The preferred type of control to display. */ - preference?: string; + preference?: RuntimeResponseGenericRuntimeResponseTypeOption.Constants.Preference | string; /** An array of objects describing the options from which the user can choose. */ options: DialogNodeOutputOptionsElement[]; /** An array of objects specifying channels for which the response is intended. If **channels** is present, the @@ -4118,6 +4324,15 @@ namespace AssistantV2 { */ channels?: ResponseGenericChannel[]; } + export namespace RuntimeResponseGenericRuntimeResponseTypeOption { + export namespace Constants { + /** The preferred type of control to display. */ + export enum Preference { + DROPDOWN = 'dropdown', + BUTTON = 'button', + } + } + } /** RuntimeResponseGenericRuntimeResponseTypePause. */ export interface RuntimeResponseGenericRuntimeResponseTypePause extends RuntimeResponseGeneric { diff --git a/discovery/v1.ts b/discovery/v1.ts index a84562e519..549240e6b5 100644 --- a/discovery/v1.ts +++ b/discovery/v1.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -55,7 +55,7 @@ class DiscoveryV1 extends BaseService { * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the version of the API you want to use. Specify dates in * YYYY-MM-DD format. The current version is `2019-04-30`. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -126,11 +126,7 @@ class DiscoveryV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createEnvironment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createEnvironment'); const parameters = { options: { @@ -181,11 +177,7 @@ class DiscoveryV1 extends BaseService { 'name': _params.name, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listEnvironments' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listEnvironments'); const parameters = { options: { @@ -235,11 +227,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getEnvironment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getEnvironment'); const parameters = { options: { @@ -303,11 +291,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateEnvironment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'updateEnvironment'); const parameters = { options: { @@ -360,11 +344,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteEnvironment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteEnvironment'); const parameters = { options: { @@ -419,11 +399,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listFields' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listFields'); const parameters = { options: { @@ -503,11 +479,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createConfiguration' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createConfiguration'); const parameters = { options: { @@ -564,11 +536,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listConfigurations' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listConfigurations'); const parameters = { options: { @@ -621,11 +589,7 @@ class DiscoveryV1 extends BaseService { 'configuration_id': _params.configurationId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getConfiguration' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getConfiguration'); const parameters = { options: { @@ -702,11 +666,7 @@ class DiscoveryV1 extends BaseService { 'configuration_id': _params.configurationId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateConfiguration' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'updateConfiguration'); const parameters = { options: { @@ -766,11 +726,7 @@ class DiscoveryV1 extends BaseService { 'configuration_id': _params.configurationId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteConfiguration' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteConfiguration'); const parameters = { options: { @@ -836,11 +792,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createCollection'); const parameters = { options: { @@ -897,11 +849,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCollections' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listCollections'); const parameters = { options: { @@ -954,11 +902,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getCollection'); const parameters = { options: { @@ -1020,11 +964,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'updateCollection'); const parameters = { options: { @@ -1079,11 +1019,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCollection'); const parameters = { options: { @@ -1138,11 +1074,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCollectionFields' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listCollectionFields'); const parameters = { options: { @@ -1201,11 +1133,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listExpansions' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listExpansions'); const parameters = { options: { @@ -1278,11 +1206,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createExpansions' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createExpansions'); const parameters = { options: { @@ -1340,11 +1264,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteExpansions' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteExpansions'); const parameters = { options: { @@ -1398,11 +1318,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getTokenizationDictionaryStatus' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getTokenizationDictionaryStatus'); const parameters = { options: { @@ -1464,11 +1380,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createTokenizationDictionary' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createTokenizationDictionary'); const parameters = { options: { @@ -1525,11 +1437,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteTokenizationDictionary' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteTokenizationDictionary'); const parameters = { options: { @@ -1583,11 +1491,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getStopwordListStatus' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getStopwordListStatus'); const parameters = { options: { @@ -1652,11 +1556,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createStopwordList' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createStopwordList'); const parameters = { options: { @@ -1714,11 +1614,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteStopwordList' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteStopwordList'); const parameters = { options: { @@ -1815,11 +1711,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'addDocument'); const parameters = { options: { @@ -1880,11 +1772,7 @@ class DiscoveryV1 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getDocumentStatus' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getDocumentStatus'); const parameters = { options: { @@ -1964,11 +1852,7 @@ class DiscoveryV1 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'updateDocument'); const parameters = { options: { @@ -2028,11 +1912,7 @@ class DiscoveryV1 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteDocument'); const parameters = { options: { @@ -2166,11 +2046,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'query' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'query'); const parameters = { options: { @@ -2286,11 +2162,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'queryNotices' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'queryNotices'); const parameters = { options: { @@ -2415,11 +2287,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'federatedQuery' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'federatedQuery'); const parameters = { options: { @@ -2525,11 +2393,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'federatedQueryNotices' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'federatedQueryNotices'); const parameters = { options: { @@ -2593,11 +2457,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getAutocompletion' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getAutocompletion'); const parameters = { options: { @@ -2655,11 +2515,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listTrainingData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listTrainingData'); const parameters = { options: { @@ -2724,11 +2580,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addTrainingData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'addTrainingData'); const parameters = { options: { @@ -2785,11 +2637,7 @@ class DiscoveryV1 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteAllTrainingData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteAllTrainingData'); const parameters = { options: { @@ -2845,11 +2693,7 @@ class DiscoveryV1 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getTrainingData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getTrainingData'); const parameters = { options: { @@ -2906,11 +2750,7 @@ class DiscoveryV1 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteTrainingData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteTrainingData'); const parameters = { options: { @@ -2966,11 +2806,7 @@ class DiscoveryV1 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listTrainingExamples' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listTrainingExamples'); const parameters = { options: { @@ -3036,11 +2872,7 @@ class DiscoveryV1 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createTrainingExample' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createTrainingExample'); const parameters = { options: { @@ -3101,11 +2933,7 @@ class DiscoveryV1 extends BaseService { 'example_id': _params.exampleId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteTrainingExample' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteTrainingExample'); const parameters = { options: { @@ -3170,11 +2998,7 @@ class DiscoveryV1 extends BaseService { 'example_id': _params.exampleId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateTrainingExample' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'updateTrainingExample'); const parameters = { options: { @@ -3235,11 +3059,7 @@ class DiscoveryV1 extends BaseService { 'example_id': _params.exampleId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getTrainingExample' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getTrainingExample'); const parameters = { options: { @@ -3297,11 +3117,7 @@ class DiscoveryV1 extends BaseService { 'customer_id': _params.customerId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteUserData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteUserData'); const parameters = { options: { @@ -3358,11 +3174,7 @@ class DiscoveryV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createEvent' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createEvent'); const parameters = { options: { @@ -3429,11 +3241,7 @@ class DiscoveryV1 extends BaseService { 'sort': _params.sort, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'queryLog' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'queryLog'); const parameters = { options: { @@ -3488,11 +3296,7 @@ class DiscoveryV1 extends BaseService { 'result_type': _params.resultType, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getMetricsQuery' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getMetricsQuery'); const parameters = { options: { @@ -3549,11 +3353,7 @@ class DiscoveryV1 extends BaseService { 'result_type': _params.resultType, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getMetricsQueryEvent' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getMetricsQueryEvent'); const parameters = { options: { @@ -3609,11 +3409,7 @@ class DiscoveryV1 extends BaseService { 'result_type': _params.resultType, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getMetricsQueryNoResults' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getMetricsQueryNoResults'); const parameters = { options: { @@ -3670,11 +3466,7 @@ class DiscoveryV1 extends BaseService { 'result_type': _params.resultType, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getMetricsEventRate' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getMetricsEventRate'); const parameters = { options: { @@ -3726,11 +3518,7 @@ class DiscoveryV1 extends BaseService { 'count': _params.count, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getMetricsQueryTokenEvent' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getMetricsQueryTokenEvent'); const parameters = { options: { @@ -3787,11 +3575,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCredentials' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listCredentials'); const parameters = { options: { @@ -3864,11 +3648,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createCredentials' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createCredentials'); const parameters = { options: { @@ -3928,11 +3708,7 @@ class DiscoveryV1 extends BaseService { 'credential_id': _params.credentialId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCredentials' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getCredentials'); const parameters = { options: { @@ -4006,11 +3782,7 @@ class DiscoveryV1 extends BaseService { 'credential_id': _params.credentialId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateCredentials' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'updateCredentials'); const parameters = { options: { @@ -4067,11 +3839,7 @@ class DiscoveryV1 extends BaseService { 'credential_id': _params.credentialId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCredentials' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCredentials'); const parameters = { options: { @@ -4127,11 +3895,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listGateways' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'listGateways'); const parameters = { options: { @@ -4189,11 +3953,7 @@ class DiscoveryV1 extends BaseService { 'environment_id': _params.environmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createGateway' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'createGateway'); const parameters = { options: { @@ -4250,11 +4010,7 @@ class DiscoveryV1 extends BaseService { 'gateway_id': _params.gatewayId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getGateway' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'getGateway'); const parameters = { options: { @@ -4309,11 +4065,7 @@ class DiscoveryV1 extends BaseService { 'gateway_id': _params.gatewayId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteGateway' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteGateway'); const parameters = { options: { @@ -5573,7 +5325,7 @@ namespace DiscoveryV1 { /** The timestamp of when the collection was last updated in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. */ updated?: string; /** The status of the collection. */ - status?: string; + status?: Collection.Constants.Status | string; /** The unique identifier of the collection's configuration. */ configuration_id?: string; /** The language of the documents stored in the collection. Permitted values include `en` (English), `de` @@ -5591,6 +5343,16 @@ namespace DiscoveryV1 { /** Object containing smart document understanding information for this collection. */ smart_document_understanding?: SduStatus; } + export namespace Collection { + export namespace Constants { + /** The status of the collection. */ + export enum Status { + ACTIVE = 'active', + PENDING = 'pending', + MAINTENANCE = 'maintenance', + } + } + } /** Object containing information about the crawl status of this collection. */ export interface CollectionCrawlStatus { @@ -5667,10 +5429,18 @@ namespace DiscoveryV1 { /** An object defining the event being created. */ export interface CreateEventResponse { /** The event type that was created. */ - type?: string; + type?: CreateEventResponse.Constants.Type | string; /** Query event data object. */ data?: EventData; } + export namespace CreateEventResponse { + export namespace Constants { + /** The event type that was created. */ + export enum Type { + CLICK = 'click', + } + } + } /** Object containing details of the stored credentials. Obtain credentials for your source from the administrator of the source. */ export interface CredentialDetails { @@ -5684,7 +5454,7 @@ namespace DiscoveryV1 { * - `"source_type": "web_crawl"` - valid `credential_type`s: `noauth` or `basic` * - "source_type": "cloud_object_storage"` - valid `credential_type`s: `aws4_hmac`. */ - credential_type?: string; + credential_type?: CredentialDetails.Constants.CredentialType | string; /** The **client_id** of the source that these credentials connect to. Only valid, and required, with a * **credential_type** of `oauth2`. */ @@ -5745,7 +5515,7 @@ namespace DiscoveryV1 { /** The type of Sharepoint repository to connect to. Only valid, and required, with a **source_type** of * `sharepoint`. */ - source_version?: string; + source_version?: CredentialDetails.Constants.SourceVersion | string; /** SharePoint OnPrem WebApplication URL. Only valid, and required, with a **source_version** of `2016`. If a * port is not supplied, the default to port `80` for http and port `443` for https connections are used. */ @@ -5771,6 +5541,24 @@ namespace DiscoveryV1 { */ secret_access_key?: string; } + export namespace CredentialDetails { + export namespace Constants { + /** The authentication method for this credentials definition. The **credential_type** specified must be supported by the **source_type**. The following combinations are possible: - `"source_type": "box"` - valid `credential_type`s: `oauth2` - `"source_type": "salesforce"` - valid `credential_type`s: `username_password` - `"source_type": "sharepoint"` - valid `credential_type`s: `saml` with **source_version** of `online`, or `ntlm_v1` with **source_version** of `2016` - `"source_type": "web_crawl"` - valid `credential_type`s: `noauth` or `basic` - "source_type": "cloud_object_storage"` - valid `credential_type`s: `aws4_hmac`. */ + export enum CredentialType { + OAUTH2 = 'oauth2', + SAML = 'saml', + USERNAME_PASSWORD = 'username_password', + NOAUTH = 'noauth', + BASIC = 'basic', + NTLM_V1 = 'ntlm_v1', + AWS4_HMAC = 'aws4_hmac', + } + /** The type of Sharepoint repository to connect to. Only valid, and required, with a **source_type** of `sharepoint`. */ + export enum SourceVersion { + ONLINE = 'online', + } + } + } /** Object containing credential information. */ export interface Credentials { @@ -5783,7 +5571,7 @@ namespace DiscoveryV1 { * - `web_crawl` indicates the credentials are used to perform a web crawl. * = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. */ - source_type?: string; + source_type?: Credentials.Constants.SourceType | string; /** Object containing details of the stored credentials. * * Obtain credentials for your source from the administrator of the source. @@ -5792,6 +5580,18 @@ namespace DiscoveryV1 { /** Object that contains details about the status of the authentication process. */ status?: StatusDetails; } + export namespace Credentials { + export namespace Constants { + /** The source that this credentials object connects to. - `box` indicates the credentials are used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud Object Store. */ + export enum SourceType { + BOX = 'box', + SALESFORCE = 'salesforce', + SHAREPOINT = 'sharepoint', + WEB_CRAWL = 'web_crawl', + CLOUD_OBJECT_STORAGE = 'cloud_object_storage', + } + } + } /** Object containing array of credential definitions. */ export interface CredentialsList { @@ -5804,7 +5604,15 @@ namespace DiscoveryV1 { /** The unique identifier of the collection that is being deleted. */ collection_id: string; /** The status of the collection. The status of a successful deletion operation is `deleted`. */ - status: string; + status: DeleteCollectionResponse.Constants.Status | string; + } + export namespace DeleteCollectionResponse { + export namespace Constants { + /** The status of the collection. The status of a successful deletion operation is `deleted`. */ + export enum Status { + DELETED = 'deleted', + } + } } /** Information returned when a configuration is deleted. */ @@ -5812,17 +5620,33 @@ namespace DiscoveryV1 { /** The unique identifier for the configuration. */ configuration_id: string; /** Status of the configuration. A deleted configuration has the status deleted. */ - status: string; + status: DeleteConfigurationResponse.Constants.Status | string; /** An array of notice messages, if any. */ notices?: Notice[]; } + export namespace DeleteConfigurationResponse { + export namespace Constants { + /** Status of the configuration. A deleted configuration has the status deleted. */ + export enum Status { + DELETED = 'deleted', + } + } + } /** Object returned after credentials are deleted. */ export interface DeleteCredentials { /** The unique identifier of the credentials that have been deleted. */ credential_id?: string; /** The status of the deletion request. */ - status?: string; + status?: DeleteCredentials.Constants.Status | string; + } + export namespace DeleteCredentials { + export namespace Constants { + /** The status of the deletion request. */ + export enum Status { + DELETED = 'deleted', + } + } } /** Information returned when a document is deleted. */ @@ -5830,7 +5654,15 @@ namespace DiscoveryV1 { /** The unique identifier of the document. */ document_id?: string; /** Status of the document. A deleted document has the status deleted. */ - status?: string; + status?: DeleteDocumentResponse.Constants.Status | string; + } + export namespace DeleteDocumentResponse { + export namespace Constants { + /** Status of the document. A deleted document has the status deleted. */ + export enum Status { + DELETED = 'deleted', + } + } } /** Response object returned when deleting an environment. */ @@ -5838,7 +5670,15 @@ namespace DiscoveryV1 { /** The unique identifier for the environment. */ environment_id: string; /** Status of the environment. */ - status: string; + status: DeleteEnvironmentResponse.Constants.Status | string; + } + export namespace DeleteEnvironmentResponse { + export namespace Constants { + /** Status of the environment. */ + export enum Status { + DELETED = 'deleted', + } + } } /** Summary of the disk usage statistics for the environment. */ @@ -5856,10 +5696,19 @@ namespace DiscoveryV1 { /** Status of the document in the ingestion process. A status of `processing` is returned for documents that are * ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */ - status?: string; + status?: DocumentAccepted.Constants.Status | string; /** Array of notices produced by the document-ingestion process. */ notices?: Notice[]; } + export namespace DocumentAccepted { + export namespace Constants { + /** Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */ + export enum Status { + PROCESSING = 'processing', + PENDING = 'pending', + } + } + } /** Object containing collection document count information. */ export interface DocumentCounts { @@ -5880,18 +5729,37 @@ namespace DiscoveryV1 { /** The unique identifier for the configuration. */ configuration_id?: string; /** Status of the document in the ingestion process. */ - status?: string; + status?: DocumentStatus.Constants.Status | string; /** Description of the document status. */ status_description?: string; /** Name of the original source file (if available). */ filename?: string; /** The type of the original source file. */ - file_type?: string; + file_type?: DocumentStatus.Constants.FileType | string; /** The SHA-1 hash of the original source file (formatted as a hexadecimal string). */ sha1?: string; /** Array of notices produced by the document-ingestion process. */ notices?: Notice[]; } + export namespace DocumentStatus { + export namespace Constants { + /** Status of the document in the ingestion process. */ + export enum Status { + AVAILABLE = 'available', + AVAILABLE_WITH_NOTICES = 'available with notices', + FAILED = 'failed', + PROCESSING = 'processing', + PENDING = 'pending', + } + /** The type of the original source file. */ + export enum FileType { + PDF = 'pdf', + HTML = 'html', + WORD = 'word', + JSON = 'json', + } + } + } /** Enrichment step to perform on the document. Each enrichment is performed on the specified field in the order that they are listed in the configuration. */ export interface Enrichment { @@ -5938,12 +5806,28 @@ namespace DiscoveryV1 { * `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and `sv` (Swedish). **Note:** Not all * features support all languages, automatic detection is recommended. */ - language?: string; + language?: EnrichmentOptions.Constants.Language | string; /** Deprecated: The element extraction model to use, which can be `contract` only. The `elements` enrichment is * deprecated. */ model?: string; } + export namespace EnrichmentOptions { + export namespace Constants { + /** ISO 639-1 code indicating the language to use for the analysis. This code overrides the automatic language detection performed by the service. Valid codes are `ar` (Arabic), `en` (English), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), `es` (Spanish), and `sv` (Swedish). **Note:** Not all features support all languages, automatic detection is recommended. */ + export enum Language { + AR = 'ar', + EN = 'en', + FR = 'fr', + DE = 'de', + IT = 'it', + PT = 'pt', + RU = 'ru', + ES = 'es', + SV = 'sv', + } + } + } /** Details about an environment. */ export interface Environment { @@ -5960,11 +5844,11 @@ namespace DiscoveryV1 { /** Current status of the environment. `resizing` is displayed when a request to increase the environment size * has been made, but is still in the process of being completed. */ - status?: string; + status?: Environment.Constants.Status | string; /** If `true`, the environment contains read-only collections that are maintained by IBM. */ read_only?: boolean; /** Current size of the environment. */ - size?: string; + size?: Environment.Constants.Size | string; /** The new size requested for this environment. Only returned when the environment *status* is `resizing`. * * *Note:* Querying and indexing can still be performed during an environment upsize. @@ -5975,6 +5859,30 @@ namespace DiscoveryV1 { /** Information about the Continuous Relevancy Training for this environment. */ search_status?: SearchStatus; } + export namespace Environment { + export namespace Constants { + /** Current status of the environment. `resizing` is displayed when a request to increase the environment size has been made, but is still in the process of being completed. */ + export enum Status { + ACTIVE = 'active', + PENDING = 'pending', + MAINTENANCE = 'maintenance', + RESIZING = 'resizing', + } + /** Current size of the environment. */ + export enum Size { + LT = 'LT', + XS = 'XS', + S = 'S', + MS = 'MS', + M = 'M', + ML = 'ML', + L = 'L', + XL = 'XL', + XXL = 'XXL', + XXXL = 'XXXL', + } + } + } /** Summary of the document usage statistics for the environment. */ export interface EnvironmentDocuments { @@ -6042,7 +5950,25 @@ namespace DiscoveryV1 { /** The name of the field. */ field?: string; /** The type of the field. */ - type?: string; + type?: Field.Constants.Type | string; + } + export namespace Field { + export namespace Constants { + /** The type of the field. */ + export enum Type { + NESTED = 'nested', + STRING = 'string', + DATE = 'date', + LONG = 'long', + INTEGER = 'integer', + SHORT = 'short', + BYTE = 'byte', + DOUBLE = 'double', + FLOAT = 'float', + BOOLEAN = 'boolean', + BINARY = 'binary', + } + } } /** Font matching configuration. */ @@ -6070,7 +5996,7 @@ namespace DiscoveryV1 { /** The current status of the gateway. `connected` means the gateway is connected to the remotly installed * gateway. `idle` means this gateway is not currently in use. */ - status?: string; + status?: Gateway.Constants.Status | string; /** The generated **token** for this gateway. The value of this field is used when configuring the remotly * installed gateway. */ @@ -6080,6 +6006,15 @@ namespace DiscoveryV1 { */ token_id?: string; } + export namespace Gateway { + export namespace Constants { + /** The current status of the gateway. `connected` means the gateway is connected to the remotly installed gateway. `idle` means this gateway is not currently in use. */ + export enum Status { + CONNECTED = 'connected', + IDLE = 'idle', + } + } + } /** Gatway deletion confirmation. */ export interface GatewayDelete { @@ -6167,7 +6102,7 @@ namespace DiscoveryV1 { * * **event** indicates that the log represents a call to the **events** API. */ - document_type?: string; + document_type?: LogQueryResponseResult.Constants.DocumentType | string; /** The value of the **natural_language_query** query parameter that was used to create these results. Only * returned with logs of type **query**. * @@ -6215,9 +6150,27 @@ namespace DiscoveryV1 { * * - `click` the result of a call to the **events** endpoint. */ - event_type?: string; + event_type?: LogQueryResponseResult.Constants.EventType | string; /** The type of result that this **event** is associated with. Only returned with logs of type `event`. */ - result_type?: string; + result_type?: LogQueryResponseResult.Constants.ResultType | string; + } + export namespace LogQueryResponseResult { + export namespace Constants { + /** The type of log entry returned. **query** indicates that the log represents the results of a call to the single collection **query** method. **event** indicates that the log represents a call to the **events** API. */ + export enum DocumentType { + QUERY = 'query', + EVENT = 'event', + } + /** The type of event that this object respresents. Possible values are - `query` the log of a query to a collection - `click` the result of a call to the **events** endpoint. */ + export enum EventType { + CLICK = 'click', + QUERY = 'query', + } + /** The type of result that this **event** is associated with. Only returned with logs of type `event`. */ + export enum ResultType { + DOCUMENT = 'document', + } + } } /** Object containing result information that was returned by the query used to create this log entry. Only returned with logs of type `query`. */ @@ -6418,12 +6371,24 @@ namespace DiscoveryV1 { * document. Typically, **remove_nulls** is invoked as the last normalization operation (if it is invoked at all, * it can be time-expensive). */ - operation?: string; + operation?: NormalizationOperation.Constants.Operation | string; /** The source field for the operation. */ source_field?: string; /** The destination field for the operation. */ destination_field?: string; } + export namespace NormalizationOperation { + export namespace Constants { + /** Identifies what type of operation to perform. **copy** - Copies the value of the **source_field** to the **destination_field** field. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. **move** - Renames (moves) the **source_field** to the **destination_field**. If the **destination_field** already exists, then the value of the **source_field** overwrites the original value of the **destination_field**. Rename is identical to copy, except that the **source_field** is removed after the value has been copied to the **destination_field** (it is the same as a _copy_ followed by a _remove_). **merge** - Merges the value of the **source_field** with the value of the **destination_field**. The **destination_field** is converted into an array if it is not already an array, and the value of the **source_field** is appended to the array. This operation removes the **source_field** after the merge. If the **source_field** does not exist in the current document, then the **destination_field** is still converted into an array (if it is not an array already). This conversion ensures the type for **destination_field** is consistent across all documents. **remove** - Deletes the **source_field** field. The **destination_field** is ignored for this operation. **remove_nulls** - Removes all nested null (blank) field values from the ingested document. **source_field** and **destination_field** are ignored by this operation because _remove_nulls_ operates on the entire ingested document. Typically, **remove_nulls** is invoked as the last normalization operation (if it is invoked at all, it can be time-expensive). */ + export enum Operation { + COPY = 'copy', + MOVE = 'move', + MERGE = 'merge', + REMOVE = 'remove', + REMOVE_NULLS = 'remove_nulls', + } + } + } /** A notice produced for the collection. */ export interface Notice { @@ -6445,7 +6410,7 @@ namespace DiscoveryV1 { /** Unique identifier of the query used for relevance training. */ query_id?: string; /** Severity level of the notice. */ - severity?: string; + severity?: Notice.Constants.Severity | string; /** Ingestion or training step in which the notice occurred. Typical step values include: * `smartDocumentUnderstanding`, `ingestion`, `indexing`, `convert`. **Note:** This is not a complete list; other * values might be returned. @@ -6454,6 +6419,15 @@ namespace DiscoveryV1 { /** The description of the notice. */ description?: string; } + export namespace Notice { + export namespace Constants { + /** Severity level of the notice. */ + export enum Severity { + WARNING = 'warning', + ERROR = 'error', + } + } + } /** Object containing heading detection conversion settings for PDF documents. */ export interface PdfHeadingDetection { @@ -6514,7 +6488,7 @@ namespace DiscoveryV1 { /** Name of the original source file (if available). */ filename?: string; /** The type of the original source file. */ - file_type?: string; + file_type?: QueryNoticesResult.Constants.FileType | string; /** The SHA-1 hash of the original source file (formatted as a hexadecimal string). */ sha1?: string; /** Array of notices for the document. */ @@ -6522,6 +6496,17 @@ namespace DiscoveryV1 { /** QueryNoticesResult accepts additional properties. */ [propName: string]: any; } + export namespace QueryNoticesResult { + export namespace Constants { + /** The type of the original source file. */ + export enum FileType { + PDF = 'pdf', + HTML = 'html', + WORD = 'word', + JSON = 'json', + } + } + } /** A passage query result. */ export interface QueryPassages { @@ -6641,7 +6626,17 @@ namespace DiscoveryV1 { * **Note**: In the event of trained collections being queried, but the trained model is not used to return * results, the **document_retrieval_strategy** will be listed as `untrained`. */ - document_retrieval_strategy?: string; + document_retrieval_strategy?: RetrievalDetails.Constants.DocumentRetrievalStrategy | string; + } + export namespace RetrievalDetails { + export namespace Constants { + /** Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results were returned using a relevancy trained model. `continuous_relevancy_training` indicates that the results were returned using the continuous relevancy training model created by result feedback analysis. `untrained` means the results were returned using the standard untrained model. **Note**: In the event of trained collections being queried, but the trained model is not used to return results, the **document_retrieval_strategy** will be listed as `untrained`. */ + export enum DocumentRetrievalStrategy { + UNTRAINED = 'untrained', + RELEVANCY_TRAINING = 'relevancy_training', + CONTINUOUS_RELEVANCY_TRAINING = 'continuous_relevancy_training', + } + } } /** Object containing smart document understanding information for this collection. */ @@ -6683,12 +6678,24 @@ namespace DiscoveryV1 { /** Current scope of the training. Always returned as `environment`. */ scope?: string; /** The current status of Continuous Relevancy Training for this environment. */ - status?: string; + status?: SearchStatus.Constants.Status | string; /** Long description of the current Continuous Relevancy Training status. */ status_description?: string; /** The date stamp of the most recent completed training for this environment. */ last_trained?: string; } + export namespace SearchStatus { + export namespace Constants { + /** The current status of Continuous Relevancy Training for this environment. */ + export enum Status { + NO_DATA = 'NO_DATA', + INSUFFICENT_DATA = 'INSUFFICENT_DATA', + TRAINING = 'TRAINING', + TRAINED = 'TRAINED', + NOT_APPLICABLE = 'NOT_APPLICABLE', + } + } + } /** A list of Document Segmentation settings. */ export interface SegmentSettings { @@ -6720,7 +6727,7 @@ namespace DiscoveryV1 { * - `web_crawl` indicates the configuration is to perform a web page crawl. * - `cloud_object_storage` indicates the configuration is to connect to a cloud object store. */ - type?: string; + type?: Source.Constants.Type | string; /** The **credential_id** of the credentials to use to connect to the source. Credentials are defined using the * **credentials** method. The **source_type** of the credentials used must match the **type** field specified in * this object. @@ -6731,6 +6738,18 @@ namespace DiscoveryV1 { /** The **options** object defines which items to crawl from the source system. */ options?: SourceOptions; } + export namespace Source { + export namespace Constants { + /** The type of source to connect to. - `box` indicates the configuration is to connect an instance of Enterprise Box. - `salesforce` indicates the configuration is to connect to Salesforce. - `sharepoint` indicates the configuration is to connect to Microsoft SharePoint Online. - `web_crawl` indicates the configuration is to perform a web page crawl. - `cloud_object_storage` indicates the configuration is to connect to a cloud object store. */ + export enum Type { + BOX = 'box', + SALESFORCE = 'salesforce', + SHAREPOINT = 'sharepoint', + WEB_CRAWL = 'web_crawl', + CLOUD_OBJECT_STORAGE = 'cloud_object_storage', + } + } + } /** The **options** object defines which items to crawl from the source system. */ export interface SourceOptions { @@ -6815,7 +6834,7 @@ namespace DiscoveryV1 { * each call. `normal` means as many as two URLs are fectched concurrently with a short delay between fetch calls. * `aggressive` means that up to ten URLs are fetched concurrently with a short delay between fetch calls. */ - crawl_speed?: string; + crawl_speed?: SourceOptionsWebCrawl.Constants.CrawlSpeed | string; /** When `true`, allows the crawl to interact with HTTPS sites with SSL certificates with untrusted signers. */ allow_untrusted_certificate?: boolean; /** The maximum number of hops to make from the initial URL. When a page is crawled each link on that page will @@ -6835,6 +6854,16 @@ namespace DiscoveryV1 { */ blacklist?: string[]; } + export namespace SourceOptionsWebCrawl { + export namespace Constants { + /** The number of concurrent URLs to fetch. `gentle` means one URL is fetched at a time with a delay between each call. `normal` means as many as two URLs are fectched concurrently with a short delay between fetch calls. `aggressive` means that up to ten URLs are fetched concurrently with a short delay between fetch calls. */ + export enum CrawlSpeed { + GENTLE = 'gentle', + NORMAL = 'normal', + AGGRESSIVE = 'aggressive', + } + } + } /** Object containing the schedule information for the source. */ export interface SourceSchedule { @@ -6854,7 +6883,19 @@ namespace DiscoveryV1 { * - `weekly`: Runs every week on Sunday between 00:00 and 06:00. * - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. */ - frequency?: string; + frequency?: SourceSchedule.Constants.Frequency | string; + } + export namespace SourceSchedule { + export namespace Constants { + /** The crawl schedule in the specified **time_zone**. - `five_minutes`: Runs every five minutes. - `hourly`: Runs every hour. - `daily`: Runs every day between 00:00 and 06:00. - `weekly`: Runs every week on Sunday between 00:00 and 06:00. - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. */ + export enum Frequency { + DAILY = 'daily', + WEEKLY = 'weekly', + MONTHLY = 'monthly', + FIVE_MINUTES = 'five_minutes', + HOURLY = 'hourly', + } + } } /** Object containing source crawl status information. */ @@ -6867,10 +6908,22 @@ namespace DiscoveryV1 { * - `queued` indicates that the crawl has been paused by the system and will automatically restart when possible. * - `unknown` indicates that an unidentified error has occured in the service. */ - status?: string; + status?: SourceStatus.Constants.Status | string; /** Date in `RFC 3339` format indicating the time of the next crawl attempt. */ next_crawl?: string; } + export namespace SourceStatus { + export namespace Constants { + /** The current status of the source crawl for this collection. This field returns `not_configured` if the default configuration for this source does not have a **source** object defined. - `running` indicates that a crawl to fetch more documents is in progress. - `complete` indicates that the crawl has completed with no errors. - `queued` indicates that the crawl has been paused by the system and will automatically restart when possible. - `unknown` indicates that an unidentified error has occured in the service. */ + export enum Status { + RUNNING = 'running', + COMPLETE = 'complete', + NOT_CONFIGURED = 'not_configured', + QUEUED = 'queued', + UNKNOWN = 'unknown', + } + } + } /** Object that contains details about the status of the authentication process. */ export interface StatusDetails { @@ -6897,10 +6950,20 @@ namespace DiscoveryV1 { /** Object describing the current status of the wordlist. */ export interface TokenDictStatusResponse { /** Current wordlist status for the specified collection. */ - status?: string; + status?: TokenDictStatusResponse.Constants.Status | string; /** The type for this wordlist. Can be `tokenization_dictionary` or `stopwords`. */ type?: string; } + export namespace TokenDictStatusResponse { + export namespace Constants { + /** Current wordlist status for the specified collection. */ + export enum Status { + ACTIVE = 'active', + PENDING = 'pending', + NOT_FOUND = 'not found', + } + } + } /** Training information for a specific collection. */ export interface TrainingDataSet { diff --git a/discovery/v2.ts b/discovery/v2.ts index a973887bf3..01e600be0b 100644 --- a/discovery/v2.ts +++ b/discovery/v2.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -55,7 +55,7 @@ class DiscoveryV2 extends BaseService { * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the version of the API you want to use. Specify dates in * YYYY-MM-DD format. The current version is `2020-08-30`. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -113,11 +113,7 @@ class DiscoveryV2 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listProjects' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listProjects'); const parameters = { options: { @@ -179,11 +175,7 @@ class DiscoveryV2 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createProject' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createProject'); const parameters = { options: { @@ -238,11 +230,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getProject' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getProject'); const parameters = { options: { @@ -301,11 +289,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateProject' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateProject'); const parameters = { options: { @@ -364,11 +348,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteProject' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteProject'); const parameters = { options: { @@ -424,11 +404,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listFields' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listFields'); const parameters = { options: { @@ -485,11 +461,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listCollections' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listCollections'); const parameters = { options: { @@ -560,11 +532,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createCollection'); const parameters = { options: { @@ -622,11 +590,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getCollection'); const parameters = { options: { @@ -691,11 +655,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateCollection'); const parameters = { options: { @@ -754,11 +714,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteCollection' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteCollection'); const parameters = { options: { @@ -859,11 +815,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listDocuments' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listDocuments'); const parameters = { options: { @@ -974,11 +926,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'addDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'addDocument'); const parameters = { options: { @@ -1044,11 +992,7 @@ class DiscoveryV2 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getDocument'); const parameters = { options: { @@ -1151,11 +1095,7 @@ class DiscoveryV2 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateDocument'); const parameters = { options: { @@ -1226,11 +1166,7 @@ class DiscoveryV2 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteDocument'); const parameters = { options: { @@ -1352,11 +1288,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'query' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'query'); const parameters = { options: { @@ -1423,11 +1355,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getAutocompletion' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getAutocompletion'); const parameters = { options: { @@ -1502,11 +1430,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'queryCollectionNotices' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'queryCollectionNotices'); const parameters = { options: { @@ -1580,11 +1504,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'queryNotices' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'queryNotices'); const parameters = { options: { @@ -1645,11 +1565,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getStopwordList' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getStopwordList'); const parameters = { options: { @@ -1719,11 +1635,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createStopwordList' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createStopwordList'); const parameters = { options: { @@ -1782,11 +1694,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteStopwordList' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteStopwordList'); const parameters = { options: { @@ -1842,11 +1750,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listExpansions' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listExpansions'); const parameters = { options: { @@ -1920,11 +1824,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createExpansions' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createExpansions'); const parameters = { options: { @@ -1983,11 +1883,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteExpansions' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteExpansions'); const parameters = { options: { @@ -2043,11 +1939,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getComponentSettings' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getComponentSettings'); const parameters = { options: { @@ -2104,11 +1996,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listTrainingQueries' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listTrainingQueries'); const parameters = { options: { @@ -2162,11 +2050,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteTrainingQueries' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteTrainingQueries'); const parameters = { options: { @@ -2229,11 +2113,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createTrainingQuery' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createTrainingQuery'); const parameters = { options: { @@ -2291,11 +2171,7 @@ class DiscoveryV2 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getTrainingQuery' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getTrainingQuery'); const parameters = { options: { @@ -2361,11 +2237,7 @@ class DiscoveryV2 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateTrainingQuery' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateTrainingQuery'); const parameters = { options: { @@ -2423,11 +2295,7 @@ class DiscoveryV2 extends BaseService { 'query_id': _params.queryId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteTrainingQuery' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteTrainingQuery'); const parameters = { options: { @@ -2484,11 +2352,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listEnrichments' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listEnrichments'); const parameters = { options: { @@ -2560,11 +2424,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createEnrichment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createEnrichment'); const parameters = { options: { @@ -2622,11 +2482,7 @@ class DiscoveryV2 extends BaseService { 'enrichment_id': _params.enrichmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getEnrichment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getEnrichment'); const parameters = { options: { @@ -2689,11 +2545,7 @@ class DiscoveryV2 extends BaseService { 'enrichment_id': _params.enrichmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateEnrichment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateEnrichment'); const parameters = { options: { @@ -2753,11 +2605,7 @@ class DiscoveryV2 extends BaseService { 'enrichment_id': _params.enrichmentId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteEnrichment' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteEnrichment'); const parameters = { options: { @@ -2814,11 +2662,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listDocumentClassifiers' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listDocumentClassifiers'); const parameters = { options: { @@ -2899,11 +2743,7 @@ class DiscoveryV2 extends BaseService { 'project_id': _params.projectId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createDocumentClassifier' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createDocumentClassifier'); const parameters = { options: { @@ -2961,11 +2801,7 @@ class DiscoveryV2 extends BaseService { 'classifier_id': _params.classifierId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getDocumentClassifier' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getDocumentClassifier'); const parameters = { options: { @@ -3043,11 +2879,7 @@ class DiscoveryV2 extends BaseService { 'classifier_id': _params.classifierId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateDocumentClassifier' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateDocumentClassifier'); const parameters = { options: { @@ -3105,11 +2937,7 @@ class DiscoveryV2 extends BaseService { 'classifier_id': _params.classifierId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteDocumentClassifier' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteDocumentClassifier'); const parameters = { options: { @@ -3168,11 +2996,7 @@ class DiscoveryV2 extends BaseService { 'classifier_id': _params.classifierId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'listDocumentClassifierModels' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'listDocumentClassifierModels'); const parameters = { options: { @@ -3258,11 +3082,7 @@ class DiscoveryV2 extends BaseService { 'classifier_id': _params.classifierId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'createDocumentClassifierModel' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'createDocumentClassifierModel'); const parameters = { options: { @@ -3322,11 +3142,7 @@ class DiscoveryV2 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'getDocumentClassifierModel' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'getDocumentClassifierModel'); const parameters = { options: { @@ -3391,11 +3207,7 @@ class DiscoveryV2 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'updateDocumentClassifierModel' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'updateDocumentClassifierModel'); const parameters = { options: { @@ -3455,11 +3267,7 @@ class DiscoveryV2 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteDocumentClassifierModel' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteDocumentClassifierModel'); const parameters = { options: { @@ -3554,11 +3362,7 @@ class DiscoveryV2 extends BaseService { 'collection_id': _params.collectionId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'analyzeDocument' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'analyzeDocument'); const parameters = { options: { @@ -3620,11 +3424,7 @@ class DiscoveryV2 extends BaseService { 'customer_id': _params.customerId, }; - const sdkHeaders = getSdkHeaders( - DiscoveryV2.DEFAULT_SERVICE_NAME, - 'v2', - 'deleteUserData' - ); + const sdkHeaders = getSdkHeaders(DiscoveryV2.DEFAULT_SERVICE_NAME, 'v2', 'deleteUserData'); const parameters = { options: { @@ -4645,7 +4445,17 @@ namespace DiscoveryV2 { * user interface. For more information, see [the product * documentation](/docs/discovery-data?topic=discovery-data-configuring-fields). */ - model?: string; + model?: CollectionDetailsSmartDocumentUnderstanding.Constants.Model | string; + } + export namespace CollectionDetailsSmartDocumentUnderstanding { + export namespace Constants { + /** Specifies the type of Smart Document Understanding (SDU) model that is enabled for the collection. The following types of models are supported: * `custom`: A user-trained model is applied. * `pre_trained`: A pretrained model is applied. This type of model is applied automatically to *Document Retrieval for Contracts* projects. * `text_extraction`: An SDU model that extracts text and metadata from the content. This model is enabled in collections by default regardless of the types of documents in the collection (as long as the service plan supports SDU models). You can apply user-trained or pretrained models to collections from the *Identify fields* page of the product user interface. For more information, see [the product documentation](/docs/discovery-data?topic=discovery-data-configuring-fields). */ + export enum Model { + CUSTOM = 'custom', + PRE_TRAINED = 'pre_trained', + TEXT_EXTRACTION = 'text_extraction', + } + } } /** An object describing an enrichment for a collection. */ @@ -4678,7 +4488,18 @@ namespace DiscoveryV2 { /** Whether users is allowed to select more than one of the aggregation terms. */ multiple_selections_allowed?: boolean; /** Type of visualization to use when rendering the aggregation. */ - visualization_type?: string; + visualization_type?: ComponentSettingsAggregation.Constants.VisualizationType | string; + } + export namespace ComponentSettingsAggregation { + export namespace Constants { + /** Type of visualization to use when rendering the aggregation. */ + export enum VisualizationType { + AUTO = 'auto', + FACET_TABLE = 'facet_table', + WORD_CLOUD = 'word_cloud', + MAP = 'map', + } + } } /** Fields shown in the results section of the UI. */ @@ -4768,12 +4589,25 @@ namespace DiscoveryV2 { * * `watson_knowledge_studio_model`: Creates an enrichment from a Watson Knowledge Studio machine learning model * that is defined in a ZIP file. */ - type?: string; + type?: CreateEnrichment.Constants.Type | string; /** An object that contains options for the current enrichment. Starting with version `2020-08-30`, the * enrichment options are not included in responses from the List Enrichments method. */ options?: EnrichmentOptions; } + export namespace CreateEnrichment { + export namespace Constants { + /** The type of this enrichment. The following types are supported: * `classifier`: Creates a document classifier enrichment from a document classifier model that you create by using the [Document classifier API](/apidocs/discovery-data#createdocumentclassifier). **Note**: A text classifier enrichment can be created only from the product user interface. * `dictionary`: Creates a custom dictionary enrichment that you define in a CSV file. * `regular_expression`: Creates a custom regular expression enrichment from regex syntax that you specify in the request. * `rule_based`: Creates an enrichment from an advanced rules model that is created and exported as a ZIP file from Watson Knowledge Studio. * `uima_annotator`: Creates an enrichment from a custom UIMA text analysis model that is defined in a PEAR file created in one of the following ways: * Watson Explorer Content Analytics Studio. **Note**: Supported in IBM Cloud Pak for Data instances only. * Rule-based model that is created in Watson Knowledge Studio. * `watson_knowledge_studio_model`: Creates an enrichment from a Watson Knowledge Studio machine learning model that is defined in a ZIP file. */ + export enum Type { + CLASSIFIER = 'classifier', + DICTIONARY = 'dictionary', + REGULAR_EXPRESSION = 'regular_expression', + UIMA_ANNOTATOR = 'uima_annotator', + RULE_BASED = 'rule_based', + WATSON_KNOWLEDGE_STUDIO_MODEL = 'watson_knowledge_studio_model', + } + } + } /** Default query parameters for this project. */ export interface DefaultQueryParams { @@ -4845,7 +4679,15 @@ namespace DiscoveryV2 { /** The unique identifier of the document. */ document_id?: string; /** Status of the document. A deleted document has the status deleted. */ - status?: string; + status?: DeleteDocumentResponse.Constants.Status | string; + } + export namespace DeleteDocumentResponse { + export namespace Constants { + /** Status of the document. A deleted document has the status deleted. */ + export enum Status { + DELETED = 'deleted', + } + } } /** Information returned after an uploaded document is accepted. */ @@ -4855,7 +4697,16 @@ namespace DiscoveryV2 { /** Status of the document in the ingestion process. A status of `processing` is returned for documents that are * ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */ - status?: string; + status?: DocumentAccepted.Constants.Status | string; + } + export namespace DocumentAccepted { + export namespace Constants { + /** Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */ + export enum Status { + PROCESSING = 'processing', + PENDING = 'pending', + } + } } /** List of document attributes. */ @@ -4933,7 +4784,7 @@ namespace DiscoveryV2 { */ test_data_file?: string; /** The status of the training run. */ - status?: string; + status?: DocumentClassifierModel.Constants.Status | string; /** An object that contains information about a trained document classifier model. */ evaluation?: ClassifierModelEvaluation; /** A unique identifier of the enrichment that is generated by this document classifier model. */ @@ -4941,6 +4792,16 @@ namespace DiscoveryV2 { /** The date that the document classifier model was deployed. */ deployed_at?: string; } + export namespace DocumentClassifierModel { + export namespace Constants { + /** The status of the training run. */ + export enum Status { + TRAINING = 'training', + AVAILABLE = 'available', + FAILED = 'failed', + } + } + } /** An object that contains a list of document classifier model definitions. */ export interface DocumentClassifierModels { @@ -4977,7 +4838,7 @@ namespace DiscoveryV2 { * * * `processing`: Ingestion is in progress. */ - status?: string; + status?: DocumentDetails.Constants.Status | string; /** Array of JSON objects for notices, meaning warning or error messages, that are produced by the document * ingestion process. The array does not include notices that are produced for child documents that are generated * when a document is processed. @@ -4996,6 +4857,17 @@ namespace DiscoveryV2 { /** The SHA-256 hash of the original source file. The hash is formatted as a hexadecimal string. */ sha256?: string; } + export namespace DocumentDetails { + export namespace Constants { + /** The status of the ingestion of the document. The possible values are: * `available`: Ingestion is finished and the document is indexed. * `failed`: Ingestion is finished, but the document is not indexed because of an error. * `pending`: The document is uploaded, but the ingestion process is not started. * `processing`: Ingestion is in progress. */ + export enum Status { + AVAILABLE = 'available', + FAILED = 'failed', + PENDING = 'pending', + PROCESSING = 'processing', + } + } + } /** Information about the child documents that are generated from a single document during ingestion or other processing. */ export interface DocumentDetailsChildren { @@ -5018,12 +4890,28 @@ namespace DiscoveryV2 { /** The description of this enrichment. */ description?: string; /** The type of this enrichment. */ - type?: string; + type?: Enrichment.Constants.Type | string; /** An object that contains options for the current enrichment. Starting with version `2020-08-30`, the * enrichment options are not included in responses from the List Enrichments method. */ options?: EnrichmentOptions; } + export namespace Enrichment { + export namespace Constants { + /** The type of this enrichment. */ + export enum Type { + PART_OF_SPEECH = 'part_of_speech', + SENTIMENT = 'sentiment', + NATURAL_LANGUAGE_UNDERSTANDING = 'natural_language_understanding', + DICTIONARY = 'dictionary', + REGULAR_EXPRESSION = 'regular_expression', + UIMA_ANNOTATOR = 'uima_annotator', + RULE_BASED = 'rule_based', + WATSON_KNOWLEDGE_STUDIO_MODEL = 'watson_knowledge_studio_model', + CLASSIFIER = 'classifier', + } + } + } /** An object that contains options for the current enrichment. Starting with version `2020-08-30`, the enrichment options are not included in responses from the List Enrichments method. */ export interface EnrichmentOptions { @@ -5106,10 +4994,28 @@ namespace DiscoveryV2 { /** The name of the field. */ field?: string; /** The type of the field. */ - type?: string; + type?: Field.Constants.Type | string; /** The collection Id of the collection where the field was found. */ collection_id?: string; } + export namespace Field { + export namespace Constants { + /** The type of the field. */ + export enum Type { + NESTED = 'nested', + STRING = 'string', + DATE = 'date', + LONG = 'long', + INTEGER = 'integer', + SHORT = 'short', + BYTE = 'byte', + DOUBLE = 'double', + FLOAT = 'float', + BOOLEAN = 'boolean', + BINARY = 'binary', + } + } + } /** Response object that contains an array of collection details. */ export interface ListCollectionsResponse { @@ -5192,12 +5098,21 @@ namespace DiscoveryV2 { /** Unique identifier of the query used for relevance training. */ query_id?: string; /** Severity level of the notice. */ - severity?: string; + severity?: Notice.Constants.Severity | string; /** Ingestion or training step in which the notice occurred. */ step?: string; /** The description of the notice. */ description?: string; } + export namespace Notice { + export namespace Constants { + /** Severity level of the notice. */ + export enum Severity { + WARNING = 'warning', + ERROR = 'error', + } + } + } /** An object that measures the metrics from a training run for each classification label separately. */ export interface PerClassModelEvaluation { @@ -5230,7 +5145,7 @@ namespace DiscoveryV2 { * The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and * installed deployments only. */ - type?: string; + type?: ProjectDetails.Constants.Type | string; /** Relevancy training status information for this project. */ relevancy_training_status?: ProjectListDetailsRelevancyTrainingStatus; /** The number of collections configured in this project. */ @@ -5238,6 +5153,18 @@ namespace DiscoveryV2 { /** Default query parameters for this project. */ default_query_parameters?: DefaultQueryParams; } + export namespace ProjectDetails { + export namespace Constants { + /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. */ + export enum Type { + DOCUMENT_RETRIEVAL = 'document_retrieval', + CONVERSATIONAL_SEARCH = 'conversational_search', + CONTENT_MINING = 'content_mining', + CONTENT_INTELLIGENCE = 'content_intelligence', + OTHER = 'other', + } + } + } /** Details about a specific project. */ export interface ProjectListDetails { @@ -5253,12 +5180,24 @@ namespace DiscoveryV2 { * The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and * installed deployments only. */ - type?: string; + type?: ProjectListDetails.Constants.Type | string; /** Relevancy training status information for this project. */ relevancy_training_status?: ProjectListDetailsRelevancyTrainingStatus; /** The number of collections configured in this project. */ collection_count?: number; } + export namespace ProjectListDetails { + export namespace Constants { + /** The type of project. The `content_intelligence` type is a *Document Retrieval for Contracts* project and the `other` type is a *Custom* project. The `content_mining` and `content_intelligence` types are available with Premium plan managed deployments and installed deployments only. */ + export enum Type { + DOCUMENT_RETRIEVAL = 'document_retrieval', + CONVERSATIONAL_SEARCH = 'conversational_search', + CONTENT_MINING = 'content_mining', + CONTENT_INTELLIGENCE = 'content_intelligence', + OTHER = 'other', + } + } + } /** Relevancy training status information for this project. */ export interface ProjectListDetailsRelevancyTrainingStatus { @@ -5475,7 +5414,7 @@ namespace DiscoveryV2 { /** Metadata of a query result. */ export interface QueryResultMetadata { /** The document retrieval source that produced this search result. */ - document_retrieval_source?: string; + document_retrieval_source?: QueryResultMetadata.Constants.DocumentRetrievalSource | string; /** The collection id associated with this training data set. */ collection_id: string; /** The confidence score for the given result. Calculated based on how relevant the result is estimated to be. @@ -5485,6 +5424,15 @@ namespace DiscoveryV2 { */ confidence?: number; } + export namespace QueryResultMetadata { + export namespace Constants { + /** The document retrieval source that produced this search result. */ + export enum DocumentRetrievalSource { + SEARCH = 'search', + CURATION = 'curation', + } + } + } /** A passage query result. */ export interface QueryResultPassage { @@ -5604,7 +5552,16 @@ namespace DiscoveryV2 { * **Note**: In the event of trained collections being queried, but the trained model is not used to return * results, the **document_retrieval_strategy** is listed as `untrained`. */ - document_retrieval_strategy?: string; + document_retrieval_strategy?: RetrievalDetails.Constants.DocumentRetrievalStrategy | string; + } + export namespace RetrievalDetails { + export namespace Constants { + /** Identifies the document retrieval strategy used for this query. `relevancy_training` indicates that the results were returned using a relevancy trained model. **Note**: In the event of trained collections being queried, but the trained model is not used to return results, the **document_retrieval_strategy** is listed as `untrained`. */ + export enum DocumentRetrievalStrategy { + UNTRAINED = 'untrained', + RELEVANCY_TRAINING = 'relevancy_training', + } + } } /** List of words to filter out of text that is submitted in queries. */ diff --git a/language-translator/v3.ts b/language-translator/v3.ts index 4f73681516..ccc80ee5f6 100644 --- a/language-translator/v3.ts +++ b/language-translator/v3.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -55,7 +55,7 @@ class LanguageTranslatorV3 extends BaseService { * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the version of the API you want to use. Specify dates in * YYYY-MM-DD format. The current version is `2018-05-01`. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -117,11 +117,7 @@ class LanguageTranslatorV3 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'listLanguages' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'listLanguages'); const parameters = { options: { @@ -194,11 +190,7 @@ class LanguageTranslatorV3 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'translate' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'translate'); const parameters = { options: { @@ -251,11 +243,7 @@ class LanguageTranslatorV3 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'listIdentifiableLanguages' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'listIdentifiableLanguages'); const parameters = { options: { @@ -304,11 +292,7 @@ class LanguageTranslatorV3 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'identify' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'identify'); const parameters = { options: { @@ -369,11 +353,7 @@ class LanguageTranslatorV3 extends BaseService { 'default': _params._default, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'listModels' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'listModels'); const parameters = { options: { @@ -517,11 +497,7 @@ class LanguageTranslatorV3 extends BaseService { 'name': _params.name, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'createModel' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'createModel'); const parameters = { options: { @@ -575,11 +551,7 @@ class LanguageTranslatorV3 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'deleteModel' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'deleteModel'); const parameters = { options: { @@ -633,11 +605,7 @@ class LanguageTranslatorV3 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'getModel' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'getModel'); const parameters = { options: { @@ -688,11 +656,7 @@ class LanguageTranslatorV3 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'listDocuments' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'listDocuments'); const parameters = { options: { @@ -797,11 +761,7 @@ class LanguageTranslatorV3 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'translateDocument' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'translateDocument'); const parameters = { options: { @@ -855,11 +815,7 @@ class LanguageTranslatorV3 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'getDocumentStatus' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'getDocumentStatus'); const parameters = { options: { @@ -912,11 +868,7 @@ class LanguageTranslatorV3 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'deleteDocument' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'deleteDocument'); const parameters = { options: { @@ -977,11 +929,7 @@ class LanguageTranslatorV3 extends BaseService { 'document_id': _params.documentId, }; - const sdkHeaders = getSdkHeaders( - LanguageTranslatorV3.DEFAULT_SERVICE_NAME, - 'v3', - 'getTranslatedDocument' - ); + const sdkHeaders = getSdkHeaders(LanguageTranslatorV3.DEFAULT_SERVICE_NAME, 'v3', 'getTranslatedDocument'); const parameters = { options: { @@ -1341,7 +1289,7 @@ namespace LanguageTranslatorV3 { */ filename: string; /** The status of the translation job associated with a submitted document. */ - status: string; + status: DocumentStatus.Constants.Status | string; /** A globally unique string that identifies the underlying model that is used for translation. */ model_id: string; /** Model ID of the base model that was used to customize the model. If the model is not a custom model, this @@ -1365,6 +1313,16 @@ namespace LanguageTranslatorV3 { /** The number of characters in the source document, present only if status=available. */ character_count?: number; } + export namespace DocumentStatus { + export namespace Constants { + /** The status of the translation job associated with a submitted document. */ + export enum Status { + PROCESSING = 'processing', + AVAILABLE = 'available', + FAILED = 'failed', + } + } + } /** IdentifiableLanguage. */ export interface IdentifiableLanguage { @@ -1465,7 +1423,24 @@ namespace LanguageTranslatorV3 { */ owner?: string; /** Availability of a model. */ - status?: string; + status?: TranslationModel.Constants.Status | string; + } + export namespace TranslationModel { + export namespace Constants { + /** Availability of a model. */ + export enum Status { + UPLOADING = 'uploading', + UPLOADED = 'uploaded', + DISPATCHING = 'dispatching', + QUEUED = 'queued', + TRAINING = 'training', + TRAINED = 'trained', + PUBLISHING = 'publishing', + AVAILABLE = 'available', + DELETED = 'deleted', + ERROR = 'error', + } + } } /** The response type for listing existing translation models. */ diff --git a/natural-language-understanding/v1.ts b/natural-language-understanding/v1.ts index c51e7aea59..e65c5501de 100644 --- a/natural-language-understanding/v1.ts +++ b/natural-language-understanding/v1.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -67,7 +67,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { * @param {Object} options - Options for the service. * @param {string} options.version - Release date of the API version you want to use. Specify dates in YYYY-MM-DD * format. The current version is `2022-04-07`. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -175,11 +175,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'analyze' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'analyze'); const parameters = { options: { @@ -233,11 +229,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listModels' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'listModels'); const parameters = { options: { @@ -289,11 +281,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteModel'); const parameters = { options: { @@ -333,6 +321,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { * requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories##categories-training-data-requirements). * @param {string} [params.trainingDataContentType] - The content type of trainingData. * @param {string} [params.name] - An optional name for the model. + * @param {JsonObject} [params.userMetadata] - An optional map of metadata key-value pairs to store with this model. * @param {string} [params.description] - An optional description of the model. * @param {string} [params.modelVersion] - An optional version string. * @param {string} [params.workspaceId] - ID of the Watson Knowledge Studio workspace that deployed this model to @@ -346,7 +335,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['language', 'trainingData']; - const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'headers']; + const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -359,6 +348,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { contentType: _params.trainingDataContentType, }, 'name': _params.name, + 'user_metadata': _params.userMetadata, 'description': _params.description, 'model_version': _params.modelVersion, 'workspace_id': _params.workspaceId, @@ -369,11 +359,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createCategoriesModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'createCategoriesModel'); const parameters = { options: { @@ -422,11 +408,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCategoriesModels' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'listCategoriesModels'); const parameters = { options: { @@ -478,11 +460,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCategoriesModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'getCategoriesModel'); const parameters = { options: { @@ -520,6 +498,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { * requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories##categories-training-data-requirements). * @param {string} [params.trainingDataContentType] - The content type of trainingData. * @param {string} [params.name] - An optional name for the model. + * @param {JsonObject} [params.userMetadata] - An optional map of metadata key-value pairs to store with this model. * @param {string} [params.description] - An optional description of the model. * @param {string} [params.modelVersion] - An optional version string. * @param {string} [params.workspaceId] - ID of the Watson Knowledge Studio workspace that deployed this model to @@ -533,7 +512,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId', 'language', 'trainingData']; - const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'headers']; + const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -546,6 +525,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { contentType: _params.trainingDataContentType, }, 'name': _params.name, + 'user_metadata': _params.userMetadata, 'description': _params.description, 'model_version': _params.modelVersion, 'workspace_id': _params.workspaceId, @@ -560,11 +540,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateCategoriesModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'updateCategoriesModel'); const parameters = { options: { @@ -620,11 +596,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCategoriesModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCategoriesModel'); const parameters = { options: { @@ -664,6 +636,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { * requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications#classification-training-data-requirements). * @param {string} [params.trainingDataContentType] - The content type of trainingData. * @param {string} [params.name] - An optional name for the model. + * @param {JsonObject} [params.userMetadata] - An optional map of metadata key-value pairs to store with this model. * @param {string} [params.description] - An optional description of the model. * @param {string} [params.modelVersion] - An optional version string. * @param {string} [params.workspaceId] - ID of the Watson Knowledge Studio workspace that deployed this model to @@ -679,7 +652,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['language', 'trainingData']; - const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'headers']; + const _validParams = ['language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -692,6 +665,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { contentType: _params.trainingDataContentType, }, 'name': _params.name, + 'user_metadata': _params.userMetadata, 'description': _params.description, 'model_version': _params.modelVersion, 'workspace_id': _params.workspaceId, @@ -703,11 +677,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createClassificationsModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'createClassificationsModel'); const parameters = { options: { @@ -756,11 +726,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'version': this.version, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listClassificationsModels' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'listClassificationsModels'); const parameters = { options: { @@ -812,11 +778,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getClassificationsModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'getClassificationsModel'); const parameters = { options: { @@ -854,6 +816,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { * requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications#classification-training-data-requirements). * @param {string} [params.trainingDataContentType] - The content type of trainingData. * @param {string} [params.name] - An optional name for the model. + * @param {JsonObject} [params.userMetadata] - An optional map of metadata key-value pairs to store with this model. * @param {string} [params.description] - An optional description of the model. * @param {string} [params.modelVersion] - An optional version string. * @param {string} [params.workspaceId] - ID of the Watson Knowledge Studio workspace that deployed this model to @@ -869,7 +832,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { ): Promise> { const _params = { ...params }; const _requiredParams = ['modelId', 'language', 'trainingData']; - const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'headers']; + const _validParams = ['modelId', 'language', 'trainingData', 'trainingDataContentType', 'name', 'userMetadata', 'description', 'modelVersion', 'workspaceId', 'versionDescription', 'trainingParameters', 'headers']; const _validationErrors = validateParams(_params, _requiredParams, _validParams); if (_validationErrors) { return Promise.reject(_validationErrors); @@ -882,6 +845,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { contentType: _params.trainingDataContentType, }, 'name': _params.name, + 'user_metadata': _params.userMetadata, 'description': _params.description, 'model_version': _params.modelVersion, 'workspace_id': _params.workspaceId, @@ -897,11 +861,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateClassificationsModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'updateClassificationsModel'); const parameters = { options: { @@ -957,11 +917,7 @@ class NaturalLanguageUnderstandingV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteClassificationsModel' - ); + const sdkHeaders = getSdkHeaders(NaturalLanguageUnderstandingV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteClassificationsModel'); const parameters = { options: { @@ -1081,6 +1037,8 @@ namespace NaturalLanguageUnderstandingV1 { trainingDataContentType?: CreateCategoriesModelConstants.TrainingDataContentType | string; /** An optional name for the model. */ name?: string; + /** An optional map of metadata key-value pairs to store with this model. */ + userMetadata?: JsonObject; /** An optional description of the model. */ description?: string; /** An optional version string. */ @@ -1127,6 +1085,8 @@ namespace NaturalLanguageUnderstandingV1 { trainingDataContentType?: UpdateCategoriesModelConstants.TrainingDataContentType | string; /** An optional name for the model. */ name?: string; + /** An optional map of metadata key-value pairs to store with this model. */ + userMetadata?: JsonObject; /** An optional description of the model. */ description?: string; /** An optional version string. */ @@ -1166,6 +1126,8 @@ namespace NaturalLanguageUnderstandingV1 { trainingDataContentType?: CreateClassificationsModelConstants.TrainingDataContentType | string; /** An optional name for the model. */ name?: string; + /** An optional map of metadata key-value pairs to store with this model. */ + userMetadata?: JsonObject; /** An optional description of the model. */ description?: string; /** An optional version string. */ @@ -1214,6 +1176,8 @@ namespace NaturalLanguageUnderstandingV1 { trainingDataContentType?: UpdateClassificationsModelConstants.TrainingDataContentType | string; /** An optional name for the model. */ name?: string; + /** An optional map of metadata key-value pairs to store with this model. */ + userMetadata?: JsonObject; /** An optional description of the model. */ description?: string; /** An optional version string. */ @@ -1316,7 +1280,7 @@ namespace NaturalLanguageUnderstandingV1 { /** The service features that are supported by the custom model. */ features?: string[]; /** When the status is `available`, the model is ready to use. */ - status: string; + status: CategoriesModel.Constants.Status | string; /** Unique model ID. */ model_id: string; /** dateTime indicating when the model was created. */ @@ -1327,6 +1291,19 @@ namespace NaturalLanguageUnderstandingV1 { /** dateTime of last successful model deployment. */ last_deployed?: string; } + export namespace CategoriesModel { + export namespace Constants { + /** When the status is `available`, the model is ready to use. */ + export enum Status { + STARTING = 'starting', + TRAINING = 'training', + DEPLOYING = 'deploying', + AVAILABLE = 'available', + ERROR = 'error', + DELETED = 'deleted', + } + } + } /** List of categories models. */ export interface CategoriesModelList { @@ -1396,7 +1373,7 @@ namespace NaturalLanguageUnderstandingV1 { /** The service features that are supported by the custom model. */ features?: string[]; /** When the status is `available`, the model is ready to use. */ - status: string; + status: ClassificationsModel.Constants.Status | string; /** Unique model ID. */ model_id: string; /** dateTime indicating when the model was created. */ @@ -1407,6 +1384,19 @@ namespace NaturalLanguageUnderstandingV1 { /** dateTime of last successful model deployment. */ last_deployed?: string; } + export namespace ClassificationsModel { + export namespace Constants { + /** When the status is `available`, the model is ready to use. */ + export enum Status { + STARTING = 'starting', + TRAINING = 'training', + DEPLOYING = 'deploying', + AVAILABLE = 'available', + ERROR = 'error', + DELETED = 'deleted', + } + } + } /** List of classifications models. */ export interface ClassificationsModelList { @@ -1438,7 +1428,16 @@ namespace NaturalLanguageUnderstandingV1 { /** Optional classifications training parameters along with model train requests. */ export interface ClassificationsTrainingParameters { /** Model type selector to train either a single_label or a multi_label classifier. */ - model_type?: string; + model_type?: ClassificationsTrainingParameters.Constants.ModelType | string; + } + export namespace ClassificationsTrainingParameters { + export namespace Constants { + /** Model type selector to train either a single_label or a multi_label classifier. */ + export enum ModelType { + SINGLE_LABEL = 'single_label', + MULTI_LABEL = 'multi_label', + } + } } /** Returns high-level concepts in the content. For example, a research paper about deep learning might return the concept, "Artificial Intelligence" although the term is not mentioned. Supported languages: English, French, German, Italian, Japanese, Korean, Portuguese, Spanish. */ @@ -1700,7 +1699,7 @@ namespace NaturalLanguageUnderstandingV1 { /** Model. */ export interface Model { /** When the status is `available`, the model is ready to use. */ - status?: string; + status?: Model.Constants.Status | string; /** Unique model ID. */ model_id?: string; /** ISO 639-1 code that indicates the language of the model. */ @@ -1718,6 +1717,19 @@ namespace NaturalLanguageUnderstandingV1 { /** A dateTime indicating when the model was created. */ created?: string; } + export namespace Model { + export namespace Constants { + /** When the status is `available`, the model is ready to use. */ + export enum Status { + STARTING = 'starting', + TRAINING = 'training', + DEPLOYING = 'deploying', + AVAILABLE = 'available', + ERROR = 'error', + DELETED = 'deleted', + } + } + } /** A list of messages describing model training issues when model status is `error`. */ export interface Notice { @@ -1910,12 +1922,36 @@ namespace NaturalLanguageUnderstandingV1 { /** The part of speech of the token. For more information about the values, see [Universal Dependencies POS * tags](https://universaldependencies.org/u/pos/). */ - part_of_speech?: string; + part_of_speech?: TokenResult.Constants.PartOfSpeech | string; /** Character offsets indicating the beginning and end of the token in the analyzed text. */ location?: number[]; /** The [lemma](https://wikipedia.org/wiki/Lemma_%28morphology%29) of the token. */ lemma?: string; } + export namespace TokenResult { + export namespace Constants { + /** The part of speech of the token. For more information about the values, see [Universal Dependencies POS tags](https://universaldependencies.org/u/pos/). */ + export enum PartOfSpeech { + ADJ = 'ADJ', + ADP = 'ADP', + ADV = 'ADV', + AUX = 'AUX', + CCONJ = 'CCONJ', + DET = 'DET', + INTJ = 'INTJ', + NOUN = 'NOUN', + NUM = 'NUM', + PART = 'PART', + PRON = 'PRON', + PROPN = 'PROPN', + PUNCT = 'PUNCT', + SCONJ = 'SCONJ', + SYM = 'SYM', + VERB = 'VERB', + X = 'X', + } + } + } } export = NaturalLanguageUnderstandingV1; diff --git a/speech-to-text/v1-generated.ts b/speech-to-text/v1-generated.ts index fc92f8bf01..0371affc50 100644 --- a/speech-to-text/v1-generated.ts +++ b/speech-to-text/v1-generated.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -71,7 +71,7 @@ class SpeechToTextV1 extends BaseService { * Construct a SpeechToTextV1 object. * * @param {Object} options - Options for the service. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -124,11 +124,7 @@ class SpeechToTextV1 extends BaseService { return Promise.reject(_validationErrors); } - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listModels' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listModels'); const parameters = { options: { @@ -180,11 +176,7 @@ class SpeechToTextV1 extends BaseService { 'model_id': _params.modelId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getModel'); const parameters = { options: { @@ -579,11 +571,7 @@ class SpeechToTextV1 extends BaseService { 'character_insertion_bias': _params.characterInsertionBias, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'recognize' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'recognize'); const parameters = { options: { @@ -670,11 +658,7 @@ class SpeechToTextV1 extends BaseService { 'user_secret': _params.userSecret, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'registerCallback' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'registerCallback'); const parameters = { options: { @@ -727,11 +711,7 @@ class SpeechToTextV1 extends BaseService { 'callback_url': _params.callbackUrl, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'unregisterCallback' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'unregisterCallback'); const parameters = { options: { @@ -1182,11 +1162,7 @@ class SpeechToTextV1 extends BaseService { 'character_insertion_bias': _params.characterInsertionBias, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createJob' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'createJob'); const parameters = { options: { @@ -1239,11 +1215,7 @@ class SpeechToTextV1 extends BaseService { return Promise.reject(_validationErrors); } - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'checkJobs' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'checkJobs'); const parameters = { options: { @@ -1301,11 +1273,7 @@ class SpeechToTextV1 extends BaseService { 'id': _params.id, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'checkJob' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'checkJob'); const parameters = { options: { @@ -1358,11 +1326,7 @@ class SpeechToTextV1 extends BaseService { 'id': _params.id, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteJob' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteJob'); const parameters = { options: { @@ -1460,11 +1424,7 @@ class SpeechToTextV1 extends BaseService { 'description': _params.description, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createLanguageModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'createLanguageModel'); const parameters = { options: { @@ -1528,11 +1488,7 @@ class SpeechToTextV1 extends BaseService { 'language': _params.language, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listLanguageModels' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listLanguageModels'); const parameters = { options: { @@ -1589,11 +1545,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getLanguageModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getLanguageModel'); const parameters = { options: { @@ -1651,11 +1603,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteLanguageModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteLanguageModel'); const parameters = { options: { @@ -1780,11 +1728,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'trainLanguageModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'trainLanguageModel'); const parameters = { options: { @@ -1844,11 +1788,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'resetLanguageModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'resetLanguageModel'); const parameters = { options: { @@ -1922,11 +1862,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'upgradeLanguageModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'upgradeLanguageModel'); const parameters = { options: { @@ -1985,11 +1921,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCorpora' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listCorpora'); const parameters = { options: { @@ -2120,11 +2052,7 @@ class SpeechToTextV1 extends BaseService { 'corpus_name': _params.corpusName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addCorpus' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'addCorpus'); const parameters = { options: { @@ -2185,11 +2113,7 @@ class SpeechToTextV1 extends BaseService { 'corpus_name': _params.corpusName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCorpus' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getCorpus'); const parameters = { options: { @@ -2253,11 +2177,7 @@ class SpeechToTextV1 extends BaseService { 'corpus_name': _params.corpusName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCorpus' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCorpus'); const parameters = { options: { @@ -2340,11 +2260,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listWords' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listWords'); const parameters = { options: { @@ -2457,11 +2373,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addWords' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'addWords'); const parameters = { options: { @@ -2585,11 +2497,7 @@ class SpeechToTextV1 extends BaseService { 'word_name': _params.wordName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addWord' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'addWord'); const parameters = { options: { @@ -2649,11 +2557,7 @@ class SpeechToTextV1 extends BaseService { 'word_name': _params.wordName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getWord' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getWord'); const parameters = { options: { @@ -2714,11 +2618,7 @@ class SpeechToTextV1 extends BaseService { 'word_name': _params.wordName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteWord' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteWord'); const parameters = { options: { @@ -2779,11 +2679,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listGrammars' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listGrammars'); const parameters = { options: { @@ -2898,11 +2794,7 @@ class SpeechToTextV1 extends BaseService { 'grammar_name': _params.grammarName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addGrammar' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'addGrammar'); const parameters = { options: { @@ -2965,11 +2857,7 @@ class SpeechToTextV1 extends BaseService { 'grammar_name': _params.grammarName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getGrammar' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getGrammar'); const parameters = { options: { @@ -3032,11 +2920,7 @@ class SpeechToTextV1 extends BaseService { 'grammar_name': _params.grammarName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteGrammar' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteGrammar'); const parameters = { options: { @@ -3119,11 +3003,7 @@ class SpeechToTextV1 extends BaseService { 'description': _params.description, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createAcousticModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'createAcousticModel'); const parameters = { options: { @@ -3187,11 +3067,7 @@ class SpeechToTextV1 extends BaseService { 'language': _params.language, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listAcousticModels' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listAcousticModels'); const parameters = { options: { @@ -3248,11 +3124,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getAcousticModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getAcousticModel'); const parameters = { options: { @@ -3310,11 +3182,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteAcousticModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteAcousticModel'); const parameters = { options: { @@ -3431,11 +3299,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'trainAcousticModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'trainAcousticModel'); const parameters = { options: { @@ -3497,11 +3361,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'resetAcousticModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'resetAcousticModel'); const parameters = { options: { @@ -3590,11 +3450,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'upgradeAcousticModel' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'upgradeAcousticModel'); const parameters = { options: { @@ -3658,11 +3514,7 @@ class SpeechToTextV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listAudio' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'listAudio'); const parameters = { options: { @@ -3840,11 +3692,7 @@ class SpeechToTextV1 extends BaseService { 'audio_name': _params.audioName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addAudio' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'addAudio'); const parameters = { options: { @@ -3920,11 +3768,7 @@ class SpeechToTextV1 extends BaseService { 'audio_name': _params.audioName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getAudio' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'getAudio'); const parameters = { options: { @@ -3988,11 +3832,7 @@ class SpeechToTextV1 extends BaseService { 'audio_name': _params.audioName, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteAudio' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteAudio'); const parameters = { options: { @@ -4055,11 +3895,7 @@ class SpeechToTextV1 extends BaseService { 'customer_id': _params.customerId, }; - const sdkHeaders = getSdkHeaders( - SpeechToTextV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteUserData' - ); + const sdkHeaders = getSdkHeaders(SpeechToTextV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteUserData'); const parameters = { options: { @@ -5945,7 +5781,7 @@ namespace SpeechToTextV1 { * * `upgrading`: The model is currently being upgraded. * * `failed`: Training of the model failed. */ - status?: string; + status?: AcousticModel.Constants.Status | string; /** A percentage that indicates the progress of the custom acoustic model's current training. A value of `100` * means that the model is fully trained. **Note:** The `progress` field does not currently reflect the progress of * the training. The field changes from `0` to `100` when training is complete. @@ -5956,6 +5792,19 @@ namespace SpeechToTextV1 { */ warnings?: string; } + export namespace AcousticModel { + export namespace Constants { + /** The current status of the custom acoustic model: * `pending`: The model was created but is waiting either for valid training data to be added or for the service to finish analyzing added data. * `ready`: The model contains valid data and is ready to be trained. If the model contains a mix of valid and invalid resources, you need to set the `strict` parameter to `false` for the training to proceed. * `training`: The model is currently being trained. * `available`: The model is trained and ready to use. * `upgrading`: The model is currently being upgraded. * `failed`: Training of the model failed. */ + export enum Status { + PENDING = 'pending', + READY = 'ready', + TRAINING = 'training', + AVAILABLE = 'available', + UPGRADING = 'upgrading', + FAILED = 'failed', + } + } + } /** Information about existing custom acoustic models. */ export interface AcousticModels { @@ -5974,7 +5823,7 @@ namespace SpeechToTextV1 { * * `undetermined` for a resource that the service cannot validate (for example, if the user mistakenly passes a * file that does not contain audio, such as a JPEG file). */ - type?: string; + type?: AudioDetails.Constants.Type | string; /** _For an audio-type resource_, the codec in which the audio is encoded. Omitted for an archive-type resource. */ codec?: string; /** _For an audio-type resource_, the sampling rate of the audio in Hertz (samples per second). Omitted for an @@ -5987,7 +5836,22 @@ namespace SpeechToTextV1 { * * Omitted for an audio-type resource. */ - compression?: string; + compression?: AudioDetails.Constants.Compression | string; + } + export namespace AudioDetails { + export namespace Constants { + /** The type of the audio resource: * `audio` for an individual audio file * `archive` for an archive (**.zip** or **.tar.gz**) file that contains audio files * `undetermined` for a resource that the service cannot validate (for example, if the user mistakenly passes a file that does not contain audio, such as a JPEG file). */ + export enum Type { + AUDIO = 'audio', + ARCHIVE = 'archive', + UNDETERMINED = 'undetermined', + } + /** _For an archive-type resource_, the format of the compressed archive: * `zip` for a **.zip** file * `gzip` for a **.tar.gz** file Omitted for an audio-type resource. */ + export enum Compression { + ZIP = 'zip', + GZIP = 'gzip', + } + } } /** Information about an audio resource from a custom acoustic model. */ @@ -6012,7 +5876,7 @@ namespace SpeechToTextV1 { * * Omitted for an archive-type resource. */ - status?: string; + status?: AudioListing.Constants.Status | string; /** _For an archive-type resource_, an object of type `AudioResource` that provides information about the * resource. Omitted for an audio-type resource. */ @@ -6022,6 +5886,16 @@ namespace SpeechToTextV1 { */ audio?: AudioResource[]; } + export namespace AudioListing { + export namespace Constants { + /** _For an audio-type resource_, the status of the resource: * `ok`: The service successfully analyzed the audio data. The data can be used to train the custom model. * `being_processed`: The service is still analyzing the audio data. The service cannot accept requests to add new audio resources or to train the custom model until its analysis is complete. * `invalid`: The audio data is not valid for training the custom model (possibly because it has the wrong format or sampling rate, or because it is corrupted). Omitted for an archive-type resource. */ + export enum Status { + OK = 'ok', + BEING_PROCESSED = 'being_processed', + INVALID = 'invalid', + } + } + } /** If audio metrics are requested, information about the signal characteristics of the input audio. */ export interface AudioMetrics { @@ -6112,7 +5986,17 @@ namespace SpeechToTextV1 { * or sampling rate, or because it is corrupted). For an archive file, the entire archive is invalid if any of its * audio files are invalid. */ - status: string; + status: AudioResource.Constants.Status | string; + } + export namespace AudioResource { + export namespace Constants { + /** The status of the audio resource: * `ok`: The service successfully analyzed the audio data. The data can be used to train the custom model. * `being_processed`: The service is still analyzing the audio data. The service cannot accept requests to add new audio resources or to train the custom model until its analysis is complete. * `invalid`: The audio data is not valid for training the custom model (possibly because it has the wrong format or sampling rate, or because it is corrupted). For an archive file, the entire archive is invalid if any of its audio files are invalid. */ + export enum Status { + OK = 'ok', + BEING_PROCESSED = 'being_processed', + INVALID = 'invalid', + } + } } /** Information about the audio resources from a custom acoustic model. */ @@ -6157,12 +6041,22 @@ namespace SpeechToTextV1 { * * `undetermined`: The service encountered an error while processing the corpus. The `error` field describes the * failure. */ - status: string; + status: Corpus.Constants.Status | string; /** If the status of the corpus is `undetermined`, the following message: `Analysis of corpus 'name' failed. * Please try adding the corpus again by setting the 'allow_overwrite' flag to 'true'`. */ error?: string; } + export namespace Corpus { + export namespace Constants { + /** The status of the corpus: * `analyzed`: The service successfully analyzed the corpus. The custom model can be trained with data from the corpus. * `being_processed`: The service is still analyzing the corpus. The service cannot accept requests to add new resources or to train the custom model. * `undetermined`: The service encountered an error while processing the corpus. The `error` field describes the failure. */ + export enum Status { + ANALYZED = 'analyzed', + BEING_PROCESSED = 'being_processed', + UNDETERMINED = 'undetermined', + } + } + } /** Information about a word that is to be added to a custom language model. */ export interface CustomWord { @@ -6215,13 +6109,23 @@ namespace SpeechToTextV1 { * * `undetermined`: The service encountered an error while processing the grammar. The `error` field describes the * failure. */ - status: string; + status: Grammar.Constants.Status | string; /** If the status of the grammar is `undetermined`, the following message: `Analysis of grammar '{grammar_name}' * failed. Please try fixing the error or adding the grammar again by setting the 'allow_overwrite' flag to * 'true'.`. */ error?: string; } + export namespace Grammar { + export namespace Constants { + /** The status of the grammar: * `analyzed`: The service successfully analyzed the grammar. The custom model can be trained with data from the grammar. * `being_processed`: The service is still analyzing the grammar. The service cannot accept requests to add new resources or to train the custom model. * `undetermined`: The service encountered an error while processing the grammar. The `error` field describes the failure. */ + export enum Status { + ANALYZED = 'analyzed', + BEING_PROCESSED = 'being_processed', + UNDETERMINED = 'undetermined', + } + } + } /** Information about the grammars from a custom language model. */ export interface Grammars { @@ -6298,7 +6202,7 @@ namespace SpeechToTextV1 { * * `upgrading`: The model is currently being upgraded. * * `failed`: Training of the model failed. */ - status?: string; + status?: LanguageModel.Constants.Status | string; /** A percentage that indicates the progress of the custom language model's current training. A value of `100` * means that the model is fully trained. **Note:** The `progress` field does not currently reflect the progress of * the training. The field changes from `0` to `100` when training is complete. @@ -6314,6 +6218,19 @@ namespace SpeechToTextV1 { */ warnings?: string; } + export namespace LanguageModel { + export namespace Constants { + /** The current status of the custom language model: * `pending`: The model was created but is waiting either for valid training data to be added or for the service to finish analyzing added data. * `ready`: The model contains valid data and is ready to be trained. If the model contains a mix of valid and invalid resources, you need to set the `strict` parameter to `false` for the training to proceed. * `training`: The model is currently being trained. * `available`: The model is trained and ready to use. * `upgrading`: The model is currently being upgraded. * `failed`: Training of the model failed. */ + export enum Status { + PENDING = 'pending', + READY = 'ready', + TRAINING = 'training', + AVAILABLE = 'available', + UPGRADING = 'upgrading', + FAILED = 'failed', + } + } + } /** Information about existing custom language models. */ export interface LanguageModels { @@ -6386,7 +6303,7 @@ namespace SpeechToTextV1 { * you must retrieve the results by checking the individual job. * * `failed`: The job failed. */ - status: string; + status: RecognitionJob.Constants.Status | string; /** The date and time in Coordinated Universal Time (UTC) at which the job was created. The value is provided in * full ISO 8601 format (`YYYY-MM-DDThh:mm:ss.sTZD`). */ @@ -6418,6 +6335,17 @@ namespace SpeechToTextV1 { */ warnings?: string[]; } + export namespace RecognitionJob { + export namespace Constants { + /** The current status of the job: * `waiting`: The service is preparing the job for processing. The service returns this status when the job is initially created or when it is waiting for capacity to process the job. The job remains in this state until the service has the capacity to begin processing it. * `processing`: The service is actively processing the job. * `completed`: The service has finished processing the job. If the job specified a callback URL and the event `recognitions.completed_with_results`, the service sent the results with the callback notification. Otherwise, you must retrieve the results by checking the individual job. * `failed`: The job failed. */ + export enum Status { + WAITING = 'waiting', + PROCESSING = 'processing', + COMPLETED = 'completed', + FAILED = 'failed', + } + } + } /** Information about current asynchronous speech recognition jobs. */ export interface RecognitionJobs { @@ -6433,10 +6361,19 @@ namespace SpeechToTextV1 { * * `created`: The service successfully allowlisted the callback URL as a result of the call. * * `already created`: The URL was already allowlisted. */ - status: string; + status: RegisterStatus.Constants.Status | string; /** The callback URL that is successfully registered. */ url: string; } + export namespace RegisterStatus { + export namespace Constants { + /** The current status of the job: * `created`: The service successfully allowlisted the callback URL as a result of the call. * `already created`: The URL was already allowlisted. */ + export enum Status { + CREATED = 'created', + ALREADY_CREATED = 'already created', + } + } + } /** Information about the speakers from speech recognition results. */ export interface SpeakerLabelsResult { @@ -6544,7 +6481,18 @@ namespace SpeechToTextV1 { * splits the transcript to avoid excessive memory use. * * `silence` - A pause or silence that is at least as long as the pause interval. */ - end_of_utterance?: string; + end_of_utterance?: SpeechRecognitionResult.Constants.EndOfUtterance | string; + } + export namespace SpeechRecognitionResult { + export namespace Constants { + /** If the `split_transcript_at_phrase_end` parameter is `true`, describes the reason for the split: * `end_of_data` - The end of the input audio stream. * `full_stop` - A full semantic stop, such as for the conclusion of a grammatical sentence. The insertion of splits is influenced by the base language model and biased by custom language models and grammars. * `reset` - The amount of audio that is currently being processed exceeds the two-minute maximum. The service splits the transcript to avoid excessive memory use. * `silence` - A pause or silence that is at least as long as the pause interval. */ + export enum EndOfUtterance { + END_OF_DATA = 'end_of_data', + FULL_STOP = 'full_stop', + RESET = 'reset', + SILENCE = 'silence', + } + } } /** The complete results for a speech recognition request. */ @@ -6637,13 +6585,24 @@ namespace SpeechToTextV1 { /** A warning from training of a custom language or custom acoustic model. */ export interface TrainingWarning { /** An identifier for the type of invalid resources listed in the `description` field. */ - code: string; + code: TrainingWarning.Constants.Code | string; /** A warning message that lists the invalid resources that are excluded from the custom model's training. The * message has the following format: `Analysis of the following {resource_type} has not completed successfully: * [{resource_names}]. They will be excluded from custom {model_type} model training.`. */ message: string; } + export namespace TrainingWarning { + export namespace Constants { + /** An identifier for the type of invalid resources listed in the `description` field. */ + export enum Code { + INVALID_AUDIO_FILES = 'invalid_audio_files', + INVALID_CORPUS_FILES = 'invalid_corpus_files', + INVALID_GRAMMAR_FILES = 'invalid_grammar_files', + INVALID_WORDS = 'invalid_words', + } + } + } /** Information about a word from a custom language model. */ export interface Word { diff --git a/text-to-speech/v1-generated.ts b/text-to-speech/v1-generated.ts index 5aca263b06..27339a433d 100644 --- a/text-to-speech/v1-generated.ts +++ b/text-to-speech/v1-generated.ts @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2024. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 + * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 */ import * as extend from 'extend'; @@ -23,9 +23,9 @@ import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { Authenticator, BaseService, + UserOptions, getAuthenticatorFromEnvironment, validateParams, - UserOptions, } from 'ibm-cloud-sdk-core'; import { getSdkHeaders } from '../lib/common'; @@ -70,7 +70,7 @@ class TextToSpeechV1 extends BaseService { * Construct a TextToSpeechV1 object. * * @param {Object} options - Options for the service. - * @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions. + * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service. Defaults to environment if not set @@ -131,11 +131,7 @@ class TextToSpeechV1 extends BaseService { return Promise.reject(_validationErrors); } - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listVoices' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'listVoices'); const parameters = { options: { @@ -202,11 +198,7 @@ class TextToSpeechV1 extends BaseService { 'voice': _params.voice, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getVoice' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'getVoice'); const parameters = { options: { @@ -383,11 +375,7 @@ class TextToSpeechV1 extends BaseService { 'pitch_percentage': _params.pitchPercentage, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'synthesize' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'synthesize'); const parameters = { options: { @@ -473,11 +461,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getPronunciation' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'getPronunciation'); const parameters = { options: { @@ -552,11 +536,7 @@ class TextToSpeechV1 extends BaseService { 'description': _params.description, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createCustomModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'createCustomModel'); const parameters = { options: { @@ -612,11 +592,7 @@ class TextToSpeechV1 extends BaseService { 'language': _params.language, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCustomModels' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'listCustomModels'); const parameters = { options: { @@ -696,11 +672,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'updateCustomModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'updateCustomModel'); const parameters = { options: { @@ -757,11 +729,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCustomModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'getCustomModel'); const parameters = { options: { @@ -814,11 +782,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCustomModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCustomModel'); const parameters = { options: { @@ -900,11 +864,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addWords' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'addWords'); const parameters = { options: { @@ -960,11 +920,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listWords' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'listWords'); const parameters = { options: { @@ -1050,11 +1006,7 @@ class TextToSpeechV1 extends BaseService { 'word': _params.word, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addWord' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'addWord'); const parameters = { options: { @@ -1111,11 +1063,7 @@ class TextToSpeechV1 extends BaseService { 'word': _params.word, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getWord' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'getWord'); const parameters = { options: { @@ -1170,11 +1118,7 @@ class TextToSpeechV1 extends BaseService { 'word': _params.word, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteWord' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteWord'); const parameters = { options: { @@ -1233,11 +1177,7 @@ class TextToSpeechV1 extends BaseService { 'customization_id': _params.customizationId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listCustomPrompts' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'listCustomPrompts'); const parameters = { options: { @@ -1377,11 +1317,7 @@ class TextToSpeechV1 extends BaseService { 'prompt_id': _params.promptId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'addCustomPrompt' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'addCustomPrompt'); const parameters = { options: { @@ -1440,11 +1376,7 @@ class TextToSpeechV1 extends BaseService { 'prompt_id': _params.promptId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getCustomPrompt' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'getCustomPrompt'); const parameters = { options: { @@ -1504,11 +1436,7 @@ class TextToSpeechV1 extends BaseService { 'prompt_id': _params.promptId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteCustomPrompt' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteCustomPrompt'); const parameters = { options: { @@ -1559,11 +1487,7 @@ class TextToSpeechV1 extends BaseService { return Promise.reject(_validationErrors); } - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'listSpeakerModels' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'listSpeakerModels'); const parameters = { options: { @@ -1657,11 +1581,7 @@ class TextToSpeechV1 extends BaseService { 'speaker_name': _params.speakerName, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'createSpeakerModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'createSpeakerModel'); const parameters = { options: { @@ -1720,11 +1640,7 @@ class TextToSpeechV1 extends BaseService { 'speaker_id': _params.speakerId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'getSpeakerModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'getSpeakerModel'); const parameters = { options: { @@ -1784,11 +1700,7 @@ class TextToSpeechV1 extends BaseService { 'speaker_id': _params.speakerId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteSpeakerModel' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteSpeakerModel'); const parameters = { options: { @@ -1849,11 +1761,7 @@ class TextToSpeechV1 extends BaseService { 'customer_id': _params.customerId, }; - const sdkHeaders = getSdkHeaders( - TextToSpeechV1.DEFAULT_SERVICE_NAME, - 'v1', - 'deleteUserData' - ); + const sdkHeaders = getSdkHeaders(TextToSpeechV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteUserData'); const parameters = { options: { @@ -2730,7 +2638,31 @@ namespace TextToSpeechV1 { * see [Working with Japanese * entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes). */ - part_of_speech?: string; + part_of_speech?: Translation.Constants.PartOfSpeech | string; + } + export namespace Translation { + export namespace Constants { + /** **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes). */ + export enum PartOfSpeech { + DOSI = 'Dosi', + FUKU = 'Fuku', + GOBI = 'Gobi', + HOKA = 'Hoka', + JODO = 'Jodo', + JOSI = 'Josi', + KATO = 'Kato', + KEDO = 'Kedo', + KEYO = 'Keyo', + KIGO = 'Kigo', + KOYU = 'Koyu', + MESI = 'Mesi', + RETA = 'Reta', + STBI = 'Stbi', + STTO = 'Stto', + STZO = 'Stzo', + SUJI = 'Suji', + } + } } /** Information about an available voice. */ @@ -2779,7 +2711,31 @@ namespace TextToSpeechV1 { * see [Working with Japanese * entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes). */ - part_of_speech?: string; + part_of_speech?: Word.Constants.PartOfSpeech | string; + } + export namespace Word { + export namespace Constants { + /** **Japanese only.** The part of speech for the word. The service uses the value to produce the correct intonation for the word. You can create only a single entry, with or without a single part of speech, for any word; you cannot create multiple entries with different parts of speech for the same word. For more information, see [Working with Japanese entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules#jaNotes). */ + export enum PartOfSpeech { + DOSI = 'Dosi', + FUKU = 'Fuku', + GOBI = 'Gobi', + HOKA = 'Hoka', + JODO = 'Jodo', + JOSI = 'Josi', + KATO = 'Kato', + KEDO = 'Kedo', + KEYO = 'Keyo', + KIGO = 'Kigo', + KOYU = 'Koyu', + MESI = 'Mesi', + RETA = 'Reta', + STBI = 'Stbi', + STTO = 'Stto', + STZO = 'Stzo', + SUJI = 'Suji', + } + } } /** For the [Add custom words](#addwords) method, one or more words that are to be added or updated for the custom model and the translation for each specified word. For the [List custom words](#listwords) method, the words and their translations from the custom model. */