From 12d34e4bd9da87e866cf36c4a1591ba7b64fdb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20R=C3=B6hrig?= <54274238+jridfe@users.noreply.github.com> Date: Thu, 14 Dec 2023 23:17:00 +0100 Subject: [PATCH] Release 2.0.0 (#9) * Release 2.0.0 common parts. * Release 2.0.0 platform specific parts. * Release 2.0.0 docs. --- MIGRATION-V1.0.0.md | 85 - MIGRATION-V2.0.0.md | 166 + README.md | 65 +- .../zibmc/classes/zcl_ibmc_assistant_v1.html | 356 +- .../zibmc/classes/zcl_ibmc_assistant_v2.html | 757 +- .../classes/zcl_ibmc_compare_comply_v1.html | 344 - .../zibmc/classes/zcl_ibmc_discovery_v1.html | 1164 --- .../zibmc/classes/zcl_ibmc_discovery_v2.html | 1157 +++ .../classes/zcl_ibmc_lang_translator_v3.html | 108 +- .../classes/zcl_ibmc_nat_lang_class_v1.html | 78 - .../zcl_ibmc_nat_lang_undrstnd_v1.html | 342 +- .../zcl_ibmc_personal_insights_v3.html | 230 - .../zibmc/classes/zcl_ibmc_service.html | 57 +- .../zibmc/classes/zcl_ibmc_service_arch.html | 40 +- .../zibmc/classes/zcl_ibmc_service_ext.html | 14 +- .../classes/zcl_ibmc_speech_to_text_v1.html | 1533 ++- .../classes/zcl_ibmc_text_to_speech_v1.html | 687 +- .../classes/zcl_ibmc_tone_analyzer_v3.html | 122 - .../abapdoc/zibmc/classes/zcl_ibmc_util.html | 16 +- .../zcl_ibmc_visual_recognition_v3.html | 224 - .../zcl_ibmc_visual_recognition_v4.html | 319 - .../classes/zcx_ibmc_service_exception.html | 2 +- .../interfaces/zif_ibmc_service_arch.html | 2 +- docs/ABAPDoc/htmldesign/stylesheet.css | 7 +- docs/index.html | 8 +- src/zcl_ibmc_assistant_v1.clas.abap | 2025 +++- src/zcl_ibmc_assistant_v1.clas.xml | 18 + src/zcl_ibmc_assistant_v2.clas.abap | 5388 ++++++++-- src/zcl_ibmc_assistant_v2.clas.xml | 96 + src/zcl_ibmc_compare_comply_v1.clas.abap | 2864 ------ src/zcl_ibmc_compare_comply_v1.clas.xml | 90 - src/zcl_ibmc_discovery_v1.clas.abap | 8733 ----------------- src/zcl_ibmc_discovery_v1.clas.xml | 390 - src/zcl_ibmc_discovery_v2.clas.abap | 7563 ++++++++++++++ src/zcl_ibmc_discovery_v2.clas.xml | 318 + src/zcl_ibmc_lang_translator_v3.clas.abap | 134 +- src/zcl_ibmc_nat_lang_class_v1.clas.abap | 797 -- src/zcl_ibmc_nat_lang_class_v1.clas.xml | 54 - src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap | 1623 ++- src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml | 60 + src/zcl_ibmc_personal_insights_v3.clas.abap | 918 -- src/zcl_ibmc_personal_insights_v3.clas.xml | 30 - src/zcl_ibmc_service.clas.abap | 723 +- src/zcl_ibmc_service.clas.xml | 402 +- src/zcl_ibmc_service_arch.clas.abap | 258 +- src/zcl_ibmc_service_arch.clas.xml | 282 +- src/zcl_ibmc_service_ext.clas.abap | 147 +- src/zcl_ibmc_service_ext.clas.xml | 240 +- src/zcl_ibmc_speech_to_text_v1.clas.abap | 1929 ++-- src/zcl_ibmc_text_to_speech_v1.clas.abap | 1446 ++- src/zcl_ibmc_text_to_speech_v1.clas.xml | 48 + src/zcl_ibmc_tone_analyzer_v3.clas.abap | 723 -- src/zcl_ibmc_tone_analyzer_v3.clas.xml | 30 - src/zcl_ibmc_util.clas.abap | 143 +- src/zcl_ibmc_util.clas.xml | 120 +- src/zcl_ibmc_visual_recognition_v3.clas.abap | 1335 --- src/zcl_ibmc_visual_recognition_v3.clas.xml | 66 - src/zcl_ibmc_visual_recognition_v4.clas.abap | 2431 ----- src/zcl_ibmc_visual_recognition_v4.clas.xml | 138 - src/zcx_ibmc_service_exception.clas.abap | 25 +- src/zcx_ibmc_service_exception.clas.xml | 50 +- src/zif_ibmc_service_arch.intf.abap | 3 +- src/zif_ibmc_service_arch.intf.xml | 30 +- 63 files changed, 24228 insertions(+), 25325 deletions(-) delete mode 100644 MIGRATION-V1.0.0.md create mode 100644 MIGRATION-V2.0.0.md delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_compare_comply_v1.html delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v1.html create mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v2.html delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_class_v1.html delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_personal_insights_v3.html delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_tone_analyzer_v3.html delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v3.html delete mode 100644 docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v4.html delete mode 100644 src/zcl_ibmc_compare_comply_v1.clas.abap delete mode 100644 src/zcl_ibmc_compare_comply_v1.clas.xml delete mode 100644 src/zcl_ibmc_discovery_v1.clas.abap delete mode 100644 src/zcl_ibmc_discovery_v1.clas.xml create mode 100644 src/zcl_ibmc_discovery_v2.clas.abap create mode 100644 src/zcl_ibmc_discovery_v2.clas.xml delete mode 100644 src/zcl_ibmc_nat_lang_class_v1.clas.abap delete mode 100644 src/zcl_ibmc_nat_lang_class_v1.clas.xml delete mode 100644 src/zcl_ibmc_personal_insights_v3.clas.abap delete mode 100644 src/zcl_ibmc_personal_insights_v3.clas.xml delete mode 100644 src/zcl_ibmc_tone_analyzer_v3.clas.abap delete mode 100644 src/zcl_ibmc_tone_analyzer_v3.clas.xml delete mode 100644 src/zcl_ibmc_visual_recognition_v3.clas.abap delete mode 100644 src/zcl_ibmc_visual_recognition_v3.clas.xml delete mode 100644 src/zcl_ibmc_visual_recognition_v4.clas.abap delete mode 100644 src/zcl_ibmc_visual_recognition_v4.clas.xml diff --git a/MIGRATION-V1.0.0.md b/MIGRATION-V1.0.0.md deleted file mode 100644 index 54dec9d..0000000 --- a/MIGRATION-V1.0.0.md +++ /dev/null @@ -1,85 +0,0 @@ -# Upgrading to ABAP SDK version 1.0.0 - -Note: If migrating from a version less than v0.3.0, also see the -[v0.3.0 migration guide -wiki](https://github.com/watson-developer-cloud/abap-sdk-nwas/blob/0.3.0/MIGRATION-V0.3.0.md). - -
- Table of Contents - -- [Breaking changes](#breaking-changes) - - [Breaking changes by service](#breaking-changes-by-service) - - [Watson Assistant V1](#watson-assistant-v1) - - [Watson Assistant V2](#watson-assistant-v2) - - [Compare and Comply V1](#compare-and-comply-v1) - - [Discovery V2](#discovery-v2) - - [Text to Speech V1](#text-to-speech-v1) - - [Discontinued services](#discontinued-services) - - [Compare and Comply V1](#compare-and-comply-v1-1) - - [Personality Insights V3](#personality-insights-v3) - - [Visual Recognition V3 and V4](#visual-recognition-v3-and-v4) - -
- -## Breaking changes - -### Breaking changes by service - -#### Watson Assistant V1 - -Data types `t_Dialog_Node_Output_Generic` and `t_Runtime_Response_Generic` were changed from structures with several components (`RESPONSE_TYPE`, `TEXT`, `VALUES`, ...) to data type `JSONOBJECT`. Depending on the expected data type, data type `JSONOBJECT` must be mapped to the corresponding data structure, for example `t_Dia_Nd_Otpt_Gnrc_Dia_Nd_Otp1` (dialog node output generic) or `t_Rt_Resp_Gnrc_Rt_Resp_Typ_Txt` (runtime response generic). - -When you fill in one of these structures and want to assign this structure to a variable of type `JSONOBJECT`, you can use the reference operator `REF` or the deprecated form `GET REFERENCE OF` to perform the mapping. When you receive data in a variable of type `JSONOBJECT` and need to map it to one of these structures, you can use method `move_data_reference_to_abap`, which is provided in the service class `zcl_ibmc_service`. - -#### Watson Assistant V2 - -Data type `t_Runtime_Response_Generic` was changed from a structure with several components (`RESPONSE_TYPE`, `TEXT`, ...) to data type `JSONOBJECT`. Depending on the expected data type, data type `JSONOBJECT` must be mapped to the corresponding data structure, for example `t_Rt_Resp_Gnrc_Rt_Resp_Typ_Txt`. - -When you fill in one of these structures and want to assign this structure to a variable of type `JSONOBJECT`, you can use the reference operator `REF` or the deprecated form `GET REFERENCE OF` to perform the mapping. When you receive data in a variable of type `JSONOBJECT` and need to map it to one of these structures, you can use method `move_data_reference_to_abap`, which is provided in the service class `zcl_ibmc_service`. - -#### Compare and Comply V1 - -Parameters `I_BEFORE` and `I_AFTER` have been removed from method `LIST_FEEDBACK`. - -#### Discovery V2 - -The Discovery V2 interface is available for Premium Discovery instances only and not supported by the ABAP SDK. - -#### Text to Speech V1 - -The following types were renamed: - -| Old name | New name | -|:-----------------------|:------------------------| -| `t_Voice_Model` | `t_Custom_Model` | -| `t_Voice_Models` | `t_Custom_Models` | -| `t_Create_Voice_Model` | `t_Create_Custom_Model` | -| `t_Update_Voice_Model` | `t_Update_Custom_Model` | - -The following methods were renamed: - -| Old name | New name | -|:---------------------|:----------------------| -| `create_Voice_Model` | `create_Custom_Model` | -| `get_Voice_Model` | `get_Custom_Model` | -| `update_Voice_Model` | `update_Custom_Model` | -| `delete_Voice_Model` | `delete_Custom_Model` | -| `list_Voice_Models` | `list_Custom_Models` | - - -### Discontinued services - -The following services are discontinued. New service instances cannot be created anymore. The ABAP SDK still includes interfaces to these services, which cannot be used anymore when IBM support of the corresponding service ends. - -#### Compare and Comply V1 - -Existing instances are supported until 30 November 2021 and will be deleted afterwards. - -#### Personality Insights V3 - -Existing instances are supported until 1 December 2021 and will be deleted afterwards. - -#### Visual Recognition V3 and V4 - -Existing instances are supported until 1 December 2021 and will be deleted afterwards. - diff --git a/MIGRATION-V2.0.0.md b/MIGRATION-V2.0.0.md new file mode 100644 index 0000000..87bffde --- /dev/null +++ b/MIGRATION-V2.0.0.md @@ -0,0 +1,166 @@ +# Upgrading to ABAP SDK version 2.0.0 + +Note: If migrating from a version less than v1.0.0, also see the +[v1.0.0 migration guide +wiki](https://github.com/watson-developer-cloud/abap-sdk-nwas/blob/1.0.0/MIGRATION-V1.0.0.md). + +
+ Table of Contents + +- [Breaking changes](#breaking-changes) + - [Breaking changes by service](#breaking-changes-by-service) + - [Watson Assistant V1](#watson-assistant-v1) + - [Watson Assistant V2](#watson-assistant-v2) + - [Language Translator V3](#language-translator-v3) + - [Speech to Text V1](#speech-to-text-v1) + - [New features by service](#new-features-by-service) + - [Watson Assistant V1](#watson-assistant-v1-1) + - [Watson Assistant V2](#watson-assistant-v2-1) + - [Discovery V2](#discovery-v2) + - [Natural Language Understanding V1](#natural-language-understanding-v1) + - [Text to Speech V1](#text-to-speech-v1) + - [Speech to Text V1](#speech-to-text-v1-1) + - [Discontinued services](#discontinued-services) + - [Discontinued services still included in the ABAP SDK in version 2.0.0](#discontinued-services-still-included-in-the-abap-sdk-in-version-200) + - [Language Translator V3](#language-translator-v3-1) + - [Discontinued services removed from the ABAP SDK in version 2.0.0](#discontinued-services-removed-from-the-abap-sdk-in-version-200) + - [Compare and Comply V1](#compare-and-comply-v1) + - [Discovery V1](#discovery-v1) + - [Natural Language Classifier V1](#natural-language-classifier-v1) + - [Personality Insights V3](#personality-insights-v3) + - [Tone Analyzer V3](#tone-analyzer-v3) + - [Visual Recognition V3 and V4](#visual-recognition-v3-and-v4) + +
+ +## Breaking changes + +### Breaking changes by service + +#### Watson Assistant V1 + +Component `Text` was removed from structure `t_Output_Data` for method `message`. The returned data is now available in component `Generic`, a standard table of `t_Runtime_Response_Generic`, which results in data of type `JSONOBJECT`. To convert data in a variable of type `JSONOBJECT` to data type string, you can use method `move_data_reference_to_abap`, which is provided in the service class `zcl_ibmc_service`. + +#### Watson Assistant V2 + +Data type `t_Dialog_Nodes_Visited` was renamed to `t_Dialog_Node_Visited`. + +#### Language Translator V3 + +The following input parameters for method `Create_Model` were renamed: + +| Old name | New name | +|:-----------------------|:---------------------------------| +| `i_Forced_Glossary_ct` | `i_Forced_Glossary_Content_Type` | +| `i_Parallel_Corpus_ct` | `i_Parallel_Corpus_Content_Type` | + +Default values for these parameters are no longer provided. + +#### Speech to Text V1 + +- Methods `Recognize` and `Create_Job`: + + - Parameter `i_Customization_Id` was removed - use + parameter `i_Language_Customization_Id` instead. + +- Method `Add_Grammar` + + - Type of parameter `i_Grammar_File` was changed from + `String` to `File`. + +### New features by service + +#### Watson Assistant V1 + +- Support for asynchronous workspace operations - new methods: + + - `Create_Workspace_Async`, `Export_Workspace_Async`, `Update_Workspace_Async` + +#### Watson Assistant V2 + +- Support to create and modify assistants, releases, skills and environments - new methods: + + - `Create_Assistant`, `Delete_Assistant`, `List_Assistants` + - `Create_Release`, `Delete_Release`, `Deploy_Release`, `Get_Release`, `List_Releases` + - `Export_Skills`, `Get_Skill`, `Import_Skills`, `Import_Skills_Status`, `Update_Skill` + - `Get_Environment`, `List_Environments`, `Update_Environment` + +#### Discovery V2 + +The ABAP SDK includes now interfaces to all Discovery V2 +methods. See details on IBM's documentation site +[here](https://cloud.ibm.com/apidocs/discovery-data). + +#### Natural Language Understanding V1 + +- Support to create and modify custom models - new methods: + + - `create_categories_model`, `list_categories_models`, `get_categories_model`, `update_categories_model`, `delete_categories_model` + - `create_classifications_model`, `list_classifications_models`, `get_classifications_model`, `update_classifications_model`, `delete_classifications_model` + +#### Text to Speech V1 + +- Support for custom prompts and speaker models - new methods: + + - `List_Custom_Prompts`, `Get_Custom_Prompt`, `Add_Custom_Prompt`, `Delete_Custom_Prompt` + - `List_Speaker_Models`, `Get_Speaker_Model`, `Create_Speaker_Model`, `Delete_Speaker_Model` + +- Method `Synthesize`: + + - New optional parameters `i_Spell_Out_Mode`, + `i_Rate_Percentage` and`i_Pitch_Percentage`. + +See details of these new methods and parameters on IBM's +documentation site [here](https://cloud.ibm.com/apidocs/text-to-speech). + +#### Speech to Text V1 + +- Methods `Recognize` and `Create_Job`: + + - New optional parameters `i_Low_Latency` and `i_Character_Insertion_Bias`. + +- Methods `Train_Language_Model` and `Train_Acoustic_Model`: + + - New optional parameter `i_strict`. + +See details of these new parameters on IBM's documentation +site [here](https://cloud.ibm.com/apidocs/speech-to-text). + + +### Discontinued services + +#### Discontinued services still included in the ABAP SDK in version 2.0.0 + +The following service is discontinued. New service instances cannot be created anymore. The ABAP SDK still includes interfaces to this service, which cannot be used anymore when IBM support of the corresponding service ends. + +##### Language Translator V3 + +Existing instances are supported until 10 June 2024 and will be deleted afterwards. + +#### Discontinued services removed from the ABAP SDK in version 2.0.0 + +The following services are discontinued. New service instances cannot be created anymore. Interfaces to these services have been removed from the ABAP SDK. + +##### Compare and Comply V1 + +Discontinued since 30 November 2021. + +##### Discovery V1 + +Discontinued since 11 July 2023. Migrate to Discovery V2. + +##### Natural Language Classifier V1 + +Discontinued since 9 August 2021. Migrate to Natural Language Understanding V1. + +##### Personality Insights V3 + +Discontinued since 1 December 2021. + +##### Tone Analyzer V3 + +Discontinued since 24 February 2023. Migrate to Natural Language Understanding V1. + +##### Visual Recognition V3 and V4 + +Discontinued since 1 December 2021. diff --git a/README.md b/README.md index 6d3de46..3240e9d 100644 --- a/README.md +++ b/README.md @@ -19,27 +19,31 @@ Additionally, as the ABAP SDK is a community release it is not updated with the
Table of Contents - * [Announcements](#announcements) - * [Before you begin](#before-you-begin) - * [Installation](#installation) - * [SAP System Configuration](#sap-system-configuration) - * [SAP Profile Parameters](#sap-profile-parameters) - * [Proxy configuration](#proxy-configuration) - * [SSL Certificates](#ssl-certificates) - * [Credentials](#credentials) - * [Configuration table](#configuration-table) - * [IAM Authentication](#iam-authentication) - * [Usage](#usage) - * [API Reference](#api-reference) - * [Questions](#questions) - * [License](#license) - * [Contributors](#contributors) - * [Acknowledgements](#acknowledgements) +- [Announcements](#announcements) +- [Before you begin](#before-you-begin) +- [Installation](#installation) +- [SAP System Configuration](#sap-system-configuration) + - [SAP Profile Parameters](#sap-profile-parameters) + - [Proxy configuration](#proxy-configuration) + - [SSL Certificates](#ssl-certificates) + - [Determine required certificate](#determine-required-certificate) + - [Add an SSL certificate to the PSE](#add-an-ssl-certificate-to-the-pse) + - [Restart the ICM (Internet Communication Manager)](#restart-the-icm-internet-communication-manager) +- [Credentials](#credentials) +- [Configuration table](#configuration-table) +- [IAM Authentication](#iam-authentication) +- [Usage](#usage) +- [API Reference](#api-reference) +- [Questions](#questions) +- [License](#license) +- [Contributors](#contributors) +- [Acknowledgements](#acknowledgements) +
## ANNOUNCEMENTS -### Major version 1.0.0 released -Version v1.0.0 of the SDK has been released and includes breaking changes - see what's changed in the [migration guide](MIGRATION-V1.0.0.md). +### Major version 2.0.0 released +Version v2.0.0 of the SDK has been released and includes breaking changes - see what's changed in the [migration guide](MIGRATION-V2.0.0.md). ## Before you begin * You need an [IBM Cloud][ibm_cloud_onboarding] account. @@ -59,7 +63,7 @@ The following SAP profile parameter settings are recommended. icm/HTTPS/client_sni_enabled = TRUE ssl/ciphersuites = 135:PFS:HIGH::EC_P256:EC_HIGH ssl/client_ciphersuites = 150:PFS:HIGH::EC_P256:EC_HIGH -wdisp/ssl_ignore_host_mismatch = TRUE +wdisp/ssl_ignore_host_mismatch = TRUE ``` ### Proxy configuration @@ -68,7 +72,7 @@ The client library respects the ABAP proxy settings. If you are using a central 2. Click *Execute* (or press F8). 3. Select menu item *Client* → *Proxy Settings*. 4. On tab *Global Settings*: Select *Proxy Setting is Active* and *No Proxy Setting for Local Server*. -5. On tabs *HTTP Log* and *HTTPS Log* specify the proxy *Host Name* and *Port*. If the proxy server requires logon credentials, also specify *User Name* and *Password*. +5. On tabs *HTTP Protocol* and *HTTPS Protocol* specify the proxy *Host Name* and *Port*. If the proxy server requires logon credentials, also specify *User Name* and *Password*. 6. Click *Execute (F8)* and *OK*. @@ -186,17 +190,11 @@ The following Watson services are currently supported: | Service | ABAP Class Name | |:------------------------------ |:----------------------------------- | -| Compare and Comply | ZCL_IBMC_COMPARE_COMPLY_V1 (\*) | -| Discovery | ZCL_IBMC_DISCOVERY_V1 | -| Language Translator | ZCL_IBMC_LANG_TRANSLATOR_V3 | -| Natural Language Classifier | ZCL_IBMC_NAT_LANG_CLASS_V1 | +| Discovery | ZCL_IBMC_DISCOVERY_V2 | +| Language Translator | ZCL_IBMC_LANG_TRANSLATOR_V3 (\*) | | Natural Language Understanding | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 | -| Personality Insights | ZCL_IBMC_PERSONAL_INSIGHTS_V3 (\*) | | Speech to Text | ZCL_IBMC_SPEECH_TO_TEXT_V1 | | Text to Speech | ZCL_IBMC_TEXT_TO_SPEECH_V1 | -| Tone Analyzer | ZCL_IBMC_TONE_ANALYZER_V3 | -| Visual Recognition | ZCL_IBMC_VISUAL_RECOGNITION_V3 (\*) | -| | ZCL_IBMC_VISUAL_RECOGNITION_V4 (\*) | | Watson Assistant | ZCL_IBMC_ASSISTANT_V1 | | | ZCL_IBMC_ASSISTANT_V2 | @@ -214,7 +212,7 @@ Using the client library requires two steps: i_url = i_apikey = ... - importing + importing eo_instance = lo_service_class ). ``` @@ -242,8 +240,8 @@ Using the client library requires two steps: lv_apikey type string value '...', lo_text_to_speech type ref to zcl_ibmc_text_to_speech_v1, lo_service_exception type ref to zcx_ibmc_service_exception, - ls_voice type zcl_ibmc_text_to_speech=>t_voice, - lt_voices type zcl_ibmc_text_to_speech=>t_voices. + ls_voice type zcl_ibmc_text_to_speech_v1=>t_voice, + lt_voices type zcl_ibmc_text_to_speech_v1=>t_voices. " get Watson Text-to-Speech service instance zcl_ibmc_service_ext=>get_instance( @@ -333,7 +331,7 @@ Using the client library requires two steps: lo_service_exception type ref to zcx_ibmc_service_exception, ls_request type zcl_ibmc_lang_translator_v3=>t_translate_request, lv_text type string, - ls_trans type zcl_ibmc_lang_translator_v3=>t_translation_result. + ls_trans type zcl_ibmc_lang_translator_v3=>t_translation_result. " get Watson Language Translator service instance zcl_ibmc_service_ext=>get_instance( @@ -349,7 +347,7 @@ Using the client library requires two steps: append lv_text to ls_request-text. ls_request-model_id = 'en-de'. ls_request-source = 'EN'. - ls_request-target = 'DE'. + ls_request-target = 'DE'. " call Watson Language Translator service to translate the text in ls_request try. @@ -393,6 +391,7 @@ This library is licensed under the [Apache 2.0 license][license]. * Joachim Rese * Jochen Röhrig * Aleksandar Debelic +* Stefan Diederichs ## Acknowledgements diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v1.html index 622d3f4..f31aab4 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v1.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v1.html @@ -1,121 +1,96 @@ -Class ZCL_IBMC_ASSISTANT_V1

Class ZCL_IBMC_ASSISTANT_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Watson Assistant v1

+Class ZCL_IBMC_ASSISTANT_V1

Class ZCL_IBMC_ASSISTANT_V1

public inheriting from zcl_ibmc_service_ext create public

Documentation

Watson Assistant v1

The IBM Watson™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your apps and your users.

The Assistant v1 API provides authoring methods your application can use to - create or update a workspace.

Types

Visibility and LevelNameDocumentation
publict_agent_availability_message (structured type) No documentation available.
publict_audit_properties (structured type) No documentation available.
publict_base_counterexample (structured type) No documentation available.
publict_base_dialog_node (structured type) No documentation available.
publict_base_entity (structured type) No documentation available.
publict_base_example (structured type) No documentation available.
publict_base_intent (structured type) No documentation available.
publict_base_message (structured type) No documentation available.
publict_base_output (structured type)

+ create or update a workspace.

Types

Visibility and LevelNameDocumentation
publict_agent_availability_message (structured type) No documentation available.
publict_audit_properties (structured type) No documentation available.
publict_base_counterexample (structured type) No documentation available.
publict_base_dialog_node (structured type) No documentation available.
publict_base_entity (structured type) No documentation available.
publict_base_example (structured type) No documentation available.
publict_base_intent (structured type) No documentation available.
publict_base_message (structured type) No documentation available.
publict_base_output (structured type)

An output object that includes the response to the user, the

- dialog nodes that were triggered, and messages from the log.
publict_base_synonym (structured type) No documentation available.
publict_base_value (structured type) No documentation available.
publict_base_workspace (structured type) No documentation available.
publict_bulk_classify_input (structured type) No documentation available.
publict_bulk_classify_output (structured type) No documentation available.
publict_bulk_classify_response (structured type) No documentation available.
publict_bulk_classify_utterance (structured type)

- The user input utterance to classify.

publict_capture_group (structured type)

- A recognized capture group for a pattern-based entity.

publict_context (structured type)

+ dialog nodes that were triggered, and messages from the log.

publict_base_synonym (structured type) No documentation available.
publict_base_value (structured type) No documentation available.
publict_base_workspace (structured type) No documentation available.
publict_bulk_classify_input (structured type) No documentation available.
publict_bulk_classify_output (structured type) No documentation available.
publict_bulk_classify_response (structured type) No documentation available.
publict_bulk_classify_utterance (structured type)

+ The user input utterance to classify.

publict_capture_group (structured type)

+ A recognized capture group for a pattern-based entity.

publict_channel_transfer_info (structured type)

+ Information used by an integration to transfer the

+ conversation to a different channel.
publict_channel_transfer_target (structured type)

+ An object specifying target channels available for the

+ transfer. Each property of this object represents an available transfer target. + Currently, the only supported property is **chat**, representing the web chat + integration.
publict_channel_transfer_target_chat (structured type)

+ Information for transferring to the web chat integration.

publict_context (structured type)

State information for the conversation. To maintain state,

- include the context from the previous response.
publict_counterexample (structured type) No documentation available.
publict_counterexample_collection (structured type) No documentation available.
publict_create_entity (structured type) No documentation available.
publict_create_intent (structured type) No documentation available.
publict_create_value (structured type) No documentation available.
publict_create_workspace (structured type) No documentation available.
publict_dialog_node (structured type) No documentation available.
publict_dialog_node_action (structured type) No documentation available.
publict_dialog_node_collection (structured type)

- An array of dialog nodes.

publict_dialog_node_context (structured type)

- The context for the dialog node.

publict_dialog_node_next_step (structured type)

- The next step to execute following this dialog node.

publict_dialog_node_output (structured type)

+ include the context from the previous response.

publict_counterexample (structured type) No documentation available.
publict_counterexample_collection (structured type) No documentation available.
publict_create_entity (structured type) No documentation available.
publict_create_intent (structured type) No documentation available.
publict_create_value (structured type) No documentation available.
publict_create_workspace (structured type) No documentation available.
publict_dialog_node (structured type) No documentation available.
publict_dialog_node_action (structured type) No documentation available.
publict_dialog_node_collection (structured type)

+ An array of dialog nodes.

publict_dialog_node_context (structured type)

+ The context for the dialog node.

publict_dialog_node_next_step (structured type)

+ The next step to execute following this dialog node.

publict_dialog_node_output (structured type)

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-ove - rview#dialog-overview-responses).
publict_dialog_node_output_generic type JSONOBJECT No documentation available.
publict_dialog_node_output_modifiers (structured type)

- Options that modify how specified output is handled.

publict_dialog_node_visited_details (structured type) No documentation available.
publict_dialog_suggestion (structured type) No documentation available.
publict_dialog_suggestion_value (structured type)

+ rview#dialog-overview-responses).

publict_dialog_node_output_generic type jsonobject No documentation available.
publict_dialog_node_output_modifiers (structured type)

+ Options that modify how specified output is handled.

publict_dialog_node_visited_details (structured type) No documentation available.
publict_dialog_suggestion (structured type) No documentation available.
publict_dialog_suggestion_value (structured type)

An object defining the message input, intents, and entities

to be sent to the Watson Assistant service if the user selects the - corresponding disambiguation option.
publict_dia_nd_otpt_cnnct_t_agnt_tr1 (structured type)

+ corresponding disambiguation option.
+
+ **Note:** These properties must be included in the request body of the next + message sent to the assistant. Do not modify or remove any of the included + properties.

publict_dia_nd_otpt_cnnct_t_agnt_tr1 (structured type)

Routing or other contextual information to be used by target

- service desk systems.
publict_dia_nd_otpt_gnrc_dia_nd_otp1 (structured type)

- An object that describes a response with response type

- `text`.
publict_dia_nd_otpt_gnrc_dia_nd_otp2 (structured type)

- An object that describes a response with response type

- `pause`.
publict_dia_nd_otpt_gnrc_dia_nd_otp3 (structured type)

- An object that describes a response with response type

- `image`.
publict_dia_nd_otpt_gnrc_dia_nd_otp4 (structured type)

- An object that describes a response with response type

- `option`.
publict_dia_nd_otpt_gnrc_dia_nd_otp5 (structured type)

- An object that describes a response with response type

- `connect_to_agent`.
publict_dia_nd_otpt_gnrc_dia_nd_otp6 (structured type)

- An object that describes a response with response type

- `search_skill`.
publict_dia_nd_otpt_resp_type_pause (structured type)

- An object that describes a response with response type

- `pause`.
publict_dia_nd_otpt_resp_typ_cnnct_1 (structured type)

- An object that describes a response with response type

- `connect_to_agent`.
publict_dia_nd_otpt_resp_typ_srch_s1 (structured type)

- An object that describes a response with response type

- `search_skill`.
publict_dia_nd_otpt_text_values_elem (structured type) No documentation available.
publict_dia_nd_output_opt_elem_value (structured type)

+ service desk systems.

publict_dia_nd_otpt_gnrc_dia_nd_ot10 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_ot11 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp1 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp2 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp3 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp4 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp5 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp6 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp7 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp8 (structured type) No documentation available.
publict_dia_nd_otpt_gnrc_dia_nd_otp9 (structured type) No documentation available.
publict_dia_nd_otpt_resp_type_audio (structured type) No documentation available.
publict_dia_nd_otpt_resp_type_iframe (structured type) No documentation available.
publict_dia_nd_otpt_resp_type_pause (structured type) No documentation available.
publict_dia_nd_otpt_resp_type_video (structured type) No documentation available.
publict_dia_nd_otpt_resp_typ_chnnl_1 (structured type) No documentation available.
publict_dia_nd_otpt_resp_typ_cnnct_1 (structured type) No documentation available.
publict_dia_nd_otpt_resp_typ_srch_s1 (structured type) No documentation available.
publict_dia_nd_otpt_resp_typ_usr_df1 (structured type) No documentation available.
publict_dia_nd_otpt_text_values_elem (structured type) No documentation available.
publict_dia_nd_output_opt_elem_value (structured type)

An object defining the message input to be sent to the

- Watson Assistant service if the user selects the corresponding option.
publict_dia_nd_output_resp_type_img (structured type)

- An object that describes a response with response type

- `image`.
publict_dia_nd_output_resp_type_opt (structured type)

- An object that describes a response with response type

- `option`.
publict_dia_nd_output_resp_type_text (structured type)

- An object that describes a response with response type

- `text`.
publict_dia_node_output_opt_element (structured type) No documentation available.
publict_empty_response type JSONOBJECT No documentation available.
publict_entity (structured type) No documentation available.
publict_entity_collection (structured type)

+ Watson Assistant service if the user selects the corresponding option.

publict_dia_nd_output_resp_type_img (structured type) No documentation available.
publict_dia_nd_output_resp_type_opt (structured type) No documentation available.
publict_dia_nd_output_resp_type_text (structured type) No documentation available.
publict_dia_node_output_opt_element (structured type) No documentation available.
publict_empty_response type jsonobject No documentation available.
publict_entity (structured type) No documentation available.
publict_entity_collection (structured type)

An array of objects describing the entities for the

- workspace.
publict_entity_mention (structured type)

- An object describing a contextual entity mention.

publict_entity_mention_collection (structured type) No documentation available.
publict_error_detail (structured type) No documentation available.
publict_error_response (structured type) No documentation available.
publict_example (structured type) No documentation available.
publict_example_collection (structured type) No documentation available.
publict_intent (structured type) No documentation available.
publict_intent_collection (structured type) No documentation available.
publict_log (structured type) No documentation available.
publict_log_collection (structured type) No documentation available.
publict_log_message (structured type)

- Log message details.

publict_log_pagination (structured type)

- The pagination data for the returned objects.

publict_mention (structured type)

- A mention of a contextual entity.

publict_message_context_metadata (structured type)

- Metadata related to the message.

publict_message_input (structured type)

- An input object that includes the input text.

publict_message_request (structured type)

+ workspace.

publict_entity_mention (structured type)

+ An object describing a contextual entity mention.

publict_entity_mention_collection (structured type) No documentation available.
publict_error_detail (structured type) No documentation available.
publict_error_response (structured type) No documentation available.
publict_example (structured type) No documentation available.
publict_example_collection (structured type) No documentation available.
publict_intent (structured type) No documentation available.
publict_intent_collection (structured type) No documentation available.
publict_log (structured type) No documentation available.
publict_log_collection (structured type) No documentation available.
publict_log_message (structured type)

+ Log message details.

publict_log_message_source (structured type)

+ An object that identifies the dialog element that generated

+ the error message.
publict_log_pagination (structured type)

+ The pagination data for the returned objects. For more

+ information about using pagination, see [Pagination](#pagination).
publict_mention (structured type)

+ A mention of a contextual entity.

publict_message_context_metadata (structured type)

+ Metadata related to the message.

publict_message_input (structured type)

+ An input object that includes the input text.

publict_message_request (structured type)

A request sent to the workspace, including the user input

- and context.
publict_message_response (structured type)

+ and context.

publict_message_response (structured type)

The response sent by the workspace, including the output

- text, detected intents and entities, and context.
publict_output_data (structured type)

+ text, detected intents and entities, and context.

publict_output_data (structured type)

An output object that includes the response to the user, the

- dialog nodes that were triggered, and messages from the log.
publict_pagination (structured type)

- The pagination data for the returned objects.

publict_rt_entity_interpretation (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_date (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_num (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_time (structured type) No documentation available.
publict_rt_response_type_suggestion (structured type)

- An object that describes a response with response type

- `suggestion`.
publict_rt_resp_gnrc_rt_resp_typ_cn1 (structured type)

- An object that describes a response with response type

- `connect_to_agent`.
publict_rt_resp_gnrc_rt_resp_typ_img (structured type)

- An object that describes a response with response type

- `image`.
publict_rt_resp_gnrc_rt_resp_typ_opt (structured type)

- An object that describes a response with response type

- `option`.
publict_rt_resp_gnrc_rt_resp_typ_ps (structured type)

- An object that describes a response with response type

- `pause`.
publict_rt_resp_gnrc_rt_resp_typ_sg1 (structured type)

- An object that describes a response with response type

- `suggestion`.
publict_rt_resp_gnrc_rt_resp_typ_txt (structured type)

- An object that describes a response with response type

- `text`.
publict_rt_resp_typ_connect_to_agent (structured type)

- An object that describes a response with response type

- `connect_to_agent`.
publict_runtime_entity (structured type)

- A term from the request that was identified as an entity.

publict_runtime_entity_alternative (structured type)

- An alternative value for the recognized entity.

publict_runtime_entity_role (structured type)

+ dialog nodes that were triggered, and messages from the log.

publict_pagination (structured type)

+ The pagination data for the returned objects. For more

+ information about using pagination, see [Pagination](#pagination).
publict_response_generic_channel (structured type) No documentation available.
publict_rt_entity_interpretation (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_date (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_num (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_time (structured type) No documentation available.
publict_rt_response_type_suggestion (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_ad (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_ch1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_cn1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_if1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_img (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_opt (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_ps (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_sg1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_txt (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_us1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_vd (structured type) No documentation available.
publict_rt_resp_type_channel_trans (structured type) No documentation available.
publict_rt_resp_type_user_defined (structured type) No documentation available.
publict_rt_resp_typ_connect_to_agent (structured type) No documentation available.
publict_runtime_entity (structured type)

+ A term from the request that was identified as an entity.

publict_runtime_entity_alternative (structured type)

+ An alternative value for the recognized entity.

publict_runtime_entity_role (structured type)

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.
publict_runtime_intent (structured type)

- An intent identified in the user input.

publict_runtime_response_generic type JSONOBJECT No documentation available.
publict_runtime_response_type_image (structured type)

- An object that describes a response with response type

- `image`.
publict_runtime_response_type_option (structured type)

- An object that describes a response with response type

- `option`.
publict_runtime_response_type_pause (structured type)

- An object that describes a response with response type

- `pause`.
publict_runtime_response_type_text (structured type)

- An object that describes a response with response type

- `text`.
publict_synonym (structured type) No documentation available.
publict_synonym_collection (structured type) No documentation available.
publict_system_response type MAP

- For internal use only.

publict_update_counterexample (structured type) No documentation available.
publict_update_dialog_node (structured type) No documentation available.
publict_update_entity (structured type) No documentation available.
publict_update_example (structured type) No documentation available.
publict_update_intent (structured type) No documentation available.
publict_update_synonym (structured type) No documentation available.
publict_update_value (structured type) No documentation available.
publict_update_workspace (structured type) No documentation available.
publict_value (structured type) No documentation available.
publict_value_collection (structured type) No documentation available.
publict_webhook (structured type)

+ workspace.

publict_runtime_intent (structured type)

+ An intent identified in the user input.

publict_runtime_response_generic type jsonobject No documentation available.
publict_runtime_response_type_audio (structured type) No documentation available.
publict_runtime_response_type_iframe (structured type) No documentation available.
publict_runtime_response_type_image (structured type) No documentation available.
publict_runtime_response_type_option (structured type) No documentation available.
publict_runtime_response_type_pause (structured type) No documentation available.
publict_runtime_response_type_text (structured type) No documentation available.
publict_runtime_response_type_video (structured type) No documentation available.
publict_status_error (structured type)

+ An object describing an error that occurred during

+ processing of an asynchronous operation.
publict_synonym (structured type) No documentation available.
publict_synonym_collection (structured type) No documentation available.
publict_system_response type jsonobject

+ For internal use only.

publict_update_counterexample (structured type) No documentation available.
publict_update_dialog_node (structured type) No documentation available.
publict_update_entity (structured type) No documentation available.
publict_update_example (structured type) No documentation available.
publict_update_intent (structured type) No documentation available.
publict_update_synonym (structured type) No documentation available.
publict_update_value (structured type) No documentation available.
publict_update_workspace (structured type) No documentation available.
publict_value (structured type) No documentation available.
publict_value_collection (structured type) No documentation available.
publict_webhook (structured type)

A webhook that can be used by dialog nodes to make

programmatic calls to an external function.

- **Note:** Currently, only a single webhook named `main_webhook` is supported.
publict_webhook_header (structured type)

- A key/value pair defining an HTTP header and a value.

publict_workspace (structured type) No documentation available.
publict_workspace_collection (structured type) No documentation available.
publict_workspace_reference (structured type) No documentation available.
publict_workspace_system_settings (structured type)

- Global settings for the workspace.

publict_ws_system_settings_off_topic (structured type)

- Workspace settings related to detection of irrelevant input.

publict_ws_system_settings_tooling (structured type)

+ **Note:** Currently, only a single webhook named `main_webhook` is supported.

publict_webhook_header (structured type)

+ A key/value pair defining an HTTP header and a value.

publict_workspace (structured type) No documentation available.
publict_workspace_collection (structured type) No documentation available.
publict_workspace_counts (structured type)

+ An object containing properties that indicate how many

+ intents, entities, and dialog nodes are defined in the workspace. This property + is included only in responses from the **Export workspace asynchronously** + method, and only when the **verbose** query parameter is set to `true`.
publict_workspace_reference (structured type) No documentation available.
publict_workspace_system_settings (structured type)

+ Global settings for the workspace.

publict_ws_system_settings_nlp (structured type)

+ Workspace settings related to the version of the training

+ algorithms currently used by the skill.
publict_ws_system_settings_off_topic (structured type)

+ Workspace settings related to detection of irrelevant input.

publict_ws_system_settings_tooling (structured type)

Workspace settings related to the Watson Assistant user

- interface.
publict_ws_systm_settings_auto_learn type JSONOBJECT

- For internal use only.

publict_ws_systm_sttngs_dsmbgtn (structured type)

- Workspace settings related to the disambiguation feature.

publict_ws_systm_sttngs_systm_entts (structured type)

+ interface.

publict_ws_systm_settings_auto_learn type jsonobject

+ For internal use only.

publict_ws_systm_sttngs_dsmbgtn (structured type)

+ Workspace settings related to the disambiguation feature.

publict_ws_systm_sttngs_systm_entts (structured type)

Workspace settings related to the behavior of system

- entities.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
bulk_classify
importingi_workspace_idtype STRING
i_requesttype T_BULK_CLASSIFY_INPUT optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_BULK_CLASSIFY_RESPONSE
raisingzcx_ibmc_service_exception

Identify intents and entities in multiple user utterances

+ entities.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
bulk_classify
importingi_workspace_idtype string
i_requesttype t_bulk_classify_input optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_bulk_classify_response
raisingzcx_ibmc_service_exception

Identify intents and entities in multiple user utterances

Send multiple user inputs to a workspace in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different workspaces.

- This method is available only with Premium plans. + This method is available only with Enterprise with Data Isolation plans.
Parameters
i_workspace_id Unique identifier of the workspace. @@ -124,7 +99,7 @@
e_response Service return value of type T_BULK_CLASSIFY_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_counterexample
importingi_workspace_idtype STRING
i_bodytype T_COUNTEREXAMPLE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COUNTEREXAMPLE
raisingzcx_ibmc_service_exception

Create counterexample

+
public instance
create_counterexample
importingi_workspace_idtype string
i_bodytype t_counterexample
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_counterexample
raisingzcx_ibmc_service_exception

Create counterexample

Add a new counterexample to a workspace. Counterexamples are examples that have been marked as irrelevant input.

@@ -141,7 +116,7 @@
e_response Service return value of type T_COUNTEREXAMPLE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_dialog_node
importingi_workspace_idtype STRING
i_bodytype T_DIALOG_NODE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DIALOG_NODE
raisingzcx_ibmc_service_exception

Create dialog node

+
public instance
create_dialog_node
importingi_workspace_idtype string
i_bodytype t_dialog_node
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_dialog_node
raisingzcx_ibmc_service_exception

Create dialog node

Create a new dialog node.

If you want to create multiple dialog nodes with a single API call, consider @@ -157,7 +132,7 @@
e_response Service return value of type T_DIALOG_NODE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_entity
importingi_workspace_idtype STRING
i_bodytype T_CREATE_ENTITY
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENTITY
raisingzcx_ibmc_service_exception

Create entity

+
public instance
create_entity
importingi_workspace_idtype string
i_bodytype t_create_entity
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_entity
raisingzcx_ibmc_service_exception

Create entity

Create a new entity, or enable a system entity.

If you want to create multiple entities with a single API call, consider using @@ -173,7 +148,7 @@
e_response Service return value of type T_ENTITY
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_example
importingi_workspace_idtype STRING
i_intenttype STRING
i_bodytype T_EXAMPLE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_EXAMPLE
raisingzcx_ibmc_service_exception

Create user input example

+
public instance
create_example
importingi_workspace_idtype string
i_intenttype string
i_bodytype t_example
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_example
raisingzcx_ibmc_service_exception

Create user input example

Add a new user input example to an intent.

If you want to add multiple examples with a single API call, consider using the @@ -191,7 +166,7 @@
e_response Service return value of type T_EXAMPLE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_intent
importingi_workspace_idtype STRING
i_bodytype T_CREATE_INTENT
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_INTENT
raisingzcx_ibmc_service_exception

Create intent

+
public instance
create_intent
importingi_workspace_idtype string
i_bodytype t_create_intent
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_intent
raisingzcx_ibmc_service_exception

Create intent

Create a new intent.

If you want to create multiple intents with a single API call, consider using @@ -207,7 +182,7 @@
e_response Service return value of type T_INTENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_synonym
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_bodytype T_SYNONYM
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SYNONYM
raisingzcx_ibmc_service_exception

Create entity value synonym

+
public instance
create_synonym
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_bodytype t_synonym
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_synonym
raisingzcx_ibmc_service_exception

Create entity value synonym

Add a new synonym to an entity value.

If you want to create multiple synonyms with a single API call, consider using @@ -228,7 +203,7 @@
e_response Service return value of type T_SYNONYM
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_value
importingi_workspace_idtype STRING
i_entitytype STRING
i_bodytype T_CREATE_VALUE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_VALUE
raisingzcx_ibmc_service_exception

Create entity value

+
public instance
create_value
importingi_workspace_idtype string
i_entitytype string
i_bodytype t_create_value
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_value
raisingzcx_ibmc_service_exception

Create entity value

Create a new value for an entity.

If you want to create multiple entity values with a single API call, consider @@ -246,9 +221,12 @@
e_response Service return value of type T_VALUE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_workspace
importingi_bodytype T_CREATE_WORKSPACE optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORKSPACE
raisingzcx_ibmc_service_exception

Create workspace

+
public instance
create_workspace
importingi_bodytype t_create_workspace optional
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace
raisingzcx_ibmc_service_exception

Create workspace

Create a workspace based on component objects. You must provide workspace - components defining the content of the new workspace. + components defining the content of the new workspace.
+
+ **Note:** The new workspace data cannot be larger than 1.5 MB. For larger + requests, use the **Create workspace asynchronously** method.
Parameters
i_body No documentation available. @@ -258,7 +236,21 @@
e_response Service return value of type T_WORKSPACE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_counterexample
importingi_workspace_idtype STRING
i_texttype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete counterexample

+
public instance
create_workspace_async
importingi_bodytype t_create_workspace optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace
raisingzcx_ibmc_service_exception

Create workspace asynchronously

+ Create a workspace asynchronously based on component objects. You must provide + workspace components defining the content of the new workspace.
+
+ A successful call to this method only initiates asynchronous creation of the + workspace. The new workspace is not available until processing completes. To + check the status of the asynchronous operation, use the **Get information about + a workspace** method. + +
Parameters
i_body + No documentation available. +
e_response + Service return value of type T_WORKSPACE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_counterexample
importingi_workspace_idtype string
i_texttype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete counterexample

Delete a counterexample from a workspace. Counterexamples are examples that have been marked as irrelevant input. @@ -267,15 +259,15 @@
i_text The text of a user input counterexample (for example, `What are you wearing?`).
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_dialog_node
importingi_workspace_idtype STRING
i_dialog_nodetype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete dialog node

+
public instance
delete_dialog_node
importingi_workspace_idtype string
i_dialog_nodetype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete dialog node

Delete a dialog node from a workspace.
Parameters
i_workspace_id Unique identifier of the workspace.
i_dialog_node - The dialog node ID (for example, `get_order`). + The dialog node ID (for example, `node_1_1479323581900`).
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_entity
importingi_workspace_idtype STRING
i_entitytype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete entity

+
public instance
delete_entity
importingi_workspace_idtype string
i_entitytype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete entity

Delete an entity from a workspace, or disable a system entity.
Parameters
i_workspace_id @@ -283,7 +275,7 @@
i_entity The name of the entity.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_example
importingi_workspace_idtype STRING
i_intenttype STRING
i_texttype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete user input example

+
public instance
delete_example
importingi_workspace_idtype string
i_intenttype string
i_texttype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete user input example

Delete a user input example from an intent.
Parameters
i_workspace_id @@ -293,7 +285,7 @@
i_text The text of the user input example.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_intent
importingi_workspace_idtype STRING
i_intenttype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete intent

+
public instance
delete_intent
importingi_workspace_idtype string
i_intenttype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete intent

Delete an intent from a workspace.
Parameters
i_workspace_id @@ -301,7 +293,7 @@
i_intent The intent name.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_synonym
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_synonymtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete entity value synonym

+
public instance
delete_synonym
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_synonymtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete entity value synonym

Delete a synonym from an entity value.
Parameters
i_workspace_id @@ -313,7 +305,7 @@
i_synonym The text of the synonym.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete labeled data

+
public instance
delete_user_data
importingi_customer_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete labeled data

Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

@@ -321,12 +313,19 @@ with a request that passes data. For more information about personal data and customer IDs, see [Information security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-secu - rity#information-security). + rity#information-security).
+
+ **Note:** This operation is intended only for deleting data associated with a + single specific customer, not for deleting data associated with multiple + customers or for any other purpose. For more information, see [Labeling and + deleting data in Watson + Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-sec + urity#information-security-gdpr-wa).
Parameters
i_customer_id The customer ID for which all data is to be deleted.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_value
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete entity value

+
public instance
delete_value
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete entity value

Delete a value from an entity.
Parameters
i_workspace_id @@ -336,13 +335,39 @@
i_value The text of the entity value.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_workspace
importingi_workspace_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete workspace

+
public instance
delete_workspace
importingi_workspace_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete workspace

Delete a workspace from the service instance.
Parameters
i_workspace_id Unique identifier of the workspace.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition public instance
get_counterexample
importingi_workspace_idtype STRING
i_texttype STRING
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COUNTEREXAMPLE
raisingzcx_ibmc_service_exception

Get counterexample

+
public instance
export_workspace_async
importingi_workspace_idtype string
i_include_audittype boolean default c_boolean_false
i_sorttype string optional
i_verbosetype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace
raisingzcx_ibmc_service_exception

Export workspace asynchronously

+ Export the entire workspace asynchronously, including all workspace + content.
+
+ A successful call to this method only initiates an asynchronous export. The + exported JSON data is not available until processing completes. After the + initial request is submitted, you can continue to poll by calling the same + request again and checking the value of the **status** property. When + processing has completed, the request returns the exported JSON data. Remember + that the usual rate limits apply. + +
Parameters
i_workspace_id + Unique identifier of the workspace. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
i_sort + Indicates how the returned workspace data will be sorted. Specify `sort=stable` + to sort all workspace objects by unique identifier, in ascending alphabetical + order. +
i_verbose + Whether the response should include the `counts` property, which indicates how + many of each component (such as intents and entities) the workspace contains. +
e_response + Service return value of type T_WORKSPACE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instanceget_appname redefinition public instance
get_counterexample
importingi_workspace_idtype string
i_texttype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_counterexample
raisingzcx_ibmc_service_exception

Get counterexample

Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input. @@ -356,20 +381,20 @@
e_response Service return value of type T_COUNTEREXAMPLE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_dialog_node
importingi_workspace_idtype STRING
i_dialog_nodetype STRING
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DIALOG_NODE
raisingzcx_ibmc_service_exception

Get dialog node

+
public instance
get_dialog_node
importingi_workspace_idtype string
i_dialog_nodetype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_dialog_node
raisingzcx_ibmc_service_exception

Get dialog node

Get information about a dialog node.
Parameters
i_workspace_id Unique identifier of the workspace.
i_dialog_node - The dialog node ID (for example, `get_order`). + The dialog node ID (for example, `node_1_1479323581900`).
i_include_audit Whether to include the audit properties (`created` and `updated` timestamps) in the response.
e_response Service return value of type T_DIALOG_NODE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_entity
importingi_workspace_idtype STRING
i_entitytype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENTITY
raisingzcx_ibmc_service_exception

Get entity

+
public instance
get_entity
importingi_workspace_idtype string
i_entitytype string
i_exporttype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_entity
raisingzcx_ibmc_service_exception

Get entity

Get information about an entity, optionally including all entity content.
Parameters
i_workspace_id @@ -387,7 +412,7 @@
e_response Service return value of type T_ENTITY
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_example
importingi_workspace_idtype STRING
i_intenttype STRING
i_texttype STRING
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_EXAMPLE
raisingzcx_ibmc_service_exception

Get user input example

+
public instance
get_example
importingi_workspace_idtype string
i_intenttype string
i_texttype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_example
raisingzcx_ibmc_service_exception

Get user input example

Get information about a user input example.
Parameters
i_workspace_id @@ -402,7 +427,7 @@
e_response Service return value of type T_EXAMPLE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_intent
importingi_workspace_idtype STRING
i_intenttype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_INTENT
raisingzcx_ibmc_service_exception

Get intent

+
public instance
get_intent
importingi_workspace_idtype string
i_intenttype string
i_exporttype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_intent
raisingzcx_ibmc_service_exception

Get intent

Get information about an intent, optionally including all intent content.
Parameters
i_workspace_id @@ -420,7 +445,7 @@
e_response Service return value of type T_INTENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_synonym
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_synonymtype STRING
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SYNONYM
raisingzcx_ibmc_service_exception

Get entity value synonym

+
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_synonym
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_synonymtype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_synonym
raisingzcx_ibmc_service_exception

Get entity value synonym

Get information about a synonym of an entity value.
Parameters
i_workspace_id @@ -437,7 +462,7 @@
e_response Service return value of type T_SYNONYM
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_value
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_VALUE
raisingzcx_ibmc_service_exception

Get entity value

+
public instance
get_value
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_exporttype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_value
raisingzcx_ibmc_service_exception

Get entity value

Get information about an entity value.
Parameters
i_workspace_id @@ -457,7 +482,7 @@
e_response Service return value of type T_VALUE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_workspace
importingi_workspace_idtype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORKSPACE
raisingzcx_ibmc_service_exception

Get information about a workspace

+
public instance
get_workspace
importingi_workspace_idtype string
i_exporttype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_sorttype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace
raisingzcx_ibmc_service_exception

Get information about a workspace

Get information about a workspace, optionally including all workspace content.
Parameters
i_workspace_id @@ -477,14 +502,20 @@
e_response Service return value of type T_WORKSPACE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_all_logs
importingi_filtertype STRING
i_sorttype STRING optional
i_page_limittype INTEGER optional
i_cursortype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LOG_COLLECTION
raisingzcx_ibmc_service_exception

List log events in all workspaces

- List the events from the logs of all workspaces in the service instance. +
public instance
list_all_logs
importingi_filtertype string
i_sorttype string optional
i_page_limittype integer default 100
i_cursortype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_log_collection
raisingzcx_ibmc_service_exception

List log events in all workspaces

+ List the events from the logs of all workspaces in the service instance.
+
+ **Note:** If you use the **cursor** parameter to retrieve results one page at a + time, subsequent requests must be no more than 5 minutes apart. Any returned + value for the **cursor** parameter becomes invalid after 5 minutes. For more + information about using pagination, see [Pagination](#pagination).
Parameters
i_filter A cacheable parameter that limits the results to those matching the specified filter. You must specify a filter query that includes a value for `language`, as well as a value for `request.context.system.assistant_id`, `workspace_id`, - or `request.context.metadata.deployment`. For more information, see the + or `request.context.metadata.deployment`. These required filters must be + specified using the exact match (`::`) operator. For more information, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-ref erence#filter-reference).
i_sort @@ -497,7 +528,7 @@
e_response Service return value of type T_LOG_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_counterexamples
importingi_workspace_idtype STRING
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COUNTEREXAMPLE_COLLECTION
raisingzcx_ibmc_service_exception

List counterexamples

+
public instance
list_counterexamples
importingi_workspace_idtype string
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_counterexample_collection
raisingzcx_ibmc_service_exception

List counterexamples

List the counterexamples for a workspace. Counterexamples are examples that have been marked as irrelevant input. @@ -520,7 +551,7 @@
e_response Service return value of type T_COUNTEREXAMPLE_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_dialog_nodes
importingi_workspace_idtype STRING
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DIALOG_NODE_COLLECTION
raisingzcx_ibmc_service_exception

List dialog nodes

+
public instance
list_dialog_nodes
importingi_workspace_idtype string
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_dialog_node_collection
raisingzcx_ibmc_service_exception

List dialog nodes

List the dialog nodes for a workspace.
Parameters
i_workspace_id @@ -542,7 +573,7 @@
e_response Service return value of type T_DIALOG_NODE_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_entities
importingi_workspace_idtype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENTITY_COLLECTION
raisingzcx_ibmc_service_exception

List entities

+
public instance
list_entities
importingi_workspace_idtype string
i_exporttype boolean default c_boolean_false
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_entity_collection
raisingzcx_ibmc_service_exception

List entities

List the entities for a workspace.
Parameters
i_workspace_id @@ -569,7 +600,7 @@
e_response Service return value of type T_ENTITY_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_examples
importingi_workspace_idtype STRING
i_intenttype STRING
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_EXAMPLE_COLLECTION
raisingzcx_ibmc_service_exception

List user input examples

+
public instance
list_examples
importingi_workspace_idtype string
i_intenttype string
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_example_collection
raisingzcx_ibmc_service_exception

List user input examples

List the user input examples for an intent, optionally including contextual entity mentions. @@ -594,7 +625,7 @@
e_response Service return value of type T_EXAMPLE_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_intents
importingi_workspace_idtype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_INTENT_COLLECTION
raisingzcx_ibmc_service_exception

List intents

+
public instance
list_intents
importingi_workspace_idtype string
i_exporttype boolean default c_boolean_false
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_intent_collection
raisingzcx_ibmc_service_exception

List intents

List the intents for a workspace.
Parameters
i_workspace_id @@ -621,8 +652,15 @@
e_response Service return value of type T_INTENT_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_logs
importingi_workspace_idtype STRING
i_sorttype STRING optional
i_filtertype STRING optional
i_page_limittype INTEGER optional
i_cursortype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LOG_COLLECTION
raisingzcx_ibmc_service_exception

List log events in a workspace

- List the events from the log of a specific workspace. +
public instance
list_logs
importingi_workspace_idtype string
i_sorttype string optional
i_filtertype string optional
i_page_limittype integer default 100
i_cursortype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_log_collection
raisingzcx_ibmc_service_exception

List log events in a workspace

+ List the events from the log of a specific workspace.
+
+ This method requires Manager access.
+
+ **Note:** If you use the **cursor** parameter to retrieve results one page at a + time, subsequent requests must be no more than 5 minutes apart. Any returned + value for the **cursor** parameter becomes invalid after 5 minutes. For more + information about using pagination, see [Pagination](#pagination).
Parameters
i_workspace_id Unique identifier of the workspace. @@ -641,7 +679,7 @@
e_response Service return value of type T_LOG_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_mentions
importingi_workspace_idtype STRING
i_entitytype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENTITY_MENTION_COLLECTION
raisingzcx_ibmc_service_exception

List entity mentions

+
public instance
list_mentions
importingi_workspace_idtype string
i_entitytype string
i_exporttype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_entity_mention_collection
raisingzcx_ibmc_service_exception

List entity mentions

List mentions for a contextual entity. An entity mention is an occurrence of a contextual entity in the context of an intent user input example. @@ -660,7 +698,7 @@
e_response Service return value of type T_ENTITY_MENTION_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_synonyms
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SYNONYM_COLLECTION
raisingzcx_ibmc_service_exception

List entity value synonyms

+
public instance
list_synonyms
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_synonym_collection
raisingzcx_ibmc_service_exception

List entity value synonyms

List the synonyms for an entity value.
Parameters
i_workspace_id @@ -686,7 +724,7 @@
e_response Service return value of type T_SYNONYM_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_values
importingi_workspace_idtype STRING
i_entitytype STRING
i_exporttype BOOLEAN default C_BOOLEAN_FALSE
i_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_VALUE_COLLECTION
raisingzcx_ibmc_service_exception

List entity values

+
public instance
list_values
importingi_workspace_idtype string
i_entitytype string
i_exporttype boolean default c_boolean_false
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_value_collection
raisingzcx_ibmc_service_exception

List entity values

List the values for an entity.
Parameters
i_workspace_id @@ -715,7 +753,7 @@
e_response Service return value of type T_VALUE_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_workspaces
importingi_page_limittype INTEGER optional
i_include_counttype BOOLEAN default C_BOOLEAN_FALSE
i_sorttype STRING optional
i_cursortype STRING optional
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORKSPACE_COLLECTION
raisingzcx_ibmc_service_exception

List workspaces

+
public instance
list_workspaces
importingi_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace_collection
raisingzcx_ibmc_service_exception

List workspaces

List the workspaces associated with a Watson Assistant service instance.
Parameters
i_page_limit @@ -735,7 +773,7 @@
e_response Service return value of type T_WORKSPACE_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
message
importingi_workspace_idtype STRING
i_bodytype T_MESSAGE_REQUEST optional
i_nodes_visited_detailstype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_MESSAGE_RESPONSE
raisingzcx_ibmc_service_exception

Get response to user input

+
public instance
message
importingi_workspace_idtype string
i_bodytype t_message_request optional
i_nodes_visited_detailstype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_message_response
raisingzcx_ibmc_service_exception

Get response to user input

Send user input to a workspace and receive a response.

**Important:** This method has been superseded by the new v2 runtime API. The v2 @@ -756,7 +794,7 @@
e_response Service return value of type T_MESSAGE_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_counterexample
importingi_workspace_idtype STRING
i_texttype STRING
i_bodytype T_UPDATE_COUNTEREXAMPLE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COUNTEREXAMPLE
raisingzcx_ibmc_service_exception

Update counterexample

+
public instance
update_counterexample
importingi_workspace_idtype string
i_texttype string
i_bodytype t_update_counterexample
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_counterexample
raisingzcx_ibmc_service_exception

Update counterexample

Update the text of a counterexample. Counterexamples are examples that have been marked as irrelevant input. @@ -772,7 +810,7 @@
e_response Service return value of type T_COUNTEREXAMPLE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_dialog_node
importingi_workspace_idtype STRING
i_dialog_nodetype STRING
i_bodytype T_UPDATE_DIALOG_NODE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DIALOG_NODE
raisingzcx_ibmc_service_exception

Update dialog node

+
public instance
update_dialog_node
importingi_workspace_idtype string
i_dialog_nodetype string
i_bodytype t_update_dialog_node
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_dialog_node
raisingzcx_ibmc_service_exception

Update dialog node

Update an existing dialog node with new or modified data.

If you want to update multiple dialog nodes with a single API call, consider @@ -781,7 +819,7 @@
Parameters
i_workspace_id Unique identifier of the workspace.
i_dialog_node - The dialog node ID (for example, `get_order`). + The dialog node ID (for example, `node_1_1479323581900`).
i_body The updated content of the dialog node.

@@ -796,7 +834,7 @@
e_response Service return value of type T_DIALOG_NODE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_entity
importingi_workspace_idtype STRING
i_entitytype STRING
i_bodytype T_UPDATE_ENTITY
i_appendtype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENTITY
raisingzcx_ibmc_service_exception

Update entity

+
public instance
update_entity
importingi_workspace_idtype string
i_entitytype string
i_bodytype t_update_entity
i_appendtype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_entity
raisingzcx_ibmc_service_exception

Update entity

Update an existing entity with new or modified data. You must provide component objects defining the content of the updated entity.

@@ -831,7 +869,7 @@
e_response Service return value of type T_ENTITY
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_example
importingi_workspace_idtype STRING
i_intenttype STRING
i_texttype STRING
i_bodytype T_UPDATE_EXAMPLE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_EXAMPLE
raisingzcx_ibmc_service_exception

Update user input example

+
public instance
update_example
importingi_workspace_idtype string
i_intenttype string
i_texttype string
i_bodytype t_update_example
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_example
raisingzcx_ibmc_service_exception

Update user input example

Update the text of a user input example.

If you want to update multiple examples with a single API call, consider using @@ -851,7 +889,7 @@
e_response Service return value of type T_EXAMPLE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_intent
importingi_workspace_idtype STRING
i_intenttype STRING
i_bodytype T_UPDATE_INTENT
i_appendtype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_INTENT
raisingzcx_ibmc_service_exception

Update intent

+
public instance
update_intent
importingi_workspace_idtype string
i_intenttype string
i_bodytype t_update_intent
i_appendtype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_intent
raisingzcx_ibmc_service_exception

Update intent

Update an existing intent with new or modified data. You must provide component objects defining the content of the updated intent.

@@ -888,7 +926,7 @@
e_response Service return value of type T_INTENT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_synonym
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_synonymtype STRING
i_bodytype T_UPDATE_SYNONYM
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SYNONYM
raisingzcx_ibmc_service_exception

Update entity value synonym

+
public instance
update_synonym
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_synonymtype string
i_bodytype t_update_synonym
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_synonym
raisingzcx_ibmc_service_exception

Update entity value synonym

Update an existing entity value synonym with new text.

If you want to update multiple synonyms with a single API call, consider using @@ -911,7 +949,7 @@
e_response Service return value of type T_SYNONYM
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_value
importingi_workspace_idtype STRING
i_entitytype STRING
i_valuetype STRING
i_bodytype T_UPDATE_VALUE
i_appendtype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_VALUE
raisingzcx_ibmc_service_exception

Update entity value

+
public instance
update_value
importingi_workspace_idtype string
i_entitytype string
i_valuetype string
i_bodytype t_update_value
i_appendtype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_value
raisingzcx_ibmc_service_exception

Update entity value

Update an existing entity value with new or modified data. You must provide component objects defining the content of the updated entity value.

@@ -950,9 +988,12 @@
e_response Service return value of type T_VALUE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_workspace
importingi_workspace_idtype STRING
i_bodytype T_UPDATE_WORKSPACE optional
i_appendtype BOOLEAN default C_BOOLEAN_FALSE
i_include_audittype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORKSPACE
raisingzcx_ibmc_service_exception

Update workspace

+
public instance
update_workspace
importingi_workspace_idtype string
i_bodytype t_update_workspace optional
i_appendtype boolean default c_boolean_false
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace
raisingzcx_ibmc_service_exception

Update workspace

Update an existing workspace with new or modified data. You must provide - component objects defining the content of the updated workspace. + component objects defining the content of the updated workspace.
+
+ **Note:** The new workspace data cannot be larger than 1.5 MB. For larger + requests, use the **Update workspace asynchronously** method.
Parameters
i_workspace_id Unique identifier of the workspace. @@ -979,4 +1020,35 @@
e_response Service return value of type T_WORKSPACE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file +
public instance
update_workspace_async
importingi_workspace_idtype string
i_bodytype t_update_workspace optional
i_appendtype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_workspace
raisingzcx_ibmc_service_exception

Update workspace asynchronously

+ Update an existing workspace asynchronously with new or modified data. You must + provide component objects defining the content of the updated workspace.
+
+ A successful call to this method only initiates an asynchronous update of the + workspace. The updated workspace is not available until processing completes. + To check the status of the asynchronous operation, use the **Get information + about a workspace** method. + +
Parameters
i_workspace_id + Unique identifier of the workspace. +
i_body + Valid data defining the new and updated workspace content.
+
+ The maximum size for this data is 50MB. If you need to import a larger amount of + workspace data, consider importing components such as intents and entities + using separate operations. +
i_append + Whether the new data is to be appended to the existing data in the object. If + **append**=`false`, elements included in the new data completely replace the + corresponding existing elements, including all subelements. For example, if the + new data for a workspace includes **entities** and **append**=`false`, all + existing entities in the workspace are discarded and replaced with the new + entities.
+
+ If **append**=`true`, existing elements are preserved, and the new elements are + added. If any elements in the new data collide with existing elements, the + update request fails. +
e_response + Service return value of type T_WORKSPACE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v2.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v2.html index d216bee..51a88ee 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v2.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_assistant_v2.html @@ -1,109 +1,130 @@ -Class ZCL_IBMC_ASSISTANT_V2

Class ZCL_IBMC_ASSISTANT_V2

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Watson Assistant v2

+Class ZCL_IBMC_ASSISTANT_V2

Class ZCL_IBMC_ASSISTANT_V2

public inheriting from zcl_ibmc_service_ext create public

Documentation

Watson Assistant v2

The IBM Watson™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your apps and your users.

The Assistant v2 API provides runtime methods your client application can use to - send user input to an assistant and receive a response.

Types

Visibility and LevelNameDocumentation
publict_agent_availability_message (structured type) No documentation available.
publict_base_message_context_global (structured type)

+ send user input to an assistant and receive a response.

Types

Visibility and LevelNameDocumentation
publict_agent_availability_message (structured type) No documentation available.
publict_assistant_collection (structured type) No documentation available.
publict_assistant_data (structured type) No documentation available.
publict_assistant_skill (structured type) No documentation available.
publict_assistant_state (structured type)

+ Status information about the skills for the assistant.

+ Included in responses only if **status**=`Available`.
publict_audit_properties (structured type) No documentation available.
publict_base_environment (structured type) No documentation available.
publict_base_env_orchestration (structured type)

+ The search skill orchestration settings for the environment.

publict_base_env_release_reference (structured type)

+ An object describing the release that is currently deployed

+ in the environment.
publict_base_message_context_global (structured type)

Session context data that is shared by all skills used by

- the Assistant.
publict_base_message_input (structured type)

- An input object that includes the input text.

publict_base_message_input_options (structured type)

- Optional properties that control how the assistant responds.

publict_bulk_classify_input (structured type) No documentation available.
publict_bulk_classify_output (structured type) No documentation available.
publict_bulk_classify_response (structured type) No documentation available.
publict_bulk_classify_utterance (structured type)

- The user input utterance to classify.

publict_capture_group (structured type) No documentation available.
publict_dialog_log_message (structured type)

- Dialog log message details.

publict_dialog_nodes_visited (structured type) No documentation available.
publict_dialog_node_action (structured type) No documentation available.
publict_dialog_suggestion (structured type) No documentation available.
publict_dialog_suggestion_value (structured type)

+ the assistant.

publict_base_message_context_skill (structured type) No documentation available.
publict_base_message_input (structured type)

+ An input object that includes the input text.

publict_base_message_input_options (structured type)

+ Optional properties that control how the assistant responds.

publict_base_skill (structured type) No documentation available.
publict_base_skill_reference (structured type) No documentation available.
publict_bulk_classify_input (structured type) No documentation available.
publict_bulk_classify_output (structured type) No documentation available.
publict_bulk_classify_response (structured type) No documentation available.
publict_bulk_classify_utterance (structured type)

+ The user input utterance to classify.

publict_capture_group (structured type) No documentation available.
publict_channel_transfer_info (structured type)

+ Information used by an integration to transfer the

+ conversation to a different channel.
publict_channel_transfer_target (structured type)

+ An object specifying target channels available for the

+ transfer. Each property of this object represents an available transfer target. + Currently, the only supported property is **chat**, representing the web chat + integration.
publict_channel_transfer_target_chat (structured type)

+ Information for transferring to the web chat integration.

publict_create_session (structured type) No documentation available.
publict_deploy_release_request (structured type)

+ A request to deploy a release to the specified environment.

publict_dialog_log_message (structured type)

+ Dialog log message details.

publict_dialog_node_action (structured type) No documentation available.
publict_dialog_node_visited (structured type)

+ An objects containing detailed diagnostic information about

+ a dialog node that was visited during processing of the input message.
publict_dialog_suggestion (structured type) No documentation available.
publict_dialog_suggestion_value (structured type)

An object defining the message input to be sent to the

- assistant if the user selects the corresponding disambiguation option.
publict_dia_nd_otpt_cnnct_t_agnt_tr1 (structured type)

+ assistant if the user selects the corresponding disambiguation option.
+
+ **Note:** This entire message input object must be included in the request body + of the next message sent to the assistant. Do not modify or remove any of the + included properties.

publict_dia_nd_otpt_cnnct_t_agnt_tr1 (structured type)

Routing or other contextual information to be used by target

- service desk systems.
publict_dia_nd_output_opt_elem_value (structured type)

+ service desk systems.

publict_dia_nd_output_opt_elem_value (structured type)

An object defining the message input to be sent to the

- assistant if the user selects the corresponding option.
publict_dia_node_output_opt_element (structured type) No documentation available.
publict_empty_response type JSONOBJECT No documentation available.
publict_error_detail (structured type) No documentation available.
publict_error_response (structured type) No documentation available.
publict_log (structured type) No documentation available.
publict_log_collection (structured type) No documentation available.
publict_log_pagination (structured type)

- The pagination data for the returned objects.

publict_message_context (structured type) No documentation available.
publict_message_context_global (structured type)

+ assistant if the user selects the corresponding option.

publict_dia_node_output_opt_element (structured type) No documentation available.
publict_empty_response type jsonobject No documentation available.
publict_environment (structured type) No documentation available.
publict_environment_collection (structured type) No documentation available.
publict_environment_reference (structured type) No documentation available.
publict_environment_skill (structured type) No documentation available.
publict_error_detail (structured type) No documentation available.
publict_error_response (structured type) No documentation available.
publict_integration_reference (structured type) No documentation available.
publict_log (structured type) No documentation available.
publict_log_collection (structured type) No documentation available.
publict_log_message_source type jsonobject

+ An object that identifies the dialog element that generated

+ the error message.
publict_log_message_source_action (structured type)

+ An object that identifies the dialog element that generated

+ the error message.
publict_log_message_source_dia_node (structured type)

+ An object that identifies the dialog element that generated

+ the error message.
publict_log_message_source_handler (structured type)

+ An object that identifies the dialog element that generated

+ the error message.
publict_log_message_source_step (structured type)

+ An object that identifies the dialog element that generated

+ the error message.
publict_log_pagination (structured type)

+ The pagination data for the returned objects. For more

+ information about using pagination, see [Pagination](#pagination).
publict_message_context (structured type) No documentation available.
publict_message_context_global (structured type)

Session context data that is shared by all skills used by

- the Assistant.
publict_message_context_skill (structured type)

- Contains information specific to a particular skill used by

- the Assistant. The property name must be the same as the name of the skill (for - example, `main skill`).
publict_message_context_skills type MAP

- Information specific to particular skills used by the

- assistant.
-
- **Note:** Currently, only a single child property is supported, containing - variables that apply to the dialog skill used by the assistant.
publict_message_context_skill_system (structured type)

- System context data used by the skill.

publict_message_context_stateless (structured type) No documentation available.
publict_message_input (structured type)

- An input object that includes the input text.

publict_message_input_options (structured type)

- Optional properties that control how the assistant responds.

publict_message_input_opt_auto_learn (structured type)

- Autolearning options for the message.


+ the assistant.
publict_message_context_skills (structured type)

+ Context data specific to particular skills used by the

+ assistant.
publict_message_context_skill_action (structured type)

+ Context variables that are used by the action skill.

publict_message_context_skill_dialog (structured type)

+ Context variables that are used by the dialog skill.

publict_message_context_skill_system (structured type)

+ System context data used by the skill.

publict_message_context_stateless (structured type) No documentation available.
publict_message_input (structured type)

+ An input object that includes the input text.

publict_message_input_attachment (structured type)

+ A reference to a media file to be sent as an attachment with

+ the message.
publict_message_input_options (structured type)

+ Optional properties that control how the assistant responds.

publict_message_input_opt_auto_learn (structured type)

+ Autolearning options for the message. For more information

+ about autolearning, see the + [documentation](/docs/watson-assistant?topic=watson-assistant-autolearn).

- **Note:** Autolearning is a beta feature.
publict_message_input_opt_spelling (structured type)

+ **Note:** Autolearning is a beta feature.

publict_message_input_opt_spelling (structured type)

Spelling correction options for the message. Any options

specified on an individual message override the settings configured for the - skill.
publict_message_input_opt_stateless (structured type)

- Optional properties that control how the assistant responds.

publict_message_input_stateless (structured type)

- An input object that includes the input text.

publict_message_output (structured type)

- Assistant output to be rendered or processed by the client.

publict_message_output_debug (structured type)

+ skill.

publict_message_input_opt_stateless (structured type)

+ Optional properties that control how the assistant responds.

publict_message_input_stateless (structured type)

+ An input object that includes the input text.

publict_message_output (structured type)

+ Assistant output to be rendered or processed by the client.

publict_message_output_debug (structured type)

Additional detailed information about a message response and

- how it was generated.
publict_message_output_spelling (structured type)

+ how it was generated.

publict_message_output_spelling (structured type)

Properties describing any spelling corrections in the user

- input that was received.
publict_message_request (structured type)

+ input that was received.

publict_message_request (structured type)

A stateful message request formatted for the Watson

- Assistant service.
publict_message_request_stateless (structured type)

+ Assistant service.

publict_message_request_stateless (structured type)

A stateless message request formatted for the Watson

- Assistant service.
publict_message_response (structured type)

- A response from the Watson Assistant service.

publict_message_response_stateless (structured type)

- A stateless response from the Watson Assistant service.

publict_mssg_cntxt_global_stateless (structured type)

+ Assistant service.

publict_message_response (structured type)

+ A response from the Watson Assistant service.

publict_message_response_stateless (structured type)

+ A stateless response from the Watson Assistant service.

publict_mssg_cntxt_global_stateless (structured type)

Session context data that is shared by all skills used by

- the Assistant.
publict_mssg_context_global_system (structured type)

+ the assistant.

publict_mssg_context_global_system (structured type)

Built-in system properties that apply to all skills used by

- the assistant.
publict_mssg_otpt_dbg_at_learn_model (structured type)

- Detailed information about how an autolearned model affected

- the response.
publict_mssg_output_debug_auto_learn (structured type)

- Detailed information about how autolearning (if enabled)

- affected the response.
-
- **Note:** Autolearning is a beta feature.
publict_rt_entity_interpretation (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_date (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_num (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_time (structured type) No documentation available.
publict_rt_response_type_suggestion (structured type)

- An object that describes a response with response type

- `suggestion`.
publict_rt_resp_gnrc_rt_resp_typ_cn1 (structured type)

- An object that describes a response with response type

- `connect_to_agent`.
publict_rt_resp_gnrc_rt_resp_typ_img (structured type)

- An object that describes a response with response type

- `image`.
publict_rt_resp_gnrc_rt_resp_typ_opt (structured type)

- An object that describes a response with response type

- `option`.
publict_rt_resp_gnrc_rt_resp_typ_ps (structured type)

- An object that describes a response with response type

- `pause`.
publict_rt_resp_gnrc_rt_resp_typ_sg1 (structured type)

- An object that describes a response with response type

- `suggestion`.
publict_rt_resp_gnrc_rt_resp_typ_sr1 (structured type)

- An object that describes a response with response type

- `search`.
publict_rt_resp_gnrc_rt_resp_typ_txt (structured type)

- An object that describes a response with response type

- `text`.
publict_rt_resp_typ_connect_to_agent (structured type)

- An object that describes a response with response type

- `connect_to_agent`.
publict_runtime_entity (structured type)

- The entity value that was recognized in the user input.

publict_runtime_entity_alternative (structured type)

- An alternative value for the recognized entity.

publict_runtime_entity_role (structured type)

+ the assistant.

publict_mssg_otpt_dbg_trn_evnt_trn_1 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_2 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_3 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_4 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_5 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_6 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_7 (structured type) No documentation available.
publict_mssg_otpt_dbg_trn_evnt_trn_8 (structured type) No documentation available.
publict_mssg_output_debug_turn_event type jsonobject No documentation available.
publict_pagination (structured type)

+ The pagination data for the returned objects. For more

+ information about using pagination, see [Pagination](#pagination).
publict_release (structured type) No documentation available.
publict_release_collection (structured type) No documentation available.
publict_release_content (structured type)

+ An object identifying the versionable content objects (such

+ as skill snapshots) that are included in the release.
publict_release_skill (structured type) No documentation available.
publict_request_analytics (structured type)

+ An optional object containing analytics data. Currently,

+ this data is used only for events sent to the Segment extension.
publict_response_generic_channel (structured type) No documentation available.
publict_rt_entity_interpretation (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_date (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_num (structured type) No documentation available.
publict_rt_entty_intrprttn_sys_time (structured type) No documentation available.
publict_rt_response_type_suggestion (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_ad (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_ch1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_cn1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_dt (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_if1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_img (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_opt (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_ps (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_sg1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_sr1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_txt (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_us1 (structured type) No documentation available.
publict_rt_resp_gnrc_rt_resp_typ_vd (structured type) No documentation available.
publict_rt_resp_type_channel_trans (structured type) No documentation available.
publict_rt_resp_type_user_defined (structured type) No documentation available.
publict_rt_resp_typ_connect_to_agent (structured type) No documentation available.
publict_runtime_entity (structured type)

+ The entity value that was recognized in the user input.

publict_runtime_entity_alternative (structured type)

+ An alternative value for the recognized entity.

publict_runtime_entity_role (structured type)

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.
publict_runtime_intent (structured type)

- An intent identified in the user input.

publict_runtime_response_generic type JSONOBJECT No documentation available.
publict_runtime_response_type_image (structured type)

- An object that describes a response with response type

- `image`.
publict_runtime_response_type_option (structured type)

- An object that describes a response with response type

- `option`.
publict_runtime_response_type_pause (structured type)

- An object that describes a response with response type

- `pause`.
publict_runtime_response_type_search (structured type)

- An object that describes a response with response type

- `search`.
publict_runtime_response_type_text (structured type)

- An object that describes a response with response type

- `text`.
publict_search_result (structured type) No documentation available.
publict_search_result_highlight (structured type)

+ property is included only if the new system entities are enabled for the skill.

publict_runtime_intent (structured type)

+ An intent identified in the user input.

publict_runtime_response_generic type jsonobject No documentation available.
publict_runtime_response_type_audio (structured type) No documentation available.
publict_runtime_response_type_date (structured type) No documentation available.
publict_runtime_response_type_iframe (structured type) No documentation available.
publict_runtime_response_type_image (structured type) No documentation available.
publict_runtime_response_type_option (structured type) No documentation available.
publict_runtime_response_type_pause (structured type) No documentation available.
publict_runtime_response_type_search (structured type) No documentation available.
publict_runtime_response_type_text (structured type) No documentation available.
publict_runtime_response_type_video (structured type) No documentation available.
publict_search_result (structured type) No documentation available.
publict_search_result_answer (structured type)

+ An object specifing a segment of text that was identified as

+ a direct answer to the search query.
publict_search_result_highlight (structured type)

An object containing segments of text from search results

- with query-matching text highlighted using HTML `<em>` tags.
publict_search_result_metadata (structured type)

+ with query-matching text highlighted using HTML `<em>` tags.

publict_search_result_metadata (structured type)

An object containing search result metadata from the

- Discovery service.
publict_session_response (structured type) No documentation available.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
bulk_classify
importingi_skill_idtype STRING
i_requesttype T_BULK_CLASSIFY_INPUT optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_BULK_CLASSIFY_RESPONSE
raisingzcx_ibmc_service_exception

Identify intents and entities in multiple user utterances

+ Discovery service.
publict_search_settings (structured type)

+ An object describing the search skill configuration.

publict_search_settings_discovery (structured type)

+ Configuration settings for the Watson Discovery service

+ instance used by the search integration.
publict_search_settings_messages (structured type)

+ The messages included with responses from the search

+ integration.
publict_search_skill_warning (structured type)

+ A warning describing an error in the search skill

+ configuration.
publict_session_response (structured type) No documentation available.
publict_skill (structured type) No documentation available.
publict_skills_async_request_status (structured type) No documentation available.
publict_skills_export (structured type) No documentation available.
publict_skills_import (structured type) No documentation available.
publict_skill_import (structured type) No documentation available.
publict_srch_settings_schema_mapping (structured type)

+ The mapping between fields in the Watson Discovery

+ collection and properties in the search response.
publict_srch_sttngs_dscvry_athntctn (structured type)

+ Authentication information for the Watson Discovery service.

+ For more information, see the [Watson Discovery + documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). +
+
+ **Note:** You must specify either **basic** or **bearer**, but not both.
publict_status_error (structured type)

+ An object describing an error that occurred during

+ processing of an asynchronous operation.
publict_turn_event_action_finished (structured type) No documentation available.
publict_turn_event_action_source (structured type) No documentation available.
publict_turn_event_action_visited (structured type) No documentation available.
publict_turn_event_callout (structured type) No documentation available.
publict_turn_event_callout_callout (structured type) No documentation available.
publict_turn_event_callout_error (structured type) No documentation available.
publict_turn_event_handler_visited (structured type) No documentation available.
publict_turn_event_node_source (structured type) No documentation available.
publict_turn_event_node_visited (structured type) No documentation available.
publict_turn_event_search (structured type) No documentation available.
publict_turn_event_search_error (structured type) No documentation available.
publict_turn_event_step_answered (structured type) No documentation available.
publict_turn_event_step_visited (structured type) No documentation available.
publict_update_environment (structured type) No documentation available.
publict_update_skill (structured type) No documentation available.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
bulk_classify
importingi_skill_idtype string
i_requesttype t_bulk_classify_input
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_bulk_classify_response
raisingzcx_ibmc_service_exception

Identify intents and entities in multiple user utterances

Send multiple user inputs to a dialog skill in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different skills or skill versions.

- This method is available only with Premium plans. + This method is available only with Enterprise with Data Isolation plans.
Parameters
i_skill_id Unique identifier of the skill. To find the skill ID in the Watson Assistant @@ -113,7 +134,43 @@
e_response Service return value of type T_BULK_CLASSIFY_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_session
importingi_assistant_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SESSION_RESPONSE
raisingzcx_ibmc_service_exception

Create a session

+
public instance
create_assistant
importingi_requesttype t_assistant_data optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_assistant_data
raisingzcx_ibmc_service_exception

Create an assistant

+ Create a new assistant.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_request + The properties of the new assistant. +
e_response + Service return value of type T_ASSISTANT_DATA +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_release
importingi_assistant_idtype string
i_releasetype t_release optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_release
raisingzcx_ibmc_service_exception

Create release

+ Create a new release using the current content of the dialog and action skills + in the draft environment. (In the Watson Assistant user interface, a release is + called a *version*.)
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_release + An object describing the release. +
e_response + Service return value of type T_RELEASE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_session
importingi_assistant_idtype string
i_createsessiontype t_create_session optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_session_response
raisingzcx_ibmc_service_exception

Create a session

Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation. A session persists until it is deleted, or until it times out because of inactivity. (For @@ -122,34 +179,91 @@ settings).
Parameters
i_assistant_id - Unique identifier of the assistant. To find the assistant ID in the Watson - Assistant user interface, open the assistant settings and click **API - Details**. For information about creating assistants, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - add#assistant-add-task).
+ The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.

- **Note:** Currently, the v2 API does not support creating assistants. + **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_createsession + No documentation available.
e_response Service return value of type T_SESSION_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_session
importingi_assistant_idtype STRING
i_session_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete session

+
public instance
delete_assistant
importingi_assistant_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete assistant

+ Delete an assistant.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_release
importingi_assistant_idtype string
i_releasetype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete release

+ Delete a release. (In the Watson Assistant user interface, a release is called a + *version*.)
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_release + Unique identifier of the release. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_session
importingi_assistant_idtype string
i_session_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete session

Deletes a session explicitly before it times out. (For more information about the session inactivity timeout, see the [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- settings)).
Parameters
i_assistant_id - Unique identifier of the assistant. To find the assistant ID in the Watson - Assistant user interface, open the assistant settings and click **API - Details**. For information about creating assistants, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - add#assistant-add-task).
+ The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.

- **Note:** Currently, the v2 API does not support creating assistants. + **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details.
i_session_id Unique identifier of the session.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete labeled data

+
public instance
delete_user_data
importingi_customer_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete labeled data

Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

@@ -159,25 +273,320 @@ security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-secu rity#information-security).

- This operation is limited to 4 requests per minute. For more information, see - **Rate limiting**. + **Note:** This operation is intended only for deleting data associated with a + single specific customer, not for deleting data associated with multiple + customers or for any other purpose. For more information, see [Labeling and + deleting data in Watson + Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-sec + urity#information-security-gdpr-wa).
Parameters
i_customer_id The customer ID for which all data is to be deleted.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
list_logs
importingi_assistant_idtype STRING
i_sorttype STRING optional
i_filtertype STRING optional
i_page_limittype INTEGER optional
i_cursortype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LOG_COLLECTION
raisingzcx_ibmc_service_exception

List log events for an assistant

+
public instance
deploy_release
importingi_assistant_idtype string
i_releasetype string
i_requesttype t_deploy_release_request
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_environment
raisingzcx_ibmc_service_exception

Deploy release

+ Update the environment with the content of the release. All snapshots saved as + part of the release become active in the environment.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_release + Unique identifier of the release. +
i_request + An input object that identifies the environment where the release is to be + deployed. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_ENVIRONMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
export_skills
importingi_assistant_idtype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_skills_export
raisingzcx_ibmc_service_exception

Export skills

+ Asynchronously export the action skill and dialog skill (if enabled) for the + assistant. Use this method to save all skill data so that you can import it to + a different assistant using the **Import skills** method.
+
+ A successful call to this method only initiates an asynchronous export. The + exported JSON data is not available until processing completes.
+
+ After the initial request is submitted, you can poll the status of the + operation by calling the same request again and checking the value of the + **status** property. If an error occurs (indicated by a **status** value of + `Failed`), the `status_description` property provides more information about + the error, and the `status_errors` property contains an array of error messages + that caused the failure.
+
+ When processing has completed, the request returns the exported JSON data. + Remember that the usual rate limits apply.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_SKILLS_EXPORT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instanceget_appname redefinition public instance
get_environment
importingi_assistant_idtype string
i_environment_idtype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_environment
raisingzcx_ibmc_service_exception

Get environment

+ Get information about an environment. For more information about environments, + see + [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assista + nt-publish-overview#environments).
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_environment_id + Unique identifier of the environment. To find the environment ID in the Watson + Assistant user interface, open the environment settings and click **API + Details**. **Note:** Currently, the API does not support creating environments. + +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_ENVIRONMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_release
importingi_assistant_idtype string
i_releasetype string
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_release
raisingzcx_ibmc_service_exception

Get release

+ Get information about a release.
+
+ Release data is not available until publishing of the release completes. If + publishing is still in progress, you can continue to poll by calling the same + request again and checking the value of the **status** property. When + processing has completed, the request returns the release data.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_release + Unique identifier of the release. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_RELEASE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_skill
importingi_assistant_idtype string
i_skill_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_skill
raisingzcx_ibmc_service_exception

Get skill

+ Get information about a skill.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_skill_id + Unique identifier of the skill. To find the skill ID in the Watson Assistant + user interface, open the skill settings and click **API Details**. +
e_response + Service return value of type T_SKILL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
import_skills
importingi_assistant_idtype string
i_skillsimporttype t_skills_import
i_include_audittype boolean default c_boolean_false
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_skills_async_request_status
raisingzcx_ibmc_service_exception

Import skills

+ Asynchronously import skills into an existing assistant from a previously + exported file.
+
+ The request body for this method should contain the response data that was + received from a previous call to the **Export skills** method, without + modification.
+
+ A successful call to this method initiates an asynchronous import. The updated + skills belonging to the assistant are not available until processing completes. + To check the status of the asynchronous import operation, use the **Get status + of skills import** method.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_skillsimport + An input object that contains the skills to import. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_SKILLS_ASYNC_REQUEST_STATUS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
import_skills_status
importingi_assistant_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_skills_async_request_status
raisingzcx_ibmc_service_exception

Get status of skills import

+ Retrieve the status of an asynchronous import operation previously initiated by + using the **Import skills** method.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
e_response + Service return value of type T_SKILLS_ASYNC_REQUEST_STATUS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_assistants
importingi_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_assistant_collection
raisingzcx_ibmc_service_exception

List assistants

+ List the assistants associated with a Watson Assistant service instance.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_page_limit + The number of records to return in each page of results. +
i_include_count + Whether to include information about the number of records that satisfy the + request, regardless of the page limit. If this parameter is `true`, the + `pagination` object in the response includes the `total` property. +
i_sort + The attribute by which returned assistants will be sorted. To reverse the sort + order, prefix the value with a minus sign (`-`). +
i_cursor + A token identifying the page of results to retrieve. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_ASSISTANT_COLLECTION +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_environments
importingi_assistant_idtype string
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_environment_collection
raisingzcx_ibmc_service_exception

List environments

+ List the environments associated with an assistant.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_page_limit + The number of records to return in each page of results. +
i_include_count + Whether to include information about the number of records that satisfy the + request, regardless of the page limit. If this parameter is `true`, the + `pagination` object in the response includes the `total` property. +
i_sort + The attribute by which returned environments will be sorted. To reverse the sort + order, prefix the value with a minus sign (`-`). +
i_cursor + A token identifying the page of results to retrieve. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_ENVIRONMENT_COLLECTION +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_logs
importingi_assistant_idtype string
i_sorttype string optional
i_filtertype string optional
i_page_limittype integer default 100
i_cursortype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_log_collection
raisingzcx_ibmc_service_exception

List log events for an assistant

List the events from the log of an assistant.

- This method is available only with Premium plans. + This method requires Manager access, and is available only with Plus and + Enterprise plans.
+
+ **Note:** If you use the **cursor** parameter to retrieve results one page at a + time, subsequent requests must be no more than 5 minutes apart. Any returned + value for the **cursor** parameter becomes invalid after 5 minutes. For more + information about using pagination, see [Pagination](#pagination).
Parameters
i_assistant_id - Unique identifier of the assistant. To find the assistant ID in the Watson - Assistant user interface, open the assistant settings and click **API - Details**. For information about creating assistants, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - add#assistant-add-task).
+ The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.

- **Note:** Currently, the v2 API does not support creating assistants. + **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details.
i_sort How to sort the returned log events. You can sort by **request_timestamp**. To reverse the sort order, prefix the parameter value with a minus sign (`-`). @@ -193,19 +602,62 @@
e_response Service return value of type T_LOG_COLLECTION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
message
importingi_assistant_idtype STRING
i_session_idtype STRING
i_requesttype T_MESSAGE_REQUEST optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_MESSAGE_RESPONSE
raisingzcx_ibmc_service_exception

Send user input to assistant (stateful)

+
public instance
list_releases
importingi_assistant_idtype string
i_page_limittype integer default 100
i_include_counttype boolean default c_boolean_false
i_sorttype string optional
i_cursortype string optional
i_include_audittype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_release_collection
raisingzcx_ibmc_service_exception

List releases

+ List the releases associated with an assistant. (In the Watson Assistant user + interface, a release is called a *version*.)
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_page_limit + The number of records to return in each page of results. +
i_include_count + Whether to include information about the number of records that satisfy the + request, regardless of the page limit. If this parameter is `true`, the + `pagination` object in the response includes the `total` property. +
i_sort + The attribute by which returned workspaces will be sorted. To reverse the sort + order, prefix the value with a minus sign (`-`). +
i_cursor + A token identifying the page of results to retrieve. +
i_include_audit + Whether to include the audit properties (`created` and `updated` timestamps) in + the response. +
e_response + Service return value of type T_RELEASE_COLLECTION +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
message
importingi_assistant_idtype string
i_session_idtype string
i_requesttype t_message_request optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_message_response
raisingzcx_ibmc_service_exception

Send user input to assistant (stateful)

Send user input to an assistant and receive a response, with conversation state (including context data) stored by Watson Assistant for the duration of the session.
Parameters
i_assistant_id - Unique identifier of the assistant. To find the assistant ID in the Watson - Assistant user interface, open the assistant settings and click **API - Details**. For information about creating assistants, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - add#assistant-add-task).
+ The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.

- **Note:** Currently, the v2 API does not support creating assistants. + **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details.
i_session_id Unique identifier of the session.
i_request @@ -214,22 +666,91 @@
e_response Service return value of type T_MESSAGE_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
message_stateless
importingi_assistant_idtype STRING
i_requesttype T_MESSAGE_REQUEST_STATELESS optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_MESSAGE_RESPONSE_STATELESS
raisingzcx_ibmc_service_exception

Send user input to assistant (stateless)

+
public instance
message_stateless
importingi_assistant_idtype string
i_requesttype t_message_request_stateless optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_message_response_stateless
raisingzcx_ibmc_service_exception

Send user input to assistant (stateless)

Send user input to an assistant and receive a response, with conversation state (including context data) managed by your application.
Parameters
i_assistant_id - Unique identifier of the assistant. To find the assistant ID in the Watson - Assistant user interface, open the assistant settings and click **API - Details**. For information about creating assistants, see the - [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - add#assistant-add-task).
+ The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.

- **Note:** Currently, the v2 API does not support creating assistants. + **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details.
i_request The message to be sent. This includes the user's input, context data, and optional content such as intents and entities.
e_response Service return value of type T_MESSAGE_RESPONSE_STATELESS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file +
public instance
update_environment
importingi_assistant_idtype string
i_environment_idtype string
i_updateenvironmenttype t_update_environment optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_environment
raisingzcx_ibmc_service_exception

Update environment

+ Update an environment with new or modified data. For more information about + environments, see + [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assista + nt-publish-overview#environments).
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_environment_id + Unique identifier of the environment. To find the environment ID in the Watson + Assistant user interface, open the environment settings and click **API + Details**. **Note:** Currently, the API does not support creating environments. + +
i_updateenvironment + The updated properties of the environment. +
e_response + Service return value of type T_ENVIRONMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_skill
importingi_assistant_idtype string
i_skill_idtype string
i_updateskilltype t_update_skill
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_skill
raisingzcx_ibmc_service_exception

Update skill

+ Update a skill with new or modified data.
+
+ **Note:** The update is performed asynchronously; you can see the status of + the update by calling the **Get skill** method and checking the value of the + **status** property.
+
+ This method is available only with Enterprise plans. + +
Parameters
i_assistant_id + The assistant ID or the environment ID of the environment where the assistant is + deployed, depending on the type of request:
+ - For message, session, and log requests, specify the environment ID of the + environment where the assistant is deployed.
+ - For all other requests, specify the assistant ID of the assistant.
+
+ To find the environment ID or assistant ID in the Watson Assistant user + interface, open the assistant settings and scroll to the **Environments** + section.
+
+ **Note:** If you are using the classic Watson Assistant experience, always use + the assistant ID. To find the assistant ID in the user interface, open the + assistant settings and click API Details. +
i_skill_id + Unique identifier of the skill. To find the skill ID in the Watson Assistant + user interface, open the skill settings and click **API Details**. +
i_updateskill + The updated properties of the skill. +
e_response + Service return value of type T_SKILL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_compare_comply_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_compare_comply_v1.html deleted file mode 100644 index 2f18e02..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_compare_comply_v1.html +++ /dev/null @@ -1,344 +0,0 @@ -Class ZCL_IBMC_COMPARE_COMPLY_V1

Class ZCL_IBMC_COMPARE_COMPLY_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Compare and Comply

- IBM Watson™ Compare and Comply analyzes governing documents to provide - details about critical aspects of the documents.

Types

Visibility and LevelNameDocumentation
publict_address (structured type)

- A party's address.

publict_aligned_element (structured type) No documentation available.
publict_attribute (structured type)

- List of document attributes.

publict_batches (structured type)

- The results of a successful **List Batches** request.

publict_batch_status (structured type)

- The batch-request status.

publict_body_cells (structured type)

- Cells that are not table header, column header, or row

- header cells.
publict_category (structured type)

- Information defining an element's subject matter.

publict_category_comparison (structured type)

- Information defining an element's subject matter.

publict_classify_return (structured type)

- The analysis of objects returned by the **Element

- classification** method.
publict_column_headers (structured type)

- Column-level cells, each applicable as a header to other

- cells in the same column as itself, of the current table.
publict_column_header_ids type TT_STRING

- An array that contains the `id` value of a column header

- that is applicable to the current cell.
publict_column_header_texts type TT_STRING

- An array that contains the `text` value of a column header

- that is applicable to the current cell.
publict_column_header_texts_norm type TT_STRING

- If you provide customization input, the normalized version

- of the column header texts according to the customization; otherwise, the same - value as `column_header_texts`.
publict_compare_return (structured type)

- The comparison of the two submitted documents.

publict_contact (structured type)

- A contact.

publict_contexts (structured type)

- Text that is related to the contents of the table and that

- precedes or follows the current table.
publict_contract_amts (structured type)

- A monetary amount identified in the input document.

publict_contract_currencies (structured type)

- The contract currencies that are declared in the document.

publict_contract_terms (structured type)

- The duration or durations of the contract.

publict_contract_types (structured type)

- The contract type identified in the input document.

publict_document (structured type)

- Basic information about the input document.

publict_doc_counts (structured type)

- Document counts.

publict_doc_info (structured type)

- Information about the parsed input document.

publict_doc_structure (structured type)

- The structure of the input document.

publict_effective_dates (structured type)

- An effective date.

publict_element (structured type)

- A component part of the document.

publict_element_locations (structured type)

- A list of `begin` and `end` indexes that indicate the

- locations of the elements in the input document.
publict_element_pair (structured type)

- Details of semantically aligned elements.

publict_error_response (structured type) No documentation available.
publict_feedback_data_input (structured type)

- Feedback data for submission.

publict_feedback_data_output (structured type)

- Information returned from the **Add Feedback** method.

publict_feedback_deleted (structured type)

- The status and message of the deletion request.

publict_feedback_input (structured type)

- The feedback to be added to an element in the document.

publict_feedback_list (structured type)

- The results of a successful **List Feedback** request for

- all feedback.
publict_feedback_return (structured type)

- Information about the document and the submitted feedback.

publict_get_feedback (structured type)

- The results of a successful **Get Feedback** request for a

- single feedback entry.
publict_htmlreturn (structured type)

- The HTML converted from an input document.

publict_inline_object (structured type) No documentation available.
publict_inline_object1 (structured type) No documentation available.
publict_inline_object2 (structured type) No documentation available.
publict_inline_object3 (structured type) No documentation available.
publict_inline_object4 (structured type) No documentation available.
publict_interpretation (structured type)

- The details of the normalized text, if applicable. This

- element is optional; it is returned only if normalized text exists.
publict_key (structured type)

- A key in a key-value pair.

publict_key_value_pair (structured type)

- Key-value pairs detected across cell boundaries.

publict_label (structured type)

- A pair of `nature` and `party` objects. The `nature` object

- identifies the effect of the element on the identified `party`, and the `party` - object identifies the affected party.
publict_leading_sentence (structured type)

- The leading sentences in a section or subsection of the

- input document.
publict_location (structured type)

- The numeric location of the identified element in the

- document, represented with two integers labeled `begin` and `end`.
publict_mention (structured type)

- A mention of a party.

publict_original_labels_in (structured type)

- The original labeling from the input document, without the

- submitted feedback.
publict_original_labels_out (structured type)

- The original labeling from the input document, without the

- submitted feedback.
publict_pagination (structured type)

- Pagination details, if required by the length of the output.

publict_paragraphs (structured type)

- The locations of each paragraph in the input document.

publict_parties (structured type)

- A party and its corresponding role, including address and

- contact information if identified.
publict_payment_terms (structured type)

- The document's payment duration or durations.

publict_row_headers (structured type)

- Row-level cells, each applicable as a header to other cells

- in the same row as itself, of the current table.
publict_row_header_ids type TT_STRING

- An array that contains the `id` value of a row header that

- is applicable to this body cell.
publict_row_header_texts type TT_STRING

- An array that contains the `text` value of a row header that

- is applicable to this body cell.
publict_row_header_texts_normalized type TT_STRING

- If you provide customization input, the normalized version

- of the row header texts according to the customization; otherwise, the same - value as `row_header_texts`.
publict_section_title (structured type)

- The table's section title, if identified.

publict_section_titles (structured type)

- An array containing one object per section or subsection

- detected in the input document. Sections and subsections are not nested; - instead, they are flattened out and can be placed back in order by using the - `begin` and `end` values of the element and the `level` value of the section.
publict_short_doc (structured type)

- Brief information about the input document.

publict_tables (structured type)

- The contents of the tables extracted from a document.

publict_table_headers (structured type)

- The contents of the current table's header.

publict_table_return (structured type)

- The analysis of the document's tables.

publict_table_title (structured type)

- If identified, the title or caption of the current table of

- the form `Table x.: ...`. Empty when no title is identified. When exposed, the - `title` is also excluded from the `contexts` array of the same table.
publict_termination_dates (structured type)

- Termination dates identified in the input document.

publict_type_label (structured type)

- Identification of a specific type.

publict_type_label_comparison (structured type)

- Identification of a specific type.

publict_unaligned_element (structured type)

- Element that does not align semantically between two

- compared documents.
publict_updated_labels_in (structured type)

- The updated labeling from the input document, accounting for

- the submitted feedback.
publict_updated_labels_out (structured type)

- The updated labeling from the input document, accounting for

- the submitted feedback.
publict_value (structured type)

- A value in a key-value pair.

publict_values TYPE STANDARD TABLE OF T_VALUE WITH NON-UNIQUE DEFAULT KEY

- A list of values in a key-value pair.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_feedback
importingi_feedback_datatype T_FEEDBACK_INPUT
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_FEEDBACK_RETURN
raisingzcx_ibmc_service_exception

Add feedback

- Adds feedback in the form of _labels_ from a subject-matter expert (SME) to a - governing document.
- **Important:** Feedback is not immediately incorporated into the training model, - nor is it guaranteed to be incorporated at a later date. Instead, submitted - feedback is used to suggest future updates to the training model. - -
Parameters
i_feedback_data - An object that defines the feedback to be submitted. -
e_response - Service return value of type T_FEEDBACK_RETURN -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
classify_elements
importingi_filetype FILE
i_file_content_typetype STRING optional
i_modeltype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFY_RETURN
raisingzcx_ibmc_service_exception

Classify the elements of a document

- Analyzes the structural and semantic elements of a document. - -
Parameters
i_file - The document to classify. -
i_file_content_type - The content type of file. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_CLASSIFY_RETURN -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
compare_documents
importingi_file_1type FILE
i_file_2type FILE
i_file_1_content_typetype STRING optional
i_file_2_content_typetype STRING optional
i_file_1_labeltype STRING default 'file_1'
i_file_2_labeltype STRING default 'file_2'
i_modeltype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COMPARE_RETURN
raisingzcx_ibmc_service_exception

Compare two documents

- Compares two input documents. Documents must be in the same format. - -
Parameters
i_file_1 - The first document to compare. -
i_file_2 - The second document to compare. -
i_file_1_content_type - The content type of file1. -
i_file_2_content_type - The content type of file2. -
i_file_1_label - A text label for the first document. -
i_file_2_label - A text label for the second document. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_COMPARE_RETURN -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
convert_to_html
importingi_filetype FILE
i_file_content_typetype STRING optional
i_modeltype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_HTMLRETURN
raisingzcx_ibmc_service_exception

Convert document to HTML

- Converts a document to HTML. - -
Parameters
i_file - The document to convert. -
i_file_content_type - The content type of file. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_HTMLRETURN -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_batch
importingi_functiontype STRING
i_input_credentials_filetype FILE
i_input_bucket_locationtype STRING
i_input_bucket_nametype STRING
i_output_credentials_filetype FILE
i_output_bucket_locationtype STRING
i_output_bucket_nametype STRING
i_modeltype STRING optional
i_input_credentials_file_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_output_credentials_file_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_BATCH_STATUS
raisingzcx_ibmc_service_exception

Submit a batch-processing request

- Run Compare and Comply methods over a collection of input documents.
-
- **Important:** Batch processing requires the use of the [IBM Cloud Object - Storage - service](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-sto - rage-about#about-ibm-cloud-object-storage). The use of IBM Cloud Object Storage - with Compare and Comply is discussed at [Using batch - processing](https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-batc - hing#before-you-batch). - -
Parameters
i_function - The Compare and Comply method to run across the submitted input documents. -
i_input_credentials_file - A JSON file containing the input Cloud Object Storage credentials. At a minimum, - the credentials must enable `READ` permissions on the bucket defined by the - `input_bucket_name` parameter. -
i_input_bucket_location - The geographical location of the Cloud Object Storage input bucket as listed on - the **Endpoint** tab of your Cloud Object Storage instance; for example, - `us-geo`, `eu-geo`, or `ap-geo`. -
i_input_bucket_name - The name of the Cloud Object Storage input bucket. -
i_output_credentials_file - A JSON file that lists the Cloud Object Storage output credentials. At a - minimum, the credentials must enable `READ` and `WRITE` permissions on the - bucket defined by the `output_bucket_name` parameter. -
i_output_bucket_location - The geographical location of the Cloud Object Storage output bucket as listed on - the **Endpoint** tab of your Cloud Object Storage instance; for example, - `us-geo`, `eu-geo`, or `ap-geo`. -
i_output_bucket_name - The name of the Cloud Object Storage output bucket. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_BATCH_STATUS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_feedback
importingi_feedback_idtype STRING
i_modeltype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_FEEDBACK_DELETED
raisingzcx_ibmc_service_exception

Delete a specified feedback entry

- Deletes a feedback entry with a specified `feedback_id`. - -
Parameters
i_feedback_id - A string that specifies the feedback entry to be deleted from the document. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_FEEDBACK_DELETED -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
extract_tables
importingi_filetype FILE
i_file_content_typetype STRING optional
i_modeltype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TABLE_RETURN
raisingzcx_ibmc_service_exception

Extract a document's tables

- Analyzes the tables in a document. - -
Parameters
i_file - The document on which to run table extraction. -
i_file_content_type - The content type of file. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_TABLE_RETURN -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition 
public instance
get_batch
importingi_batch_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_BATCH_STATUS
raisingzcx_ibmc_service_exception

Get information about a specific batch-processing job

- Gets information about a batch-processing job with a specified ID. - -
Parameters
i_batch_id - The ID of the batch-processing job whose information you want to retrieve. -
e_response - Service return value of type T_BATCH_STATUS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_feedback
importingi_feedback_idtype STRING
i_modeltype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GET_FEEDBACK
raisingzcx_ibmc_service_exception

Get a specified feedback entry

- Gets a feedback entry with a specified `feedback_id`. - -
Parameters
i_feedback_id - A string that specifies the feedback entry to be included in the output. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_GET_FEEDBACK -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
list_batches
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_BATCHES
raisingzcx_ibmc_service_exception

List submitted batch-processing jobs

- Lists batch-processing jobs submitted by users. - -
Parameters
e_response - Service return value of type T_BATCHES -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_feedback
importingi_feedback_typetype STRING optional
i_document_titletype STRING optional
i_model_idtype STRING optional
i_model_versiontype STRING optional
i_category_removedtype STRING optional
i_category_addedtype STRING optional
i_category_not_changedtype STRING optional
i_type_removedtype STRING optional
i_type_addedtype STRING optional
i_type_not_changedtype STRING optional
i_page_limittype INTEGER optional
i_cursortype STRING optional
i_sorttype STRING optional
i_include_totaltype BOOLEAN optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_FEEDBACK_LIST
raisingzcx_ibmc_service_exception

List the feedback in a document

- Lists the feedback in a document. - -
Parameters
i_feedback_type - An optional string that filters the output to include only feedback with the - specified feedback type. The only permitted value is `element_classification`. -
i_document_title - An optional string that filters the output to include only feedback from the - document with the specified `document_title`. -
i_model_id - An optional string that filters the output to include only feedback with the - specified `model_id`. The only permitted value is `contracts`. -
i_model_version - An optional string that filters the output to include only feedback with the - specified `model_version`. -
i_category_removed - An optional string in the form of a comma-separated list of categories. If it is - specified, the service filters the output to include only feedback that has at - least one category from the list removed. -
i_category_added - An optional string in the form of a comma-separated list of categories. If this - is specified, the service filters the output to include only feedback that has - at least one category from the list added. -
i_category_not_changed - An optional string in the form of a comma-separated list of categories. If this - is specified, the service filters the output to include only feedback that has - at least one category from the list unchanged. -
i_type_removed - An optional string of comma-separated `nature`:`party` pairs. If this is - specified, the service filters the output to include only feedback that has at - least one `nature`:`party` pair from the list removed. -
i_type_added - An optional string of comma-separated `nature`:`party` pairs. If this is - specified, the service filters the output to include only feedback that has at - least one `nature`:`party` pair from the list removed. -
i_type_not_changed - An optional string of comma-separated `nature`:`party` pairs. If this is - specified, the service filters the output to include only feedback that has at - least one `nature`:`party` pair from the list unchanged. -
i_page_limit - An optional integer specifying the number of documents that you want the service - to return. -
i_cursor - An optional string that returns the set of documents after the previous set. Use - this parameter with the `page_limit` parameter. -
i_sort - An optional comma-separated list of fields in the document to sort on. You can - optionally specify the sort direction by prefixing the value of the field with - `-` for descending order or `+` for ascending order (the default). Currently - permitted sorting fields are `created`, `user_id`, and `document_title`. -
i_include_total - An optional boolean value. If specified as `true`, the `pagination` object in - the output includes a value called `total` that gives the total count of - feedback created. -
e_response - Service return value of type T_FEEDBACK_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_batch
importingi_batch_idtype STRING
i_actiontype STRING
i_modeltype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_BATCH_STATUS
raisingzcx_ibmc_service_exception

Update a pending or active batch-processing job

- Updates a pending or active batch-processing job. You can rescan the input - bucket to check for new documents or cancel a job. - -
Parameters
i_batch_id - The ID of the batch-processing job you want to update. -
i_action - The action you want to perform on the specified batch-processing job. -
i_model - The analysis model to be used by the service. For the **Element classification** - and **Compare two documents** methods, the default is `contracts`. For the - **Extract tables** method, the default is `tables`. These defaults apply to the - standalone methods as well as to the methods' use in batch-processing - requests. -
e_response - Service return value of type T_BATCH_STATUS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v1.html deleted file mode 100644 index 700fea0..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v1.html +++ /dev/null @@ -1,1164 +0,0 @@ -Class ZCL_IBMC_DISCOVERY_V1

Class ZCL_IBMC_DISCOVERY_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Discovery

- IBM Watson™ Discovery is a cognitive search and content analytics engine - that you can add to applications to identify patterns, trends and actionable - insights to drive better decision-making. Securely unify structured and - unstructured data with pre-enriched content, and use a simplified query - language to eliminate the need for manual filtering of results.

Types

Visibility and LevelNameDocumentation
publict_aggregation_result (structured type)

- Aggregation results for the specified query.

publict_calculation (structured type) No documentation available.
publict_collection (structured type)

- A collection for storing documents.

publict_collection_crawl_status (structured type)

- Object containing information about the crawl status of this

- collection.
publict_collection_disk_usage (structured type)

- Summary of the disk usage statistics for this collection.

publict_collection_usage (structured type)

- Summary of the collection usage in the environment.

publict_coll_query_large (structured type)

- Object that describes a long query.

publict_completions (structured type)

- An object containing an array of autocompletion suggestions.

publict_configuration (structured type)

- A custom configuration for the environment.

publict_conversions (structured type)

- Document conversion settings.

publict_create_collection_request (structured type)

- Object containing specification for a new collection.

publict_create_environment_request (structured type)

- Object containing information about a new environment.

publict_create_event_object (structured type)

- An object defining the event being created.

publict_create_event_response (structured type)

- An object defining the event being created.

publict_credentials (structured type)

- Object containing credential information.

publict_credentials_list (structured type)

- Object containing array of credential definitions.

publict_credential_details (structured type)

- Object containing details of the stored credentials.


-
- Obtain credentials for your source from the administrator of the source.
publict_delete_collection_response (structured type)

- Response object returned when deleting a colleciton.

publict_delete_credentials (structured type)

- Object returned after credentials are deleted.

publict_delete_document_response (structured type)

- Information returned when a document is deleted.

publict_delete_environment_response (structured type)

- Response object returned when deleting an environment.

publict_del_configuration_response (structured type)

- Information returned when a configuration is deleted.

publict_disk_usage (structured type)

- Summary of the disk usage statistics for the environment.

publict_document_accepted (structured type)

- Information returned after an uploaded document is accepted.

publict_document_counts (structured type)

- Object containing collection document count information.

publict_document_status (structured type)

- Status information about a submitted document.

publict_elements_enrichment_options (structured type)

- An object representing the configuration options to use for

- the `elements` enrichment.
publict_enrichment (structured type)

- 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.
publict_enrichments TYPE STANDARD TABLE OF T_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY

- An array of document enrichment settings for the

- configuration.
publict_enrichment_options (structured type)

- Options which are specific to a particular enrichment.

publict_environment (structured type)

- Details about an environment.

publict_environment_documents (structured type)

- Summary of the document usage statistics for the

- environment.
publict_error_response (structured type)

- An error response object.

publict_event_data (structured type)

- Query event data object.

publict_expansion (structured type)

- An expansion definition. Each object respresents one set of

- expandable strings. For example, you could have expansions for the word `hot` - in one object, and expansions for the word `cold` in another.
publict_expansions (structured type)

- The query expansion definitions for the specified

- collection.
publict_fed_query_large (structured type)

- Object that describes a long query.

publict_field (structured type)

- Object containing field details.

publict_filter (structured type) No documentation available.
publict_font_setting (structured type)

- Font matching configuration.

publict_font_settings TYPE STANDARD TABLE OF T_FONT_SETTING WITH NON-UNIQUE DEFAULT KEY

- Array of font matching configurations.

publict_gateway (structured type)

- Object describing a specific gateway.

publict_gateway_delete (structured type)

- Gatway deletion confirmation.

publict_gateway_list (structured type)

- Object containing gateways array.

publict_gateway_name (structured type)

- Object containing user-defined name.

publict_histogram (structured type) No documentation available.
publict_html_settings (structured type)

- A list of HTML conversion settings.

publict_index_capacity (structured type)

- Details about the resource usage and capacity of the

- environment.
publict_inline_object (structured type) No documentation available.
publict_list_collections_response (structured type)

- Response object containing an array of collection details.

publict_list_configurations_response (structured type)

- Object containing an array of available configurations.

publict_list_environments_response (structured type)

- Response object containing an array of configured

- environments.
publict_log_qry_resp_rslt_docs_rslt (structured type)

- Each object in the **results** array corresponds to an

- individual document returned by the original query.
publict_log_query_response (structured type)

- Object containing results that match the requested **logs**

- query.
publict_log_query_response_result (structured type)

- Individual result object for a **logs** query. Each object

- represents either a query to a Discovery collection or an event that is - associated with a query.
publict_log_query_resp_result_docs (structured type)

- Object containing result information that was returned by

- the query used to create this log entry. Only returned with logs of type - `query`.
publict_lst_collection_fields_resp (structured type)

- The list of fetched fields.


-
- The fields are returned using a fully qualified name format, however, the format - differs slightly from that used by the query operations.
-
- * Fields which contain nested JSON objects are assigned a type of - "nested".
-
- * Fields which belong to a nested object are prefixed with `.properties` (for - example, `warnings.properties.severity` means that the `warnings` object has a - property called `severity`).
-
- * Fields returned from the News collection are prefixed with - `v{N}-fullnews-t3-{YEAR}.mappings` (for example, - `v5-fullnews-t3-2016.mappings.text.properties.author`).
publict_metric_aggregation (structured type)

- An aggregation analyzing log information for queries and

- events.
publict_metric_aggregation_result (structured type)

- Aggregation result data for the requested metric.

publict_metric_response (structured type)

- The response generated from a call to a **metrics** method.

publict_metric_token_aggregation (structured type)

- An aggregation analyzing log information for queries and

- events.
publict_metric_token_aggr_result (structured type)

- Aggregation result data for the requested metric.

publict_metric_token_response (structured type)

- The response generated from a call to a **metrics** method

- that evaluates tokens.
publict_nested (structured type) No documentation available.
publict_new_training_query (structured type)

- Training query to add.

publict_nlu_enrichment_categories type MAP

- An object that indicates the Categories enrichment will be

- applied to the specified field.
publict_nlu_enrichment_concepts (structured type)

- An object specifiying the concepts enrichment and related

- parameters.
publict_nlu_enrichment_emotion (structured type)

- An object specifying the emotion detection enrichment and

- related parameters.
publict_nlu_enrichment_entities (structured type)

- An object speficying the Entities enrichment and related

- parameters.
publict_nlu_enrichment_features (structured type)

- Object containing Natural Language Understanding features to

- be used.
publict_nlu_enrichment_keywords (structured type)

- An object specifying the Keyword enrichment and related

- parameters.
publict_nlu_enrichment_options (structured type)

- An object representing the configuration options to use for

- the `natural_language_understanding` enrichments.
publict_nlu_enrichment_relations (structured type)

- An object specifying the relations enrichment and related

- parameters.
publict_nlu_enrichment_sentiment (structured type)

- An object specifying the sentiment extraction enrichment and

- related parameters.
publict_nl_enrichment_semantic_roles (structured type)

- An object specifiying the semantic roles enrichment and

- related parameters.
publict_normalizations TYPE STANDARD TABLE OF T_NORMALIZATION_OPERATION WITH NON-UNIQUE DEFAULT KEY

- Defines operations that can be used to transform the final

- output JSON into a normalized form. Operations are executed in the order that - they appear in the array.
publict_normalization_operation (structured type)

- Object containing normalization operations.

publict_notice (structured type)

- A notice produced for the collection.

publict_pdf_heading_detection (structured type)

- Object containing heading detection conversion settings for

- PDF documents.
publict_pdf_settings (structured type)

- A list of PDF conversion settings.

publict_query_aggregation (structured type)

- An aggregation produced by Discovery to analyze the input

- provided.
publict_query_large (structured type)

- Object that describes a long query.

publict_query_notices_response (structured type)

- Object containing notice query results.

publict_query_notices_result (structured type)

- Query result object.

publict_query_passages (structured type)

- A passage query result.

publict_query_response (structured type)

- A response containing the documents and aggregations for the

- query.
publict_query_result (structured type)

- Query result object.

publict_query_result_metadata (structured type)

- Metadata of a query result.

publict_retrieval_details (structured type)

- An object contain retrieval type information.

publict_sdu_status (structured type)

- Object containing smart document understanding information

- for this collection.
publict_sdu_status_custom_fields (structured type)

- Information about custom smart document understanding fields

- that exist in this collection.
publict_search_status (structured type)

- Information about the Continuous Relevancy Training for this

- environment.
publict_segment_settings (structured type)

- A list of Document Segmentation settings.

publict_source (structured type)

- Object containing source parameters for the configuration.

publict_source_options (structured type)

- The **options** object defines which items to crawl from the

- source system.
publict_source_options_buckets (structured type)

- Object defining a cloud object store bucket to crawl.

publict_source_options_folder (structured type)

- Object that defines a box folder to crawl with this

- configuration.
publict_source_options_object (structured type)

- Object that defines a Salesforce document object type crawl

- with this configuration.
publict_source_options_site_coll (structured type)

- Object that defines a Microsoft SharePoint site collection

- to crawl with this configuration.
publict_source_options_web_crawl (structured type)

- Object defining which URL to crawl and how to crawl it.

publict_source_schedule (structured type)

- Object containing the schedule information for the source.

publict_source_status (structured type)

- Object containing source crawl status information.

publict_term (structured type) No documentation available.
publict_timeslice (structured type) No documentation available.
publict_token_dict (structured type)

- Tokenization dictionary describing how words are tokenized

- during ingestion and at query time.
publict_token_dict_rule (structured type)

- An object defining a single tokenizaion rule.

publict_token_dict_status_response (structured type)

- Object describing the current status of the wordlist.

publict_top_hits (structured type) No documentation available.
publict_top_hits_results (structured type)

- Top hit information for this query.

publict_training_data_set (structured type)

- Training information for a specific collection.

publict_training_example (structured type)

- Training example details.

publict_training_example_list (structured type)

- Object containing an array of training examples.

publict_training_example_patch (structured type)

- Training example to add.

publict_training_query (structured type)

- Training query details.

publict_training_status (structured type)

- Training status details.

publict_update_collection_request (structured type)

- Object containing collection update information.

publict_update_environment_request (structured type)

- Object containing environment update information.

publict_word_heading_detection (structured type)

- Object containing heading detection conversion settings for

- Microsoft Word documents.
publict_word_settings (structured type)

- A list of Word conversion settings.

publict_word_style (structured type)

- Microsoft Word styles to convert into a specified HTML head

- level.
publict_word_styles TYPE STANDARD TABLE OF T_WORD_STYLE WITH NON-UNIQUE DEFAULT KEY

- Array of Microsoft Word styles to convert.

publict_xpath_patterns (structured type)

- Object containing an array of XPaths.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_document
importingi_environment_idtype STRING
i_collection_idtype STRING
i_filetype FILE optional
i_filenametype STRING optional
i_file_content_typetype STRING optional
i_metadatatype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DOCUMENT_ACCEPTED
raisingzcx_ibmc_service_exception

Add a document

- Add a document to a collection with optional metadata.
-
- * The **version** query parameter is still required.
-
- * Returns immediately after the system has accepted the document for - processing.
-
- * The user must provide document content, metadata, or both. If the request is - missing both document content and metadata, it is rejected.
-
- * The user can set the **Content-Type** parameter on the **file** part to - indicate the media type of the document. If the **Content-Type** parameter is - missing or is one of the generic media types (for example, - `application/octet-stream`), then the service attempts to automatically detect - the document's media type.
-
- * The following field names are reserved and will be filtered out if present - after normalization: `id`, `score`, `highlight`, and any field with the prefix - of: `_`, `+`, or `-`
-
- * Fields with empty name values after normalization are filtered out before - indexing.
-
- * Fields containing the following characters after normalization are filtered - out before indexing: `#` and `,`
-
- **Note:** Documents can be added with a specific **document_id** by using the - **/v1/environments/{environment_id}/collections/{collection_id&# - 125;/documents** method. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_file - The content of the document to ingest. The maximum supported file size when - adding a file to a collection is 50 megabytes, the maximum supported file size - when testing a configuration is 1 megabyte. Files larger than the supported - size are rejected. -
i_filename - The filename for file. -
i_file_content_type - The content type of file. -
i_metadata - The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 - MB are rejected. Example: ``` {
- "Creator": "Johnny Appleseed",
- "Subject": "Apples"
- } ```. -
e_response - Service return value of type T_DOCUMENT_ACCEPTED -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_training_data
importingi_environment_idtype STRING
i_collection_idtype STRING
i_bodytype T_NEW_TRAINING_QUERY
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_QUERY
raisingzcx_ibmc_service_exception

Add query to training data

- Adds a query to the training data for this collection. The query can contain a - filter and natural language query. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_body - The body of the training data query that is to be added to the collection's - training data. -
e_response - Service return value of type T_TRAINING_QUERY -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_collection
importingi_environment_idtype STRING
i_bodytype T_CREATE_COLLECTION_REQUEST
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Create a collection

- -
Parameters
i_environment_id - The ID of the environment. -
i_body - Input an object that allows you to add a collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_configuration
importingi_environment_idtype STRING
i_configurationtype T_CONFIGURATION
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CONFIGURATION
raisingzcx_ibmc_service_exception

Add configuration

- Creates a new configuration.
-
- If the input configuration contains the **configuration_id**, **created**, or - **updated** properties, then they are ignored and overridden by the system, and - an error is not returned so that the overridden fields do not need to be - removed when copying a configuration.
-
- The configuration can contain unrecognized JSON fields. Any such fields are - ignored and do not generate an error. This makes it easier to use newer - configuration files with older versions of the API and the service. It also - makes it possible for the tooling to add additional metadata and information to - the configuration. - -
Parameters
i_environment_id - The ID of the environment. -
i_configuration - Input an object that enables you to customize how your content is ingested and - what enrichments are added to your data.
-
- **name** is required and must be unique within the current **environment**. All - other properties are optional.
-
- If the input configuration contains the **configuration_id**, **created**, or - **updated** properties, then they will be ignored and overridden by the system - (an error is not returned so that the overridden fields do not need to be - removed when copying a configuration).
-
- The configuration can contain unrecognized JSON fields. Any such fields will be - ignored and will not generate an error. This makes it easier to use newer - configuration files with older versions of the API and the service. It also - makes it possible for the tooling to add additional metadata and information to - the configuration. -
e_response - Service return value of type T_CONFIGURATION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_credentials
importingi_environment_idtype STRING
i_credentials_parametertype T_CREDENTIALS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CREDENTIALS
raisingzcx_ibmc_service_exception

Create credentials

- Creates a set of credentials to connect to a remote source. Created credentials - are used in a configuration to associate a collection with the remote - source.
-
- **Note:** All credentials are sent over an encrypted connection and encrypted at - rest. - -
Parameters
i_environment_id - The ID of the environment. -
i_credentials_parameter - An object that defines an individual set of source credentials. -
e_response - Service return value of type T_CREDENTIALS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_environment
importingi_bodytype T_CREATE_ENVIRONMENT_REQUEST
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENVIRONMENT
raisingzcx_ibmc_service_exception

Create an environment

- Creates a new environment for private data. An environment must be created - before collections can be created.
-
- **Note**: You can create only one environment for private data per service - instance. An attempt to create another environment results in an error. - -
Parameters
i_body - An object that defines an environment name and optional description. The fields - in this object are not approved for personal information and cannot be deleted - based on customer ID. -
e_response - Service return value of type T_ENVIRONMENT -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_event
importingi_query_eventtype T_CREATE_EVENT_OBJECT
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CREATE_EVENT_RESPONSE
raisingzcx_ibmc_service_exception

Create event

- The **Events** API can be used to create log entries that are associated with - specific queries. For example, you can record which documents in the results - set were "clicked" by a user and when that click occurred. - -
Parameters
i_query_event - An object that defines a query event to be added to the log. -
e_response - Service return value of type T_CREATE_EVENT_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_expansions
importingi_environment_idtype STRING
i_collection_idtype STRING
i_bodytype T_EXPANSIONS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_EXPANSIONS
raisingzcx_ibmc_service_exception

Create or update expansion list

- Create or replace the Expansion list for this collection. The maximum number of - expanded terms per collection is `500`.
- The current expansion list is replaced with the uploaded content. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_body - An object that defines the expansion list. -
e_response - Service return value of type T_EXPANSIONS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_gateway
importingi_environment_idtype STRING
i_gateway_nametype T_GATEWAY_NAME optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GATEWAY
raisingzcx_ibmc_service_exception

Create Gateway

- Create a gateway configuration to use with a remotely installed gateway. - -
Parameters
i_environment_id - The ID of the environment. -
i_gateway_name - The name of the gateway to created. -
e_response - Service return value of type T_GATEWAY -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_stopword_list
importingi_environment_idtype STRING
i_collection_idtype STRING
i_stopword_filetype FILE
i_stopword_filenametype STRING
i_stopword_file_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TOKEN_DICT_STATUS_RESPONSE
raisingzcx_ibmc_service_exception

Create stopword list

- Upload a custom stopword list to use with the specified collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_stopword_file - The content of the stopword list to ingest. -
i_stopword_filename - The filename for stopwordFile. -
e_response - Service return value of type T_TOKEN_DICT_STATUS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_tokenization_dictionary
importingi_environment_idtype STRING
i_collection_idtype STRING
i_tokenization_dictionarytype T_TOKEN_DICT optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TOKEN_DICT_STATUS_RESPONSE
raisingzcx_ibmc_service_exception

Create tokenization dictionary

- Upload a custom tokenization dictionary to use with the specified collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_tokenization_dictionary - An object that represents the tokenization dictionary to be uploaded. -
e_response - Service return value of type T_TOKEN_DICT_STATUS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_training_example
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
i_bodytype T_TRAINING_EXAMPLE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_EXAMPLE
raisingzcx_ibmc_service_exception

Add example to training data query

- Adds a example to this training data query. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
i_body - The body of the example that is to be added to the specified query. -
e_response - Service return value of type T_TRAINING_EXAMPLE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_all_training_data
importingi_environment_idtype STRING
i_collection_idtype STRING
raisingzcx_ibmc_service_exception

Delete all training data

- Deletes all training data from a collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_collection
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DELETE_COLLECTION_RESPONSE
raisingzcx_ibmc_service_exception

Delete a collection

- -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_DELETE_COLLECTION_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_configuration
importingi_environment_idtype STRING
i_configuration_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DEL_CONFIGURATION_RESPONSE
raisingzcx_ibmc_service_exception

Delete a configuration

- The deletion is performed unconditionally. A configuration deletion request - succeeds even if the configuration is referenced by a collection or document - ingestion. However, documents that have already been submitted for processing - continue to use the deleted configuration. Documents are always processed with - a snapshot of the configuration as it existed at the time the document was - submitted. - -
Parameters
i_environment_id - The ID of the environment. -
i_configuration_id - The ID of the configuration. -
e_response - Service return value of type T_DEL_CONFIGURATION_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_credentials
importingi_environment_idtype STRING
i_credential_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DELETE_CREDENTIALS
raisingzcx_ibmc_service_exception

Delete credentials

- Deletes a set of stored credentials from your Discovery instance. - -
Parameters
i_environment_id - The ID of the environment. -
i_credential_id - The unique identifier for a set of source credentials. -
e_response - Service return value of type T_DELETE_CREDENTIALS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_document
importingi_environment_idtype STRING
i_collection_idtype STRING
i_document_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DELETE_DOCUMENT_RESPONSE
raisingzcx_ibmc_service_exception

Delete a document

- If the given document ID is invalid, or if the document is not found, then the a - success response is returned (HTTP status code `200`) with the status set to - 'deleted'. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_document_id - The ID of the document. -
e_response - Service return value of type T_DELETE_DOCUMENT_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_environment
importingi_environment_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DELETE_ENVIRONMENT_RESPONSE
raisingzcx_ibmc_service_exception

Delete environment

- -
Parameters
i_environment_id - The ID of the environment. -
e_response - Service return value of type T_DELETE_ENVIRONMENT_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_expansions
importingi_environment_idtype STRING
i_collection_idtype STRING
raisingzcx_ibmc_service_exception

Delete the expansion list

- Remove the expansion information for this collection. The expansion list must be - deleted to disable query expansion for a collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_gateway
importingi_environment_idtype STRING
i_gateway_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GATEWAY_DELETE
raisingzcx_ibmc_service_exception

Delete Gateway

- Delete the specified gateway configuration. - -
Parameters
i_environment_id - The ID of the environment. -
i_gateway_id - The requested gateway ID. -
e_response - Service return value of type T_GATEWAY_DELETE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_stopword_list
importingi_environment_idtype STRING
i_collection_idtype STRING
raisingzcx_ibmc_service_exception

Delete a custom stopword list

- Delete a custom stopword list from the collection. After a custom stopword list - is deleted, the default list is used for the collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_tokenization_dictionary
importingi_environment_idtype STRING
i_collection_idtype STRING
raisingzcx_ibmc_service_exception

Delete tokenization dictionary

- Delete the tokenization dictionary from the collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_training_data
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
raisingzcx_ibmc_service_exception

Delete a training data query

- Removes the training data query and all associated examples from the training - data set. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_training_example
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
i_example_idtype STRING
raisingzcx_ibmc_service_exception

Delete example for training data query

- Deletes the example document with the given ID from the training data query. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
i_example_id - The ID of the document as it is indexed. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
raisingzcx_ibmc_service_exception

Delete labeled data

- Deletes all data associated with a specified customer ID. The method has no - effect if no data is associated with the customer ID.
-
- You associate a customer ID with data by passing the **X-Watson-Metadata** - header with a request that passes data. For more information about personal - data and customer IDs, see [Information - security](https://cloud.ibm.com/docs/discovery?topic=discovery-information-secu - rity#information-security). - -
Parameters
i_customer_id - The customer ID for which all data is to be deleted. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
federated_query
importingi_environment_idtype STRING
i_query_longtype T_FED_QUERY_LARGE
i_x_watson_logging_opt_outtype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_QUERY_RESPONSE
raisingzcx_ibmc_service_exception

Query multiple collections

- By using this method, you can construct long queries that search multiple - collection. For details, see the [Discovery - documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - pts#query-concepts). - -
Parameters
i_environment_id - The ID of the environment. -
i_query_long - No documentation available. -
i_x_watson_logging_opt_out - If `true`, queries are not stored in the Discovery **Logs** endpoint. -
e_response - Service return value of type T_QUERY_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
federated_query_notices
importingi_environment_idtype STRING
i_collection_idstype TT_STRING
i_filtertype STRING optional
i_querytype STRING optional
i_natural_language_querytype STRING optional
i_aggregationtype STRING optional
i_counttype INTEGER optional
i_returntype TT_STRING optional
i_offsettype INTEGER optional
i_sorttype TT_STRING optional
i_highlighttype BOOLEAN default C_BOOLEAN_FALSE
i_deduplicate_fieldtype STRING optional
i_similartype BOOLEAN default C_BOOLEAN_FALSE
i_similar_document_idstype TT_STRING optional
i_similar_fieldstype TT_STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_QUERY_NOTICES_RESPONSE
raisingzcx_ibmc_service_exception

Query multiple collection system notices

- Queries for notices (errors or warnings) that might have been generated by the - system. Notices are generated when ingesting documents and performing relevance - training. See the [Discovery - documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - pts#query-concepts) for more details on the query language. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_ids - A comma-separated list of collection IDs to be queried against. -
i_filter - A cacheable query that excludes documents that don't mention the query - content. Filter searches are better for metadata-type searches and for - assessing the concepts in the data set. -
i_query - A query search returns all documents in your data set with full enrichments and - full text, but with the most relevant documents listed first. -
i_natural_language_query - A natural language query that returns relevant documents by utilizing training - data and natural language understanding. -
i_aggregation - An aggregation search that returns an exact answer by combining query search - with filters. Useful for applications to build lists, tables, and time series. - For a full list of possible aggregations, see the Query reference. -
i_count - Number of results to return. The maximum for the **count** and **offset** values - together in any one query is **10000**. -
i_return - A comma-separated list of the portion of the document hierarchy to return. -
i_offset - The number of query results to skip at the beginning. For example, if the total - number of results that are returned is 10 and the offset is 8, it returns the - last two results. The maximum for the **count** and **offset** values together - in any one query is **10000**. -
i_sort - A comma-separated list of fields in the document to sort on. You can optionally - specify a sort direction by prefixing the field with `-` for descending or `+` - for ascending. Ascending is the default sort direction if no prefix is - specified. -
i_highlight - When true, a highlight field is returned for each result which contains the - fields which match the query with `<em></em>` tags around the - matching query terms. -
i_deduplicate_field - When specified, duplicate results based on the field specified are removed from - the returned results. Duplicate comparison is limited to the current query - only, **offset** is not considered. This parameter is currently Beta - functionality. -
i_similar - When `true`, results are returned based on their similarity to the document IDs - specified in the **similar.document_ids** parameter. -
i_similar_document_ids - A comma-separated list of document IDs to find similar documents.
-
- **Tip:** Include the **natural_language_query** parameter to expand the scope of - the document similarity search with the natural language query. Other query - parameters, such as **filter** and **query**, are subsequently applied and - reduce the scope. -
i_similar_fields - A comma-separated list of field names that are used as a basis for comparison to - identify similar documents. If not specified, the entire document is used for - comparison. -
e_response - Service return value of type T_QUERY_NOTICES_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition 
public instance
get_autocompletion
importingi_environment_idtype STRING
i_collection_idtype STRING
i_prefixtype STRING
i_fieldtype STRING optional
i_counttype INTEGER optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COMPLETIONS
raisingzcx_ibmc_service_exception

Get Autocomplete Suggestions

- Returns completion query suggestions for the specified prefix. /n/n - **Important:** this method is only valid when using the Cloud Pak version of - Discovery. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_prefix - The prefix to use for autocompletion. For example, the prefix `Ho` could - autocomplete to `Hot`, `Housing`, or `How do I upgrade`. Possible completions - are. -
i_field - The field in the result documents that autocompletion suggestions are identified - from. -
i_count - The number of autocompletion suggestions to return. -
e_response - Service return value of type T_COMPLETIONS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_collection
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Get collection details

- -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_configuration
importingi_environment_idtype STRING
i_configuration_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CONFIGURATION
raisingzcx_ibmc_service_exception

Get configuration details

- -
Parameters
i_environment_id - The ID of the environment. -
i_configuration_id - The ID of the configuration. -
e_response - Service return value of type T_CONFIGURATION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_credentials
importingi_environment_idtype STRING
i_credential_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CREDENTIALS
raisingzcx_ibmc_service_exception

View Credentials

- Returns details about the specified credentials.
-
- **Note:** Secure credential information such as a password or SSH key is never - returned and must be obtained from the source system. - -
Parameters
i_environment_id - The ID of the environment. -
i_credential_id - The unique identifier for a set of source credentials. -
e_response - Service return value of type T_CREDENTIALS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_document_status
importingi_environment_idtype STRING
i_collection_idtype STRING
i_document_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DOCUMENT_STATUS
raisingzcx_ibmc_service_exception

Get document details

- Fetch status details about a submitted document. **Note:** this operation does - not return the document itself. Instead, it returns only the document's - processing status and any notices (warnings or errors) that were generated when - the document was ingested. Use the query API to retrieve the actual document - content. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_document_id - The ID of the document. -
e_response - Service return value of type T_DOCUMENT_STATUS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_environment
importingi_environment_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENVIRONMENT
raisingzcx_ibmc_service_exception

Get environment info

- -
Parameters
i_environment_id - The ID of the environment. -
e_response - Service return value of type T_ENVIRONMENT -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_gateway
importingi_environment_idtype STRING
i_gateway_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GATEWAY
raisingzcx_ibmc_service_exception

List Gateway Details

- List information about the specified gateway. - -
Parameters
i_environment_id - The ID of the environment. -
i_gateway_id - The requested gateway ID. -
e_response - Service return value of type T_GATEWAY -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_metrics_event_rate
importingi_start_timetype DATETIME optional
i_end_timetype DATETIME optional
i_result_typetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_METRIC_RESPONSE
raisingzcx_ibmc_service_exception

Percentage of queries with an associated event

- The percentage of queries using the **natural_language_query** parameter that - have a corresponding "click" event over a specified time window. - This metric requires having integrated event tracking in your application using - the **Events** API. - -
Parameters
i_start_time - Metric is computed from data recorded after this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_end_time - Metric is computed from data recorded before this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_result_type - The type of result to consider when calculating the metric. -
e_response - Service return value of type T_METRIC_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_metrics_query
importingi_start_timetype DATETIME optional
i_end_timetype DATETIME optional
i_result_typetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_METRIC_RESPONSE
raisingzcx_ibmc_service_exception

Number of queries over time

- Total number of queries using the **natural_language_query** parameter over a - specific time window. - -
Parameters
i_start_time - Metric is computed from data recorded after this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_end_time - Metric is computed from data recorded before this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_result_type - The type of result to consider when calculating the metric. -
e_response - Service return value of type T_METRIC_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_metrics_query_event
importingi_start_timetype DATETIME optional
i_end_timetype DATETIME optional
i_result_typetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_METRIC_RESPONSE
raisingzcx_ibmc_service_exception

Number of queries with an event over time

- Total number of queries using the **natural_language_query** parameter that have - a corresponding "click" event over a specified time window. This - metric requires having integrated event tracking in your application using the - **Events** API. - -
Parameters
i_start_time - Metric is computed from data recorded after this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_end_time - Metric is computed from data recorded before this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_result_type - The type of result to consider when calculating the metric. -
e_response - Service return value of type T_METRIC_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_metrics_query_no_results
importingi_start_timetype DATETIME optional
i_end_timetype DATETIME optional
i_result_typetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_METRIC_RESPONSE
raisingzcx_ibmc_service_exception

Number of queries with no search results over time

- Total number of queries using the **natural_language_query** parameter that have - no results returned over a specified time window. - -
Parameters
i_start_time - Metric is computed from data recorded after this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_end_time - Metric is computed from data recorded before this timestamp; must be in - `YYYY-MM-DDThh:mm:ssZ` format. -
i_result_type - The type of result to consider when calculating the metric. -
e_response - Service return value of type T_METRIC_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_metrics_query_token_event
importingi_counttype INTEGER optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_METRIC_TOKEN_RESPONSE
raisingzcx_ibmc_service_exception

Most frequent query tokens with an event

- The most frequent query tokens parsed from the **natural_language_query** - parameter and their corresponding "click" event rate within the - recording period (queries and events are stored for 30 days). A query token is - an individual word or unigram within the query string. - -
Parameters
i_count - Number of results to return. The maximum for the **count** and **offset** values - together in any one query is **10000**. -
e_response - Service return value of type T_METRIC_TOKEN_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
get_stopword_list_status
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TOKEN_DICT_STATUS_RESPONSE
raisingzcx_ibmc_service_exception

Get stopword list status

- Returns the current status of the stopword list for the specified collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_TOKEN_DICT_STATUS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_tokenization_dict_status
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TOKEN_DICT_STATUS_RESPONSE
raisingzcx_ibmc_service_exception

Get tokenization dictionary status

- Returns the current status of the tokenization dictionary for the specified - collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_TOKEN_DICT_STATUS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_training_data
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_QUERY
raisingzcx_ibmc_service_exception

Get details about a query

- Gets details for a specific training data query, including the query string and - all examples. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
e_response - Service return value of type T_TRAINING_QUERY -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_training_example
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
i_example_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_EXAMPLE
raisingzcx_ibmc_service_exception

Get details for training data example

- Gets the details for this training example. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
i_example_id - The ID of the document as it is indexed. -
e_response - Service return value of type T_TRAINING_EXAMPLE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_collections
importingi_environment_idtype STRING
i_nametype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LIST_COLLECTIONS_RESPONSE
raisingzcx_ibmc_service_exception

List collections

- Lists existing collections for the service instance. - -
Parameters
i_environment_id - The ID of the environment. -
i_name - Find collections with the given name. -
e_response - Service return value of type T_LIST_COLLECTIONS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_collection_fields
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LST_COLLECTION_FIELDS_RESP
raisingzcx_ibmc_service_exception

List collection fields

- Gets a list of the unique fields (and their types) stored in the index. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_LST_COLLECTION_FIELDS_RESP -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_configurations
importingi_environment_idtype STRING
i_nametype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LIST_CONFIGURATIONS_RESPONSE
raisingzcx_ibmc_service_exception

List configurations

- Lists existing configurations for the service instance. - -
Parameters
i_environment_id - The ID of the environment. -
i_name - Find configurations with the given name. -
e_response - Service return value of type T_LIST_CONFIGURATIONS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_credentials
importingi_environment_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CREDENTIALS_LIST
raisingzcx_ibmc_service_exception

List credentials

- List all the source credentials that have been created for this service - instance.
-
- **Note:** All credentials are sent over an encrypted connection and encrypted - at rest. - -
Parameters
i_environment_id - The ID of the environment. -
e_response - Service return value of type T_CREDENTIALS_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_environments
importingi_nametype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LIST_ENVIRONMENTS_RESPONSE
raisingzcx_ibmc_service_exception

List environments

- List existing environments for the service instance. - -
Parameters
i_name - Show only the environment with the given name. -
e_response - Service return value of type T_LIST_ENVIRONMENTS_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_expansions
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_EXPANSIONS
raisingzcx_ibmc_service_exception

Get the expansion list

- Returns the current expansion list for the specified collection. If an expansion - list is not specified, an object with empty expansion arrays is returned. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_EXPANSIONS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_fields
importingi_environment_idtype STRING
i_collection_idstype TT_STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LST_COLLECTION_FIELDS_RESP
raisingzcx_ibmc_service_exception

List fields across collections

- Gets a list of the unique fields (and their types) stored in the indexes of the - specified collections. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_ids - A comma-separated list of collection IDs to be queried against. -
e_response - Service return value of type T_LST_COLLECTION_FIELDS_RESP -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_gateways
importingi_environment_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GATEWAY_LIST
raisingzcx_ibmc_service_exception

List Gateways

- List the currently configured gateways. - -
Parameters
i_environment_id - The ID of the environment. -
e_response - Service return value of type T_GATEWAY_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_training_data
importingi_environment_idtype STRING
i_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_DATA_SET
raisingzcx_ibmc_service_exception

List training data

- Lists the training data for the specified collection. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
e_response - Service return value of type T_TRAINING_DATA_SET -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_training_examples
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_EXAMPLE_LIST
raisingzcx_ibmc_service_exception

List examples for a training data query

- List all examples for this training data query. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
e_response - Service return value of type T_TRAINING_EXAMPLE_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
query
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_longtype T_COLL_QUERY_LARGE optional
i_x_watson_logging_opt_outtype BOOLEAN default C_BOOLEAN_FALSE
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_QUERY_RESPONSE
raisingzcx_ibmc_service_exception

Query a collection

- By using this method, you can construct long queries. For details, see the - [Discovery - documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - pts#query-concepts). - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_long - An object that represents the query to be submitted. -
i_x_watson_logging_opt_out - If `true`, queries are not stored in the Discovery **Logs** endpoint. -
e_response - Service return value of type T_QUERY_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
query_log
importingi_filtertype STRING optional
i_querytype STRING optional
i_counttype INTEGER optional
i_offsettype INTEGER optional
i_sorttype TT_STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LOG_QUERY_RESPONSE
raisingzcx_ibmc_service_exception

Search the query and event log

- Searches the query and event log to find query sessions that match the specified - criteria. Searching the **logs** endpoint uses the standard Discovery query - syntax for the parameters that are supported. - -
Parameters
i_filter - A cacheable query that excludes documents that don't mention the query - content. Filter searches are better for metadata-type searches and for - assessing the concepts in the data set. -
i_query - A query search returns all documents in your data set with full enrichments and - full text, but with the most relevant documents listed first. -
i_count - Number of results to return. The maximum for the **count** and **offset** values - together in any one query is **10000**. -
i_offset - The number of query results to skip at the beginning. For example, if the total - number of results that are returned is 10 and the offset is 8, it returns the - last two results. The maximum for the **count** and **offset** values together - in any one query is **10000**. -
i_sort - A comma-separated list of fields in the document to sort on. You can optionally - specify a sort direction by prefixing the field with `-` for descending or `+` - for ascending. Ascending is the default sort direction if no prefix is - specified. -
e_response - Service return value of type T_LOG_QUERY_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
query_notices
importingi_environment_idtype STRING
i_collection_idtype STRING
i_filtertype STRING optional
i_querytype STRING optional
i_natural_language_querytype STRING optional
i_passagestype BOOLEAN optional
i_aggregationtype STRING optional
i_counttype INTEGER optional
i_returntype TT_STRING optional
i_offsettype INTEGER optional
i_sorttype TT_STRING optional
i_highlighttype BOOLEAN default C_BOOLEAN_FALSE
i_passages_fieldstype TT_STRING optional
i_passages_counttype INTEGER optional
i_passages_characterstype INTEGER optional
i_deduplicate_fieldtype STRING optional
i_similartype BOOLEAN default C_BOOLEAN_FALSE
i_similar_document_idstype TT_STRING optional
i_similar_fieldstype TT_STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_QUERY_NOTICES_RESPONSE
raisingzcx_ibmc_service_exception

Query system notices

- Queries for notices (errors or warnings) that might have been generated by the - system. Notices are generated when ingesting documents and performing relevance - training. See the [Discovery - documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - pts#query-concepts) for more details on the query language. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_filter - A cacheable query that excludes documents that don't mention the query - content. Filter searches are better for metadata-type searches and for - assessing the concepts in the data set. -
i_query - A query search returns all documents in your data set with full enrichments and - full text, but with the most relevant documents listed first. -
i_natural_language_query - A natural language query that returns relevant documents by utilizing training - data and natural language understanding. -
i_passages - A passages query that returns the most relevant passages from the results. -
i_aggregation - An aggregation search that returns an exact answer by combining query search - with filters. Useful for applications to build lists, tables, and time series. - For a full list of possible aggregations, see the Query reference. -
i_count - Number of results to return. The maximum for the **count** and **offset** values - together in any one query is **10000**. -
i_return - A comma-separated list of the portion of the document hierarchy to return. -
i_offset - The number of query results to skip at the beginning. For example, if the total - number of results that are returned is 10 and the offset is 8, it returns the - last two results. The maximum for the **count** and **offset** values together - in any one query is **10000**. -
i_sort - A comma-separated list of fields in the document to sort on. You can optionally - specify a sort direction by prefixing the field with `-` for descending or `+` - for ascending. Ascending is the default sort direction if no prefix is - specified. -
i_highlight - When true, a highlight field is returned for each result which contains the - fields which match the query with `<em></em>` tags around the - matching query terms. -
i_passages_fields - A comma-separated list of fields that passages are drawn from. If this parameter - not specified, then all top-level fields are included. -
i_passages_count - The maximum number of passages to return. The search returns fewer passages if - the requested total is not found. -
i_passages_characters - The approximate number of characters that any one passage will have. -
i_deduplicate_field - When specified, duplicate results based on the field specified are removed from - the returned results. Duplicate comparison is limited to the current query - only, **offset** is not considered. This parameter is currently Beta - functionality. -
i_similar - When `true`, results are returned based on their similarity to the document IDs - specified in the **similar.document_ids** parameter. -
i_similar_document_ids - A comma-separated list of document IDs to find similar documents.
-
- **Tip:** Include the **natural_language_query** parameter to expand the scope of - the document similarity search with the natural language query. Other query - parameters, such as **filter** and **query**, are subsequently applied and - reduce the scope. -
i_similar_fields - A comma-separated list of field names that are used as a basis for comparison to - identify similar documents. If not specified, the entire document is used for - comparison. -
e_response - Service return value of type T_QUERY_NOTICES_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_collection
importingi_environment_idtype STRING
i_collection_idtype STRING
i_bodytype T_UPDATE_COLLECTION_REQUEST
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Update a collection

- -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_body - Input an object that allows you to update a collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_configuration
importingi_environment_idtype STRING
i_configuration_idtype STRING
i_configurationtype T_CONFIGURATION
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CONFIGURATION
raisingzcx_ibmc_service_exception

Update a configuration

- Replaces an existing configuration.
- * Completely replaces the original configuration.
- * The **configuration_id**, **updated**, and **created** fields are accepted - in the request, but they are ignored, and an error is not generated. It is also - acceptable for users to submit an updated configuration with none of the three - properties.
- * Documents are processed with a snapshot of the configuration as it was at - the time the document was submitted to be ingested. This means that already - submitted documents will not see any updates made to the configuration. - -
Parameters
i_environment_id - The ID of the environment. -
i_configuration_id - The ID of the configuration. -
i_configuration - Input an object that enables you to update and customize how your data is - ingested and what enrichments are added to your data. The **name** parameter - is required and must be unique within the current **environment**. All other - properties are optional, but if they are omitted the default values replace - the current value of each omitted property.
-
- If the input configuration contains the **configuration_id**, **created**, or - **updated** properties, they are ignored and overridden by the system, and an - error is not returned so that the overridden fields do not need to be removed - when updating a configuration.
-
- The configuration can contain unrecognized JSON fields. Any such fields are - ignored and do not generate an error. This makes it easier to use newer - configuration files with older versions of the API and the service. It also - makes it possible for the tooling to add additional metadata and information to - the configuration. -
e_response - Service return value of type T_CONFIGURATION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_credentials
importingi_environment_idtype STRING
i_credential_idtype STRING
i_credentials_parametertype T_CREDENTIALS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CREDENTIALS
raisingzcx_ibmc_service_exception

Update credentials

- Updates an existing set of source credentials.
-
- **Note:** All credentials are sent over an encrypted connection and encrypted at - rest. - -
Parameters
i_environment_id - The ID of the environment. -
i_credential_id - The unique identifier for a set of source credentials. -
i_credentials_parameter - An object that defines an individual set of source credentials. -
e_response - Service return value of type T_CREDENTIALS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_document
importingi_environment_idtype STRING
i_collection_idtype STRING
i_document_idtype STRING
i_filetype FILE optional
i_filenametype STRING optional
i_file_content_typetype STRING optional
i_metadatatype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DOCUMENT_ACCEPTED
raisingzcx_ibmc_service_exception

Update a document

- Replace an existing document or add a document with a specified **document_id**. - Starts ingesting a document with optional metadata.
-
- **Note:** When uploading a new document with this method it automatically - replaces any document stored with the same **document_id** if it exists. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_document_id - The ID of the document. -
i_file - The content of the document to ingest. The maximum supported file size when - adding a file to a collection is 50 megabytes, the maximum supported file size - when testing a configuration is 1 megabyte. Files larger than the supported - size are rejected. -
i_filename - The filename for file. -
i_file_content_type - The content type of file. -
i_metadata - The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 - MB are rejected. Example: ``` {
- "Creator": "Johnny Appleseed",
- "Subject": "Apples"
- } ```. -
e_response - Service return value of type T_DOCUMENT_ACCEPTED -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_environment
importingi_environment_idtype STRING
i_bodytype T_UPDATE_ENVIRONMENT_REQUEST
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ENVIRONMENT
raisingzcx_ibmc_service_exception

Update an environment

- Updates an environment. The environment's **name** and **description** - parameters can be changed. You must specify a **name** for the environment. - -
Parameters
i_environment_id - The ID of the environment. -
i_body - An object that defines the environment's name and, optionally, description. - -
e_response - Service return value of type T_ENVIRONMENT -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_training_example
importingi_environment_idtype STRING
i_collection_idtype STRING
i_query_idtype STRING
i_example_idtype STRING
i_bodytype T_TRAINING_EXAMPLE_PATCH
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_EXAMPLE
raisingzcx_ibmc_service_exception

Change label or cross reference for example

- Changes the label or cross reference query for this training data example. - -
Parameters
i_environment_id - The ID of the environment. -
i_collection_id - The ID of the collection. -
i_query_id - The ID of the query used for training. -
i_example_id - The ID of the document as it is indexed. -
i_body - The body of the example that is to be added to the specified query. -
e_response - Service return value of type T_TRAINING_EXAMPLE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v2.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v2.html new file mode 100644 index 0000000..402494d --- /dev/null +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_discovery_v2.html @@ -0,0 +1,1157 @@ +Class ZCL_IBMC_DISCOVERY_V2

Class ZCL_IBMC_DISCOVERY_V2

public inheriting from zcl_ibmc_service_ext create public

Documentation

Discovery v2

+ IBM Watson® Discovery is a cognitive search and content analytics engine + that you can add to applications to identify patterns, trends and actionable + insights to drive better decision-making. Securely unify structured and + unstructured data with pre-enriched content, and use a simplified query + language to eliminate the need for manual filtering of results.

Types

Visibility and LevelNameDocumentation
publict_analyzed_document (structured type)

+ An object that contains the converted document and any

+ identified enrichments. Root-level fields from the original file are returned + also.
publict_analyzed_result (structured type)

+ Result of the document analysis.

publict_classifier_federated_model (structured type)

+ An object with details for creating federated document

+ classifier models.
publict_classifier_model_evaluation (structured type)

+ An object that contains information about a trained document

+ classifier model.
publict_cllctn_dtls_smrt_doc_undrst1 (structured type)

+ An object that describes the Smart Document Understanding

+ model for a collection.
publict_cmpnnt_settings_fields_shown (structured type)

+ Fields shown in the results section of the UI.

publict_cmpnnt_sttngs_flds_shwn_body (structured type)

+ Body label.

publict_cmpnnt_sttngs_flds_shwn_ttl (structured type)

+ Title label.

publict_collection (structured type)

+ A collection for storing documents.

publict_collection_details (structured type)

+ A collection for storing documents.

publict_collection_enrichment (structured type)

+ An object describing an enrichment for a collection.

publict_completions (structured type)

+ An object that contains an array of autocompletion

+ suggestions.
publict_component_settings_aggr (structured type)

+ Display settings for aggregations.

publict_component_settings_response (structured type)

+ The default component settings for this project.

publict_create_document_classifier (structured type)

+ An object that manages the settings and data that is

+ required to train a document classification model.
publict_create_enrichment (structured type)

+ Information about a specific enrichment.

publict_curated_results (structured type)

+ Object that contains an array of curated results.

publict_curation (structured type)

+ Curated query and responses.

publict_curations (structured type)

+ Array of queries with curated responses for the specified

+ project.
publict_curation_result (structured type)

+ Result information for a curated query.

publict_curation_status (structured type)

+ Curation status information.

publict_default_query_params (structured type)

+ Default query parameters for this project.

publict_delete_document_response (structured type)

+ Information returned when a document is deleted.

publict_dflt_qry_params_tab_results (structured type)

+ Default project query settings for table results.

publict_dflt_qry_prms_sggstd_rfnmnts (structured type)

+ Object that contains suggested refinement settings.


+
+ **Note**: The `suggested_refinements` parameter that identified dynamic facets + from the data is deprecated.
publict_dflt_query_params_passages (structured type)

+ Default settings configuration for passage search options.

publict_document_accepted (structured type)

+ Information returned after an uploaded document is accepted.

publict_document_attribute (structured type)

+ List of document attributes.

publict_document_classifier (structured type)

+ Information about a document classifier.

publict_document_classifiers (structured type)

+ An object that contains a list of document classifier

+ definitions.
publict_document_classifier_model (structured type)

+ Information about a document classifier model.

publict_document_classifier_models (structured type)

+ An object that contains a list of document classifier model

+ definitions.
publict_document_details (structured type)

+ Information about a document.

publict_document_details_children (structured type)

+ Information about the child documents that are generated

+ from a single document during ingestion or other processing.
publict_doc_classifier_enrichment (structured type)

+ An object that describes enrichments that are applied to the

+ training and test data that is used by the document classifier.
publict_doc_classifier_model_train (structured type)

+ An object that contains configuration settings for a

+ document classifier model training run.
publict_enrichment (structured type)

+ Information about a specific enrichment.

publict_enrichments (structured type)

+ An object that contains an array of enrichment definitions.

publict_enrichment_options (structured type)

+ 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.
publict_error_response (structured type)

+ Error response information.

publict_expansion (structured type)

+ An expansion definition. Each object respresents one set of

+ expandable strings. For example, you could have expansions for the word `hot` + in one object, and expansions for the word `cold` in another. Follow these + guidelines when you add terms:
+
+ * Specify the terms in lowercase. Lowercase terms expand to uppercase.
+
+ * Multiword terms are supported only in bidirectional expansions.
+
+ * Do not specify a term that is specified in the stop words list for the + collection.
publict_expansions (structured type)

+ The query expansion definitions for the specified

+ collection.
publict_field (structured type)

+ Object that contains field details.

publict_list_collections_response (structured type)

+ Response object that contains an array of collection

+ details.
publict_list_documents_response (structured type)

+ Response object that contains an array of documents.

publict_list_fields_response (structured type)

+ The list of fetched fields.


+
+ The fields are returned using a fully qualified name format, however, the format + differs slightly from that used by the query operations.
+
+ * Fields which contain nested objects are assigned a type of + "nested".
+
+ * Fields which belong to a nested object are prefixed with `.properties` (for + example, `warnings.properties.severity` means that the `warnings` object has a + property called `severity`).
publict_list_projects_response (structured type)

+ A list of projects in this instance.

publict_mdl_evaluation_macro_average (structured type)

+ A macro-average computes metric independently for each class

+ and then takes the average. Class refers to the classification label that is + specified in the **answer_field**.
publict_mdl_evaluation_micro_average (structured type)

+ A micro-average aggregates the contributions of all classes

+ to compute the average metric. Classes refers to the classification labels that + are specified in the **answer_field**.
publict_notice (structured type)

+ A notice produced for the collection.

publict_per_class_model_evaluation (structured type)

+ An object that measures the metrics from a training run for

+ each classification label separately.
publict_prjct_lst_dtls_rlvncy_trnng1 (structured type)

+ Relevancy training status information for this project.

publict_project_creation (structured type)

+ Detailed information about the specified project.

publict_project_creation_details (structured type)

+ Details about a specific project.

publict_project_details (structured type)

+ Detailed information about the specified project.

publict_project_list_details (structured type)

+ Details about a specific project.

publict_project_name (structured type)

+ Object that contains a new name for the specified project.

publict_project_rel_train_status (structured type)

+ Relevancy training status information for this project.

publict_qry_aggr_qry_clcltn_aggr (structured type)

+ Returns a scalar calculation across all documents for the

+ field specified. Possible calculations include min, max, sum, average, and + unique_count.
publict_qry_aggr_qry_histogram_aggr (structured type)

+ Numeric interval segments to categorize documents by using

+ field values from a single numeric field to describe the category.
publict_qry_aggr_qry_timeslice_aggr (structured type)

+ A specialized histogram aggregation that uses dates to

+ create interval segments.
publict_qry_aggr_query_group_by_aggr (structured type)

+ Separates document results into groups that meet the

+ conditions you specify.
publict_qry_aggr_query_top_hits_aggr (structured type)

+ Returns the top documents ranked by the score of the query.

publict_qry_lrg_sggstd_refinements (structured type)

+ Configuration for suggested refinements.


+
+ **Note**: The **suggested_refinements** parameter that identified dynamic facets + from the data is deprecated.
publict_query_aggregation type jsonobject

+ An object that defines how to aggregate query results.

publict_query_aggr_query_filter_aggr (structured type)

+ A modifier that narrows the document set of the

+ subaggregations it precedes.
publict_query_aggr_query_nested_aggr (structured type)

+ A restriction that alters the document set that is used by

+ the aggregations that it precedes. Subsequent aggregations are applied to + nested documents from the specified field.
publict_query_aggr_query_pair_aggr (structured type)

+ Calculates relevancy values using combinations of document

+ sets from results of the specified pair of aggregations.
publict_query_aggr_query_term_aggr (structured type)

+ Returns results from the field that is specified.

publict_query_aggr_query_topic_aggr (structured type)

+ Detects how much the frequency of a given facet value

+ deviates from the expected average for the given time period. This aggregation + type does not use data from previous time periods. It calculates an index by + using the averages of frequency counts of other facet values for the given time + period.
publict_query_aggr_query_trend_aggr (structured type)

+ Detects sharp and unexpected changes in the frequency of a

+ facet or facet value over time based on the past history of frequency changes + of the facet value.
publict_query_calculation_aggr (structured type)

+ Returns a scalar calculation across all documents for the

+ field specified. Possible calculations include min, max, sum, average, and + unique_count.
publict_query_filter_aggregation (structured type)

+ A modifier that narrows the document set of the

+ subaggregations it precedes.
publict_query_group_by_aggregation (structured type)

+ Separates document results into groups that meet the

+ conditions you specify.
publict_query_group_by_aggr_result (structured type)

+ Result group for the `group_by` aggregation.

publict_query_histogram_aggregation (structured type)

+ Numeric interval segments to categorize documents by using

+ field values from a single numeric field to describe the category.
publict_query_histogram_aggr_result (structured type)

+ Histogram numeric interval result.

publict_query_large (structured type)

+ Object that describes a long query.

publict_query_large_passages (structured type)

+ Configuration for passage retrieval.

publict_query_large_similar (structured type)

+ Finds results from documents that are similar to documents

+ of interest. Use this parameter to add a *More like these* function to your + search. You can include this parameter with or without a **query**, **filter** + or **natural_language_query** parameter.
publict_query_large_table_results (structured type)

+ Configuration for table retrieval.

publict_query_nested_aggregation (structured type)

+ A restriction that alters the document set that is used by

+ the aggregations that it precedes. Subsequent aggregations are applied to + nested documents from the specified field.
publict_query_notices_response (structured type)

+ Object that contains notice query results.

publict_query_pair_aggregation (structured type)

+ Calculates relevancy values using combinations of document

+ sets from results of the specified pair of aggregations.
publict_query_pair_aggr_result (structured type)

+ Result for the `pair` aggregation.

publict_query_response (structured type)

+ A response that contains the documents and aggregations for

+ the query.
publict_query_response_passage (structured type)

+ A passage query response.

publict_query_result (structured type)

+ Result document for the specified query.

publict_query_result_metadata (structured type)

+ Metadata of a query result.

publict_query_result_passage (structured type)

+ A passage query result.

publict_query_sub_aggregation type jsonobject

+ Aggregation results. For more information about supported

+ aggregation types, see the [product + documentation](/docs/discovery-data?topic=discovery-data-query-aggregations).
publict_query_suggested_refinement (structured type)

+ A suggested additional query term or terms user to filter

+ results. **Note**: The `suggested_refinements` parameter is deprecated.
publict_query_table_result (structured type)

+ A tables whose content or context match a search query.

publict_query_term_aggregation (structured type)

+ Returns results from the field that is specified.

publict_query_term_aggr_result (structured type)

+ Top value result for the `term` aggregation.

publict_query_timeslice_aggregation (structured type)

+ A specialized histogram aggregation that uses dates to

+ create interval segments.
publict_query_timeslice_aggr_result (structured type)

+ A timeslice interval segment.

publict_query_topic_aggregation (structured type)

+ Detects how much the frequency of a given facet value

+ deviates from the expected average for the given time period. This aggregation + type does not use data from previous time periods. It calculates an index by + using the averages of frequency counts of other facet values for the given time + period.
publict_query_topic_aggr_result (structured type)

+ Result for the `topic` aggregation.

publict_query_top_hits_aggregation (structured type)

+ Returns the top documents ranked by the score of the query.

publict_query_top_hits_aggr_result (structured type)

+ A query response that contains the matching documents for

+ the preceding aggregations.
publict_query_trend_aggregation (structured type)

+ Detects sharp and unexpected changes in the frequency of a

+ facet or facet value over time based on the past history of frequency changes + of the facet value.
publict_query_trend_aggr_result (structured type)

+ Result for the `trend` aggregation.

publict_result_passage_answer (structured type)

+ Object that contains a potential answer to the specified

+ query.
publict_retrieval_details (structured type)

+ An object contain retrieval type information.

publict_stop_word_list (structured type)

+ List of words to filter out of text that is submitted in

+ queries.
publict_table_body_cells (structured type)

+ Cells that are not table header, column header, or row

+ header cells.
publict_table_cell_key (structured type)

+ A key in a key-value pair.

publict_table_cell_value type standard table of t_table_cell_values with non-unique default key

+ A list of values in a key-value pair.

publict_table_cell_values (structured type)

+ A value in a key-value pair.

publict_table_column_headers (structured type)

+ Column-level cells, each applicable as a header to other

+ cells in the same column as itself, of the current table.
publict_table_column_header_ids (structured type)

+ An array of values, each being the `id` value of a column

+ header that is applicable to the current cell.
publict_table_column_header_texts (structured type)

+ An array of values, each being the `text` value of a column

+ header that is applicable to the current cell.
publict_table_element_location (structured type)

+ The numeric location of the identified element in the

+ document, represented with two integers labeled `begin` and `end`.
publict_table_headers (structured type)

+ The contents of the current table's header.

publict_table_key_value_pairs (structured type)

+ Key-value pairs detected across cell boundaries.

publict_table_result_table (structured type)

+ Full table object retrieved from Table Understanding

+ Enrichment.
publict_table_row_headers (structured type)

+ Row-level cells, each applicable as a header to other cells

+ in the same row as itself, of the current table.
publict_table_row_header_ids (structured type)

+ An array of values, each being the `id` value of a row

+ header that is applicable to this body cell.
publict_table_row_header_texts (structured type)

+ An array of values, each being the `text` value of a row

+ header that is applicable to this body cell.
publict_table_text_location (structured type)

+ Text and associated location within a table.

publict_tab_column_header_texts_norm (structured type)

+ If you provide customization input, the normalized version

+ of the column header texts according to the customization; otherwise, the same + value as `column_header_texts`.
publict_tab_row_header_texts_norm (structured type)

+ If you provide customization input, the normalized version

+ of the row header texts according to the customization; otherwise, the same + value as `row_header_texts`.
publict_training_example (structured type)

+ Object that contains example response details for a training

+ query.
publict_training_query (structured type)

+ Object that contains training query details.

publict_training_query_set (structured type)

+ Object specifying the training queries contained in the

+ identified training set.
publict_update_collection (structured type)

+ An object that represents the collection to be updated.

publict_update_document_classifier (structured type)

+ An object that contains a new name or description for a

+ document classifier, updated training data, or new or updated test data.
publict_update_enrichment (structured type)

+ An object that contains a new name and description for an

+ enrichment.
publict_upd_doc_classifier_model (structured type)

+ An object that contains a new name or description for a

+ document classifier model.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_document
importingi_project_idtype string
i_collection_idtype string
i_filetype file optional
i_filenametype string optional
i_file_content_typetype string optional
i_metadatatype string optional
i_x_watson_discovery_forcetype boolean default c_boolean_false
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_accepted
raisingzcx_ibmc_service_exception

Add a document

+ Add a document to a collection with optional metadata.
+
+ Returns immediately after the system has accepted the document for + processing.
+
+ Use this method to upload a file to the collection. You cannot use this method + to crawl an external data source.
+
+ * For a list of supported file types, see the [product + documentation](/docs/discovery-data?topic=discovery-data-collections#supportedf + iletypes).
+
+ * You must provide document content, metadata, or both. If the request is + missing both document content and metadata, it is rejected.
+
+ * You can set the **Content-Type** parameter on the **file** part to indicate + the media type of the document. If the **Content-Type** parameter is missing or + is one of the generic media types (for example, `application/octet-stream`), + then the service attempts to automatically detect the document's media + type.
+
+ * If the document is uploaded to a collection that shares its data with + another collection, the **X-Watson-Discovery-Force** header must be set to + `true`.
+
+ * In curl requests only, you can assign an ID to a document that you add by + appending the ID to the endpoint + (`/v2/projects/{project_id}/collections/{collection_id}/doc + uments/{document_id}`). If a document already exists with the + specified ID, it is replaced.
+
+ For more information about how certain file types and field names are handled + when a file is added to a collection, see the [product + documentation](/docs/discovery-data?topic=discovery-data-index-overview#field-n + ame-limits). + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_file + When adding a document, the content of the document to ingest. For maximum + supported file size limits, see [the + documentation](/docs/discovery-data?topic=discovery-data-collections#collection + s-doc-limits).
+
+ When analyzing a document, the content of the document to analyze but not + ingest. Only the `application/json` content type is supported currently. For + maximum supported file size limits, see [the product + documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- + limits). +
i_filename + The filename for file. +
i_file_content_type + The content type of file. +
i_metadata + Add information about the file that you want to include in the response.
+
+ The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 + MB are rejected.
+
+ Example:
+
+ ```
+ {
+ "filename": "favorites2.json",
+ "file_type": "json"
+ }. +
i_x_watson_discovery_force + When `true`, the uploaded document is added to the collection even if the data + for that collection is shared with other collections. +
e_response + Service return value of type T_DOCUMENT_ACCEPTED +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
analyze_document
importingi_project_idtype string
i_collection_idtype string
i_filetype file optional
i_filenametype string optional
i_file_content_typetype string optional
i_metadatatype string optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_analyzed_document
raisingzcx_ibmc_service_exception

Analyze a Document

+ Process a document and return it for realtime use. Supports JSON files + only.
+
+ The file is not stored in the collection, but is processed according to the + collection's configuration settings. To get results, enrichments must be + applied to a field in the collection that also exists in the file that you want + to analyze. For example, to analyze text in a `Quote` field, you must apply + enrichments to the `Quote` field in the collection configuration. Then, when + you analyze the file, the text in the `Quote` field is analyzed and results are + written to a field named `enriched_Quote`.
+
+ **Note:** This method is supported with Enterprise plan deployments and + installed deployments only. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_file + When adding a document, the content of the document to ingest. For maximum + supported file size limits, see [the + documentation](/docs/discovery-data?topic=discovery-data-collections#collection + s-doc-limits).
+
+ When analyzing a document, the content of the document to analyze but not + ingest. Only the `application/json` content type is supported currently. For + maximum supported file size limits, see [the product + documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- + limits). +
i_filename + The filename for file. +
i_file_content_type + The content type of file. +
i_metadata + Add information about the file that you want to include in the response.
+
+ The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 + MB are rejected.
+
+ Example:
+
+ ```
+ {
+ "filename": "favorites2.json",
+ "file_type": "json"
+ }. +
e_response + Service return value of type T_ANALYZED_DOCUMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_collection
importingi_project_idtype string
i_collectiondetailstype t_collection_details
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_collection_details
raisingzcx_ibmc_service_exception

Create a collection

+ Create a new collection in the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collectiondetails + An object that represents the collection to be created. +
e_response + Service return value of type T_COLLECTION_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_document_classifier
importingi_project_idtype string
i_training_datatype file
i_classifiertype t_create_document_classifier
i_test_datatype file optional
i_training_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_test_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier
raisingzcx_ibmc_service_exception

Create a document classifier

+ Create a document classifier. You can use the API to create a document + classifier in any project type. After you create a document classifier, you can + use the Enrichments API to create a classifier enrichment, and then the + Collections API to apply the enrichment to a collection in the project.
+
+ **Note:** This method is supported on installed instances (IBM Cloud Pak for + Data) or IBM Cloud-managed Premium or Enterprise plan instances. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_training_data + The training data CSV file to upload. The CSV file must have headers. The file + must include a field that contains the text you want to classify and a field + that contains the classification labels that you want to use to classify your + data. If you want to specify multiple values in a single field, use a semicolon + as the value separator. For a sample file, see [the product + documentation](/docs/discovery-data?topic=discovery-data-cm-doc-classifier). +
i_classifier + An object that manages the settings and data that is required to train a + document classification model. +
i_test_data + The CSV with test data to upload. The column values in the test file must be the + same as the column values in the training data file. If no test data is + provided, the training data is split into two separate groups of training and + test data. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_enrichment
importingi_project_idtype string
i_enrichmenttype t_create_enrichment
i_filetype file optional
i_file_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichment
raisingzcx_ibmc_service_exception

Create an enrichment

+ Create an enrichment for use with the specified project. To apply the enrichment + to a collection in the project, use the [Collections + API](/apidocs/discovery-data#createcollection). + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_enrichment + Information about a specific enrichment. +
i_file + The enrichment file to upload. Expected file types per enrichment are as + follows:
+
+ * CSV for `dictionary`
+
+ * PEAR for `uima_annotator` and `rule_based` (Explorer)
+
+ * ZIP for `watson_knowledge_studio_model` and `rule_based` (Studio Advanced Rule + Editor). +
e_response + Service return value of type T_ENRICHMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_expansions
importingi_project_idtype string
i_collection_idtype string
i_bodytype t_expansions
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_expansions
raisingzcx_ibmc_service_exception

Create or update an expansion list

+ Creates or replaces the expansion list for this collection. An expansion list + introduces alternative wording for key terms that are mentioned in your + collection. By identifying synonyms or common misspellings, you expand the + scope of a query beyond exact matches. The maximum number of expanded terms + allowed per collection is 5,000. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_body + An object that defines the expansion list. +
e_response + Service return value of type T_EXPANSIONS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_project
importingi_projectcreationtype t_project_creation
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_project_details
raisingzcx_ibmc_service_exception

Create a project

+ Create a new project for this instance + +
Parameters
i_projectcreation + An object that represents the project to be created. +
e_response + Service return value of type T_PROJECT_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_stopword_list
importingi_project_idtype string
i_collection_idtype string
i_stopwordlisttype t_stop_word_list optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_stop_word_list
raisingzcx_ibmc_service_exception

Create a custom stop words list

+ Adds a list of custom stop words. Stop words are words that you want the service + to ignore when they occur in a query because they're not useful in + distinguishing the semantic meaning of the query. The stop words list cannot + contain more than 1 million characters.
+
+ A default stop words list is used by all collections. The default list is + applied both at indexing time and at query time. A custom stop words list that + you add is used at query time only.
+
+ The custom stop words list augments the default stop words list; you cannot + remove stop words. For information about the default stop words lists per + language, see [the product + documentation](/docs/discovery-data?topic=discovery-data-stopwords). + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_stopwordlist + No documentation available. +
e_response + Service return value of type T_STOP_WORD_LIST +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_training_query
importingi_project_idtype string
i_trainingquerytype t_training_query
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query
raisingzcx_ibmc_service_exception

Create training query

+ Add a query to the training data for this project. The query can contain a + filter and natural language query. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_trainingquery + An object that represents the query to be submitted. At least 50 queries are + required for training to begin. A maximum of 10,000 queries are allowed. +
e_response + Service return value of type T_TRAINING_QUERY +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
cre_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_documentclassifiermodeltraintype t_doc_classifier_model_train
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_model
raisingzcx_ibmc_service_exception

Create a document classifier model

+ Create a document classifier model by training a model that uses the data and + classifier settings defined in the specified document classifier.
+
+ **Note:** This method is supported on installed intances (IBM Cloud Pak for + Data) or IBM Cloud-managed Premium or Enterprise plan instances. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
i_documentclassifiermodeltrain + An object that contains the training configuration information for the document + classifier to be trained. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_collection
importingi_project_idtype string
i_collection_idtype string
raisingzcx_ibmc_service_exception

Delete a collection

+ Deletes the specified collection from the project. All documents stored in the + specified collection and not shared is also deleted. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_document
importingi_project_idtype string
i_collection_idtype string
i_document_idtype string
i_x_watson_discovery_forcetype boolean default c_boolean_false
i_accepttype string default 'application/json'
exportinge_responsetype t_delete_document_response
raisingzcx_ibmc_service_exception

Delete a document

+ Deletes the document with the document ID that you specify from the collection. + Removes uploaded documents from the collection permanently. If you delete a + document that was added by crawling an external data source, the document will + be added again with the next scheduled crawl of the data source. The delete + function removes the document from the collection, not from the external data + source.
+
+ **Note:** Files such as CSV or JSON files generate subdocuments when they are + added to a collection. If you delete a subdocument, and then repeat the action + that created it, the deleted document is added back in to your collection. To + remove subdocuments that are generated by an uploaded file, delete the original + document instead. You can get the document ID of the original document from the + `parent_document_id` of the subdocument result. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_document_id + The ID of the document. +
i_x_watson_discovery_force + When `true`, the uploaded document is added to the collection even if the data + for that collection is shared with other collections. +
e_response + Service return value of type T_DELETE_DOCUMENT_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_document_classifier
importingi_project_idtype string
i_classifier_idtype string
raisingzcx_ibmc_service_exception

Delete a document classifier

+ Deletes an existing document classifier from the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_enrichment
importingi_project_idtype string
i_enrichment_idtype string
raisingzcx_ibmc_service_exception

Delete an enrichment

+ Deletes an existing enrichment from the specified project.
+
+ **Note:** Only enrichments that have been manually created can be deleted. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_enrichment_id + The ID of the enrichment. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_expansions
importingi_project_idtype string
i_collection_idtype string
raisingzcx_ibmc_service_exception

Delete the expansion list

+ Removes the expansion information for this collection. To disable query + expansion for a collection, delete the expansion list. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_project
importingi_project_idtype string
raisingzcx_ibmc_service_exception

Delete a project

+ Deletes the specified project.
+
+ **Important:** Deleting a project deletes everything that is part of the + specified project, including all collections. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_stopword_list
importingi_project_idtype string
i_collection_idtype string
raisingzcx_ibmc_service_exception

Delete a custom stop words list

+ Deletes a custom stop words list to stop using it in queries against the + collection. After a custom stop words list is deleted, the default stop words + list is used. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_training_queries
importingi_project_idtype string
raisingzcx_ibmc_service_exception

Delete training queries

+ Removes all training queries for the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_training_query
importingi_project_idtype string
i_query_idtype string
raisingzcx_ibmc_service_exception

Delete a training data query

+ Removes details from a training data query, including the query string and all + examples. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_query_id + The ID of the query used for training. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_user_data
importingi_customer_idtype string
raisingzcx_ibmc_service_exception

Delete labeled data

+ Deletes all data associated with a specified customer ID. The method has no + effect if no data is associated with the customer ID.
+
+ You associate a customer ID with data by passing the **X-Watson-Metadata** + header with a request that passes data. For more information about personal + data and customer IDs, see [Information + security](/docs/discovery-data?topic=discovery-data-information-security#inform + ation-security).
+
+ **Note:** This method is only supported on IBM Cloud instances of Discovery. + +
Parameters
i_customer_id + The customer ID for which all data is to be deleted. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
del_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_model_idtype string
raisingzcx_ibmc_service_exception

Delete a document classifier model

+ Deletes an existing document classifier model from the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
i_model_id + The ID of the classifier model. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instanceget_appname redefinition 
public instance
get_autocompletion
importingi_project_idtype string
i_prefixtype string
i_collection_idstype tt_string optional
i_fieldtype string optional
i_counttype integer default 5
i_accepttype string default 'application/json'
exportinge_responsetype t_completions
raisingzcx_ibmc_service_exception

Get Autocomplete Suggestions

+ Returns completion query suggestions for the specified prefix. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_prefix + The prefix to use for autocompletion. For example, the prefix `Ho` could + autocomplete to `hot`, `housing`, or `how`. +
i_collection_ids + Comma separated list of the collection IDs. If this parameter is not specified, + all collections in the project are used. +
i_field + The field in the result documents that autocompletion suggestions are identified + from. +
i_count + The number of autocompletion suggestions to return. +
e_response + Service return value of type T_COMPLETIONS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_collection
importingi_project_idtype string
i_collection_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_collection_details
raisingzcx_ibmc_service_exception

Get collection

+ Get details about the specified collection. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
e_response + Service return value of type T_COLLECTION_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_component_settings
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_component_settings_response
raisingzcx_ibmc_service_exception

List component settings

+ Returns default configuration settings for components. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
e_response + Service return value of type T_COMPONENT_SETTINGS_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_document
importingi_project_idtype string
i_collection_idtype string
i_document_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_details
raisingzcx_ibmc_service_exception

Get document details

+ Get details about a specific document, whether the document is added by + uploading a file or by crawling an external data source.
+
+ **Note**: This method is available only from Cloud Pak for Data version 4.0.9 + and later installed instances and from Plus and Enterprise plan IBM + Cloud-managed instances. It is not currently available from Premium plan + instances. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_document_id + The ID of the document. +
e_response + Service return value of type T_DOCUMENT_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_document_classifier
importingi_project_idtype string
i_classifier_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier
raisingzcx_ibmc_service_exception

Get a document classifier

+ Get details about a specific document classifier. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_model
raisingzcx_ibmc_service_exception

Get a document classifier model

+ Get details about a specific document classifier model. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
i_model_id + The ID of the classifier model. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_enrichment
importingi_project_idtype string
i_enrichment_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichment
raisingzcx_ibmc_service_exception

Get enrichment

+ Get details about a specific enrichment. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_enrichment_id + The ID of the enrichment. +
e_response + Service return value of type T_ENRICHMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_project
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_project_details
raisingzcx_ibmc_service_exception

Get project

+ Get details on the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
e_response + Service return value of type T_PROJECT_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
get_stopword_list
importingi_project_idtype string
i_collection_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_stop_word_list
raisingzcx_ibmc_service_exception

Get a custom stop words list

+ Returns the custom stop words list that is used by the collection. For + information about the default stop words lists that are applied to queries, see + [the product + documentation](/docs/discovery-data?topic=discovery-data-stopwords). + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
e_response + Service return value of type T_STOP_WORD_LIST +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_training_query
importingi_project_idtype string
i_query_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query
raisingzcx_ibmc_service_exception

Get a training data query

+ Get details for a specific training data query, including the query string and + all examples + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_query_id + The ID of the query used for training. +
e_response + Service return value of type T_TRAINING_QUERY +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_collections
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_list_collections_response
raisingzcx_ibmc_service_exception

List collections

+ Lists existing collections for the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
e_response + Service return value of type T_LIST_COLLECTIONS_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_documents
importingi_project_idtype string
i_collection_idtype string
i_counttype integer default 1000
i_statustype string optional
i_has_noticestype boolean optional
i_is_parenttype boolean optional
i_parent_document_idtype string optional
i_sha256type string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_list_documents_response
raisingzcx_ibmc_service_exception

List documents

+ Lists the documents in the specified collection. The list includes only the + document ID of each document and returns information for up to 10,000 + documents.
+
+ **Note**: This method is available only from Cloud Pak for Data version 4.0.9 + and later installed instances and from Plus and Enterprise plan IBM + Cloud-managed instances. It is not currently available from Premium plan + instances. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_count + The maximum number of documents to return. Up to 1,000 documents are returned by + default. The maximum number allowed is 10,000. +
i_status + Filters the documents to include only documents with the specified ingestion + status. The options include:
+
+ * `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.
+
+ You can specify one status value or add a comma-separated list of more than one + status value. For example, `available,failed`. +
i_has_notices + If set to `true`, only documents that have notices, meaning documents for which + warnings or errors were generated during the ingestion, are returned. If set to + `false`, only documents that don't have notices are returned. If + unspecified, no filter based on notices is applied.
+
+ Notice details are not available in the result, but you can use the [Query + collection notices](#querycollectionnotices) method to find details by adding + the parameter `query=notices.document_id:{document-id}`. +
i_is_parent + If set to `true`, only parent documents, meaning documents that were split + during the ingestion process and resulted in two or more child documents, are + returned. If set to `false`, only child documents are returned. If unspecified, + no filter based on the parent or child relationship is applied.
+
+ CSV files, for example, are split into separate documents per line and JSON + files are split into separate documents per object. +
i_parent_document_id + Filters the documents to include only child documents that were generated when + the specified parent document was processed. +
i_sha256 + Filters the documents to include only documents with the specified SHA-256 hash. + Format the hash as a hexadecimal string. +
e_response + Service return value of type T_LIST_DOCUMENTS_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_document_classifiers
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifiers
raisingzcx_ibmc_service_exception

List document classifiers

+ Get a list of the document classifiers in a project. Returns only the name and + classifier ID of each document classifier. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIERS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_enrichments
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichments
raisingzcx_ibmc_service_exception

List enrichments

+ Lists the enrichments available to this project. The *Part of Speech* and + *Sentiment of Phrases* enrichments might be listed, but are reserved for + internal use only. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
e_response + Service return value of type T_ENRICHMENTS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_expansions
importingi_project_idtype string
i_collection_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_expansions
raisingzcx_ibmc_service_exception

Get the expansion list

+ Returns the current expansion list for the specified collection. If an expansion + list is not specified, an empty expansions array is returned. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
e_response + Service return value of type T_EXPANSIONS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_fields
importingi_project_idtype string
i_collection_idstype tt_string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_list_fields_response
raisingzcx_ibmc_service_exception

List fields

+ Gets a list of the unique fields (and their types) stored in the specified + collections. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_ids + Comma separated list of the collection IDs. If this parameter is not specified, + all collections in the project are used. +
e_response + Service return value of type T_LIST_FIELDS_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_projects
importingi_accepttype string default 'application/json'
exportinge_responsetype t_list_projects_response
raisingzcx_ibmc_service_exception

List projects

+ Lists existing projects for this instance. + +
Parameters
e_response + Service return value of type T_LIST_PROJECTS_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_training_queries
importingi_project_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query_set
raisingzcx_ibmc_service_exception

List training queries

+ List the training queries for the specified project. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
e_response + Service return value of type T_TRAINING_QUERY_SET +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
lst_document_classifier_models
importingi_project_idtype string
i_classifier_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_models
raisingzcx_ibmc_service_exception

List document classifier models

+ Get a list of the document classifier models in a project. Returns only the name + and model ID of each document classifier model. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER_MODELS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
query
importingi_project_idtype string
i_query_longtype t_query_large optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_query_response
raisingzcx_ibmc_service_exception

Query a project

+ Search your data by submitting queries that are written in natural language or + formatted in the Discovery Query Language. For more information, see the + [Discovery + documentation](/docs/discovery-data?topic=discovery-data-query-concepts). The + default query parameters differ by project type. For more information about the + project default settings, see the [Discovery + documentation](/docs/discovery-data?topic=discovery-data-query-defaults). See + [the Projects API documentation](#create-project) for details about how to set + custom default query settings.
+
+ The length of the UTF-8 encoding of the POST body cannot exceed 10,000 bytes, + which is roughly equivalent to 10,000 characters in English. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_query_long + An object that represents the query to be submitted. +
e_response + Service return value of type T_QUERY_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
query_collection_notices
importingi_project_idtype string
i_collection_idtype string
i_filtertype string optional
i_querytype string optional
i_natural_language_querytype string optional
i_counttype integer default 10
i_offsettype integer optional
i_accepttype string default 'application/json'
exportinge_responsetype t_query_notices_response
raisingzcx_ibmc_service_exception

Query collection notices

+ Finds collection-level notices (errors and warnings) that are generated when + documents are ingested. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_filter + Searches for documents that match the Discovery Query Language criteria that is + specified as input. Filter calls are cached and are faster than query calls + because the results are not ordered by relevance. When used with the + `aggregation`, `query`, or `natural_language_query` parameters, the `filter` + parameter runs first. This parameter is useful for limiting results to those + that contain specific metadata values. +
i_query + A query search that is written in the Discovery Query Language and returns all + matching documents in your data set with full enrichments and full text, and + with the most relevant documents listed first. +
i_natural_language_query + A natural language query that returns relevant documents by using training data + and natural language understanding. +
i_count + Number of results to return. The maximum for the **count** and **offset** values + together in any one query is **10,000**. +
i_offset + The number of query results to skip at the beginning. For example, if the total + number of results that are returned is 10 and the offset is 8, it returns the + last two results. The maximum for the **count** and **offset** values together + in any one query is **10000**. +
e_response + Service return value of type T_QUERY_NOTICES_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
query_notices
importingi_project_idtype string
i_filtertype string optional
i_querytype string optional
i_natural_language_querytype string optional
i_counttype integer default 10
i_offsettype integer optional
i_accepttype string default 'application/json'
exportinge_responsetype t_query_notices_response
raisingzcx_ibmc_service_exception

Query project notices

+ Finds project-level notices (errors and warnings). Currently, project-level + notices are generated by relevancy training. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_filter + Searches for documents that match the Discovery Query Language criteria that is + specified as input. Filter calls are cached and are faster than query calls + because the results are not ordered by relevance. When used with the + `aggregation`, `query`, or `natural_language_query` parameters, the `filter` + parameter runs first. This parameter is useful for limiting results to those + that contain specific metadata values. +
i_query + A query search that is written in the Discovery Query Language and returns all + matching documents in your data set with full enrichments and full text, and + with the most relevant documents listed first. +
i_natural_language_query + A natural language query that returns relevant documents by using training data + and natural language understanding. +
i_count + Number of results to return. The maximum for the **count** and **offset** values + together in any one query is **10,000**. +
i_offset + The number of query results to skip at the beginning. For example, if the total + number of results that are returned is 10 and the offset is 8, it returns the + last two results. The maximum for the **count** and **offset** values together + in any one query is **10000**. +
e_response + Service return value of type T_QUERY_NOTICES_RESPONSE +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_collection
importingi_project_idtype string
i_collection_idtype string
i_updatecollectiontype t_update_collection
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_collection_details
raisingzcx_ibmc_service_exception

Update a collection

+ Updates the specified collection's name, description, and enrichments. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_updatecollection + An object that represents the collection to be updated. +
e_response + Service return value of type T_COLLECTION_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_document
importingi_project_idtype string
i_collection_idtype string
i_document_idtype string
i_filetype file optional
i_filenametype string optional
i_file_content_typetype string optional
i_metadatatype string optional
i_x_watson_discovery_forcetype boolean default c_boolean_false
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_accepted
raisingzcx_ibmc_service_exception

Update a document

+ Replace an existing document or add a document with a specified document ID. + Starts ingesting a document with optional metadata.
+
+ Use this method to upload a file to a collection. You cannot use this method to + crawl an external data source.
+
+ If the document is uploaded to a collection that shares its data with another + collection, the **X-Watson-Discovery-Force** header must be set to `true`.
+
+ **Notes:**
+
+ * Uploading a new document with this method automatically replaces any existing + document stored with the same document ID.
+
+ * If an uploaded document is split into child documents during ingestion, all + existing child documents are overwritten, even if the updated version of the + document has fewer child documents. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_collection_id + The ID of the collection. +
i_document_id + The ID of the document. +
i_file + When adding a document, the content of the document to ingest. For maximum + supported file size limits, see [the + documentation](/docs/discovery-data?topic=discovery-data-collections#collection + s-doc-limits).
+
+ When analyzing a document, the content of the document to analyze but not + ingest. Only the `application/json` content type is supported currently. For + maximum supported file size limits, see [the product + documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- + limits). +
i_filename + The filename for file. +
i_file_content_type + The content type of file. +
i_metadata + Add information about the file that you want to include in the response.
+
+ The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 + MB are rejected.
+
+ Example:
+
+ ```
+ {
+ "filename": "favorites2.json",
+ "file_type": "json"
+ }. +
i_x_watson_discovery_force + When `true`, the uploaded document is added to the collection even if the data + for that collection is shared with other collections. +
e_response + Service return value of type T_DOCUMENT_ACCEPTED +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_document_classifier
importingi_project_idtype string
i_classifier_idtype string
i_classifiertype t_update_document_classifier
i_training_datatype file optional
i_test_datatype file optional
i_training_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_test_data_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier
raisingzcx_ibmc_service_exception

Update a document classifier

+ Update the document classifier name or description, update the training data, or + add or update the test data. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
i_classifier + An object that contains a new name or description for a document classifier, + updated training data, or new or updated test data. +
i_training_data + The training data CSV file to upload. The CSV file must have headers. The file + must include a field that contains the text you want to classify and a field + that contains the classification labels that you want to use to classify your + data. If you want to specify multiple values in a single column, use a + semicolon as the value separator. For a sample file, see [the product + documentation](/docs/discovery-data?topic=discovery-data-cm-doc-classifier). +
i_test_data + The CSV with test data to upload. The column values in the test file must be the + same as the column values in the training data file. If no test data is + provided, the training data is split into two separate groups of training and + test data. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_enrichment
importingi_project_idtype string
i_enrichment_idtype string
i_updateenrichmenttype t_update_enrichment
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_enrichment
raisingzcx_ibmc_service_exception

Update an enrichment

+ Updates an existing enrichment's name and description. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_enrichment_id + The ID of the enrichment. +
i_updateenrichment + An object that lists the new name and description for an enrichment. +
e_response + Service return value of type T_ENRICHMENT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_project
importingi_project_idtype string
i_projectnametype t_project_name optional
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_project_details
raisingzcx_ibmc_service_exception

Update a project

+ Update the specified project's name. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_projectname + An object that represents the new name of the project. +
e_response + Service return value of type T_PROJECT_DETAILS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_training_query
importingi_project_idtype string
i_query_idtype string
i_bodytype t_training_query
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_training_query
raisingzcx_ibmc_service_exception

Update a training query

+ Updates an existing training query and it's examples. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_query_id + The ID of the query used for training. +
i_body + The body of the example that is to be added to the specified query. +
e_response + Service return value of type T_TRAINING_QUERY +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
upd_document_classifier_model
importingi_project_idtype string
i_classifier_idtype string
i_model_idtype string
i_updtdcmntclssfrmdltype t_upd_doc_classifier_model
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_classifier_model
raisingzcx_ibmc_service_exception

Update a document classifier model

+ Update the document classifier model name or description. + +
Parameters
i_project_id + The ID of the project. This information can be found from the *Integrate and + Deploy* page in Discovery. +
i_classifier_id + The ID of the classifier. +
i_model_id + The ID of the classifier model. +
i_updtdcmntclssfrmdl + An object that lists a new name or description for a document classifier model. +
e_response + Service return value of type T_DOCUMENT_CLASSIFIER_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_lang_translator_v3.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_lang_translator_v3.html index 0c0178d..fd811d7 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_lang_translator_v3.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_lang_translator_v3.html @@ -1,25 +1,25 @@ -Class ZCL_IBMC_LANG_TRANSLATOR_V3

Class ZCL_IBMC_LANG_TRANSLATOR_V3

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Language Translator

+Class ZCL_IBMC_LANG_TRANSLATOR_V3

Class ZCL_IBMC_LANG_TRANSLATOR_V3

public inheriting from zcl_ibmc_service_ext create public

Documentation

Language Translator

IBM Watson™ Language Translator translates text from one language to another. The service offers multiple IBM-provided translation models that you can customize based on your unique terminology and language. Use Language Translator to take news from across the globe and present it in your language, - communicate with your customers in their own language, and more.

Types

Visibility and LevelNameDocumentation
publict_base_model_id type STRING

+ communicate with your customers in their own language, and more.

Types

Visibility and LevelNameDocumentation
publict_base_model_id type string

Model ID of the base model that was used to customize the

model. If the model is not a custom model, this will be absent or an empty - string.
publict_delete_model_result (structured type) No documentation available.
publict_document_id type STRING

+ string.

publict_delete_model_result (structured type) No documentation available.
publict_document_id type string

System generated ID identifying a document being translated

- using one specific translation model.
publict_document_list (structured type) No documentation available.
publict_document_status (structured type)

- Document information, including translation status.

publict_error_response (structured type) No documentation available.
publict_get_translated_doc_response type FILE No documentation available.
publict_identifiable_language (structured type) No documentation available.
publict_identifiable_languages (structured type) No documentation available.
publict_identified_language (structured type) No documentation available.
publict_identified_languages (structured type) No documentation available.
publict_inline_object (structured type) No documentation available.
publict_inline_object1 (structured type) No documentation available.
publict_language (structured type)

- Response payload for languages.

publict_languages (structured type)

- The response type for listing supported languages.

publict_model_id type STRING

+ using one specific translation model.

publict_document_list (structured type) No documentation available.
publict_document_status (structured type)

+ Document information, including translation status.

publict_error_response (structured type) No documentation available.
publict_get_translated_doc_response type file No documentation available.
publict_identifiable_language (structured type) No documentation available.
publict_identifiable_languages (structured type) No documentation available.
publict_identified_language (structured type) No documentation available.
publict_identified_languages (structured type) No documentation available.
publict_inline_object (structured type) No documentation available.
publict_inline_object1 (structured type) No documentation available.
publict_language (structured type)

+ Response payload for languages.

publict_languages (structured type)

+ The response type for listing supported languages.

publict_model_id type string

A globally unique string that identifies the underlying

- model that is used for translation.
publict_source type STRING

- Translation source language code.

publict_target type STRING

- Translation target language code.

publict_translate_request (structured type) No documentation available.
publict_translation (structured type) No documentation available.
publict_translation_model (structured type)

- Response payload for models.

publict_translation_models (structured type)

- The response type for listing existing translation models.

publict_translation_result (structured type) No documentation available.
publict_translation_status type STRING

+ model that is used for translation.

publict_source type string

+ Translation source language code.

publict_target type string

+ Translation target language code.

publict_translate_request (structured type) No documentation available.
publict_translation (structured type) No documentation available.
publict_translation_model (structured type)

+ Response payload for models.

publict_translation_models (structured type)

+ The response type for listing existing translation models.

publict_translation_result (structured type) No documentation available.
publict_translation_status type string

The status of the translation job associated with a

- submitted document.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
create_model
importingi_base_model_idtype STRING
i_forced_glossarytype FILE optional
i_parallel_corpustype FILE optional
i_nametype STRING optional
i_forced_glossary_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_parallel_corpus_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRANSLATION_MODEL
raisingzcx_ibmc_service_exception

Create model

+ submitted document.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
create_model
importingi_base_model_idtype string
i_forced_glossarytype file optional
i_forced_glossary_content_typetype string optional
i_parallel_corpustype file optional
i_parallel_corpus_content_typetype string optional
i_nametype string optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_translation_model
raisingzcx_ibmc_service_exception

Create model

Uploads training files to customize a translation model. You can customize a model with a forced glossary or with a parallel corpus:
* Use a *forced glossary* to force certain terms and phrases to be translated in @@ -110,6 +110,8 @@ method description.

*With `curl`, use `--form forced_glossary=@{filename}`.*. +
i_forced_glossary_content_type + The content type of forcedGlossary.
i_parallel_corpus A file with parallel sentences for the source and target languages. You can upload multiple parallel corpus files in one request by repeating the @@ -122,6 +124,8 @@ information, see **Supported file formats** in the method description.

*With `curl`, use `--form parallel_corpus=@{filename}`.*. +
i_parallel_corpus_content_type + The content type of parallelCorpus.
i_name An optional model name that you can use to identify the model. Valid characters are letters, numbers, dashes, underscores, spaces, and apostrophes. The maximum @@ -129,13 +133,13 @@
e_response Service return value of type T_TRANSLATION_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_document
importingi_document_idtype STRING
raisingzcx_ibmc_service_exception

Delete document

+
public instance
delete_document
importingi_document_idtype string
raisingzcx_ibmc_service_exception

Delete document

Deletes a document
Parameters
i_document_id Document ID of the document to delete.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_model
importingi_model_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DELETE_MODEL_RESULT
raisingzcx_ibmc_service_exception

Delete model

+
public instance
delete_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_delete_model_result
raisingzcx_ibmc_service_exception

Delete model

Deletes a custom translation model.
Parameters
i_model_id @@ -143,7 +147,7 @@
e_response Service return value of type T_DELETE_MODEL_RESULT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition public instance
get_document_status
importingi_document_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DOCUMENT_STATUS
raisingzcx_ibmc_service_exception

Get document status

+
public instanceget_appname redefinition public instance
get_document_status
importingi_document_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_document_status
raisingzcx_ibmc_service_exception

Get document status

Gets the translation status of a document
Parameters
i_document_id @@ -151,17 +155,17 @@
e_response Service return value of type T_DOCUMENT_STATUS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_model
importingi_model_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRANSLATION_MODEL
raisingzcx_ibmc_service_exception

Get model details

+
public instance
get_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_translation_model
raisingzcx_ibmc_service_exception

Get model details

Gets information about a translation model, including training status for custom - models. Use this API call to poll the status of your customization request. A - successfully completed training has a status of `available`. + models. Use this method to poll the status of your customization request. A + successfully completed training request has a status of `available`.
Parameters
i_model_id Model ID of the model to get.
e_response Service return value of type T_TRANSLATION_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_translated_document
importingi_document_idtype STRING
i_accepttype STRING optional
exportinge_responsetype FILE
raisingzcx_ibmc_service_exception

Get translated document

+
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_translated_document
importingi_document_idtype string
i_accepttype string optional
exportinge_responsetype file
raisingzcx_ibmc_service_exception

Get translated document

Gets the translated document associated with the given document ID
Parameters
i_document_id @@ -183,7 +187,7 @@
e_response Service return value of type FILE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
identify
importingi_texttype STRING
i_contenttypetype STRING default 'text/plain'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_IDENTIFIED_LANGUAGES
raisingzcx_ibmc_service_exception

Identify language

+
public instance
identify
importingi_texttype string
i_contenttypetype string default 'text/plain'
i_accepttype string default 'application/json'
exportinge_responsetype t_identified_languages
raisingzcx_ibmc_service_exception

Identify language

Identifies the language of the input text.
Parameters
i_text @@ -191,20 +195,20 @@
e_response Service return value of type T_IDENTIFIED_LANGUAGES
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_documents
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_DOCUMENT_LIST
raisingzcx_ibmc_service_exception

List documents

+
public instance
list_documents
importingi_accepttype string default 'application/json'
exportinge_responsetype t_document_list
raisingzcx_ibmc_service_exception

List documents

Lists documents that have been submitted for translation
Parameters
e_response Service return value of type T_DOCUMENT_LIST
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_identifiable_languages
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_IDENTIFIABLE_LANGUAGES
raisingzcx_ibmc_service_exception

List identifiable languages

+
public instance
list_identifiable_languages
importingi_accepttype string default 'application/json'
exportinge_responsetype t_identifiable_languages
raisingzcx_ibmc_service_exception

List identifiable languages

Lists the languages that the service can identify. Returns the language code (for example, `en` for English or `es` for Spanish) and name of each language.
Parameters
e_response Service return value of type T_IDENTIFIABLE_LANGUAGES
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_languages
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_LANGUAGES
raisingzcx_ibmc_service_exception

List supported languages

+
public instance
list_languages
importingi_accepttype string default 'application/json'
exportinge_responsetype t_languages
raisingzcx_ibmc_service_exception

List supported languages

Lists all supported languages for translation. The method returns an array of supported languages with information about each language. Languages are listed in alphabetical order by language code (for example, `af`, `ar`). In addition @@ -215,7 +219,7 @@
Parameters
e_response Service return value of type T_LANGUAGES
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_models
importingi_sourcetype STRING optional
i_targettype STRING optional
i_defaulttype BOOLEAN optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRANSLATION_MODELS
raisingzcx_ibmc_service_exception

List models

+
public instance
list_models
importingi_sourcetype string optional
i_targettype string optional
i_defaulttype boolean optional
i_accepttype string default 'application/json'
exportinge_responsetype t_translation_models
raisingzcx_ibmc_service_exception

List models

Lists available translation models.
Parameters
i_source @@ -231,7 +235,7 @@
e_response Service return value of type T_TRANSLATION_MODELS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
translate
importingi_requesttype T_TRANSLATE_REQUEST
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRANSLATION_RESULT
raisingzcx_ibmc_service_exception

Translate

+
public instance
translate
importingi_requesttype t_translate_request
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_translation_result
raisingzcx_ibmc_service_exception

Translate

Translates the input text from the source language to the target language. Specify a model ID that indicates the source and target languages, or specify the source and target languages individually. You can omit the source language @@ -248,20 +252,52 @@
e_response Service return value of type T_TRANSLATION_RESULT
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
translate_document
importingi_filetype FILE
i_filenametype STRING
i_file_content_typetype STRING optional
i_model_idtype STRING optional
i_sourcetype STRING optional
i_targettype STRING optional
i_document_idtype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DOCUMENT_STATUS
raisingzcx_ibmc_service_exception

Translate document

+
public instance
translate_document
importingi_filetype file
i_filenametype string
i_file_content_typetype string optional
i_model_idtype string optional
i_sourcetype string optional
i_targettype string optional
i_document_idtype string optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_document_status
raisingzcx_ibmc_service_exception

Translate document

Submit a document for translation. You can submit the document contents in the - `file` parameter, or you can reference a previously submitted document by + `file` parameter, or you can specify a previously submitted document by document ID. The maximum file size for document translation is
- * 20 MB for service instances on the Standard, Advanced, and Premium plans
- * 2 MB for service instances on the Lite plan + * **2 MB** for service instances on the Lite plan
+ * **20 MB** for service instances on the Standard plan
+ * **50 MB** for service instances on the Advanced plan
+ * **150 MB** for service instances on the Premium plan
+
+ You can specify the format of the file to be translated in one of two ways:
+ * By specifying the appropriate file extension for the format.
+ * By specifying the content type (MIME type) of the format as the `type` of the + `file` parameter.
+
+ In some cases, especially for subtitle file formats, you must use either the + file extension or the content type. For more information about all supported + file formats, their file extensions and content types, and how and when to + specify the file extension or content type, see [Supported file + formats](https://cloud.ibm.com/docs/language-translator?topic=language-translat + or-document-translator-tutorial#supported-file-formats).
+
+ **Note:** When translating a previously submitted document, the target language + must be different from the target language of the original request when the + document was initially submitted.
Parameters
i_file The contents of the source file to translate. The maximum file size for document - translation is 20 MB for service instances on the Standard, Advanced, and - Premium plans, and 2 MB for service instances on the Lite plan. For more - information, see [Supported file formats - (Beta)](https://cloud.ibm.com/docs/language-translator?topic=language-translato - r-document-translator-tutorial#supported-file-formats). + translation is
+ * **2 MB** for service instances on the Lite plan
+ * **20 MB** for service instances on the Standard plan
+ * **50 MB** for service instances on the Advanced plan
+ * **150 MB** for service instances on the Premium plan
+
+ You can specify the format of the file to be translated in one of two ways:
+ * By specifying the appropriate file extension for the format.
+ * By specifying the content type (MIME type) of the format as the `type` of the + `file` parameter.
+
+ In some cases, especially for subtitle file formats, you must use either the + file extension or the content type.
+
+ For more information about all supported file formats, their file extensions and + content types, and how and when to specify the file extension or content type, + see [Supported file + formats](https://cloud.ibm.com/docs/language-translator?topic=language-translat + or-document-translator-tutorial#supported-file-formats).
i_filename The filename for file.
i_file_content_type @@ -284,4 +320,4 @@
e_response Service return value of type T_DOCUMENT_STATUS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_class_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_class_v1.html deleted file mode 100644 index daaa2d3..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_class_v1.html +++ /dev/null @@ -1,78 +0,0 @@ -Class ZCL_IBMC_NAT_LANG_CLASS_V1

Class ZCL_IBMC_NAT_LANG_CLASS_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Natural Language Classifier

- IBM Watson™ Natural Language Classifier uses machine learning algorithms - to return the top matching predefined classes for short text input. You create - and train a classifier to connect predefined classes to example texts so that - the service can apply those classes to new inputs.

Types

Visibility and LevelNameDocumentation
publict_classification (structured type)

- Response from the classifier for a phrase.

publict_classification_collection (structured type)

- Response from the classifier for multiple phrases.

publict_classified_class (structured type)

- Class and confidence.

publict_classifier (structured type)

- A classifier for natural language phrases.

publict_classifier_list (structured type)

- List of available classifiers.

publict_classify_collection_input (structured type)

- Request payload to classify.

publict_classify_input (structured type)

- Request payload to classify.

publict_collection_item (structured type)

- Response from the classifier for a phrase in a collection.

publict_empty type JSONOBJECT No documentation available.
publict_error_cloud (structured type)

- Response payload for Cloud errors.

publict_error_response (structured type)

- Response payload for HTTP errors.

publict_inline_object (structured type) No documentation available.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
classify
importingi_classifier_idtype STRING
i_bodytype T_CLASSIFY_INPUT
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFICATION
raisingzcx_ibmc_service_exception

Classify a phrase

- Returns label information for the input. The status must be `Available` before - you can use the classifier to classify text. - -
Parameters
i_classifier_id - Classifier ID to use. -
i_body - Phrase to classify. -
e_response - Service return value of type T_CLASSIFICATION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
classify_collection
importingi_classifier_idtype STRING
i_bodytype T_CLASSIFY_COLLECTION_INPUT
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFICATION_COLLECTION
raisingzcx_ibmc_service_exception

Classify multiple phrases

- Returns label information for multiple phrases. The status must be `Available` - before you can use the classifier to classify text.
-
- Note that classifying Japanese texts is a beta feature. - -
Parameters
i_classifier_id - Classifier ID to use. -
i_body - Phrase to classify. You can submit up to 30 text phrases in a request. -
e_response - Service return value of type T_CLASSIFICATION_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_classifier
importingi_training_metadatatype FILE
i_training_datatype FILE
i_training_metadata_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_training_data_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIER
raisingzcx_ibmc_service_exception

Create classifier

- Sends data to create and train a classifier and returns information about the - new classifier. - -
Parameters
i_training_metadata - Metadata in JSON format. The metadata identifies the language of the data, and - an optional name to identify the classifier. Specify the language with the - 2-letter primary language code as assigned in ISO standard 639.
-
- Supported languages are English (`en`), Arabic (`ar`), French (`fr`), German, - (`de`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Brazilian Portuguese - (`pt`), and Spanish (`es`). -
i_training_data - Training data in CSV format. Each text value must have at least one class. The - data can include up to 3,000 classes and 20,000 records. For details, see [Data - preparation](https://cloud.ibm.com/docs/natural-language-classifier?topic=natur - al-language-classifier-using-your-data). -
e_response - Service return value of type T_CLASSIFIER -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_classifier
importingi_classifier_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete classifier

- -
Parameters
i_classifier_id - Classifier ID to delete. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition 
public instance
get_classifier
importingi_classifier_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIER
raisingzcx_ibmc_service_exception

Get information about a classifier

- Returns status and other information about a classifier. - -
Parameters
i_classifier_id - Classifier ID to query. -
e_response - Service return value of type T_CLASSIFIER -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
list_classifiers
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIER_LIST
raisingzcx_ibmc_service_exception

List classifiers

- Returns an empty array if no classifiers are available. - -
Parameters
e_response - Service return value of type T_CLASSIFIER_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_undrstnd_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_undrstnd_v1.html index 6aa2b5a..665ce3d 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_undrstnd_v1.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_nat_lang_undrstnd_v1.html @@ -1,4 +1,4 @@ -Class ZCL_IBMC_NAT_LANG_UNDRSTND_V1

Class ZCL_IBMC_NAT_LANG_UNDRSTND_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Natural Language Understanding

+Class ZCL_IBMC_NAT_LANG_UNDRSTND_V1

Class ZCL_IBMC_NAT_LANG_UNDRSTND_V1

public inheriting from zcl_ibmc_service_ext create public

Documentation

Natural Language Understanding

Analyze various features of text content at scale. Provide text, raw HTML, or a public URL and IBM Watson Natural Language Understanding will give you results for the features you request. The service cleans HTML content before analysis @@ -8,43 +8,83 @@ You can create [custom models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural -language-understanding-customizing) with Watson Knowledge Studio to detect - custom entities and relations in Natural Language Understanding.

Types

Visibility and LevelNameDocumentation
publict_advanced_rules_model (structured type)

- Advanced rules model.

publict_advanced_rules_model_list (structured type)

- List of advanced rules models.

publict_advncd_rls_analysis_results type JSONOBJECT No documentation available.
publict_analysis_results (structured type)

- Results of the analysis, organized by feature.

publict_analysis_results_usage (structured type)

- API usage information for the request.

publict_author (structured type)

- The author of the analyzed content.

publict_base_advanced_rules_model (structured type)

- Advanced rules model.

publict_categories_options (structured type)

- Returns a five-level taxonomy of the content. The top three

- categories are returned.
+ custom entities and relations in Natural Language Understanding.
+
+ IBM is sunsetting Watson Natural Language Understanding Custom Sentiment (BETA). + From **June 1, 2023** onward, you will no longer be able to use the Custom + Sentiment feature.<br /><br />To ensure we continue providing our + clients with robust and powerful text classification capabilities, IBM recently + announced the general availability of a new [single-label text classification + capability](https://cloud.ibm.com/docs/natural-language-understanding?topic=nat + ural-language-understanding-classifications). This new feature includes extended + language support and training data customizations suited for building a custom + sentiment classifier.<br /><br />If you would like more information + or further guidance, please contact IBM Cloud Support.{: deprecated}

Types

Visibility and LevelNameDocumentation
publict_advanced_rules_model (structured type)

+ The advanced rules feature is deprecated. Existing models

+ are supported until 24 June 2021, but after 10 June 2021, you will not be able + to deploy advanced rules models to Natural Language Understanding. After 24 + June 2021, advanced rules models will not run in Natural Language + Understanding.
+
+ Advanced rules model.
publict_advanced_rules_model_list (structured type)

+ The advanced rules feature is deprecated. Existing models

+ are supported until 24 June 2021, but after 10 June 2021, you will not be able + to deploy advanced rules models to Natural Language Understanding. After 24 + June 2021, advanced rules models will not run in Natural Language + Understanding.
+
+ List of advanced rules models.
publict_advncd_rls_analysis_results type jsonobject No documentation available.
publict_analysis_results (structured type)

+ Results of the analysis, organized by feature.

publict_analysis_results_usage (structured type)

+ API usage information for the request.

publict_author (structured type)

+ The author of the analyzed content.

publict_base_advanced_rules_model (structured type)

+ The advanced rules feature is deprecated. Existing models

+ are supported until 24 June 2021, but after 10 June 2021, you will not be able + to deploy advanced rules models to Natural Language Understanding. After 24 + June 2021, advanced rules models will not run in Natural Language + Understanding.
+
+ Advanced rules model.
publict_categories_model (structured type)

+ Categories model.

publict_categories_model_list (structured type)

+ List of categories models.

publict_categories_options (structured type)

+ Returns a hierarchical taxonomy of the content. The top

+ three categories are returned by default.

Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, - Portuguese, Spanish.
publict_categories_relevant_text (structured type)

- Relevant text that contributed to the categorization.

publict_categories_result (structured type)

- A categorization of the analyzed text.

publict_concepts_options (structured type)

+ Portuguese, Spanish.

publict_categories_relevant_text (structured type)

+ Relevant text that contributed to the categorization.

publict_categories_result (structured type)

+ A categorization of the analyzed text.

publict_classifications_model (structured type)

+ Classifications model.

publict_classifications_model_list (structured type)

+ List of classifications models.

publict_classifications_options (structured type)

+ Returns text classifications for the content.

publict_classifications_result (structured type)

+ A classification of the analyzed text.

publict_clssfctns_mdl_fl_and_mtdt (structured type)

+ Metadata associated with this custom model.

publict_clssfctns_mdl_fl_mtdt_and_t1 (structured type)

+ Metadata associated with this custom model.

publict_clssfctns_trnng_parameters (structured type)

+ Optional classifications training parameters along with

+ model train requests.
publict_concepts_options (structured type)

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.
publict_concepts_result (structured type)

+ Portuguese, Spanish.

publict_concepts_result (structured type)

The general concepts referenced or alluded to in the

- analyzed text.
publict_ctgrs_result_explanation (structured type)

+ analyzed text.

publict_ctgrs_mdl_file_and_metadata (structured type)

+ Metadata associated with this custom model.

publict_ctgrs_result_explanation (structured type)

Information that helps to explain what contributed to the

- categories result.
publict_dbpedia_resource type STRING

- Link to the corresponding DBpedia resource.

publict_delete_model_results (structured type)

- Delete model results.

publict_disambiguation_result (structured type)

- Disambiguation information for the entity.

publict_document_emotion_results (structured type)

- Emotion results for the document as a whole.

publict_document_sentiment_results (structured type) No documentation available.
publict_emotion_options (structured type)

+ categories result.

publict_dbpedia_resource type string

+ Link to the corresponding DBpedia resource.

publict_delete_model_results (structured type)

+ Delete model results.

publict_disambiguation_result (structured type)

+ Disambiguation information for the entity.

publict_document_emotion_results (structured type)

+ Emotion results for the document as a whole.

publict_document_sentiment_results (structured type) No documentation available.
publict_emotion_options (structured type)

Detects anger, disgust, fear, joy, or sadness that is

conveyed in the content or by the context around target phrases specified in the targets parameter. You can analyze emotion for detected entities with `entities.emotion` and for keywords with `keywords.emotion`.

- Supported languages: English.
publict_emotion_result (structured type)

+ Supported languages: English.

publict_emotion_result (structured type)

The detected anger, disgust, fear, joy, or sadness that is

conveyed by the content. Emotion information can be returned for detected - entities, keywords, or user-specified target phrases found in the text.
publict_emotion_scores (structured type) No documentation available.
publict_entities_options (structured type)

+ entities, keywords, or user-specified target phrases found in the text.

publict_emotion_scores (structured type) No documentation available.
publict_entities_options (structured type)

Identifies people, cities, organizations, and other entities

in the content. For more information, see [Entity types and subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natur @@ -52,30 +92,32 @@
Supported languages: English, French, German, Italian, Japanese, Korean, Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported - only through custom models.
publict_entities_result (structured type)

+ only through custom models.

publict_entities_result (structured type)

The important people, places, geopolitical entities and

- other types of entities in your content.
publict_entity_mention (structured type) No documentation available.
publict_error_response (structured type) No documentation available.
publict_features (structured type)

- Analysis features and options.

publict_features_results (structured type)

- Analysis results for each requested feature.

publict_features_results_metadata (structured type)

+ other types of entities in your content.

publict_entity_mention (structured type) No documentation available.
publict_error_response (structured type) No documentation available.
publict_features (structured type)

+ Analysis features and options.

publict_features_results (structured type)

+ Analysis results for each requested feature.

publict_features_results_metadata (structured type)

Webpage metadata, such as the author and the title of the

- page.
publict_feature_sentiment_results (structured type) No documentation available.
publict_feed (structured type)

- RSS or ATOM feed found on the webpage.

publict_file_and_metadata (structured type)

- Metadata associated with this custom model.

publict_keywords_options (structured type)

+ page.

publict_feature_sentiment_results (structured type) No documentation available.
publict_feed (structured type)

+ RSS or ATOM feed found on the webpage.

publict_file_and_metadata (structured type)

+ Metadata associated with this custom model.

publict_keywords_options (structured type)

Returns important keywords in the content.



Supported languages: English, French, German, Italian, Japanese, Korean, - Portuguese, Russian, Spanish, Swedish.
publict_keywords_result (structured type)

+ Portuguese, Russian, Spanish, Swedish.

publict_keywords_result (structured type)

The important keywords in the content, organized by

- relevance.
publict_list_models_results (structured type)

- Custom models that are available for entities and relations.

publict_metadata_options type JSONOBJECT

+ relevance.

publict_list_models_results (structured type)

+ Custom models that are available for entities and relations.

publict_metadata_options type jsonobject

Returns information from the document, including author

name, title, RSS/ATOM feeds, prominent page image, and publication date. - Supports URL and HTML input types only.
publict_metadata_result (structured type)

+ Supports URL and HTML input types only.

publict_metadata_result (structured type)

The authors, publication date, title, prominent page image,

- and RSS/ATOM feeds of the webpage. Supports URL and HTML input types.
publict_model (structured type) No documentation available.
publict_model_file_and_metadata (structured type)

- Metadata associated with this custom model.

publict_model_metadata (structured type)

- Metadata associated with this custom model.

publict_parameters (structured type)

- An object containing request parameters.

publict_relations_options (structured type)

+ and RSS/ATOM feeds of the webpage. Supports URL and HTML input types.

publict_model (structured type) No documentation available.
publict_model_file_and_metadata (structured type)

+ Metadata associated with this custom model.

publict_model_metadata (structured type)

+ Metadata associated with this custom model.

publict_notice (structured type)

+ A list of messages describing model training issues when

+ model status is `error`.
publict_parameters (structured type)

+ An object containing request parameters.

publict_relations_options (structured type)

Recognizes when two entities are related and identifies the

type of relation. For example, an `awardedTo` relation might connect the entities "Nobel Prize" and "Albert Einstein". For more @@ -85,37 +127,40 @@
Supported languages: Arabic, English, German, Japanese, Korean, Spanish. Chinese, Dutch, French, Italian, and Portuguese custom models are also - supported.
publict_relations_result (structured type)

- The relations between entities found in the content.

publict_relation_argument (structured type) No documentation available.
publict_relation_entity (structured type)

- An entity that corresponds with an argument in a relation.

publict_semantic_roles_action (structured type) No documentation available.
publict_semantic_roles_entity (structured type) No documentation available.
publict_semantic_roles_keyword (structured type) No documentation available.
publict_semantic_roles_object (structured type) No documentation available.
publict_semantic_roles_options (structured type)

+ supported.

publict_relations_result (structured type)

+ The relations between entities found in the content.

publict_relation_argument (structured type) No documentation available.
publict_relation_entity (structured type)

+ An entity that corresponds with an argument in a relation.

publict_semantic_roles_action (structured type) No documentation available.
publict_semantic_roles_entity (structured type) No documentation available.
publict_semantic_roles_keyword (structured type) No documentation available.
publict_semantic_roles_object (structured type) No documentation available.
publict_semantic_roles_options (structured type)

Parses sentences into subject, action, and object form.



- Supported languages: English, German, Japanese, Korean, Spanish.
publict_semantic_roles_result (structured type)

+ Supported languages: English, German, Japanese, Korean, Spanish.

publict_semantic_roles_result (structured type)

The object containing the actions and the objects the

- actions act upon.
publict_semantic_roles_result_action (structured type)

- The extracted action from the sentence.

publict_semantic_roles_result_object (structured type)

- The extracted object from the sentence.

publict_semantic_roles_subject (structured type) No documentation available.
publict_semantic_roles_verb (structured type) No documentation available.
publict_sentence_result (structured type) No documentation available.
publict_sentiment_model (structured type) No documentation available.
publict_sentiment_options (structured type)

+ actions act upon.

publict_semantic_roles_result_action (structured type)

+ The extracted action from the sentence.

publict_semantic_roles_result_object (structured type)

+ The extracted object from the sentence.

publict_semantic_roles_subject (structured type) No documentation available.
publict_semantic_roles_verb (structured type) No documentation available.
publict_sentence_result (structured type) No documentation available.
publict_sentiment_model (structured type) No documentation available.
publict_sentiment_options (structured type)

Analyzes the general sentiment of your content or the

sentiment toward specific target phrases. You can analyze sentiment for detected entities with `entities.sentiment` and for keywords with `keywords.sentiment`.

Supported languages: Arabic, English, French, German, Italian, Japanese, - Korean, Portuguese, Russian, Spanish.
publict_sentiment_result (structured type)

- The sentiment of the content.

publict_smntc_roles_result_subject (structured type)

- The extracted subject from the sentence.

publict_sntmnt_mdl_file_and_metadata (structured type)

- Metadata associated with this custom model.

publict_summarization_options (structured type)

- (Experimental) Returns a summary of content.


+ Korean, Portuguese, Russian, Spanish.
publict_sentiment_result (structured type)

+ The sentiment of the content.

publict_smntc_roles_result_subject (structured type)

+ The extracted subject from the sentence.

publict_sntmnt_mdl_file_and_metadata (structured type)

+ Metadata associated with this custom model.

publict_summarization_options (structured type)

+ (Experimental) Returns a summary of content.


+
+ Supported languages: English only.

- Supported languages: English only.
publict_summarization_result (structured type)

- (Experimental) Summary of content.

publict_syntax_options (structured type)

- Returns tokens and sentences from the input text.

publict_syntax_options_tokens (structured type)

- Tokenization options.

publict_syntax_result (structured type)

- Tokens and sentences returned from syntax analysis.

publict_targeted_emotion_results (structured type)

- Emotion results for a specified target.

publict_targeted_sentiment_results (structured type) No documentation available.
publict_token_result (structured type) No documentation available.
publict_usage (structured type)

- Usage information.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
analyze
importingi_parameterstype T_PARAMETERS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ANALYSIS_RESULTS
raisingzcx_ibmc_service_exception

Analyze text

+ Supported regions: Dallas region only.
publict_summarization_result (structured type)

+ (Experimental) Summary of content.

publict_syntax_options (structured type)

+ Returns tokens and sentences from the input text.

publict_syntax_options_tokens (structured type)

+ Tokenization options.

publict_syntax_result (structured type)

+ Tokens and sentences returned from syntax analysis.

publict_targeted_emotion_results (structured type)

+ Emotion results for a specified target.

publict_targeted_sentiment_results (structured type) No documentation available.
publict_token_result (structured type) No documentation available.
publict_usage (structured type)

+ Usage information.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
analyze
importingi_parameterstype t_parameters
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_analysis_results
raisingzcx_ibmc_service_exception

Analyze text

Analyzes text, HTML, or a public webpage for the following features:
- Categories
+ - Classifications
- Concepts
- Emotion
- Entities
@@ -138,7 +183,90 @@
e_response Service return value of type T_ANALYSIS_RESULTS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_model
importingi_model_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_DELETE_MODEL_RESULTS
raisingzcx_ibmc_service_exception

Delete model

+
public instance
create_categories_model
importingi_languagetype string
i_training_datatype file
i_training_data_content_typetype string optional
i_nametype string optional
i_user_metadatatype jsonobject optional
i_descriptiontype string optional
i_model_versiontype string optional
i_workspace_idtype string optional
i_version_descriptiontype string optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_categories_model
raisingzcx_ibmc_service_exception

Create categories model

+ (Beta) Creates a custom categories model by uploading training data and + associated metadata. The model begins the training and deploying process and is + ready to use when the `status` is `available`. + +
Parameters
i_language + The 2-letter language code of this model. +
i_training_data + Training data in JSON format. For more information, see [Categories training + data + requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + atural-language-understanding-categories##categories-training-data-requirements) + . +
i_training_data_content_type + The content type of trainingData. +
i_name + An optional name for the model. +
i_user_metadata + An optional map of metadata key-value pairs to store with this model. +
i_description + An optional description of the model. +
i_model_version + An optional version string. +
i_workspace_id + ID of the Watson Knowledge Studio workspace that deployed this model to Natural + Language Understanding. +
i_version_description + The description of the version. +
e_response + Service return value of type T_CATEGORIES_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
create_classifications_model
importingi_languagetype string
i_training_datatype file
i_training_data_content_typetype string optional
i_nametype string optional
i_user_metadatatype jsonobject optional
i_descriptiontype string optional
i_model_versiontype string optional
i_workspace_idtype string optional
i_version_descriptiontype string optional
i_training_parameterstype t_clssfctns_trnng_parameters optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_classifications_model
raisingzcx_ibmc_service_exception

Create classifications model

+ Creates a custom classifications model by uploading training data and associated + metadata. The model begins the training and deploying process and is ready to + use when the `status` is `available`. + +
Parameters
i_language + The 2-letter language code of this model. +
i_training_data + Training data in JSON format. For more information, see [Classifications + training data + requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + atural-language-understanding-classifications#classification-training-data-requi + rements). +
i_training_data_content_type + The content type of trainingData. +
i_name + An optional name for the model. +
i_user_metadata + An optional map of metadata key-value pairs to store with this model. +
i_description + An optional description of the model. +
i_model_version + An optional version string. +
i_workspace_id + ID of the Watson Knowledge Studio workspace that deployed this model to Natural + Language Understanding. +
i_version_description + The description of the version. +
i_training_parameters + Optional classifications training parameters along with model train requests. +
e_response + Service return value of type T_CLASSIFICATIONS_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_categories_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_delete_model_results
raisingzcx_ibmc_service_exception

Delete categories model

+ (Beta) Un-deploys the custom categories model with the given model ID and + deletes all associated customer data, including any training data or binary + artifacts. + +
Parameters
i_model_id + ID of the model. +
e_response + Service return value of type T_DELETE_MODEL_RESULTS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_classifications_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_delete_model_results
raisingzcx_ibmc_service_exception

Delete classifications model

+ Un-deploys the custom classifications model with the given model ID and deletes + all associated customer data, including any training data or binary artifacts. + +
Parameters
i_model_id + ID of the model. +
e_response + Service return value of type T_DELETE_MODEL_RESULTS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_delete_model_results
raisingzcx_ibmc_service_exception

Delete model

Deletes a custom model
Parameters
i_model_id @@ -146,7 +274,37 @@
e_response Service return value of type T_DELETE_MODEL_RESULTS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
list_models
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_LIST_MODELS_RESULTS
raisingzcx_ibmc_service_exception

List models

+
public instanceget_appname redefinition public instance
get_categories_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_categories_model
raisingzcx_ibmc_service_exception

Get categories model details

+ (Beta) Returns the status of the categories model with the given model ID. + +
Parameters
i_model_id + ID of the model. +
e_response + Service return value of type T_CATEGORIES_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_classifications_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_classifications_model
raisingzcx_ibmc_service_exception

Get classifications model details

+ Returns the status of the classifications model with the given model ID. + +
Parameters
i_model_id + ID of the model. +
e_response + Service return value of type T_CLASSIFICATIONS_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
list_categories_models
importingi_accepttype string default 'application/json'
exportinge_responsetype t_categories_model_list
raisingzcx_ibmc_service_exception

List categories models

+ (Beta) Returns all custom categories models associated with this service + instance. + +
Parameters
e_response + Service return value of type T_CATEGORIES_MODEL_LIST +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_classifications_models
importingi_accepttype string default 'application/json'
exportinge_responsetype t_classifications_model_list
raisingzcx_ibmc_service_exception

List classifications models

+ Returns all custom classifications models associated with this service instance. + + +
Parameters
e_response + Service return value of type T_CLASSIFICATIONS_MODEL_LIST +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_models
importingi_accepttype string default 'application/json'
exportinge_responsetype t_list_models_results
raisingzcx_ibmc_service_exception

List models

Lists Watson Knowledge Studio [custom entities and relations models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural -language-understanding-customizing) that are deployed to your Natural Language @@ -155,4 +313,70 @@
Parameters
e_response Service return value of type T_LIST_MODELS_RESULTS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file +
public instance
update_categories_model
importingi_model_idtype string
i_languagetype string
i_training_datatype file
i_training_data_content_typetype string optional
i_nametype string optional
i_user_metadatatype jsonobject optional
i_descriptiontype string optional
i_model_versiontype string optional
i_workspace_idtype string optional
i_version_descriptiontype string optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_categories_model
raisingzcx_ibmc_service_exception

Update categories model

+ (Beta) Overwrites the training data associated with this custom categories model + and retrains the model. The new model replaces the current deployment. + +
Parameters
i_model_id + ID of the model. +
i_language + The 2-letter language code of this model. +
i_training_data + Training data in JSON format. For more information, see [Categories training + data + requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + atural-language-understanding-categories##categories-training-data-requirements) + . +
i_training_data_content_type + The content type of trainingData. +
i_name + An optional name for the model. +
i_user_metadata + An optional map of metadata key-value pairs to store with this model. +
i_description + An optional description of the model. +
i_model_version + An optional version string. +
i_workspace_id + ID of the Watson Knowledge Studio workspace that deployed this model to Natural + Language Understanding. +
i_version_description + The description of the version. +
e_response + Service return value of type T_CATEGORIES_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
update_classifications_model
importingi_model_idtype string
i_languagetype string
i_training_datatype file
i_training_data_content_typetype string optional
i_nametype string optional
i_user_metadatatype jsonobject optional
i_descriptiontype string optional
i_model_versiontype string optional
i_workspace_idtype string optional
i_version_descriptiontype string optional
i_training_parameterstype t_clssfctns_trnng_parameters optional
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_classifications_model
raisingzcx_ibmc_service_exception

Update classifications model

+ Overwrites the training data associated with this custom classifications model + and retrains the model. The new model replaces the current deployment. + +
Parameters
i_model_id + ID of the model. +
i_language + The 2-letter language code of this model. +
i_training_data + Training data in JSON format. For more information, see [Classifications + training data + requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + atural-language-understanding-classifications#classification-training-data-requi + rements). +
i_training_data_content_type + The content type of trainingData. +
i_name + An optional name for the model. +
i_user_metadata + An optional map of metadata key-value pairs to store with this model. +
i_description + An optional description of the model. +
i_model_version + An optional version string. +
i_workspace_id + ID of the Watson Knowledge Studio workspace that deployed this model to Natural + Language Understanding. +
i_version_description + The description of the version. +
i_training_parameters + Optional classifications training parameters along with model train requests. +
e_response + Service return value of type T_CLASSIFICATIONS_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_personal_insights_v3.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_personal_insights_v3.html deleted file mode 100644 index 7df4116..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_personal_insights_v3.html +++ /dev/null @@ -1,230 +0,0 @@ -Class ZCL_IBMC_PERSONAL_INSIGHTS_V3

Class ZCL_IBMC_PERSONAL_INSIGHTS_V3

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Personality Insights

- IBM® will begin sunsetting IBM Watson™ Personality Insights on 1 - December 2020. For a period of one year from this date, you will still be able - to use Watson Personality Insights. However, as of 1 December 2021, the - offering will no longer be available.<br/><br/>As an alternative, - we encourage you to consider migrating to IBM Watson™ Natural Language - Understanding, a service on IBM Cloud® that uses deep learning to extract - data and insights from text such as keywords, categories, sentiment, emotion, - and syntax to provide insights for your business or industry. For more - information, see [About Natural Language - Understanding](https://cloud.ibm.com/docs/natural-language-understanding?topic= - natural-language-understanding-about).
- {: deprecated}
-
- The IBM Watson Personality Insights service enables applications to derive - insights from social media, enterprise data, or other digital communications. - The service uses linguistic analytics to infer individuals' intrinsic - personality characteristics, including Big Five, Needs, and Values, from - digital communications such as email, text messages, tweets, and forum - posts.
-
- The service can automatically infer, from potentially noisy social media, - portraits of individuals that reflect their personality characteristics. The - service can infer consumption preferences based on the results of its analysis - and, for JSON content that is timestamped, can report temporal behavior.
- * For information about the meaning of the models that the service uses to - describe personality characteristics, see [Personality - models](https://cloud.ibm.com/docs/personality-insights?topic=personality-insig - hts-models#models).
- * For information about the meaning of the consumption preferences, see - [Consumption - preferences](https://cloud.ibm.com/docs/personality-insights?topic=personality- - insights-preferences#preferences).
-
- **Note:** Request logging is disabled for the Personality Insights service. - Regardless of whether you set the `X-Watson-Learning-Opt-Out` request header, - the service does not log or retain data from requests and responses.

Types

Visibility and LevelNameDocumentation
publict_behavior (structured type)

- The temporal behavior for the input content.

publict_cnsmptn_preferences_category (structured type)

- The consumption preferences that the service inferred from

- the input content.
publict_consumption_preferences (structured type)

- A consumption preference that the service inferred from the

- input content.
publict_content (structured type)

- The full input content that the service is to analyze.

publict_content_item (structured type)

- An input content item that the service is to analyze.

publict_csv_file type STRING

- A CSV file that contains the results of the personality

- profile that the service generated for the input content.
publict_error_model (structured type)

- The error response from a failed request.

publict_profile (structured type)

- The personality profile that the service generated for the

- input content.
publict_trait (structured type)

- The characteristics that the service inferred from the input

- content.
publict_warning (structured type)

- A warning message that is associated with the input content.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instanceget_appname redefinition 
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
profile
importingi_contenttype T_CONTENT
i_content_typetype STRING default 'text/plain'
i_content_languagetype STRING default 'en'
i_accept_languagetype STRING default 'en'
i_raw_scorestype BOOLEAN default C_BOOLEAN_FALSE
i_csv_headerstype BOOLEAN default C_BOOLEAN_FALSE
i_consumption_preferencestype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
exportinge_responsetype T_PROFILE
raisingzcx_ibmc_service_exception

Get profile

- Generates a personality profile for the author of the input text. The service - accepts a maximum of 20 MB of input content, but it requires much less text to - produce an accurate profile. The service can analyze text in Arabic, English, - Japanese, Korean, or Spanish. It can return its results in a variety of - languages.
-
- **See also:**
- * [Requesting a - profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-input#input)
- * [Providing sufficient - input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - ts-input#sufficient)
-
- ### Content types
-
- You can provide input content as plain text (`text/plain`), HTML (`text/html`), - or JSON (`application/json`) by specifying the **Content-Type** parameter. The - default is `text/plain`.
- * Per the JSON specification, the default character encoding for JSON content is - effectively always UTF-8.
- * Per the HTTP specification, the default encoding for plain text and HTML is - ISO-8859-1 (effectively, the ASCII character set).
-
- When specifying a content type of plain text or HTML, include the `charset` - parameter to indicate the character encoding of the input text; for example, - `Content-Type: text/plain;charset=utf-8`.
-
- **See also:** [Specifying request and response - formats](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-input#formats)
-
- ### Accept types
-
- You must request a response as JSON (`application/json`) or comma-separated - values (`text/csv`) by specifying the **Accept** parameter. CSV output includes - a fixed number of columns. Set the **csv_headers** parameter to `true` to - request optional column headers for CSV output.
-
- **See also:**
- * [Understanding a JSON - profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-output#output)
- * [Understanding a CSV - profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-outputCSV#outputCSV) - -
Parameters
i_content - A maximum of 20 MB of content to analyze, though the service requires much less - text; for more information, see [Providing sufficient - input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - ts-input#sufficient). For JSON input, provide an object of type `Content`. -
i_content_type - The type of the input. For more information, see **Content types** in the method - description. -
i_content_language - The language of the input text for the request: Arabic, English, Japanese, - Korean, or Spanish. Regional variants are treated as their parent language; for - example, `en-US` is interpreted as `en`.
-
- The effect of the **Content-Language** parameter depends on the **Content-Type** - parameter. When **Content-Type** is `text/plain` or `text/html`, - **Content-Language** is the only way to specify the language. When - **Content-Type** is `application/json`, **Content-Language** overrides a - language specified with the `language` parameter of a `ContentItem` object, and - content items that specify a different language are ignored; omit this - parameter to base the language on the specification of the content items. You - can specify any combination of languages for **Content-Language** and - **Accept-Language**. -
i_accept_language - The desired language of the response. For two-character arguments, regional - variants are treated as their parent language; for example, `en-US` is - interpreted as `en`. You can specify any combination of languages for the input - and response content. -
i_raw_scores - Indicates whether a raw score in addition to a normalized percentile is returned - for each characteristic; raw scores are not compared with a sample population. - By default, only normalized percentiles are returned. -
i_csv_headers - Indicates whether column labels are returned with a CSV response. By default, no - column labels are returned. Applies only when the response type is CSV - (`text/csv`). -
i_consumption_preferences - Indicates whether consumption preferences are returned with the results. By - default, no consumption preferences are returned. -
e_response - Service return value of type T_PROFILE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
profile_as_csv
importingi_contenttype T_CONTENT
i_content_typetype STRING default 'text/plain'
i_content_languagetype STRING default 'en'
i_accept_languagetype STRING default 'en'
i_raw_scorestype BOOLEAN default C_BOOLEAN_FALSE
i_csv_headerstype BOOLEAN default C_BOOLEAN_FALSE
i_consumption_preferencestype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'text/csv'
exportinge_responsetype STRING
raisingzcx_ibmc_service_exception

Get profile as csv

- Generates a personality profile for the author of the input text. The service - accepts a maximum of 20 MB of input content, but it requires much less text to - produce an accurate profile. The service can analyze text in Arabic, English, - Japanese, Korean, or Spanish. It can return its results in a variety of - languages.
-
- **See also:**
- * [Requesting a - profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-input#input)
- * [Providing sufficient - input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - ts-input#sufficient)
-
- ### Content types
-
- You can provide input content as plain text (`text/plain`), HTML (`text/html`), - or JSON (`application/json`) by specifying the **Content-Type** parameter. The - default is `text/plain`.
- * Per the JSON specification, the default character encoding for JSON content is - effectively always UTF-8.
- * Per the HTTP specification, the default encoding for plain text and HTML is - ISO-8859-1 (effectively, the ASCII character set).
-
- When specifying a content type of plain text or HTML, include the `charset` - parameter to indicate the character encoding of the input text; for example, - `Content-Type: text/plain;charset=utf-8`.
-
- **See also:** [Specifying request and response - formats](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-input#formats)
-
- ### Accept types
-
- You must request a response as JSON (`application/json`) or comma-separated - values (`text/csv`) by specifying the **Accept** parameter. CSV output includes - a fixed number of columns. Set the **csv_headers** parameter to `true` to - request optional column headers for CSV output.
-
- **See also:**
- * [Understanding a JSON - profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-output#output)
- * [Understanding a CSV - profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - ghts-outputCSV#outputCSV) - -
Parameters
i_content - A maximum of 20 MB of content to analyze, though the service requires much less - text; for more information, see [Providing sufficient - input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - ts-input#sufficient). For JSON input, provide an object of type `Content`. -
i_content_type - The type of the input. For more information, see **Content types** in the method - description. -
i_content_language - The language of the input text for the request: Arabic, English, Japanese, - Korean, or Spanish. Regional variants are treated as their parent language; for - example, `en-US` is interpreted as `en`.
-
- The effect of the **Content-Language** parameter depends on the **Content-Type** - parameter. When **Content-Type** is `text/plain` or `text/html`, - **Content-Language** is the only way to specify the language. When - **Content-Type** is `application/json`, **Content-Language** overrides a - language specified with the `language` parameter of a `ContentItem` object, and - content items that specify a different language are ignored; omit this - parameter to base the language on the specification of the content items. You - can specify any combination of languages for **Content-Language** and - **Accept-Language**. -
i_accept_language - The desired language of the response. For two-character arguments, regional - variants are treated as their parent language; for example, `en-US` is - interpreted as `en`. You can specify any combination of languages for the input - and response content. -
i_raw_scores - Indicates whether a raw score in addition to a normalized percentile is returned - for each characteristic; raw scores are not compared with a sample population. - By default, only normalized percentiles are returned. -
i_csv_headers - Indicates whether column labels are returned with a CSV response. By default, no - column labels are returned. Applies only when the response type is CSV - (`text/csv`). -
i_consumption_preferences - Indicates whether consumption preferences are returned with the results. By - default, no consumption preferences are returned. -
e_response - Service return value of type STRING -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service.html index d1f1bd6..e03f9cf 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service.html @@ -1,4 +1,4 @@ -Class ZCL_IBMC_SERVICE

Class ZCL_IBMC_SERVICE

public inheriting from ZCL_IBMC_SERVICE_ARCH create public

Documentation

ABAP SDK for IBM Watson - Service Class

Types

Visibility and LevelNameDocumentation
publicbinary type XSTRING 
publicboolean type ZIF_IBMC_SERVICE_ARCH~BOOLEAN 
publicchar type ZIF_IBMC_SERVICE_ARCH~CHAR 
publicdata_reference type ref to DATA 
publicdate type STRING 
publicdatetime (typing)DateTime type, format 2018-10-23T15:18:18.914xxxZ
publicdouble type F 
publicfieldname (typing) 
publicfile type XSTRING 
publicfloat type F 
publicinteger type I 
publicjsonobject type ref to DATA 
publiclong type INT8 
publicmap type ref to DATA 
publicnumber type F 
publicshort type INT2 
publictime type STRING 
publicts_file_with_metadata (structured type) 
publicts_form_part type ZIF_IBMC_SERVICE_ARCH~TS_FORM_PART 
publicts_map_file (structured type) 
publictt_boolean TYPE standard table of ZIF_IBMC_SERVICE_ARCH~BOOLEAN with non-unique default key 
publictt_char TYPE standard table of ZIF_IBMC_SERVICE_ARCH~CHAR with non-unique default key 
publictt_double TYPE standard table of DOUBLE with non-unique default key 
publictt_file TYPE standard table of FILE with non-unique default key 
publictt_file_with_metadata TYPE standard table of TS_FILE_WITH_METADATA with non-unique default key 
publictt_float TYPE standard table of FLOAT with non-unique default key 
publictt_form_part type ZIF_IBMC_SERVICE_ARCH~TT_FORM_PART 
publictt_integer TYPE standard table of INTEGER with non-unique default key 
publictt_long TYPE standard table of LONG with non-unique default key 
publictt_map_file TYPE standard table of TS_MAP_FILE with non-unique default key 
publictt_number TYPE standard table of NUMBER with non-unique default key 
publictt_short TYPE standard table of SHORT with non-unique default key 
publictt_string type ZIF_IBMC_SERVICE_ARCH~TT_STRING 

Constants

Visibility and LevelNameDocumentation
public staticc_blank type STRING value '&#§§#&__%$X' 
public staticc_boolean_false type BOOLEAN value SPACE 
public staticc_boolean_true type BOOLEAN value 'X' 
public staticc_datatype (structured type)  
public staticc_default type STRING value 'DEFAULT' 
public staticc_f_zero type F value '-2147481.648' 
public staticc_i8_zero type INT8 value -9223372036854775608 
public staticc_i_zero type I value -2147481648 
public staticc_msgid type SY-MSGID value 'ZIBMC' 
public staticc_subrc_unknown type SY-SUBRC value 999999 
public staticc_tribool_false type BOOLEAN value '-' 

Attributes

Visibility and LevelNameDocumentation
public instancep_debug_mode type CHAR value SPACE 
public instancep_request_prop_default type TS_REQUEST_PROP  
public instancep_version type STRING  

Methods

Visibility and LevelNameDocumentation
public static
abap_to_json
importingi_nametype STRING optional
i_valuetype ANY
i_dictionarytype ANY optional
i_required_fieldstype ANY optional
i_lower_casetype BOOLEAN default C_BOOLEAN_TRUE
returningvalue(e_json)type STRING

Extracts a JSON string from an ABAP structure.

+Class ZCL_IBMC_SERVICE

Class ZCL_IBMC_SERVICE

public inheriting from zcl_ibmc_service_arch create public

Documentation

ABAP SDK for IBM Watson - Service Class

Types

Visibility and LevelNameDocumentation
publicbinary type xstring 
publicboolean type zif_ibmc_service_arch~boolean 
publicchar type zif_ibmc_service_arch~char 
publicdata_reference type ref to data 
publicdate type string 
publicdatetime (typing)DateTime type, format 2018-10-23T15:18:18.914xxxZ
publicdouble type f 
publicfieldname (typing) 
publicfile type xstring 
publicfloat type f 
publicinteger type i 
publicjsonobject type ref to data 
publiclong type int8 
publicmap type ref to data 
publicnumber type f 
publicshort type int2 
publictime type string 
publicts_file_with_metadata (structured type) 
publicts_form_part type zif_ibmc_service_arch~ts_form_part 
publicts_map_file (structured type) 
publictt_boolean type standard table of zif_ibmc_service_arch~boolean with non-unique default key 
publictt_char type standard table of zif_ibmc_service_arch~char with non-unique default key 
publictt_double type standard table of double with non-unique default key 
publictt_file type standard table of file with non-unique default key 
publictt_file_with_metadata type standard table of ts_file_with_metadata with non-unique default key 
publictt_float type standard table of float with non-unique default key 
publictt_form_part type zif_ibmc_service_arch~tt_form_part 
publictt_integer type standard table of integer with non-unique default key 
publictt_long type standard table of long with non-unique default key 
publictt_map_file type standard table of ts_map_file with non-unique default key 
publictt_number type standard table of number with non-unique default key 
publictt_short type standard table of short with non-unique default key 
publictt_string type zif_ibmc_service_arch~tt_string 

Constants

Visibility and LevelNameDocumentation
public staticc_blank type string value '&#!-#&__%$X' 
public staticc_boolean_false type boolean value space 
public staticc_boolean_true type boolean value 'X' 
public staticc_datatype (structured type)  
public staticc_default type string value 'DEFAULT' 
public staticc_f_zero type f value '-2147481.648' 
public staticc_i8_zero type int8 value -9223372036854775608 
public staticc_i_zero type i value -2147481648 
public staticc_msgid type sy-msgid value 'ZIBMC' 
public staticc_subrc_unknown type sy-subrc value 999999 
public staticc_tribool_false type boolean value '-' 

Attributes

Visibility and LevelNameDocumentation
public instancep_debug_mode type char value space 
public instancep_request_prop_default type ts_request_prop  
public instancep_version type string  

Methods

Visibility and LevelNameDocumentation
public static
abap_to_json
importingi_nametype string optional
i_valuetype any
i_dictionarytype any optional
i_required_fieldstype any optional
i_lower_casetype boolean default c_boolean_true
returningvalue(e_json)type string

Extracts a JSON string from an ABAP structure.

Parameters
i_name Name of component to be extracted.
i_value ABAP structure to be converted to JSON string. @@ -9,41 +9,41 @@ Otherwise it is omitted in JSON string.
i_lower_case If set to C_BOOLEAN_TRUE all keys in JSON string will be lower case.
e_json JSON string. -
public static
add_header_parameter
importingi_parametertype STRING
i_valuetype STRING
i_is_booleantype BOOLEAN default C_BOOLEAN_FALSE
changingc_headerstype ZIF_IBMC_SERVICE_ARCH~TS_REQUEST_PROP-HEADERS

Method for internal use.

-
public static
add_query_parameter
importingi_parametertype STRING
i_valuetype STRING
i_is_booleantype BOOLEAN default C_BOOLEAN_FALSE
changingc_urltype TS_URL

Method for internal use.

-
public static
get_components
importingi_structuretype ANY
exportingvalue(e_components)type ZIF_IBMC_SERVICE_ARCH~TT_STRING

Returns component names of a given structure.

+
public static
add_header_parameter
importingi_parametertype string
i_valuetype string
i_is_booleantype boolean default c_boolean_false
changingc_headerstype zif_ibmc_service_arch~ts_request_prop-headers

Method for internal use.

+
public static
add_query_parameter
importingi_parametertype string
i_valuetype string
i_is_booleantype boolean default c_boolean_false
changingc_urltype ts_url

Method for internal use.

+
public static
get_components
importingi_structuretype any
exportingvalue(e_components)type zif_ibmc_service_arch~tt_string

Returns component names of a given structure.

Parameters
i_structure Structure with components.
e_components Internal table of component names. -
public static
get_datatype
importingi_fieldtype ANY
returningvalue(e_datatype)type ZIF_IBMC_SERVICE_ARCH~CHAR

Returns data type of a given parameter.

+
public static
get_datatype
importingi_fieldtype any
returningvalue(e_datatype)type zif_ibmc_service_arch~char

Returns data type of a given parameter.

Parameters
i_field Field of type that is supposed to be determined.
e_datatype Technical type (= base type) of I_FIELD. -
public static
get_field_type
importingi_fieldtype ANY
exportinge_technical_typetype ZIF_IBMC_SERVICE_ARCH~CHAR
e_relative_typetype STRING
e_lengthtype I

Returns field type and length of a given parameter.

+
public static
get_field_type
importingi_fieldtype any
exportinge_technical_typetype zif_ibmc_service_arch~char
e_relative_typetype string
e_lengthtype i

Returns field type and length of a given parameter.

Parameters
i_field Field of type that is supposed to be determined.
e_technical_type Technical type (= base type) of I_FIELD.
e_relative_type Relative type (= data type) of I_FIELD.
e_length Length of type of I_FIELD. -
public static
get_file_extension
importingvalue(i_mime_type)type STRING
returningvalue(e_extension)type STRING

Returns the file extension for a mime type

, +
public static
get_file_extension
importingvalue(i_mime_type)type string
returningvalue(e_extension)type string

Returns the file extension for a mime type

, e.g. 'text/plain' -> 'txt'
Parameters
i_mime_type MIME type.
e_extension File extension (without leading dot). -
public static
get_full_url
importingi_urltype TS_URL
returningvalue(e_url)type STRING

Method for internal use.

-
public static
move_data_reference_to_abap
importingi_data_referencetype DATA_REFERENCE
exportingvalue(e_abap)type ANY
raisingzcx_ibmc_service_exception

Moves a referenced data structure to an ABAP structure.

+
public static
get_full_url
importingi_urltype ts_url
returningvalue(e_url)type string

Method for internal use.

+
public static
move_data_reference_to_abap
importingi_data_referencetype data_reference
exportingvalue(e_abap)type any
raisingzcx_ibmc_service_exception

Moves a referenced data structure to an ABAP structure.

Parameters
i_data_reference Reference to data object.
e_abap ABAP structure to be filled.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public static
normalize_url
changingc_urltype TS_URL

Method for internal use.

-
public static
parse_json
importingi_jsontype STRING
i_dictionarytype ANY optional
changingvalue(c_abap)type ANY
zcx_ibmc_service_exception

Parses a JSON string into an ABAP structure.

+
public static
normalize_url
changingc_urltype ts_url

Method for internal use.

+
public static
parse_json
importingi_jsontype string
i_dictionarytype any optional
changingvalue(c_abap)type any
zcx_ibmc_service_exception

Parses a JSON string into an ABAP structure.

Parameters
i_json JSON string.
i_dictionary Dictionary for mapping of identifier names.
c_abap ABAP structure to be filled
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public static
raise_exception
importingi_msgnotype SY-MSGNO optional
i_msgv1type STRING optional
i_msgv2type STRING optional
i_msgv3type STRING optional
i_msgv4type STRING optional
i_texttype STRING optional
i_subrctype SY-SUBRC default C_SUBRC_UNKNOWN
i_previoustype ref to CX_ROOT optional
i_http_statustype TS_HTTP_STATUS optional
raisingzcx_ibmc_service_exception

Raises an exception.

+
public static
raise_exception
importingi_msgnotype sy-msgno optional
i_msgv1type string optional
i_msgv2type string optional
i_msgv3type string optional
i_msgv4type string optional
i_texttype string optional
i_subrctype sy-subrc default c_subrc_unknown
i_previoustype ref to cx_root optional
i_http_statustype ts_http_status optional
raisingzcx_ibmc_service_exception

Raises an exception.

Parameters
i_msgno Message number.
i_msgv1 Substitution for 1st placeholder in message. @@ -55,17 +55,17 @@
i_previous Exception that has been captured before.
i_http_status HTTP status code if exception is triggered by HTTP error
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised. -
public static
unescape_unicode
importingi_intype STRING
returningvalue(e_out)type STRING

Unescape unicode codepoints to characters in a string

, +
public static
unescape_unicode
importingi_intype string
returningvalue(e_out)type string

Unescape unicode codepoints to characters in a string

, e.g. '\u0041 b \u0063' -> 'A b c'
Parameters
i_in String with unicode codepoints.
e_out Unescaped string. -
public instance
check_http_response
importingi_responsetype TO_REST_RESPONSE optional
i_urltype TS_URL optional
raisingzcx_ibmc_service_exception

Throws an exception, if HTTP response indicates an error.

+
public instance
check_http_response
importingi_responsetype to_rest_response optional
i_urltype ts_url optional
raisingzcx_ibmc_service_exception

Throws an exception, if HTTP response indicates an error.

Parameters
i_response HTTP response to be checked.
i_url URL that the request has been sent to.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
constructor
importingi_urltype STRING optional
i_hosttype STRING optional
i_proxy_hosttype STRING optional
i_proxy_porttype STRING optional
i_usernametype STRING optional
i_passwordtype STRING optional
i_apikeytype STRING optional
i_access_tokentype TS_ACCESS_TOKEN optional
i_ssl_idtype ZIF_IBMC_SERVICE_ARCH~TY_SSL_ID optional
i_debug_modetype CHAR default SPACE

Class constructor.

+
public instance
constructor
importingi_urltype string optional
i_hosttype string optional
i_proxy_hosttype string optional
i_proxy_porttype string optional
i_usernametype string optional
i_passwordtype string optional
i_apikeytype string optional
i_access_tokentype ts_access_token optional
i_ssl_idtype zif_ibmc_service_arch~ty_ssl_id optional
i_debug_modetype char default space

Class constructor.

Parameters
i_url URL of the service.
i_host Host of the service. I_URL and I_HOST can be used synonymously. @@ -77,39 +77,44 @@
i_access_token Access token to authenticate on service.
i_ssl_id ID of PSE, not applicable on SAP Cloud Platform.
i_debug_mode not used. -
public instance
get_access_token
importingi_request_proptype TS_REQUEST_PROP optional
returningvalue(e_access_token)type TS_ACCESS_TOKEN
raisingzcx_ibmc_service_exception

Method for internal use.

-
public instance
get_appname
returningvalue(e_appname)type STRING

Returns the service name.

+
public instance
get_access_token
importingi_request_proptype ts_request_prop optional
returningvalue(e_access_token)type ts_access_token
raisingzcx_ibmc_service_exception

Method for internal use.

+
public instance
get_appname
returningvalue(e_appname)type string

Returns the service name.

Parameters
e_appname Name of the service. -
public instance
get_request_prop
importingi_auth_methodtype STRING default C_DEFAULT
returningvalue(e_request_prop)type TS_REQUEST_PROP

Method for internal use.

-
public instance
get_rest_client
importingi_request_proptype TS_REQUEST_PROP
returningvalue(e_client)type TS_CLIENT
raisingzcx_ibmc_service_exception

Method for internal use.

-
public instance
http_delete
importingi_request_proptype TS_REQUEST_PROP
returningvalue(e_response)type TO_REST_RESPONSE
raisingzcx_ibmc_service_exception

Sends a HTTP DELETE request.

+
public instance
get_request_prop
importingi_auth_methodtype string default c_default
returningvalue(e_request_prop)type ts_request_prop

Method for internal use.

+
public instance
get_rest_client
importingi_request_proptype ts_request_prop
returningvalue(e_client)type ts_client
raisingzcx_ibmc_service_exception

Method for internal use.

+
public instance
http_delete
importingi_request_proptype ts_request_prop
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Sends a HTTP DELETE request.

Parameters
i_request_prop Request properties.
e_response Response returned by service.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
http_get
importingi_request_proptype TS_REQUEST_PROP
returningvalue(e_response)type TO_REST_RESPONSE
raisingzcx_ibmc_service_exception

Sends a HTTP GET request.

+
public instance
http_get
importingi_request_proptype ts_request_prop
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Sends a HTTP GET request.

Parameters
i_request_prop Request properties.
e_response Response returned by service.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
http_post
importingi_request_proptype TS_REQUEST_PROP
returningvalue(e_response)type TO_REST_RESPONSE
raisingzcx_ibmc_service_exception

Sends a HTTP POST request.

+
public instance
http_patch
importingi_request_proptype ts_request_prop
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Sends a HTTP PATCH request.

Parameters
i_request_prop Request properties.
e_response Response returned by service.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
http_post_multipart
importingi_request_proptype TS_REQUEST_PROP
it_form_parttype TT_FORM_PART
returningvalue(e_response)type TO_REST_RESPONSE
raisingzcx_ibmc_service_exception

Sends a HTTP POST request with multipart body.

+
public instance
http_post
importingi_request_proptype ts_request_prop
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Sends a HTTP POST request.

+ +
Parameters
i_request_prop Request properties. +
e_response Response returned by service. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
http_post_multipart
importingi_request_proptype ts_request_prop
it_form_parttype tt_form_part
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Sends a HTTP POST request with multipart body.

Parameters
i_request_prop Request properties.
it_form_part Internal table of form parts in request body.
e_response Response returned by service.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
http_put
importingi_request_proptype TS_REQUEST_PROP
returningvalue(e_response)type TO_REST_RESPONSE
raisingzcx_ibmc_service_exception

Sends a HTTP PUT request.

+
public instance
http_put
importingi_request_proptype ts_request_prop
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Sends a HTTP PUT request.

Parameters
i_request_prop Request properties.
e_response Response returned by service.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
set_access_token
importingi_access_tokentype TS_ACCESS_TOKEN

Sets an access token explicitly.

+
public instance
set_access_token
importingi_access_tokentype ts_access_token

Sets an access token explicitly.

Parameters
i_access_token Access token. -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_arch.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_arch.html index 32334f9..2d24aee 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_arch.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_arch.html @@ -1,81 +1,77 @@ -Class ZCL_IBMC_SERVICE_ARCH

Class ZCL_IBMC_SERVICE_ARCH

public create public

Documentation

IBM Watson SDK Platform-specifics

Interfaces

zif_ibmc_service_arch

Types

Visibility and LevelNameDocumentation
publicto_form_part type ref to IF_HTTP_ENTITY 
publicto_http_client type ref to IF_HTTP_CLIENTHTTP Client Control Block
publicto_http_entity type ref to IF_HTTP_ENTITY 
publicto_rest_client type ref to CL_REST_HTTP_CLIENTREST HTTP Client
publicto_rest_entity type ref to IF_REST_ENTITY 
publicto_rest_request type ref to IF_REST_ENTITY 
publicto_rest_response type ref to IF_REST_ENTITY 
publicts_access_token type ZIF_IBMC_SERVICE_ARCH~TS_ACCESS_TOKEN 
publicts_client (structured type) 
publicts_header type ZIF_IBMC_SERVICE_ARCH~TS_HEADER 
publicts_http_status type ZIF_IBMC_SERVICE_ARCH~TS_HTTP_STATUS 
publicts_request_prop type ZIF_IBMC_SERVICE_ARCH~TS_REQUEST_PROP 
publicts_url type ZIF_IBMC_SERVICE_ARCH~TS_URL 
publictt_header type ZIF_IBMC_SERVICE_ARCH~TT_HEADER 

Methods

Visibility and LevelNameDocumentation
public static
base64_decode
importingi_base64type STRING
returningvalue(e_binary)type XSTRING
raisingzcx_ibmc_service_exception

Decodes base64 encoded data to binary.

+Class ZCL_IBMC_SERVICE_ARCH

Class ZCL_IBMC_SERVICE_ARCH

public create public

Documentation

IBM Watson SDK Platform-specifics

Interfaces

zif_ibmc_service_arch

Types

Visibility and LevelNameDocumentation
publicto_form_part type ref to if_web_http_request 
publicto_http_client type ref to if_web_http_clientHTTP Client Control Block
publicto_rest_request type ref to if_web_http_request 
publicto_rest_response type ref to if_web_http_response 
publicts_access_token type zif_ibmc_service_arch~ts_access_token 
publicts_client (structured type) 
publicts_header type zif_ibmc_service_arch~ts_header 
publicts_http_stat (structured type) 
publicts_http_status (structured type) 
publicts_request_prop type zif_ibmc_service_arch~ts_request_prop 
publicts_url type zif_ibmc_service_arch~ts_url 
publictt_header type zif_ibmc_service_arch~tt_header 

Methods

Visibility and LevelNameDocumentation
public static
base64_decode
importingi_base64type string
returningvalue(e_binary)type xstring
raisingzcx_ibmc_service_exception

Decodes base64 encoded data to binary.

Parameters
i_base64 Base64-encoded binary
e_binary Binary data
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public static
convert_string_to_utf8
importingi_stringtype STRING
returningvalue(e_utf8)type XSTRING
raisingzcx_ibmc_service_exception

Converts STRING data to UTF8 encoded XSTRING.

+
public static
convert_string_to_utf8
importingi_stringtype string
returningvalue(e_utf8)type xstring
raisingzcx_ibmc_service_exception

Converts STRING data to UTF8 encoded XSTRING.

Parameters
i_string STRING data
e_utf8 UTF8-encoded data -
Class-based Exceptions
zcx_ibmc_service_exceptionIBM Cloud Service Exception
public static
create_client_by_url
importingi_urltype STRING
i_request_proptype TS_REQUEST_PROP
exportinge_clienttype TS_CLIENT
raisingzcx_ibmc_service_exception

Returns a HTTP/REST client based on an URL.

+
public static
create_client_by_url
importingi_urltype string
i_request_proptype ts_request_prop
exportinge_clienttype ts_client
raisingzcx_ibmc_service_exception

Returns a HTTP/REST client based on an URL.

Parameters
i_url URL
i_request_prop Request parameters
e_client HTTP/REST client
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public static
execute
importingi_clienttype TS_CLIENT
i_methodtype ZIF_IBMC_SERVICE_ARCH~CHAR default ZIF_IBMC_SERVICE_ARCH~C_METHOD_GET
returningvalue(e_response)type TO_REST_RESPONSE
raisingzcx_ibmc_service_exception

Executes a HTTP request.

+
public static
execute
importingi_clienttype ts_client
i_methodtype zif_ibmc_service_arch~char
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Executes a HTTP request.

Parameters
i_client HTTP/REST client
i_method HTTP method (GET,POST,PUT,DELETE)
e_response Response of the request
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public static
get_default_proxy
importingi_urltype TS_URL optional
exportinge_proxy_hosttype STRING
e_proxy_porttype STRING

Returns the default proxy host and port.

+
public static
get_default_proxy
importingi_urltype ts_url optional
exportinge_proxy_hosttype string
e_proxy_porttype string

Returns the default proxy host and port.

Parameters
i_url target URL
e_proxy_host Proxy host
e_proxy_port Proxy port -
public static
get_http_status
importingi_rest_responsetype TO_REST_RESPONSE
returningvalue(e_status)type TS_HTTP_STATUS

Returns the status of a REST response.

+
public static
get_http_status
importingi_rest_responsetype ref to if_web_http_response
returningvalue(e_status)type ts_http_status

Returns the status of a REST response.

Parameters
i_rest_response HTTP/REST response
e_status HTTP status -
public static
get_progname
returningvalue(e_progname)type STRING

Returns an ABAP module identifier.

+
public static
get_progname
returningvalue(e_progname)type string

Returns an ABAP module identifier.

Parameters
e_progname ABAP module identifier -
public static
get_response_binary
importingi_responsetype TO_REST_RESPONSE
returningvalue(e_data)type XSTRING

Reads binary data from a HTTP response.

+
public static
get_response_binary
importingi_responsetype ref to if_web_http_response
returningvalue(e_data)type xstring

Reads binary data from a HTTP response.

Parameters
i_response HTTP response
e_data Binary data -
public static
get_response_header
importingi_responsetype TO_REST_RESPONSE
i_header_fieldtype STRING
returningvalue(e_value)type STRING

Returns a HTTP response header.

+
public static
get_response_header
importingi_responsetype to_rest_response
i_header_fieldtype string
returningvalue(e_value)type string

Returns a HTTP response header.

Parameters
i_response HTTP/REST response
i_header_field Header field name
e_value Header field value -
public static
get_response_string
importingi_responsetype TO_REST_RESPONSE
returningvalue(e_data)type STRING

Reads character data from a HTTP response.

+
public static
get_response_string
importingi_responsetype ref to if_web_http_response
returningvalue(e_data)type string

Reads character data from a HTTP response.

Parameters
i_response HTTP response
e_data Character data -
public static
get_rest_request
importingi_clienttype TS_CLIENT
returningvalue(e_rest_request)type TO_REST_REQUEST

Returns a request object from a HTTP client object.

- -
Parameters
i_client HTTP/REST client -
e_rest_request REST request object -
public static
get_timezone
returningvalue(e_timezone)type ZIF_IBMC_SERVICE_ARCH~TY_TIMEZONE

Returns the user's time zone.

+
public static
get_timezone
returningvalue(e_timezone)type zif_ibmc_service_arch~ty_timezone

Returns the user's time zone.

Parameters
e_timezone user's time zone -
public static
set_authentication_basic
importingi_clienttype TS_CLIENT
i_usernametype STRING
i_passwordtype STRING

Sets request header for basic authentication.

+
public static
set_authentication_basic
importingi_clienttype ts_client
i_usernametype string
i_passwordtype string

Sets request header for basic authentication.

Parameters
i_client HTTP/REST client
i_username User name
i_password Password -
public static
set_request_body_cdata
importingi_clienttype TS_CLIENT
i_datatype STRING

Set character data for the body of a HTTP request.

+
public static
set_request_body_cdata
importingi_clienttype ts_client
i_datatype string

Set character data for the body of a HTTP request.

Parameters
i_client HTTP/REST client
i_data Character data -
public static
set_request_body_xdata
importingi_clienttype TS_CLIENT
i_datatype XSTRING

Set binary data for the body of a HTTP request.

+
public static
set_request_body_xdata
importingi_clienttype ts_client
i_datatype xstring

Set binary data for the body of a HTTP request.

Parameters
i_client HTTP/REST client
i_data Binary data -
public static
set_request_header
importingi_clienttype TS_CLIENT
i_nametype STRING
i_valuetype STRING

Sets a HTTP header.

+
public static
set_request_header
importingi_clienttype ts_client
i_nametype string
i_valuetype string

Sets a HTTP header.

Parameters
i_client HTTP/REST client
i_name Header field name
i_value Header field value -
public static
set_request_uri
importingi_clienttype TS_CLIENT
i_uritype STRING

Sets the URI for a HTTP request.

+
public static
set_request_uri
importingi_clienttype ts_client
i_uritype string

Sets the URI for a HTTP request.

Parameters
i_client HTTP/REST client
i_uri URI -
public instance
add_form_part
importingi_clienttype TS_CLIENT
it_form_parttype ZIF_IBMC_SERVICE_ARCH=>TT_FORM_PART
raisingzcx_ibmc_service_exception

Generates a multi-part request body.

+
public instance
add_form_part
importingi_clienttype ts_client
it_form_parttype zif_ibmc_service_arch~tt_form_part
raisingzcx_ibmc_service_exception

Generates a multi-part request body.

Parameters
i_client HTTP/REST client
it_form_part Table of form parts
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_ext.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_ext.html index 98e9e8f..388b2a7 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_ext.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_ext.html @@ -1,4 +1,4 @@ -Class ZCL_IBMC_SERVICE_EXT

Class ZCL_IBMC_SERVICE_EXT

public inheriting from ZCL_IBMC_SERVICE create public

Documentation

Extended REST API service class

Types

Visibility and LevelNameDocumentation
publicts_oauth_prop (structured type) 
publicty_image_class type STRING 
publicty_image_format (typing) 
publicty_instance_id (typing) 
publicty_servicename (typing) 

Constants

Visibility and LevelNameDocumentation
public staticc_field_none type FIELDNAME value '###'Field Name
public staticc_format_all type TY_IMAGE_FORMAT value '*'Image encoding (jpg, png, ...)
public staticc_format_gif type TY_IMAGE_FORMAT value 'gif'Image encoding (jpg, png, ...)
public staticc_format_jpg type TY_IMAGE_FORMAT value 'jpg'Image encoding (jpg, png, ...)
public staticc_format_png type TY_IMAGE_FORMAT value 'png'Image encoding (jpg, png, ...)
public staticc_format_tif type TY_IMAGE_FORMAT value 'tif'Image encoding (jpg, png, ...)
public staticc_format_unknown type TY_IMAGE_FORMAT value '###'Image encoding (jpg, png, ...)
public staticc_format_zip type TY_IMAGE_FORMAT value 'zip'Image encoding (jpg, png, ...)
public staticc_iam_token_host type STRING value 'iam.cloud.ibm.com' 
public staticc_iam_token_path type STRING value '/identity/token' 
public staticc_icp4d_token_path type STRING value '/v1/preauth/validateAuth' 
public staticc_token_generation_always type CHAR value 'A' 
public staticc_token_generation_auto type CHAR value SPACE 
public staticc_token_generation_never type CHAR value 'N' 

Attributes

Visibility and LevelNameDocumentation
public instancep_instance_id type TY_INSTANCE_ID  
public instancep_servicename type TY_SERVICENAME  

Methods

Visibility and LevelNameDocumentation
public static
get_instance
importingi_instance_idtype TY_INSTANCE_ID optional
i_urltype STRING optional
i_hosttype STRING optional
i_usernametype STRING optional
i_passwordtype STRING optional
i_proxy_hosttype STRING optional
i_proxy_porttype STRING optional
i_apikeytype STRING optional
i_auth_methodtype STRING default C_DEFAULT
i_oauth_proptype TS_OAUTH_PROP optional
i_access_tokentype TS_ACCESS_TOKEN optional
i_token_generationtype CHAR default C_TOKEN_GENERATION_AUTO
i_request_headerstype STRING optional
i_versiontype STRING optional
exportingvalue(eo_instance)type ANY

Factory method to instantiate a service specific wrapper class.

+Class ZCL_IBMC_SERVICE_EXT

Class ZCL_IBMC_SERVICE_EXT

public inheriting from zcl_ibmc_service create public

Documentation

Extended REST API service class

Types

Visibility and LevelNameDocumentation
publicts_oauth_prop (structured type) 
publicty_image_class type string 
publicty_image_format (typing) 
publicty_instance_id (typing) 
publicty_servicename (typing) 

Constants

Visibility and LevelNameDocumentation
public staticc_field_none type fieldname value '###'Field Name
public staticc_format_all type ty_image_format value '*'Image encoding (jpg, png, ...)
public staticc_format_gif type ty_image_format value 'gif'Image encoding (jpg, png, ...)
public staticc_format_jpg type ty_image_format value 'jpg'Image encoding (jpg, png, ...)
public staticc_format_png type ty_image_format value 'png'Image encoding (jpg, png, ...)
public staticc_format_tif type ty_image_format value 'tif'Image encoding (jpg, png, ...)
public staticc_format_unknown type ty_image_format value '###'Image encoding (jpg, png, ...)
public staticc_format_zip type ty_image_format value 'zip'Image encoding (jpg, png, ...)
public staticc_iam_token_host type string value 'iam.cloud.ibm.com' 
public staticc_iam_token_path type string value '/identity/token' 
public staticc_icp4d_token_path type string value '/v1/preauth/validateAuth' 
public staticc_token_generation_always type char value 'A' 
public staticc_token_generation_auto type char value space 
public staticc_token_generation_never type char value 'N' 

Attributes

Visibility and LevelNameDocumentation
public instancep_instance_id type ty_instance_id  
public instancep_servicename type ty_servicename  

Methods

Visibility and LevelNameDocumentation
public static
get_instance
importingi_instance_idtype ty_instance_id optional
i_urltype string optional
i_hosttype string optional
i_usernametype string optional
i_passwordtype string optional
i_proxy_hosttype string optional
i_proxy_porttype string optional
i_apikeytype string optional
i_auth_methodtype string default c_default
i_oauth_proptype ts_oauth_prop optional
i_access_tokentype ts_access_token optional
i_token_generationtype char default c_token_generation_auto
i_request_headerstype string optional
i_versiontype string optional
exportingvalue(eo_instance)type any

Factory method to instantiate a service specific wrapper class.

Parameters
i_instance_id Value of field INSTANCE_UID in table ZIBMC_CONFIG. @@ -18,7 +18,7 @@ C_TOKEN_GENERATION_AUTO - Access to token is refreshed just before it expires.
i_request_headers List of headers sent with every request, format 'Header1=Value1;Header2=Value2'.
i_version Value of query parameter VERSION. -
public static
get_zipdata
importingit_examplestype ANY TABLE
iv_field_classtype FIELDNAME default C_FIELD_NONE
iv_field_filenametype FIELDNAME optional
iv_field_imagetype FIELDNAME optional
iv_image_formattype TY_IMAGE_FORMAT optional
iv_image_nametype STRING optional
exportinget_zipdatatype TT_MAP_FILE
raisingzcx_ibmc_service_exception

Compresses multiple images from an internal table

to a one or more xstrings in ZIP format. +
public static
get_zipdata
importingit_examplestype any table
iv_field_classtype fieldname default c_field_none
iv_field_filenametype fieldname optional
iv_field_imagetype fieldname optional
iv_image_formattype ty_image_format optional
iv_image_nametype string optional
exportinget_zipdatatype tt_map_file
raisingzcx_ibmc_service_exception

Compresses multiple images from an internal table

to a one or more xstrings in ZIP format.
Parameters
it_examples Internal table of images.
iv_field_class @@ -31,15 +31,15 @@
iv_image_name Name of the image.
et_zipdata Internal table containing a compressed ZIP xstring for each image class.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_access_token redefinition 
public instance
get_bearer_token
returningvalue(e_bearer_token)type STRING

Returns the bearer token, if available.

+
public instanceget_access_token redefinition public instance
get_bearer_token
returningvalue(e_bearer_token)type string

Returns the bearer token, if available.

Parameters
e_bearer_token Access token. -
public instance
get_config_value
importingi_defaulttype ZIBMC_CONFIG-VALUE optional
i_paramtype ZIBMC_CONFIG-PARAM
returningvalue(e_value)type ZIBMC_CONFIG-VALUE
raisingzcx_ibmc_service_exception

Retrieves a value of a configuration parameter

from table ZIBMC_CONFIG. +
public instance
get_config_value
importingi_defaulttype zibmc_config-value optional
i_paramtype zibmc_config-param
returningvalue(e_value)type zibmc_config-value
raisingzcx_ibmc_service_exception

Retrieves a value of a configuration parameter

from table ZIBMC_CONFIG.
Parameters
i_default Default value, if configuration parameter is not found.
i_param Configuration parameter name. -
public instanceget_request_prop redefinition public instance
get_sdk_version_date
returningvalue(e_sdk_version_date)type STRING

Returns the SDK built date.

+
public instanceget_request_prop redefinition public instance
get_sdk_version_date
returningvalue(e_sdk_version_date)type string

Returns the SDK built date.

Parameters
e_sdk_version_date Built data in format YYYYMMDD. -
public instance
set_bearer_token
importingi_bearer_tokentype STRING

Method for internal use.

-
\ No newline at end of file +public instance
set_bearer_token
importingi_bearer_tokentype string

Method for internal use.

+
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_speech_to_text_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_speech_to_text_v1.html index bcc2faa..983f3cb 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_speech_to_text_v1.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_speech_to_text_v1.html @@ -1,11 +1,25 @@ -Class ZCL_IBMC_SPEECH_TO_TEXT_V1

Class ZCL_IBMC_SPEECH_TO_TEXT_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Speech to Text

+Class ZCL_IBMC_SPEECH_TO_TEXT_V1

Class ZCL_IBMC_SPEECH_TO_TEXT_V1

public inheriting from zcl_ibmc_service_ext create public

Documentation

Speech to Text

The IBM Watson™ Speech to Text service provides APIs that use IBM's speech-recognition capabilities to produce transcripts of spoken audio. The service can transcribe speech from various languages and audio formats. In addition to basic transcription, the service can produce detailed information - about many different aspects of the audio. For most languages, the service - supports two sampling rates, broadband and narrowband. It returns all JSON - response content in the UTF-8 character set.
+ about many different aspects of the audio. It returns all JSON response content + in the UTF-8 character set.
+
+ The service supports two types of models: previous-generation models that + include the terms `Broadband` and `Narrowband` in their names, and + next-generation models that include the terms `Multimedia` and `Telephony` in + their names. Broadband and multimedia models have minimum sampling rates of 16 + kHz. Narrowband and telephony models have minimum sampling rates of 8 kHz. The + next-generation models offer high throughput and greater transcription + accuracy.
+
+ Effective **31 July 2023**, all previous-generation models will be removed from + the service and the documentation. Most previous-generation models were + deprecated on 15 March 2022. You must migrate to the equivalent next-generation + model by 31 July 2023. For more information, see [Migrating to next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + igrate).{: deprecated}

For speech recognition, the service supports synchronous and asynchronous HTTP Representational State Transfer (REST) interfaces. It also supports a WebSocket @@ -20,83 +34,82 @@ service also supports grammars. A grammar is a formal language specification that lets you restrict the phrases that the service can recognize.

- Language model customization and acoustic model customization are generally - available for production use with all language models that are generally - available. Grammars are beta functionality for all language models that support - language model customization.

Types

Visibility and LevelNameDocumentation
publict_acoustic_model (structured type)

- Information about an existing custom acoustic model.

publict_acoustic_models (structured type)

- Information about existing custom acoustic models.

publict_audio_details (structured type)

+ Language model customization and grammars are available for most previous- and + next-generation models. Acoustic model customization is available for all + previous-generation models.

Types

Visibility and LevelNameDocumentation
publict_acoustic_model (structured type)

+ Information about an existing custom acoustic model.

publict_acoustic_models (structured type)

+ Information about existing custom acoustic models.

publict_audio_details (structured type)

Information about an audio resource from a custom acoustic

- model.
publict_audio_listing (structured type)

+ model.

publict_audio_listing (structured type)

Information about an audio resource from a custom acoustic

- model.
publict_audio_metrics (structured type)

+ model.

publict_audio_metrics (structured type)

If audio metrics are requested, information about the signal

- characteristics of the input audio.
publict_audio_metrics_details (structured type)

+ characteristics of the input audio.

publict_audio_metrics_details (structured type)

Detailed information about the signal characteristics of the

- input audio.
publict_audio_metrics_histogram_bin (structured type)

+ input audio.

publict_audio_metrics_histogram_bin (structured type)

A bin with defined boundaries that indicates the number of

values in a range of signal characteristics for a histogram. The first and last bins of a histogram are the boundary bins. They cover the intervals between negative infinity and the first boundary, and between the last boundary and - positive infinity, respectively.
publict_audio_resource (structured type)

+ positive infinity, respectively.

publict_audio_resource (structured type)

Information about an audio resource from a custom acoustic

- model.
publict_audio_resources (structured type)

+ model.

publict_audio_resources (structured type)

Information about the audio resources from a custom acoustic

- model.
publict_corpora (structured type)

- Information about the corpora from a custom language model.

publict_corpus (structured type)

- Information about a corpus from a custom language model.

publict_create_acoustic_model (structured type)

- Information about the new custom acoustic model.

publict_create_language_model (structured type)

- Information about the new custom language model.

publict_custom_word (structured type)

+ model.

publict_corpora (structured type)

+ Information about the corpora from a custom language model.

publict_corpus (structured type)

+ Information about a corpus from a custom language model.

publict_create_acoustic_model (structured type)

+ Information about the new custom acoustic model.

publict_create_language_model (structured type)

+ Information about the new custom language model.

publict_custom_word (structured type)

Information about a word that is to be added to a custom

- language model.
publict_custom_words (structured type)

+ language model.

publict_custom_words (structured type)

Information about the words that are to be added to a custom

- language model.
publict_empty_response_body type JSONOBJECT

- The empty response from a request.

publict_error_model (structured type)

- The error response from a failed request.

publict_grammar (structured type)

- Information about a grammar from a custom language model.

publict_grammars (structured type)

- Information about the grammars from a custom language model.

publict_inline_object (structured type) No documentation available.
publict_keyword_result (structured type)

+ language model.

publict_empty_response_body type jsonobject

+ The empty response from a request.

publict_error_model (structured type)

+ The error response from a failed request.

publict_grammar (structured type)

+ Information about a grammar from a custom language model.

publict_grammars (structured type)

+ Information about the grammars from a custom language model.

publict_inline_object (structured type) No documentation available.
publict_keyword_result (structured type)

Information about a match for a keyword from speech

- recognition results.
publict_language_model (structured type)

- Information about an existing custom language model.

publict_language_models (structured type)

- Information about existing custom language models.

publict_processed_audio (structured type)

+ recognition results.

publict_language_model (structured type)

+ Information about an existing custom language model.

publict_language_models (structured type)

+ Information about existing custom language models.

publict_processed_audio (structured type)

Detailed timing information about the service's

- processing of the input audio.
publict_processing_metrics (structured type)

+ processing of the input audio.

publict_processing_metrics (structured type)

If processing metrics are requested, information about the

service's processing of the input audio. Processing metrics are not - available with the synchronous **Recognize audio** method.
publict_recognition_job (structured type)

+ available with the synchronous [Recognize audio](#recognize) method.

publict_recognition_job (structured type)

Information about a current asynchronous speech recognition

- job.
publict_recognition_jobs (structured type)

+ job.

publict_recognition_jobs (structured type)

Information about current asynchronous speech recognition

- jobs.
publict_register_status (structured type)

+ jobs.

publict_register_status (structured type)

Information about a request to register a callback for

- asynchronous speech recognition.
publict_spch_recognition_alternative (structured type)

- An alternative transcript from speech recognition results.

publict_speaker_labels_result (structured type)

+ asynchronous speech recognition.

publict_spch_recognition_alternative (structured type)

+ An alternative transcript from speech recognition results.

publict_speaker_labels_result (structured type)

Information about the speakers from speech recognition

- results.
publict_speech_model (structured type)

- Information about an available language model.

publict_speech_models (structured type)

- Information about the available language models.

publict_speech_recognition_result (structured type)

- Component results for a speech recognition request.

publict_speech_recognition_results (structured type)

- The complete results for a speech recognition request.

publict_supported_features (structured type)

- Additional service features that are supported with the

- model.
publict_training_response (structured type)

+ results.

publict_speech_model (structured type)

+ Information about an available language model.

publict_speech_models (structured type)

+ Information about the available language models.

publict_speech_recognition_result (structured type)

+ Component results for a speech recognition request.

publict_speech_recognition_results (structured type)

+ The complete results for a speech recognition request.

publict_supported_features (structured type)

+ Indicates whether select service features are supported with

+ the model.
publict_training_response (structured type)

The response from training of a custom language or custom

- acoustic model.
publict_training_warning (structured type)

+ acoustic model.

publict_training_warning (structured type)

A warning from training of a custom language or custom

- acoustic model.
publict_word (structured type)

- Information about a word from a custom language model.

publict_words (structured type)

- Information about the words from a custom language model.

publict_word_alternative_result (structured type)

+ acoustic model.

publict_word (structured type)

+ Information about a word from a custom language model.

publict_words (structured type)

+ Information about the words from a custom language model.

publict_word_alternative_result (structured type)

An alternative hypothesis for a word from speech recognition

- results.
publict_word_alternative_results (structured type)

+ results.

publict_word_alternative_results (structured type)

Information about alternative hypotheses for words from

- speech recognition results.
publict_word_error (structured type)

+ speech recognition results.

publict_word_error (structured type)

An error associated with a word from a custom language

- model.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_audio
importingi_customization_idtype STRING
i_audio_nametype STRING
i_audio_resourcetype FILE
i_content_typetype STRING default 'application/zip'
i_contained_content_typetype STRING optional
i_allow_overwritetype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add an audio resource

+ model.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_audio
importingi_customization_idtype string
i_audio_nametype string
i_audio_resourcetype file
i_content_typetype string default 'application/zip'
i_contained_content_typetype string optional
i_allow_overwritetype boolean default c_boolean_false
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Add an audio resource

Adds an audio resource to a custom acoustic model. Add audio content that reflects the acoustic characteristics of the audio that you plan to transcribe. You must use credentials for the instance of the service that owns a model to add an audio resource to it. Adding audio data does not affect the custom - acoustic model until you train the model for the new data by using the **Train - a custom acoustic model** method.
+ acoustic model until you train the model for the new data by using the [Train a + custom acoustic model](#trainacousticmodel) method.

You can add individual audio files or an archive file that contains multiple audio files. Adding multiple audio files via a single archive file is @@ -107,11 +120,17 @@ You can use this method to add any number of audio resources to a custom model by calling the method once for each audio or archive file. You can add multiple different audio resources at the same time. You must add a minimum of 10 - minutes and a maximum of 200 hours of audio that includes speech, not just - silence, to a custom acoustic model before you can train it. No audio resource, - audio- or archive-type, can be larger than 100 MB. To add an audio resource - that has the same name as an existing audio resource, set the `allow_overwrite` - parameter to `true`; otherwise, the request fails.
+ minutes of audio that includes speech, not just silence, to a custom acoustic + model before you can train it. No audio resource, audio- or archive-type, can + be larger than 100 MB. To add an audio resource that has the same name as an + existing audio resource, set the `allow_overwrite` parameter to `true`; + otherwise, the request fails. A custom model can contain no more than 50 hours + of audio (for IBM Cloud) or 200 hours of audio (for IBM Cloud Pak for Data). + **Note:** For IBM Cloud, the maximum hours of audio for a custom acoustic model + was reduced from 200 to 50 hours in August and September 2022. For more + information, see [Maximum hours of + audio](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audioReso + urces#audioMaximum).

The method is asynchronous. It can take several seconds or minutes to complete depending on the duration of the audio and, in the case of an archive file, the @@ -123,10 +142,14 @@ for current requests completes.

To determine the status of the service's analysis of the audio, use the - **Get an audio resource** method to poll the status of the audio. The method - accepts the customization ID of the custom model and the name of the audio - resource, and it returns the status of the resource. Use a loop to check the - status of the audio every few seconds until it becomes `ok`.
+ [Get an audio resource](#getaudio) method to poll the status of the audio. The + method accepts the customization ID of the custom model and the name of the + audio resource, and it returns the status of the resource. Use a loop to check + the status of the audio every few seconds until it becomes `ok`.
+
+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +

**See also:** [Add audio to the custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic# @@ -164,9 +187,9 @@ appropriate rate. If the sampling rate of the audio is lower than the minimum required rate, the service labels the audio file as `invalid`.

- **See also:** [Audio + **See also:** [Supported audio formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-f - ormats#audio-formats).
+ ormats).

### Content types for archive-type resources

@@ -229,7 +252,7 @@ information, see **Content types for archive-type resources** in the method description.
i_contained_content_type - **For an archive-type resource,** specify the format of the audio files that are + _For an archive-type resource_, specify the format of the audio files that are contained in the archive file if they are of type `audio/alaw`, `audio/basic`, `audio/l16`, or `audio/mulaw`. Include the `rate`, `channels`, and `endianness` parameters where necessary. In this case, all audio files that are contained in @@ -243,69 +266,78 @@ speech recognition. For more information, see **Content types for audio-type resources** in the method description.

- **For an audio-type resource,** omit the header. + _For an audio-type resource_, omit the header.
i_allow_overwrite If `true`, the specified audio resource overwrites an existing audio resource with the same name. If `false`, the request fails if an audio resource with the same name already exists. The parameter has no effect if an audio resource with the same name does not already exist.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_corpus
importingi_customization_idtype STRING
i_corpus_nametype STRING
i_corpus_filetype FILE
i_allow_overwritetype BOOLEAN default C_BOOLEAN_FALSE
i_corpus_file_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add a corpus

+
public instance
add_corpus
importingi_customization_idtype string
i_corpus_nametype string
i_corpus_filetype file
i_allow_overwritetype boolean default c_boolean_false
i_corpus_file_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Add a corpus

Adds a single corpus text file of new training data to a custom language model. Use multiple requests to submit multiple corpus text files. You must use credentials for the instance of the service that owns a model to add a corpus to it. Adding a corpus does not affect the custom language model until you - train the model for the new data by using the **Train a custom language model** - method.
+ train the model for the new data by using the [Train a custom language + model](#trainlanguagemodel) method.

Submit a plain text file that contains sample sentences from the domain of - interest to enable the service to extract words in context. The more sentences - you add that represent the context in which speakers use words from the domain, - the better the service's recognition accuracy.
+ interest to enable the service to parse the words in context. The more + sentences you add that represent the context in which speakers use words from + the domain, the better the service's recognition accuracy.

The call returns an HTTP 201 response code if the corpus is valid. The service - then asynchronously processes the contents of the corpus and automatically - extracts new words that it finds. This operation can take on the order of - minutes to complete depending on the total number of words and the number of - new words in the corpus, as well as the current load on the service. You cannot - submit requests to add additional resources to the custom model or to train the - model until the service's analysis of the corpus for the current request - completes. Use the **List a corpus** method to check the status of the + then asynchronously processes and automatically extracts data from the contents + of the corpus. This operation can take on the order of minutes to complete + depending on the current load on the service, the total number of words in the + corpus, and, _for custom models that are based on previous-generation models_, + the number of new (out-of-vocabulary) words in the corpus. You cannot submit + requests to add additional resources to the custom model or to train the model + until the service's analysis of the corpus for the current request + completes. Use the [Get a corpus](#getcorpus) method to check the status of the analysis.

- The service auto-populates the model's words resource with words from the - corpus that are not found in its base vocabulary. These words are referred to - as out-of-vocabulary (OOV) words. After adding a corpus, you must validate the + _For custom models that are based on previous-generation models_, the service + auto-populates the model's words resource with words from the corpus that + are not found in its base vocabulary. These words are referred to as + out-of-vocabulary (OOV) words. After adding a corpus, you must validate the words resource to ensure that each OOV word's definition is complete and - valid. You can use the **List custom words** method to examine the words - resource. You can use other words method to eliminate typos and modify how - words are pronounced as needed.
+ valid. You can use the [List custom words](#listwords) method to examine the + words resource. You can use other words method to eliminate typos and modify + how words are pronounced and displayed as needed.

To add a corpus file that has the same name as an existing corpus, set the `allow_overwrite` parameter to `true`; otherwise, the request fails. Overwriting an existing corpus causes the service to process the corpus text - file and extract OOV words anew. Before doing so, it removes any OOV words + file and extract its data anew. _For a custom model that is based on a + previous-generation model_, the service first removes any OOV words that are associated with the existing corpus from the model's words resource unless they were also added by another corpus or grammar, or they have been modified - in some way with the **Add custom words** or **Add a custom word** method. -
+ in some way with the [Add custom words](#addwords) or [Add a custom + word](#addword) method.

The service limits the overall amount of data that you can add to a custom model - to a maximum of 10 million total words from all sources combined. Also, you can - add no more than 90 thousand custom (OOV) words to a model. This includes words - that the service extracts from corpora and grammars, and words that you add - directly.
+ to a maximum of 10 million total words from all sources combined. _For a custom + model that is based on a previous-generation model_, you can add no more than + 90 thousand custom (OOV) words to a model. This includes words that the service + extracts from corpora and grammars, and words that you add directly.

**See also:**
* [Add a corpus to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC reate#addCorpus)
- * [Working with - corpora](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpora - Words#workingCorpora)
- * [Validating a words - resource](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - aWords#validateModel) + * [Working with corpora for previous-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords#workingCorpora)
+ * [Working with corpora for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords-ng#workingCorpora-ng)
+ * [Validating a words resource for previous-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords#validateModel)
+ * [Validating a words resource for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords-ng#validateModel-ng)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -333,10 +365,10 @@ encoding if it encounters non-ASCII characters.

Make sure that you know the character encoding of the file. You must use that - encoding when working with the words in the custom language model. For more - information, see [Character - encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - aWords#charEncoding).
+ same encoding when working with the words in the custom language model. For + more information, see [Character encoding for custom + words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor + ds#charEncoding).

With the `curl` command, use the `--data-binary` option to upload the file for the request. @@ -346,13 +378,13 @@ exists. The parameter has no effect if a corpus with the same name does not already exist.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_grammar
importingi_customization_idtype STRING
i_grammar_nametype STRING
i_grammar_filetype STRING
i_content_typetype STRING default 'application/srgs'
i_allow_overwritetype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add a grammar

+
public instance
add_grammar
importingi_customization_idtype string
i_grammar_nametype string
i_grammar_filetype file
i_content_typetype string default 'application/srgs'
i_allow_overwritetype boolean default c_boolean_false
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Add a grammar

Adds a single grammar file to a custom language model. Submit a plain text file in UTF-8 format that defines the grammar. Use multiple requests to submit multiple grammar files. You must use credentials for the instance of the service that owns a model to add a grammar to it. Adding a grammar does not affect the custom language model until you train the model for the new data by - using the **Train a custom language model** method.
+ using the [Train a custom language model](#trainlanguagemodel) method.

The call returns an HTTP 201 response code if the grammar is valid. The service then asynchronously processes the contents of the grammar and automatically @@ -361,14 +393,17 @@ well as the current load on the service. You cannot submit requests to add additional resources to the custom model or to train the model until the service's analysis of the grammar for the current request completes. Use - the **Get a grammar** method to check the status of the analysis.
+ the [Get a grammar](#getgrammar) method to check the status of the analysis. +

- The service populates the model's words resource with any word that is - recognized by the grammar that is not found in the model's base - vocabulary. These are referred to as out-of-vocabulary (OOV) words. You can use - the **List custom words** method to examine the words resource and use other + _For grammars that are based on previous-generation models,_ the service + populates the model's words resource with any word that is recognized by + the grammar that is not found in the model's base vocabulary. These are + referred to as out-of-vocabulary (OOV) words. You can use the [List custom + words](#listwords) method to examine the words resource and use other words-related methods to eliminate typos and modify how words are pronounced as - needed.
+ needed. _For grammars that are based on next-generation models,_ the service + extracts no OOV words from the grammars.

To add a grammar that has the same name as an existing grammar, set the `allow_overwrite` parameter to `true`; otherwise, the request fails. @@ -376,13 +411,14 @@ and extract OOV words anew. Before doing so, it removes any OOV words associated with the existing grammar from the model's words resource unless they were also added by another resource or they have been modified in - some way with the **Add custom words** or **Add a custom word** method.
+ some way with the [Add custom words](#addwords) or [Add a custom + word](#addword) method.

- The service limits the overall amount of data that you can add to a custom model - to a maximum of 10 million total words from all sources combined. Also, you can - add no more than 90 thousand OOV words to a model. This includes words that the - service extracts from corpora and grammars and words that you add directly. -
+ _For grammars that are based on previous-generation models,_ the service limits + the overall amount of data that you can add to a custom model to a maximum of + 10 million total words from all sources combined. Also, you can add no more + than 90 thousand OOV words to a model. This includes words that the service + extracts from corpora and grammars and words that you add directly.

**See also:**
* [Understanding @@ -390,7 +426,10 @@ rUnderstand#grammarUnderstand)
* [Add a grammar to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammarAd - d#addGrammar) + d#addGrammar)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -433,54 +472,65 @@ exists. The parameter has no effect if a grammar with the same name does not already exist.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_word
importingi_customization_idtype STRING
i_word_nametype STRING
i_custom_wordtype T_CUSTOM_WORD
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add a custom word

- Adds a custom word to a custom language model. The service populates the words +
public instance
add_word
importingi_customization_idtype string
i_word_nametype string
i_custom_wordtype t_custom_word
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Add a custom word

+ Adds a custom word to a custom language model. You can use this method to add a + word or to modify an existing word in the words resource. _For custom models + that are based on previous-generation models_, the service populates the words resource for a custom model with out-of-vocabulary (OOV) words from each corpus - or grammar that is added to the model. You can use this method to add a word or - to modify an existing word in the words resource. The words resource for a - model can contain a maximum of 90 thousand custom (OOV) words. This includes - words that the service extracts from corpora and grammars and words that you - add directly.
+ or grammar that is added to the model. You can use this method to modify OOV + words in the model's words resource.
+
+ _For a custom model that is based on a previous-generation models_, the words + resource for a model can contain a maximum of 90 thousand custom (OOV) words. + This includes words that the service extracts from corpora and grammars and + words that you add directly.

You must use credentials for the instance of the service that owns a model to add or modify a custom word for the model. Adding or modifying a custom word does not affect the custom model until you train the model for the new data by - using the **Train a custom language model** method.
+ using the [Train a custom language model](#trainlanguagemodel) method.

Use the `word_name` parameter to specify the custom word that is to be added or modified. Use the `CustomWord` object to provide one or both of the optional - `sounds_like` and `display_as` fields for the word.
+ `display_as` or `sounds_like` fields for the word.
+ * The `display_as` field provides a different way of spelling the word in a + transcript. Use the parameter when you want the word to appear different from + its usual representation or from its spelling in training data. For example, + you might indicate that the word `IBM` is to be displayed as `IBM™`. +
* The `sounds_like` field provides an array of one or more pronunciations for the word. Use the parameter to specify how the word can be pronounced by users. Use the parameter for words that are difficult to pronounce, foreign words, acronyms, and so on. For example, you might specify that the word `IEEE` can sound like `i triple e`. You can specify a maximum of five sounds-like - pronunciations for a word. If you omit the `sounds_like` field, the service + pronunciations for a word. _For custom models that are based on + previous-generation models_, if you omit the `sounds_like` field, the service attempts to set the field to its pronunciation of the word. It cannot generate a pronunciation for all words, so you must review the word's definition to - ensure that it is complete and valid.
- * The `display_as` field provides a different way of spelling the word in a - transcript. Use the parameter when you want the word to appear different from - its usual representation or from its spelling in training data. For example, - you might indicate that the word `IBM(trademark)` is to be displayed as - `IBM™`.
+ ensure that it is complete and valid.

If you add a custom word that already exists in the words resource for the custom model, the new definition overwrites the existing data for the word. If the service encounters an error, it does not add the word to the words - resource. Use the **List a custom word** method to review the word that you - add.
+ resource. Use the [Get a custom word](#getword) method to review the word that + you add.

**See also:**
* [Add words to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC reate#addWords)
- * [Working with custom - words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWo - rds#workingWords)
- * [Validating a words - resource](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - aWords#validateModel) + * [Working with custom words for previous-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords#workingWords)
+ * [Working with custom words for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords-ng#workingWords-ng)
+ * [Validating a words resource for previous-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords#validateModel)
+ * [Validating a words resource for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords-ng#validateModel-ng)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -498,38 +548,43 @@ Specify an empty object to add a word with no sounds-like or display-as information.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_words
importingi_customization_idtype STRING
i_custom_wordstype T_CUSTOM_WORDS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add custom words

- Adds one or more custom words to a custom language model. The service populates - the words resource for a custom model with out-of-vocabulary (OOV) words from - each corpus or grammar that is added to the model. You can use this method to - add additional words or to modify existing words in the words resource. The - words resource for a model can contain a maximum of 90 thousand custom (OOV) - words. This includes words that the service extracts from corpora and grammars - and words that you add directly.
+
public instance
add_words
importingi_customization_idtype string
i_custom_wordstype t_custom_words
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Add custom words

+ Adds one or more custom words to a custom language model. You can use this + method to add words or to modify existing words in a custom model's words + resource. _For custom models that are based on previous-generation models_, the + service populates the words resource for a custom model with out-of-vocabulary + (OOV) words from each corpus or grammar that is added to the model. You can use + this method to modify OOV words in the model's words resource.
+
+ _For a custom model that is based on a previous-generation model_, the words + resource for a model can contain a maximum of 90 thousand custom (OOV) words. + This includes words that the service extracts from corpora and grammars and + words that you add directly.

You must use credentials for the instance of the service that owns a model to add or modify custom words for the model. Adding or modifying custom words does not affect the custom model until you train the model for the new data by using - the **Train a custom language model** method.
+ the [Train a custom language model](#trainlanguagemodel) method.

You add custom words by providing a `CustomWords` object, which is an array of - `CustomWord` objects, one per word. You must use the object's `word` - parameter to identify the word that is to be added. You can also provide one or - both of the optional `sounds_like` and `display_as` fields for each word.
+ `CustomWord` objects, one per word. Use the object's `word` parameter to + identify the word that is to be added. You can also provide one or both of the + optional `display_as` or `sounds_like` fields for each word.
+ * The `display_as` field provides a different way of spelling the word in a + transcript. Use the parameter when you want the word to appear different from + its usual representation or from its spelling in training data. For example, + you might indicate that the word `IBM` is to be displayed as `IBM™`. +
* The `sounds_like` field provides an array of one or more pronunciations for the word. Use the parameter to specify how the word can be pronounced by users. Use the parameter for words that are difficult to pronounce, foreign words, acronyms, and so on. For example, you might specify that the word `IEEE` can - sound like `i triple e`. You can specify a maximum of five sounds-like - pronunciations for a word. If you omit the `sounds_like` field, the service + sound like `I triple E`. You can specify a maximum of five sounds-like + pronunciations for a word. _For a custom model that is based on a + previous-generation model_, if you omit the `sounds_like` field, the service attempts to set the field to its pronunciation of the word. It cannot generate a pronunciation for all words, so you must review the word's definition to - ensure that it is complete and valid.
- * The `display_as` field provides a different way of spelling the word in a - transcript. Use the parameter when you want the word to appear different from - its usual representation or from its spelling in training data. For example, - you might indicate that the word `IBM(trademark)` is to be displayed as - `IBM™`.
+ ensure that it is complete and valid.

If you add a custom word that already exists in the words resource for the custom model, the new definition overwrites the existing data for the word. If @@ -542,29 +597,35 @@ number of new words that you add but is generally faster than adding a corpus or grammar.

- You can monitor the status of the request by using the **List a custom language - model** method to poll the model's status. Use a loop to check the status - every 10 seconds. The method returns a `Customization` object that includes a - `status` field. A status of `ready` means that the words have been added to the - custom model. The service cannot accept requests to add new data or to train - the model until the existing request completes.
+ You can monitor the status of the request by using the [Get a custom language + model](#getlanguagemodel) method to poll the model's status. Use a loop to + check the status every 10 seconds. The method returns a `Customization` object + that includes a `status` field. A status of `ready` means that the words have + been added to the custom model. The service cannot accept requests to add new + data or to train the model until the existing request completes.

- You can use the **List custom words** or **List a custom word** method to review - the words that you add. Words with an invalid `sounds_like` field include an - `error` field that describes the problem. You can use other words-related - methods to correct errors, eliminate typos, and modify how words are pronounced - as needed.
+ You can use the [List custom words](#listwords) or [Get a custom word](#getword) + method to review the words that you add. Words with an invalid `sounds_like` + field include an `error` field that describes the problem. You can use other + words-related methods to correct errors, eliminate typos, and modify how words + are pronounced as needed.

**See also:**
* [Add words to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC reate#addWords)
- * [Working with custom - words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWo - rds#workingWords)
- * [Validating a words - resource](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - aWords#validateModel) + * [Working with custom words for previous-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords#workingWords)
+ * [Working with custom words for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords-ng#workingWords-ng)
+ * [Validating a words resource for previous-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords#validateModel)
+ * [Validating a words resource for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + ords-ng#validateModel-ng)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -574,7 +635,7 @@ A `CustomWords` object that provides information about one or more custom words that are to be added to or updated in the custom language model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
check_job
importingi_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_RECOGNITION_JOB
raisingzcx_ibmc_service_exception

Check a job

+
public instance
check_job
importingi_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_recognition_job
raisingzcx_ibmc_service_exception

Check a job

Returns information about the specified job. The response always includes the status of the job and its creation and update times. If the status is `completed`, the response includes the results of the recognition request. You @@ -584,9 +645,9 @@ You can use the method to retrieve the results of any job, regardless of whether it was submitted with a callback URL and the `recognitions.completed_with_results` event, and you can retrieve the results - multiple times for as long as they remain available. Use the **Check jobs** - method to request information about the most recent jobs associated with the - calling credentials.
+ multiple times for as long as they remain available. Use the [Check + jobs](#checkjobs) method to request information about the most recent jobs + associated with the calling credentials.

**See also:** [Checking the status and retrieving the results of a job](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#job). @@ -599,15 +660,15 @@
e_response Service return value of type T_RECOGNITION_JOB
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
check_jobs
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_RECOGNITION_JOBS
raisingzcx_ibmc_service_exception

Check jobs

+
public instance
check_jobs
importingi_accepttype string default 'application/json'
exportinge_responsetype t_recognition_jobs
raisingzcx_ibmc_service_exception

Check jobs

Returns the ID and status of the latest 100 outstanding jobs associated with the credentials with which it is called. The method also returns the creation and update times of each job, and, if a job was created with a callback URL and a user token, the user token for the job. To obtain the results for a job whose status is `completed` or not one of the latest 100 outstanding jobs, use the - **Check a job** method. A job and its results remain available until you delete - them with the **Delete a job** method or until the job's time to live - expires, whichever comes first.
+ [Check a job[(#checkjob) method. A job and its results remain available until + you delete them with the [Delete a job](#deletejob) method or until the + job's time to live expires, whichever comes first.

**See also:** [Checking the status of the latest jobs](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#jobs @@ -616,7 +677,7 @@
Parameters
e_response Service return value of type T_RECOGNITION_JOBS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_acoustic_model
importingi_create_acoustic_modeltype T_CREATE_ACOUSTIC_MODEL
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ACOUSTIC_MODEL
raisingzcx_ibmc_service_exception

Create a custom acoustic model

+
public instance
create_acoustic_model
importingi_create_acoustic_modeltype t_create_acoustic_model
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_acoustic_model
raisingzcx_ibmc_service_exception

Create a custom acoustic model

Creates a new custom acoustic model for a specified base model. The custom acoustic model can be used only with the base model for which it is created. The model is owned by the instance of the service whose credentials are used to @@ -627,6 +688,18 @@ You do not lose any models, but you cannot create any more until your model count is below the limit.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
+ **Important:** Effective **31 July 2023**, all previous-generation models will + be removed from the service and the documentation. Most previous-generation + models were deprecated on 15 March 2022. You must migrate to the equivalent + next-generation model by 31 July 2023. For more information, see [Migrating to + next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + igrate).
+
**See also:** [Create a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic# createModel-acoustic). @@ -637,7 +710,7 @@
e_response Service return value of type T_ACOUSTIC_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_job
importingi_audiotype FILE
i_content_typetype STRING default 'application/octet-stream'
i_modeltype STRING default 'en-US_BroadbandModel'
i_callback_urltype STRING optional
i_eventstype STRING optional
i_user_tokentype STRING optional
i_results_ttltype INTEGER optional
i_language_customization_idtype STRING optional
i_acoustic_customization_idtype STRING optional
i_base_model_versiontype STRING optional
i_customization_weighttype DOUBLE optional
i_inactivity_timeouttype INTEGER optional
i_keywordstype TT_STRING optional
i_keywords_thresholdtype FLOAT optional
i_max_alternativestype INTEGER optional
i_word_alternatives_thresholdtype FLOAT optional
i_word_confidencetype BOOLEAN default C_BOOLEAN_FALSE
i_timestampstype BOOLEAN default C_BOOLEAN_FALSE
i_profanity_filtertype BOOLEAN default C_BOOLEAN_TRUE
i_smart_formattingtype BOOLEAN default C_BOOLEAN_FALSE
i_speaker_labelstype BOOLEAN default C_BOOLEAN_FALSE
i_customization_idtype STRING optional
i_grammar_nametype STRING optional
i_redactiontype BOOLEAN default C_BOOLEAN_FALSE
i_processing_metricstype BOOLEAN default C_BOOLEAN_FALSE
i_processing_metrics_intervaltype FLOAT optional
i_audio_metricstype BOOLEAN default C_BOOLEAN_FALSE
i_end_of_phrase_silence_timetype DOUBLE optional
i_splt_trnscrpt_at_phrase_endtype BOOLEAN default C_BOOLEAN_FALSE
i_speech_detector_sensitivitytype FLOAT optional
i_background_audio_suppressiontype FLOAT optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_RECOGNITION_JOB
raisingzcx_ibmc_service_exception

Create a job

+
public instance
create_job
importingi_audiotype file
i_content_typetype string default 'application/octet-stream'
i_modeltype string default 'en-US_BroadbandModel'
i_callback_urltype string optional
i_eventstype string optional
i_user_tokentype string optional
i_results_ttltype integer optional
i_language_customization_idtype string optional
i_acoustic_customization_idtype string optional
i_base_model_versiontype string optional
i_customization_weighttype double optional
i_inactivity_timeouttype integer default 30
i_keywordstype tt_string optional
i_keywords_thresholdtype float optional
i_max_alternativestype integer default 1
i_word_alternatives_thresholdtype float optional
i_word_confidencetype boolean default c_boolean_false
i_timestampstype boolean default c_boolean_false
i_profanity_filtertype boolean default c_boolean_true
i_smart_formattingtype boolean default c_boolean_false
i_speaker_labelstype boolean default c_boolean_false
i_grammar_nametype string optional
i_redactiontype boolean default c_boolean_false
i_processing_metricstype boolean default c_boolean_false
i_processing_metrics_intervaltype float default '1.0'
i_audio_metricstype boolean default c_boolean_false
i_end_of_phrase_silence_timetype double default '0.8'
i_splt_trnscrpt_at_phrase_endtype boolean default c_boolean_false
i_speech_detector_sensitivitytype float default '0.5'
i_background_audio_suppressiontype float default '0.0'
i_low_latencytype boolean default c_boolean_false
i_character_insertion_biastype float default '0.0'
i_accepttype string default 'application/json'
exportinge_responsetype t_recognition_job
raisingzcx_ibmc_service_exception

Create a job

Creates a job for a new asynchronous recognition request. The job is owned by the instance of the service whose credentials are used to create it. How you learn the status and results of a job depends on the parameters you include @@ -648,17 +721,18 @@ parameters to subscribe to specific events and to specify a string that is to be included with each notification for the job.
* By polling the service: Omit the `callback_url`, `events`, and `user_token` - parameters. You must then use the **Check jobs** or **Check a job** methods to - check the status of the job, using the latter to retrieve the results when the - job is complete.
+ parameters. You must then use the [Check jobs](#checkjobs) or [Check a + job](#checkjob) methods to check the status of the job, using the latter to + retrieve the results when the job is complete.

The two approaches are not mutually exclusive. You can poll the service for job status or obtain results from the service manually even if you include a callback URL. In both cases, you can include the `results_ttl` parameter to specify how long the results are to remain available after the job is complete. - Using the HTTPS **Check a job** method to retrieve results is more secure than - receiving them via callback notification over HTTP because it provides - confidentiality in addition to authentication and data integrity.
+ Using the HTTPS [Check a job](#checkjob) method to retrieve results is more + secure than receiving them via callback notification over HTTP because it + provides confidentiality in addition to authentication and data integrity. +

The method supports the same basic parameters as other HTTP and WebSocket recognition requests. It also supports the following parameters specific to the @@ -740,9 +814,48 @@ rate. If the sampling rate of the audio is lower than the minimum required rate, the request fails.

- **See also:** [Audio + **See also:** [Supported audio formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-f - ormats#audio-formats). + ormats).
+
+ ### Next-generation models
+
+ The service supports next-generation `Multimedia` (16 kHz) and `Telephony` (8 + kHz) models for many languages. Next-generation models have higher throughput + than the service's previous generation of `Broadband` and `Narrowband` + models. When you use next-generation models, the service can return + transcriptions more quickly and also provide noticeably better transcription + accuracy.
+
+ You specify a next-generation model by using the `model` query parameter, as you + do a previous-generation model. Most next-generation models support the + `low_latency` parameter, and all next-generation models support the + `character_insertion_bias` parameter. These parameters are not available with + previous-generation models.
+
+ Next-generation models do not support all of the speech recognition parameters + that are available for use with previous-generation models. Next-generation + models do not support the following parameters:
+ * `acoustic_customization_id`
+ * `keywords` and `keywords_threshold`
+ * `processing_metrics` and `processing_metrics_interval`
+ * `word_alternatives_threshold`
+
+ **Important:** Effective **31 July 2023**, all previous-generation models will + be removed from the service and the documentation. Most previous-generation + models were deprecated on 15 March 2022. You must migrate to the equivalent + next-generation model by 31 July 2023. For more information, see [Migrating to + next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + igrate).
+
+ **See also:**
+ * [Next-generation languages and + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + g)
+ * [Supported features for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + g#models-ng-features)
Parameters
i_audio The audio to transcribe. @@ -750,16 +863,26 @@ The format (MIME type) of the audio. For more information about specifying an audio format, see **Audio formats (content types)** in the method description.
i_model - The identifier of the model that is to be used for the recognition request. - (**Note:** The model `ar-AR_BroadbandModel` is deprecated; use - `ar-MS_BroadbandModel` instead.) See [Languages and - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - odels). + The model to use for speech recognition. If you omit the `model` parameter, the + service uses the US English `en-US_BroadbandModel` by default.
+
+ _For IBM Cloud Pak for Data,_ if you do not install the `en-US_BroadbandModel`, + you must either specify a model with the request or specify a new default model + for your installation of the service.
+
+ **See also:**
+ * [Using a model for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-mod + els-use)
+ * [Using the default + model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-us + e#models-use-default).
i_callback_url A URL to which callback notifications are to be sent. The URL must already be - successfully allowlisted by using the **Register a callback** method. You can - include the same callback URL with any number of job creation requests. Omit - the parameter to poll the service for job completion and results.
+ successfully allowlisted by using the [Register a callback](#registercallback) + method. You can include the same callback URL with any number of job creation + requests. Omit the parameter to poll the service for job completion and + results.

Use the `user_token` parameter to specify a unique user-specified string with each job to differentiate the callback notifications for the jobs. @@ -769,8 +892,8 @@ * `recognitions.started` generates a callback notification when the service begins to process the job.
* `recognitions.completed` generates a callback notification when the job is - complete. You must use the **Check a job** method to retrieve the results - before they time out or are deleted.
+ complete. You must use the [Check a job](#checkjob) method to retrieve the + results before they time out or are deleted.
* `recognitions.completed_with_results` generates a callback notification when the job is complete. The notification includes the results of the request.
* `recognitions.failed` generates a callback notification if the service @@ -798,9 +921,10 @@ the recognition request. The base model of the specified custom language model must match the model specified with the `model` parameter. You must make the request with credentials for the instance of the service that owns the custom - model. By default, no custom language model is used. See [Custom - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - stom-input).
+ model. By default, no custom language model is used. See [Using a custom + language model for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-lan + guageUse).

**Note:** Use this parameter instead of the deprecated `customization_id` parameter. @@ -809,18 +933,19 @@ the recognition request. The base model of the specified custom acoustic model must match the model specified with the `model` parameter. You must make the request with credentials for the instance of the service that owns the custom - model. By default, no custom acoustic model is used. See [Custom - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - stom-input). + model. By default, no custom acoustic model is used. See [Using a custom + acoustic model for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-aco + usticUse).
i_base_model_version The version of the specified base model that is to be used with the recognition request. Multiple versions of a base model can exist when a model is updated for internal improvements. The parameter is intended primarily for use with custom models that have been upgraded for a new base model. The default value depends on whether the parameter is used with or without a custom model. See - [Base model - version](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#v - ersion). + [Making speech recognition requests with upgraded custom + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + pgrade-use#custom-upgrade-use-recognition).
i_customization_weight If you specify the customization ID (GUID) of a custom language model with the recognition request, the customization weight tells the service how much weight @@ -828,19 +953,22 @@ model for the current request.

Specify a value between 0.0 and 1.0. Unless a different customization weight was - specified for the custom model when it was trained, the default value is 0.3. A - customization weight that you specify overrides a weight that was specified - when the custom model was trained.
-
- The default value yields the best performance in general. Assign a higher value - if your audio makes frequent use of OOV words from the custom model. Use - caution when setting the weight: a higher value can improve the accuracy of - phrases from the custom model's domain, but it can negatively affect - performance on non-domain phrases.
-
- See [Custom - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - stom-input). + specified for the custom model when the model was trained, the default value + is:
+ * 0.3 for previous-generation models
+ * 0.2 for most next-generation models
+ * 0.1 for next-generation English and Japanese models
+
+ A customization weight that you specify overrides a weight that was specified + when the custom model was trained. The default value yields the best + performance in general. Assign a higher value if your audio makes frequent use + of OOV words from the custom model. Use caution when setting the weight: a + higher value can improve the accuracy of phrases from the custom model's + domain, but it can negatively affect performance on non-domain phrases.
+
+ See [Using customization + weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-language + Use#weight).
i_inactivity_timeout The time in seconds after which, if only silence (no speech) is detected in streaming audio, the connection is closed with a 400 error. The parameter is @@ -861,48 +989,50 @@ case-insensitive.

See [Keyword - spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - #keyword_spotting). + spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + ng#keyword-spotting).
i_keywords_threshold A confidence value that is the lower bound for spotting a keyword. A word is considered to match a keyword if its confidence is greater than or equal to the threshold. Specify a probability between 0.0 and 1.0. If you specify a threshold, you must also specify one or more keywords. The service performs no keyword spotting if you omit either parameter. See [Keyword - spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - #keyword_spotting). + spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + ng#keyword-spotting).
i_max_alternatives The maximum number of alternative transcripts that the service is to return. By default, the service returns a single transcript. If you specify a value of `0`, the service uses the default value, `1`. See [Maximum - alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - tput#max_alternatives). + alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-me + tadata#max-alternatives).
i_word_alternatives_threshold A confidence value that is the lower bound for identifying a hypothesis as a possible word alternative (also known as "Confusion Networks"). An alternative word is considered if its confidence is greater than or equal to the threshold. Specify a probability between 0.0 and 1.0. By default, the service computes no alternative words. See [Word - alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - tput#word_alternatives). + alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-sp + otting#word-alternatives).
i_word_confidence If `true`, the service returns a confidence measure in the range of 0.0 to 1.0 for each word. By default, the service returns no word confidence scores. See [Word - confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - ut#word_confidence). + confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + data#word-confidence).
i_timestamps If `true`, the service returns time alignment for each word. By default, no timestamps are returned. See [Word - timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - ut#word_timestamps). + timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + data#word-timestamps).
i_profanity_filter If `true`, the service filters profanity from all output except for keyword results by replacing inappropriate words with a series of asterisks. Set the - parameter to `false` to return results with no censoring. Applies to US English - transcription only. See [Profanity - filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - t#profanity_filter). + parameter to `false` to return results with no censoring.
+
+ **Note:** The parameter can be used with US English and Japanese transcription + only. See [Profanity + filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + tting#profanity-filtering).
i_smart_formatting If `true`, the service converts dates, times, series of digits and numbers, phone numbers, currency values, and internet addresses into more readable, @@ -911,38 +1041,39 @@ punctuation symbols. By default, the service performs no smart formatting.

- **Note:** Applies to US English, Japanese, and Spanish transcription only.
+ **Note:** The parameter can be used with US English, Japanese, and Spanish (all + dialects) transcription only.

See [Smart - formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - ut#smart_formatting). + formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-form + atting#smart-formatting).
i_speaker_labels If `true`, the response includes labels that identify which words were spoken by which participants in a multi-person exchange. By default, the service returns no speaker labels. Setting `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify `false` for the parameter.
-
- **Note:** Applies to US English, Australian English, German, Japanese, Korean, - and Spanish (both broadband and narrowband models) and UK English (narrowband - model) transcription only.
+ * _For previous-generation models,_ the parameter can be used with Australian + English, US English, German, Japanese, Korean, and Spanish (both broadband and + narrowband models) and UK English (narrowband model) transcription only.
+ * _For next-generation models,_ the parameter can be used with Czech, English + (Australian, Indian, UK, and US), German, Japanese, Korean, and Spanish + transcription only.

See [Speaker - labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#s - peaker_labels). -
i_customization_id - **Deprecated.** Use the `language_customization_id` parameter to specify the - customization ID (GUID) of a custom language model that is to be used with the - recognition request. Do not specify both parameters with a request. + labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker- + labels).
i_grammar_name The name of a grammar that is to be used with the recognition request. If you specify a grammar, you must also use the `language_customization_id` parameter to specify the name of the custom language model for which the grammar is defined. The service recognizes only strings that are recognized by the specified grammar; it does not recognize other custom words from the - model's words resource. See - [Grammars](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - #grammars-input). + model's words resource.
+
+ See [Using a grammar for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-gra + mmarUse).
i_redaction If `true`, the service redacts, or masks, numeric data from final transcripts. The feature redacts any number that has three or more consecutive digits by @@ -956,11 +1087,12 @@ and `keywords_threshold` parameters) and returns only a single final transcript (forces the `max_alternatives` parameter to be `1`).

- **Note:** Applies to US English, Japanese, and Korean transcription only.
+ **Note:** The parameter can be used with US English, Japanese, and Korean + transcription only.

See [Numeric - redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - t#redaction). + redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + tting#numeric-redaction).
i_processing_metrics If `true`, requests processing metrics about the service's transcription of the input audio. The service returns processing metrics at the interval @@ -970,7 +1102,7 @@
See [Processing metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - #processing_metrics). + #processing-metrics).
i_processing_metrics_interval Specifies the interval in real wall-clock seconds at which the service is to return processing metrics. The parameter is ignored unless the @@ -986,7 +1118,7 @@
See [Processing metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - #processing_metrics). + #processing-metrics).
i_audio_metrics If `true`, requests detailed information about the signal characteristics of the input audio. The service returns audio metrics with the final transcription @@ -994,11 +1126,11 @@
See [Audio metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - #audio_metrics). + #audio-metrics).
i_end_of_phrase_silence_time - If `true`, specifies the duration of the pause interval at which the service - splits a transcript into multiple final results. If the service detects pauses - or extended silence before it reaches the end of the audio stream, its response + Specifies the duration of the pause interval at which the service splits a + transcript into multiple final results. If the service detects pauses or + extended silence before it reaches the end of the audio stream, its response can include multiple final results. Silence indicates a point at which the speaker pauses between spoken words or phrases.

@@ -1012,20 +1144,24 @@ Chinese is 0.6 seconds.

See [End of phrase silence - time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#sil - ence_time). + time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#si + lence-time).
i_splt_trnscrpt_at_phrase_end If `true`, directs the service to split the transcript into multiple final results based on semantic features of the input, for example, at the conclusion of meaningful phrases such as sentences. The service bases its understanding of semantic features on the base language model that you use with a request. Custom language models and grammars can also influence how and where the - service splits a transcript. By default, the service splits transcripts based - solely on the pause interval.
+ service splits a transcript.
+
+ By default, the service splits transcripts based solely on the pause interval. + If the parameters are used together on the same request, + `end_of_phrase_silence_time` has precedence over + `split_transcript_at_phrase_end`.

See [Split transcript at phrase - end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#spli - t_transcript). + end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#spl + it-transcript).
i_speech_detector_sensitivity The sensitivity of speech activity detection that the service is to perform. Use the parameter to suppress word insertions from music, coughing, and other @@ -1039,9 +1175,15 @@ sensitivity.
* 1.0 suppresses no audio (speech detection sensitivity is disabled).

- The values increase on a monotonic curve. See [Speech Activity - Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - #detection). + The values increase on a monotonic curve. Specifying one or two decimal places + of precision (for example, `0.55`) is typically more than sufficient.
+
+ The parameter is supported with all next-generation models and with most + previous-generation models. See [Speech detector + sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + ection#detection-parameters-sensitivity) and [Language model + support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + on#detection-support).
i_background_audio_suppression The level to which the service is to suppress background audio based on its volume to prevent it from being transcribed as speech. Use the parameter to @@ -1053,13 +1195,60 @@ * 0.5 provides a reasonable level of audio suppression for general usage.
* 1.0 suppresses all audio (no audio is transcribed).

- The values increase on a monotonic curve. See [Speech Activity - Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - #detection). + The values increase on a monotonic curve. Specifying one or two decimal places + of precision (for example, `0.55`) is typically more than sufficient.
+
+ The parameter is supported with all next-generation models and with most + previous-generation models. See [Background audio + suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + ection#detection-parameters-suppression) and [Language model + support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + on#detection-support). +
i_low_latency + If `true` for next-generation `Multimedia` and `Telephony` models that support + low latency, directs the service to produce results even more quickly than it + usually does. Next-generation models produce transcription results faster than + previous-generation models. The `low_latency` parameter causes the models to + produce results even more quickly, though the results might be less accurate + when the parameter is used.
+
+ The parameter is not available for previous-generation `Broadband` and + `Narrowband` models. It is available for most next-generation models.
+ * For a list of next-generation models that support low latency, see [Supported + next-generation language + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + g#models-ng-supported).
+ * For more information about the `low_latency` parameter, see [Low + latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim + #low-latency). +
i_character_insertion_bias + For next-generation models, an indication of whether the service is biased to + recognize shorter or longer strings of characters when developing transcription + hypotheses. By default, the service is optimized to produce the best balance of + strings of different lengths.
+
+ The default bias is 0.0. The allowable range of values is -1.0 to 1.0.
+ * Negative values bias the service to favor hypotheses with shorter strings of + characters.
+ * Positive values bias the service to favor hypotheses with longer strings of + characters.
+
+ As the value approaches -1.0 or 1.0, the impact of the parameter becomes more + pronounced. To determine the most effective value for your scenario, start by + setting the value of the parameter to a small increment, such as -0.1, -0.05, + 0.05, or 0.1, and assess how the value impacts the transcription results. Then + experiment with different values as necessary, adjusting the value by small + increments.
+
+ The parameter is not available for previous-generation models.
+
+ See [Character insertion + bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#in + sertion-bias).
e_response Service return value of type T_RECOGNITION_JOB
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_language_model
importingi_create_language_modeltype T_CREATE_LANGUAGE_MODEL
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LANGUAGE_MODEL
raisingzcx_ibmc_service_exception

Create a custom language model

+
public instance
create_language_model
importingi_create_language_modeltype t_create_language_model
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_language_model
raisingzcx_ibmc_service_exception

Create a custom language model

Creates a new custom language model for a specified base model. The custom language model can be used only with the base model for which it is created. The model is owned by the instance of the service whose credentials are used to @@ -1070,9 +1259,21 @@ You do not lose any models, but you cannot create any more until your model count is below the limit.

- **See also:** [Create a custom language + **Important:** Effective **31 July 2023**, all previous-generation models will + be removed from the service and the documentation. Most previous-generation + models were deprecated on 15 March 2022. You must migrate to the equivalent + next-generation model by 31 July 2023. For more information, see [Migrating to + next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + igrate).
+
+ **See also:**
+ * [Create a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC - reate#createModel-language). + reate#createModel-language)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_create_language_model A `CreateLanguageModel` object that provides basic information about the new @@ -1080,12 +1281,16 @@
e_response Service return value of type T_LANGUAGE_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_acoustic_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a custom acoustic model

+
public instance
delete_acoustic_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete a custom acoustic model

Deletes an existing custom acoustic model. The custom model cannot be deleted if another request, such as adding an audio resource to the model, is currently being processed. You must use credentials for the instance of the service that owns a model to delete it.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Deleting a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAco usticModels#deleteModel-acoustic). @@ -1095,16 +1300,20 @@ the request. You must make the request with credentials for the instance of the service that owns the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_audio
importingi_customization_idtype STRING
i_audio_nametype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete an audio resource

+
public instance
delete_audio
importingi_customization_idtype string
i_audio_nametype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete an audio resource

Deletes an existing audio resource from a custom acoustic model. Deleting an archive-type audio resource removes the entire archive of files. The service does not allow deletion of individual files from an archive resource.

Removing an audio resource does not affect the custom model until you train the - model on its updated data by using the **Train a custom acoustic model** - method. You can delete an existing audio resource from a model while a - different resource is being added to the model. You must use credentials for - the instance of the service that owns a model to delete its audio resources. + model on its updated data by using the [Train a custom acoustic + model](#trainacousticmodel) method. You can delete an existing audio resource + from a model while a different resource is being added to the model. You must + use credentials for the instance of the service that owns a model to delete its + audio resources.
+
+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models.

**See also:** [Deleting an audio resource from a custom acoustic @@ -1118,15 +1327,19 @@
i_audio_name The name of the audio resource for the custom acoustic model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_corpus
importingi_customization_idtype STRING
i_corpus_nametype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a corpus

- Deletes an existing corpus from a custom language model. The service removes any - out-of-vocabulary (OOV) words that are associated with the corpus from the - custom model's words resource unless they were also added by another - corpus or grammar, or they were modified in some way with the **Add custom - words** or **Add a custom word** method. Removing a corpus does not affect the - custom model until you train the model with the **Train a custom language - model** method. You must use credentials for the instance of the service that - owns a model to delete its corpora.
+
public instance
delete_corpus
importingi_customization_idtype string
i_corpus_nametype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete a corpus

+ Deletes an existing corpus from a custom language model. Removing a corpus does + not affect the custom model until you train the model with the [Train a custom + language model](#trainlanguagemodel) method. You must use credentials for the + instance of the service that owns a model to delete its corpora.
+
+ _For custom models that are based on previous-generation models_, the service + removes any out-of-vocabulary (OOV) words that are associated with the corpus + from the custom model's words resource unless they were also added by + another corpus or grammar, or they were modified in some way with the [Add + custom words](#addwords) or [Add a custom word](#addword) method.
+
+

**See also:** [Deleting a corpus from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCor @@ -1139,19 +1352,24 @@
i_corpus_name The name of the corpus for the custom language model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_grammar
importingi_customization_idtype STRING
i_grammar_nametype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a grammar

- Deletes an existing grammar from a custom language model. The service removes - any out-of-vocabulary (OOV) words associated with the grammar from the custom - model's words resource unless they were also added by another resource or - they were modified in some way with the **Add custom words** or **Add a custom - word** method. Removing a grammar does not affect the custom model until you - train the model with the **Train a custom language model** method. You must use - credentials for the instance of the service that owns a model to delete its - grammar.
-
- **See also:** [Deleting a grammar from a custom language +
public instance
delete_grammar
importingi_customization_idtype string
i_grammar_nametype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete a grammar

+ Deletes an existing grammar from a custom language model. _For grammars that are + based on previous-generation models,_ the service removes any out-of-vocabulary + (OOV) words associated with the grammar from the custom model's words + resource unless they were also added by another resource or they were modified + in some way with the [Add custom words](#addwords) or [Add a custom + word](#addword) method. Removing a grammar does not affect the custom model + until you train the model with the [Train a custom language + model](#trainlanguagemodel) method. You must use credentials for the instance + of the service that owns a model to delete its grammar.
+
+ **See also:**
+ * [Deleting a grammar from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageGra - mmars#deleteGrammar). + mmars#deleteGrammar)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -1160,7 +1378,7 @@
i_grammar_name The name of the grammar for the custom language model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_job
importingi_idtype STRING
raisingzcx_ibmc_service_exception

Delete a job

+
public instance
delete_job
importingi_idtype string
raisingzcx_ibmc_service_exception

Delete a job

Deletes the specified job. You cannot delete a job that the service is actively processing. Once you delete a job, its results are no longer available. The service automatically deletes a job and its results when the time to live for @@ -1176,22 +1394,26 @@ must make the request with credentials for the instance of the service that owns the job.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_language_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a custom language model

+
public instance
delete_language_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete a custom language model

Deletes an existing custom language model. The custom model cannot be deleted if another request, such as adding a corpus or grammar to the model, is currently being processed. You must use credentials for the instance of the service that owns a model to delete it.

- **See also:** [Deleting a custom language + **See also:**
+ * [Deleting a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLan - guageModels#deleteModel-language). + guageModels#deleteModel-language)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
raisingzcx_ibmc_service_exception

Delete labeled data

+
public instance
delete_user_data
importingi_customer_idtype string
raisingzcx_ibmc_service_exception

Delete labeled data

Deletes all data that is associated with a specified customer ID. The method deletes all data for the customer ID, regardless of the method by which the information was added. The method has no effect if no data is associated with @@ -1214,15 +1436,15 @@
Parameters
i_customer_id The customer ID for which all data is to be deleted.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_word
importingi_customization_idtype STRING
i_word_nametype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a custom word

+
public instance
delete_word
importingi_customization_idtype string
i_word_nametype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Delete a custom word

Deletes a custom word from a custom language model. You can remove any word that you added to the custom model's words resource via any means. However, if the word also exists in the service's base vocabulary, the service removes - only the custom pronunciation for the word; the word remains in the base - vocabulary. Removing a custom word does not affect the custom model until you - train the model with the **Train a custom language model** method. You must use - credentials for the instance of the service that owns a model to delete its - words.
+ the word only from the words resource; the word remains in the base vocabulary. + Removing a custom word does not affect the custom model until you train the + model with the [Train a custom language model](#trainlanguagemodel) method. You + must use credentials for the instance of the service that owns a model to + delete its words.

**See also:** [Deleting a word from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor @@ -1239,11 +1461,15 @@ encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor aWords#charEncoding).
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_acoustic_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ACOUSTIC_MODEL
raisingzcx_ibmc_service_exception

Get a custom acoustic model

+
public instance
get_acoustic_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_acoustic_model
raisingzcx_ibmc_service_exception

Get a custom acoustic model

Gets information about a specified custom acoustic model. You must use credentials for the instance of the service that owns a model to list information about it.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Listing custom acoustic models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAc ousticModels#listModels-acoustic). @@ -1255,29 +1481,33 @@
e_response Service return value of type T_ACOUSTIC_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition public instance
get_audio
importingi_customization_idtype STRING
i_audio_nametype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_AUDIO_LISTING
raisingzcx_ibmc_service_exception

Get an audio resource

+
public instanceget_appname redefinition public instance
get_audio
importingi_customization_idtype string
i_audio_nametype string
i_accepttype string default 'application/json'
exportinge_responsetype t_audio_listing
raisingzcx_ibmc_service_exception

Get an audio resource

Gets information about an audio resource from a custom acoustic model. The method returns an `AudioListing` object whose fields depend on the type of audio resource that you specify with the method's `audio_name` parameter:
- * **For an audio-type resource,** the object's fields match those of an + * _For an audio-type resource_, the object's fields match those of an `AudioResource` object: `duration`, `name`, `details`, and `status`.
- * **For an archive-type resource,** the object includes a `container` field - whose fields match those of an `AudioResource` object. It also includes an - `audio` field, which contains an array of `AudioResource` objects that provides + * _For an archive-type resource_, the object includes a `container` field whose + fields match those of an `AudioResource` object. It also includes an `audio` + field, which contains an array of `AudioResource` objects that provides information about the audio files that are contained in the archive.

The information includes the status of the specified audio resource. The status is important for checking the service's analysis of a resource that you add to the custom model.
- * For an audio-type resource, the `status` field is located in the + * _For an audio-type resource_, the `status` field is located in the `AudioListing` object.
- * For an archive-type resource, the `status` field is located in the + * _For an archive-type resource_, the `status` field is located in the `AudioResource` object that is returned in the `container` field.

You must use credentials for the instance of the service that owns a model to list its audio resources.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Listing audio resources for a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAud io#listAudio). @@ -1291,11 +1521,13 @@
e_response Service return value of type T_AUDIO_LISTING
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_corpus
importingi_customization_idtype STRING
i_corpus_nametype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CORPUS
raisingzcx_ibmc_service_exception

Get a corpus

+
public instance
get_corpus
importingi_customization_idtype string
i_corpus_nametype string
i_accepttype string default 'application/json'
exportinge_responsetype t_corpus
raisingzcx_ibmc_service_exception

Get a corpus

Gets information about a corpus from a custom language model. The information - includes the total number of words and out-of-vocabulary (OOV) words, name, and - status of the corpus. You must use credentials for the instance of the service - that owns a model to list its corpora.
+ includes the name, status, and total number of words for the corpus. _For + custom models that are based on previous-generation models_, it also includes + the number of out-of-vocabulary (OOV) words from the corpus. You must use + credentials for the instance of the service that owns a model to list its + corpora.

**See also:** [Listing corpora for a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCor @@ -1310,15 +1542,20 @@
e_response Service return value of type T_CORPUS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_grammar
importingi_customization_idtype STRING
i_grammar_nametype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GRAMMAR
raisingzcx_ibmc_service_exception

Get a grammar

- Gets information about a grammar from a custom language model. The information - includes the total number of out-of-vocabulary (OOV) words, name, and status of - the grammar. You must use credentials for the instance of the service that owns - a model to list its grammars.
+
public instance
get_grammar
importingi_customization_idtype string
i_grammar_nametype string
i_accepttype string default 'application/json'
exportinge_responsetype t_grammar
raisingzcx_ibmc_service_exception

Get a grammar

+ Gets information about a grammar from a custom language model. For each grammar, + the information includes the name, status, and (for grammars that are based on + previous-generation models) the total number of out-of-vocabulary (OOV) words. + You must use credentials for the instance of the service that owns a model to + list its grammars.

- **See also:** [Listing grammars from a custom language + **See also:**
+ * [Listing grammars from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageGra - mmars#listGrammars). + mmars#listGrammars)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -1329,14 +1566,18 @@
e_response Service return value of type T_GRAMMAR
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_language_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LANGUAGE_MODEL
raisingzcx_ibmc_service_exception

Get a custom language model

+
public instance
get_language_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_language_model
raisingzcx_ibmc_service_exception

Get a custom language model

Gets information about a specified custom language model. You must use credentials for the instance of the service that owns a model to list information about it.

- **See also:** [Listing custom language + **See also:**
+ * [Listing custom language models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLa - nguageModels#listModels-language). + nguageModels#listModels-language)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -1345,23 +1586,22 @@
e_response Service return value of type T_LANGUAGE_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_model
importingi_model_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SPEECH_MODEL
raisingzcx_ibmc_service_exception

Get a model

+
public instance
get_model
importingi_model_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_speech_model
raisingzcx_ibmc_service_exception

Get a model

Gets information for a single specified language model that is available for use with the service. The information includes the name of the model and its minimum sampling rate in Hertz, among other things.

- **See also:** [Languages and - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - odels). + **See also:** [Listing a specific + model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-li + st#models-list-specific).
Parameters
i_model_id - The identifier of the model in the form of its name from the output of the **Get - a model** method. (**Note:** The model `ar-AR_BroadbandModel` is deprecated; - use `ar-MS_BroadbandModel` instead.). + The identifier of the model in the form of its name from the output of the [List + models](#listmodels) method.
e_response Service return value of type T_SPEECH_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_word
importingi_customization_idtype STRING
i_word_nametype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORD
raisingzcx_ibmc_service_exception

Get a custom word

+
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_word
importingi_customization_idtype string
i_word_nametype string
i_accepttype string default 'application/json'
exportinge_responsetype t_word
raisingzcx_ibmc_service_exception

Get a custom word

Gets information about a custom word from a custom language model. You must use credentials for the instance of the service that owns a model to list information about its words.
@@ -1383,31 +1623,37 @@
e_response Service return value of type T_WORD
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_acoustic_models
importingi_languagetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ACOUSTIC_MODELS
raisingzcx_ibmc_service_exception

List custom acoustic models

+
public instance
list_acoustic_models
importingi_languagetype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_acoustic_models
raisingzcx_ibmc_service_exception

List custom acoustic models

Lists information about all custom acoustic models that are owned by an instance of the service. Use the `language` parameter to see all custom acoustic models for the specified language. Omit the parameter to see all custom acoustic models for all languages. You must use credentials for the instance of the service that owns a model to list information about it.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Listing custom acoustic models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAc ousticModels#listModels-acoustic).
Parameters
i_language The identifier of the language for which custom language or custom acoustic - models are to be returned. Omit the parameter to see all custom language or - custom acoustic models that are owned by the requesting credentials. (**Note:** - The identifier `ar-AR` is deprecated; use `ar-MS` instead.)
+ models are to be returned. Specify the five-character language identifier; for + example, specify `en-US` to see all custom language or custom acoustic models + that are based on US English models. Omit the parameter to see all custom + language or custom acoustic models that are owned by the requesting + credentials.

To determine the languages for which customization is available, see [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c - ustomization#languageSupport). + ustom-support).
e_response Service return value of type T_ACOUSTIC_MODELS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_audio
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_AUDIO_RESOURCES
raisingzcx_ibmc_service_exception

List audio resources

+
public instance
list_audio
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_audio_resources
raisingzcx_ibmc_service_exception

List audio resources

Lists information about all audio resources from a custom acoustic model. The information includes the name of the resource and information about its audio data, such as its duration. It also includes the status of the audio resource, @@ -1416,6 +1662,10 @@ credentials for the instance of the service that owns a model to list its audio resources.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Listing audio resources for a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAud io#listAudio). @@ -1427,11 +1677,13 @@
e_response Service return value of type T_AUDIO_RESOURCES
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_corpora
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CORPORA
raisingzcx_ibmc_service_exception

List corpora

+
public instance
list_corpora
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_corpora
raisingzcx_ibmc_service_exception

List corpora

Lists information about all corpora from a custom language model. The - information includes the total number of words and out-of-vocabulary (OOV) - words, name, and status of each corpus. You must use credentials for the - instance of the service that owns a model to list its corpora.
+ information includes the name, status, and total number of words for each + corpus. _For custom models that are based on previous-generation models_, it + also includes the number of out-of-vocabulary (OOV) words from the corpus. You + must use credentials for the instance of the service that owns a model to list + its corpora.

**See also:** [Listing corpora for a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCor @@ -1444,15 +1696,20 @@
e_response Service return value of type T_CORPORA
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_grammars
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_GRAMMARS
raisingzcx_ibmc_service_exception

List grammars

- Lists information about all grammars from a custom language model. The - information includes the total number of out-of-vocabulary (OOV) words, name, - and status of each grammar. You must use credentials for the instance of the - service that owns a model to list its grammars.
+
public instance
list_grammars
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_grammars
raisingzcx_ibmc_service_exception

List grammars

+ Lists information about all grammars from a custom language model. For each + grammar, the information includes the name, status, and (for grammars that are + based on previous-generation models) the total number of out-of-vocabulary + (OOV) words. You must use credentials for the instance of the service that owns + a model to list its grammars.

- **See also:** [Listing grammars from a custom language + **See also:**
+ * [Listing grammars from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageGra - mmars#listGrammars). + mmars#listGrammars)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for @@ -1461,52 +1718,62 @@
e_response Service return value of type T_GRAMMARS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_language_models
importingi_languagetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_LANGUAGE_MODELS
raisingzcx_ibmc_service_exception

List custom language models

+
public instance
list_language_models
importingi_languagetype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_language_models
raisingzcx_ibmc_service_exception

List custom language models

Lists information about all custom language models that are owned by an instance of the service. Use the `language` parameter to see all custom language models for the specified language. Omit the parameter to see all custom language models for all languages. You must use credentials for the instance of the service that owns a model to list information about it.

- **See also:** [Listing custom language + **See also:**
+ * [Listing custom language models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLa - nguageModels#listModels-language). + nguageModels#listModels-language)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_language The identifier of the language for which custom language or custom acoustic - models are to be returned. Omit the parameter to see all custom language or - custom acoustic models that are owned by the requesting credentials. (**Note:** - The identifier `ar-AR` is deprecated; use `ar-MS` instead.)
+ models are to be returned. Specify the five-character language identifier; for + example, specify `en-US` to see all custom language or custom acoustic models + that are based on US English models. Omit the parameter to see all custom + language or custom acoustic models that are owned by the requesting + credentials.

To determine the languages for which customization is available, see [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c - ustomization#languageSupport). + ustom-support).
e_response Service return value of type T_LANGUAGE_MODELS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_models
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_SPEECH_MODELS
raisingzcx_ibmc_service_exception

List models

+
public instance
list_models
importingi_accepttype string default 'application/json'
exportinge_responsetype t_speech_models
raisingzcx_ibmc_service_exception

List models

Lists all language models that are available for use with the service. The information includes the name of the model and its minimum sampling rate in Hertz, among other things. The ordering of the list of models can change from call to call; do not rely on an alphabetized or static list of models.

- **See also:** [Languages and - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - odels). + **See also:** [Listing all + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-l + ist#models-list-all).
Parameters
e_response Service return value of type T_SPEECH_MODELS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_words
importingi_customization_idtype STRING
i_word_typetype STRING default 'all'
i_sorttype STRING default 'alphabetical'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORDS
raisingzcx_ibmc_service_exception

List custom words

+
public instance
list_words
importingi_customization_idtype string
i_word_typetype string default 'all'
i_sorttype string default 'alphabetical'
i_accepttype string default 'application/json'
exportinge_responsetype t_words
raisingzcx_ibmc_service_exception

List custom words

Lists information about custom words from a custom language model. You can list all words from the custom model's words resource, only custom words that - were added or modified by the user, or only out-of-vocabulary (OOV) words that - were extracted from corpora or are recognized by grammars. You can also - indicate the order in which the service is to return words; by default, the - service lists words in ascending alphabetical order. You must use credentials - for the instance of the service that owns a model to list information about its - words.
+ were added or modified by the user, or, _for a custom model that is based on a + previous-generation model_, only out-of-vocabulary (OOV) words that were + extracted from corpora or are recognized by grammars. _For a custom model that + is based on a next-generation model_, you can list all words or only those + words that were added directly by a user, which return the same results.
+
+ You can also indicate the order in which the service is to return words; by + default, the service lists words in ascending alphabetical order. You must use + credentials for the instance of the service that owns a model to list + information about its words.

**See also:** [Listing words from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor @@ -1523,7 +1790,11 @@ * `user` shows only custom words that were added or modified by the user directly.
* `corpora` shows only OOV that were extracted from corpora.
- * `grammars` shows only OOV words that are recognized by grammars. + * `grammars` shows only OOV words that are recognized by grammars.
+
+ _For a custom model that is based on a next-generation model_, only `all` and + `user` apply. Both options return the same results. Words from other sources + are not added to custom models that are based on next-generation models.
i_sort Indicates the order in which the words are to be listed, `alphabetical` or by `count`. You can prepend an optional `+` or `-` to an argument to indicate @@ -1536,7 +1807,7 @@ e_response Service return value of type T_WORDS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
recognize
importingi_audiotype FILE
i_content_typetype STRING default 'application/octet-stream'
i_modeltype STRING default 'en-US_BroadbandModel'
i_language_customization_idtype STRING optional
i_acoustic_customization_idtype STRING optional
i_base_model_versiontype STRING optional
i_customization_weighttype DOUBLE optional
i_inactivity_timeouttype INTEGER optional
i_keywordstype TT_STRING optional
i_keywords_thresholdtype FLOAT optional
i_max_alternativestype INTEGER optional
i_word_alternatives_thresholdtype FLOAT optional
i_word_confidencetype BOOLEAN default C_BOOLEAN_FALSE
i_timestampstype BOOLEAN default C_BOOLEAN_FALSE
i_profanity_filtertype BOOLEAN default C_BOOLEAN_TRUE
i_smart_formattingtype BOOLEAN default C_BOOLEAN_FALSE
i_speaker_labelstype BOOLEAN default C_BOOLEAN_FALSE
i_customization_idtype STRING optional
i_grammar_nametype STRING optional
i_redactiontype BOOLEAN default C_BOOLEAN_FALSE
i_audio_metricstype BOOLEAN default C_BOOLEAN_FALSE
i_end_of_phrase_silence_timetype DOUBLE optional
i_splt_trnscrpt_at_phrase_endtype BOOLEAN default C_BOOLEAN_FALSE
i_speech_detector_sensitivitytype FLOAT optional
i_background_audio_suppressiontype FLOAT optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_SPEECH_RECOGNITION_RESULTS
raisingzcx_ibmc_service_exception

Recognize audio

+
public instance
recognize
importingi_audiotype file
i_content_typetype string default 'application/octet-stream'
i_modeltype string default 'en-US_BroadbandModel'
i_language_customization_idtype string optional
i_acoustic_customization_idtype string optional
i_base_model_versiontype string optional
i_customization_weighttype double optional
i_inactivity_timeouttype integer default 30
i_keywordstype tt_string optional
i_keywords_thresholdtype float optional
i_max_alternativestype integer default 1
i_word_alternatives_thresholdtype float optional
i_word_confidencetype boolean default c_boolean_false
i_timestampstype boolean default c_boolean_false
i_profanity_filtertype boolean default c_boolean_true
i_smart_formattingtype boolean default c_boolean_false
i_speaker_labelstype boolean default c_boolean_false
i_grammar_nametype string optional
i_redactiontype boolean default c_boolean_false
i_audio_metricstype boolean default c_boolean_false
i_end_of_phrase_silence_timetype double default '0.8'
i_splt_trnscrpt_at_phrase_endtype boolean default c_boolean_false
i_speech_detector_sensitivitytype float default '0.5'
i_background_audio_suppressiontype float default '0.0'
i_low_latencytype boolean default c_boolean_false
i_character_insertion_biastype float default '0.0'
i_accepttype string default 'application/json'
exportinge_responsetype t_speech_recognition_results
raisingzcx_ibmc_service_exception

Recognize audio

Sends audio and returns transcription results for a recognition request. You can pass a maximum of 100 MB and a minimum of 100 bytes of audio with a request. The service automatically detects the endianness of the incoming audio and, for @@ -1610,13 +1881,53 @@ rate. If the sampling rate of the audio is lower than the minimum required rate, the request fails.

- **See also:** [Audio + **See also:** [Supported audio formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-f - ormats#audio-formats).
+ ormats).
+
+ ### Next-generation models
+
+ The service supports next-generation `Multimedia` (16 kHz) and `Telephony` (8 + kHz) models for many languages. Next-generation models have higher throughput + than the service's previous generation of `Broadband` and `Narrowband` + models. When you use next-generation models, the service can return + transcriptions more quickly and also provide noticeably better transcription + accuracy.
+
+ You specify a next-generation model by using the `model` query parameter, as you + do a previous-generation model. Most next-generation models support the + `low_latency` parameter, and all next-generation models support the + `character_insertion_bias` parameter. These parameters are not available with + previous-generation models.
+
+ Next-generation models do not support all of the speech recognition parameters + that are available for use with previous-generation models. Next-generation + models do not support the following parameters:
+ * `acoustic_customization_id`
+ * `keywords` and `keywords_threshold`
+ * `processing_metrics` and `processing_metrics_interval`
+ * `word_alternatives_threshold`
+
+ **Important:** Effective **31 July 2023**, all previous-generation models will + be removed from the service and the documentation. Most previous-generation + models were deprecated on 15 March 2022. You must migrate to the equivalent + next-generation model by 31 July 2023. For more information, see [Migrating to + next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + igrate).
+
+ **See also:**
+ * [Next-generation languages and + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + g)
+ * [Supported features for next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + g#models-ng-features)

### Multipart speech recognition

- **Note:** The Watson SDKs do not support multipart speech recognition.
+ **Note:** The asynchronous HTTP interface, WebSocket interface, and Watson SDKs + do not support multipart speech recognition.

The HTTP `POST` method of the service also supports multipart speech recognition. With multipart requests, you pass all audio data as multipart form @@ -1640,19 +1951,29 @@ The format (MIME type) of the audio. For more information about specifying an audio format, see **Audio formats (content types)** in the method description.
i_model - The identifier of the model that is to be used for the recognition request. - (**Note:** The model `ar-AR_BroadbandModel` is deprecated; use - `ar-MS_BroadbandModel` instead.) See [Languages and - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - odels). + The model to use for speech recognition. If you omit the `model` parameter, the + service uses the US English `en-US_BroadbandModel` by default.
+
+ _For IBM Cloud Pak for Data,_ if you do not install the `en-US_BroadbandModel`, + you must either specify a model with the request or specify a new default model + for your installation of the service.
+
+ **See also:**
+ * [Using a model for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-mod + els-use)
+ * [Using the default + model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-us + e#models-use-default).
i_language_customization_id The customization ID (GUID) of a custom language model that is to be used with the recognition request. The base model of the specified custom language model must match the model specified with the `model` parameter. You must make the request with credentials for the instance of the service that owns the custom - model. By default, no custom language model is used. See [Custom - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - stom-input).
+ model. By default, no custom language model is used. See [Using a custom + language model for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-lan + guageUse).

**Note:** Use this parameter instead of the deprecated `customization_id` parameter. @@ -1661,18 +1982,19 @@ the recognition request. The base model of the specified custom acoustic model must match the model specified with the `model` parameter. You must make the request with credentials for the instance of the service that owns the custom - model. By default, no custom acoustic model is used. See [Custom - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - stom-input). + model. By default, no custom acoustic model is used. See [Using a custom + acoustic model for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-aco + usticUse).
i_base_model_version The version of the specified base model that is to be used with the recognition request. Multiple versions of a base model can exist when a model is updated for internal improvements. The parameter is intended primarily for use with custom models that have been upgraded for a new base model. The default value depends on whether the parameter is used with or without a custom model. See - [Base model - version](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#v - ersion). + [Making speech recognition requests with upgraded custom + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + pgrade-use#custom-upgrade-use-recognition). i_customization_weight If you specify the customization ID (GUID) of a custom language model with the recognition request, the customization weight tells the service how much weight @@ -1680,19 +2002,22 @@ model for the current request.

Specify a value between 0.0 and 1.0. Unless a different customization weight was - specified for the custom model when it was trained, the default value is 0.3. A - customization weight that you specify overrides a weight that was specified - when the custom model was trained.
-
- The default value yields the best performance in general. Assign a higher value - if your audio makes frequent use of OOV words from the custom model. Use - caution when setting the weight: a higher value can improve the accuracy of - phrases from the custom model's domain, but it can negatively affect - performance on non-domain phrases.
-
- See [Custom - models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - stom-input). + specified for the custom model when the model was trained, the default value + is:
+ * 0.3 for previous-generation models
+ * 0.2 for most next-generation models
+ * 0.1 for next-generation English and Japanese models
+
+ A customization weight that you specify overrides a weight that was specified + when the custom model was trained. The default value yields the best + performance in general. Assign a higher value if your audio makes frequent use + of OOV words from the custom model. Use caution when setting the weight: a + higher value can improve the accuracy of phrases from the custom model's + domain, but it can negatively affect performance on non-domain phrases.
+
+ See [Using customization + weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-language + Use#weight).
i_inactivity_timeout The time in seconds after which, if only silence (no speech) is detected in streaming audio, the connection is closed with a 400 error. The parameter is @@ -1713,48 +2038,50 @@ case-insensitive.

See [Keyword - spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - #keyword_spotting). + spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + ng#keyword-spotting).
i_keywords_threshold A confidence value that is the lower bound for spotting a keyword. A word is considered to match a keyword if its confidence is greater than or equal to the threshold. Specify a probability between 0.0 and 1.0. If you specify a threshold, you must also specify one or more keywords. The service performs no keyword spotting if you omit either parameter. See [Keyword - spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - #keyword_spotting). + spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + ng#keyword-spotting). i_max_alternatives The maximum number of alternative transcripts that the service is to return. By default, the service returns a single transcript. If you specify a value of `0`, the service uses the default value, `1`. See [Maximum - alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - tput#max_alternatives). + alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-me + tadata#max-alternatives). i_word_alternatives_threshold A confidence value that is the lower bound for identifying a hypothesis as a possible word alternative (also known as "Confusion Networks"). An alternative word is considered if its confidence is greater than or equal to the threshold. Specify a probability between 0.0 and 1.0. By default, the service computes no alternative words. See [Word - alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - tput#word_alternatives). + alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-sp + otting#word-alternatives). i_word_confidence If `true`, the service returns a confidence measure in the range of 0.0 to 1.0 for each word. By default, the service returns no word confidence scores. See [Word - confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - ut#word_confidence). + confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + data#word-confidence). i_timestamps If `true`, the service returns time alignment for each word. By default, no timestamps are returned. See [Word - timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - ut#word_timestamps). + timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + data#word-timestamps). i_profanity_filter If `true`, the service filters profanity from all output except for keyword results by replacing inappropriate words with a series of asterisks. Set the - parameter to `false` to return results with no censoring. Applies to US English - transcription only. See [Profanity - filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - t#profanity_filter). + parameter to `false` to return results with no censoring.
+
+ **Note:** The parameter can be used with US English and Japanese transcription + only. See [Profanity + filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + tting#profanity-filtering).
i_smart_formatting If `true`, the service converts dates, times, series of digits and numbers, phone numbers, currency values, and internet addresses into more readable, @@ -1763,38 +2090,39 @@ punctuation symbols. By default, the service performs no smart formatting.

- **Note:** Applies to US English, Japanese, and Spanish transcription only.
+ **Note:** The parameter can be used with US English, Japanese, and Spanish (all + dialects) transcription only.

See [Smart - formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - ut#smart_formatting). + formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-form + atting#smart-formatting).
i_speaker_labels If `true`, the response includes labels that identify which words were spoken by which participants in a multi-person exchange. By default, the service returns no speaker labels. Setting `speaker_labels` to `true` forces the `timestamps` parameter to be `true`, regardless of whether you specify `false` for the parameter.
-
- **Note:** Applies to US English, Australian English, German, Japanese, Korean, - and Spanish (both broadband and narrowband models) and UK English (narrowband - model) transcription only.
+ * _For previous-generation models,_ the parameter can be used with Australian + English, US English, German, Japanese, Korean, and Spanish (both broadband and + narrowband models) and UK English (narrowband model) transcription only.
+ * _For next-generation models,_ the parameter can be used with Czech, English + (Australian, Indian, UK, and US), German, Japanese, Korean, and Spanish + transcription only.

See [Speaker - labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#s - peaker_labels). -
i_customization_id - **Deprecated.** Use the `language_customization_id` parameter to specify the - customization ID (GUID) of a custom language model that is to be used with the - recognition request. Do not specify both parameters with a request. + labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker- + labels). i_grammar_name The name of a grammar that is to be used with the recognition request. If you specify a grammar, you must also use the `language_customization_id` parameter to specify the name of the custom language model for which the grammar is defined. The service recognizes only strings that are recognized by the specified grammar; it does not recognize other custom words from the - model's words resource. See - [Grammars](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - #grammars-input). + model's words resource.
+
+ See [Using a grammar for speech + recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-gra + mmarUse).
i_redaction If `true`, the service redacts, or masks, numeric data from final transcripts. The feature redacts any number that has three or more consecutive digits by @@ -1808,11 +2136,12 @@ and `keywords_threshold` parameters) and returns only a single final transcript (forces the `max_alternatives` parameter to be `1`).

- **Note:** Applies to US English, Japanese, and Korean transcription only.
+ **Note:** The parameter can be used with US English, Japanese, and Korean + transcription only.

See [Numeric - redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - t#redaction). + redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + tting#numeric-redaction).
i_audio_metrics If `true`, requests detailed information about the signal characteristics of the input audio. The service returns audio metrics with the final transcription @@ -1820,11 +2149,11 @@
See [Audio metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - #audio_metrics). + #audio-metrics).
i_end_of_phrase_silence_time - If `true`, specifies the duration of the pause interval at which the service - splits a transcript into multiple final results. If the service detects pauses - or extended silence before it reaches the end of the audio stream, its response + Specifies the duration of the pause interval at which the service splits a + transcript into multiple final results. If the service detects pauses or + extended silence before it reaches the end of the audio stream, its response can include multiple final results. Silence indicates a point at which the speaker pauses between spoken words or phrases.

@@ -1838,20 +2167,24 @@ Chinese is 0.6 seconds.

See [End of phrase silence - time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#sil - ence_time). + time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#si + lence-time).
i_splt_trnscrpt_at_phrase_end If `true`, directs the service to split the transcript into multiple final results based on semantic features of the input, for example, at the conclusion of meaningful phrases such as sentences. The service bases its understanding of semantic features on the base language model that you use with a request. Custom language models and grammars can also influence how and where the - service splits a transcript. By default, the service splits transcripts based - solely on the pause interval.
+ service splits a transcript.
+
+ By default, the service splits transcripts based solely on the pause interval. + If the parameters are used together on the same request, + `end_of_phrase_silence_time` has precedence over + `split_transcript_at_phrase_end`.

See [Split transcript at phrase - end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#spli - t_transcript). + end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#spl + it-transcript).
i_speech_detector_sensitivity The sensitivity of speech activity detection that the service is to perform. Use the parameter to suppress word insertions from music, coughing, and other @@ -1865,9 +2198,15 @@ sensitivity.
* 1.0 suppresses no audio (speech detection sensitivity is disabled).

- The values increase on a monotonic curve. See [Speech Activity - Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - #detection). + The values increase on a monotonic curve. Specifying one or two decimal places + of precision (for example, `0.55`) is typically more than sufficient.
+
+ The parameter is supported with all next-generation models and with most + previous-generation models. See [Speech detector + sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + ection#detection-parameters-sensitivity) and [Language model + support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + on#detection-support).
i_background_audio_suppression The level to which the service is to suppress background audio based on its volume to prevent it from being transcribed as speech. Use the parameter to @@ -1879,13 +2218,60 @@ * 0.5 provides a reasonable level of audio suppression for general usage.
* 1.0 suppresses all audio (no audio is transcribed).

- The values increase on a monotonic curve. See [Speech Activity - Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - #detection). + The values increase on a monotonic curve. Specifying one or two decimal places + of precision (for example, `0.55`) is typically more than sufficient.
+
+ The parameter is supported with all next-generation models and with most + previous-generation models. See [Background audio + suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + ection#detection-parameters-suppression) and [Language model + support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + on#detection-support). +
i_low_latency + If `true` for next-generation `Multimedia` and `Telephony` models that support + low latency, directs the service to produce results even more quickly than it + usually does. Next-generation models produce transcription results faster than + previous-generation models. The `low_latency` parameter causes the models to + produce results even more quickly, though the results might be less accurate + when the parameter is used.
+
+ The parameter is not available for previous-generation `Broadband` and + `Narrowband` models. It is available for most next-generation models.
+ * For a list of next-generation models that support low latency, see [Supported + next-generation language + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + g#models-ng-supported).
+ * For more information about the `low_latency` parameter, see [Low + latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim + #low-latency). +
i_character_insertion_bias + For next-generation models, an indication of whether the service is biased to + recognize shorter or longer strings of characters when developing transcription + hypotheses. By default, the service is optimized to produce the best balance of + strings of different lengths.
+
+ The default bias is 0.0. The allowable range of values is -1.0 to 1.0.
+ * Negative values bias the service to favor hypotheses with shorter strings of + characters.
+ * Positive values bias the service to favor hypotheses with longer strings of + characters.
+
+ As the value approaches -1.0 or 1.0, the impact of the parameter becomes more + pronounced. To determine the most effective value for your scenario, start by + setting the value of the parameter to a small increment, such as -0.1, -0.05, + 0.05, or 0.1, and assess how the value impacts the transcription results. Then + experiment with different values as necessary, adjusting the value by small + increments.
+
+ The parameter is not available for previous-generation models.
+
+ See [Character insertion + bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#in + sertion-bias).
e_response Service return value of type T_SPEECH_RECOGNITION_RESULTS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
register_callback
importingi_callback_urltype STRING
i_user_secrettype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_REGISTER_STATUS
raisingzcx_ibmc_service_exception

Register a callback

+
public instance
register_callback
importingi_callback_urltype string
i_user_secrettype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_register_status
raisingzcx_ibmc_service_exception

Register a callback

Registers a callback URL with the service for use with subsequent asynchronous recognition requests. The service attempts to register, or allowlist, the callback URL if it is not already registered by sending a `GET` request to the @@ -1903,7 +2289,7 @@ service does not receive a reply with a response code of 200 and a body that echoes the challenge string sent by the service within five seconds, it does not allowlist the URL; it instead sends status code 400 in response to the - **Register a callback** request. If the requested callback URL is already + request to register a callback. If the requested callback URL is already allowlisted, the service responds to the initial registration request with response code 200.

@@ -1938,7 +2324,7 @@
e_response Service return value of type T_REGISTER_STATUS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
reset_acoustic_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Reset a custom acoustic model

+
public instance
reset_acoustic_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Reset a custom acoustic model

Resets a custom acoustic model by removing all audio resources from the model. Resetting a custom acoustic model initializes the model to its state when it was first created. Metadata such as the name and language of the model are @@ -1948,6 +2334,10 @@ model until the existing reset request completes. You must use credentials for the instance of the service that owns a model to reset it.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Resetting a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAco usticModels#resetModel-acoustic). @@ -1957,7 +2347,7 @@ the request. You must make the request with credentials for the instance of the service that owns the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
reset_language_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Reset a custom language model

+
public instance
reset_language_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Reset a custom language model

Resets a custom language model by removing all corpora, grammars, and words from the model. Resetting a custom language model initializes the model to its state when it was first created. Metadata such as the name and language of the model @@ -1965,16 +2355,20 @@ re-created. You must use credentials for the instance of the service that owns a model to reset it.

- **See also:** [Resetting a custom language + **See also:**
+ * [Resetting a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLan - guageModels#resetModel-language). + guageModels#resetModel-language)
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
train_acoustic_model
importingi_customization_idtype STRING
i_custom_language_model_idtype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_RESPONSE
raisingzcx_ibmc_service_exception

Train a custom acoustic model

+
public instance
train_acoustic_model
importingi_customization_idtype string
i_custom_language_model_idtype string optional
i_stricttype boolean default c_boolean_true
i_accepttype string default 'application/json'
exportinge_responsetype t_training_response
raisingzcx_ibmc_service_exception

Train a custom acoustic model

Initiates the training of a custom acoustic model with new or changed audio resources. After adding or deleting audio resources for a custom acoustic model, use this method to begin the actual training of the model on the latest @@ -1991,14 +2385,14 @@ of 2 hours of audio. The method returns an HTTP 200 response code to indicate that the training process has begun.

- You can monitor the status of the training by using the **Get a custom acoustic - model** method to poll the model's status. Use a loop to check the status - once a minute. The method returns an `AcousticModel` object that includes - `status` and `progress` fields. A status of `available` indicates that the - custom model is trained and ready to use. The service cannot train a model - while it is handling another request for the model. The service cannot accept - subsequent training requests, or requests to add new audio resources, until the - existing training request completes.
+ You can monitor the status of the training by using the [Get a custom acoustic + model](#getacousticmodel) method to poll the model's status. Use a loop to + check the status once a minute. The method returns an `AcousticModel` object + that includes `status` and `progress` fields. A status of `available` indicates + that the custom model is trained and ready to use. The service cannot train a + model while it is handling another request for the model. The service cannot + accept subsequent training requests, or requests to add new audio resources, + until the existing training request completes.

You can use the optional `custom_language_model_id` parameter to specify the GUID of a separately created custom language model that is to be used during @@ -2009,6 +2403,10 @@ models must be based on the same version of the same base model, and the custom language model must be fully trained and available.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:**
* [Train the custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic# @@ -2023,8 +2421,15 @@ * The service is currently handling another request for the custom model, such as another training request or a request to add audio resources to the model.
- * The custom model contains less than 10 minutes or more than 200 hours of audio - data.
+ * The custom model contains less than 10 minutes of audio that includes speech, + not silence.
+ * The custom model contains more than 50 hours of audio (for IBM Cloud) or more + that 200 hours of audio (for IBM Cloud Pak for Data). **Note:** For IBM Cloud, + the maximum hours of audio for a custom acoustic model was reduced from 200 to + 50 hours in August and September 2022. For more information, see [Maximum hours + of + audio](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audioReso + urces#audioMaximum).
* You passed a custom language model with the `custom_language_model_id` query parameter that is not in the available state. A custom language model must be fully trained and available to be used to train a custom acoustic model.
@@ -2049,10 +2454,16 @@ as the custom acoustic model, and the custom language model must be fully trained and available. The credentials specified with the request must own both custom models. +
i_strict + If `false`, allows training of the custom acoustic model to proceed as long as + the model contains at least one valid audio resource. The method returns an + array of `TrainingWarning` objects that lists any invalid resources. By default + (`true`), training of a custom acoustic model fails (status code 400) if the + model contains one or more invalid audio resources. e_response Service return value of type T_TRAINING_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
train_language_model
importingi_customization_idtype STRING
i_word_type_to_addtype STRING default 'all'
i_customization_weighttype DOUBLE optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_RESPONSE
raisingzcx_ibmc_service_exception

Train a custom language model

+
public instance
train_language_model
importingi_customization_idtype string
i_word_type_to_addtype string default 'all'
i_customization_weighttype double optional
i_stricttype boolean default c_boolean_true
i_accepttype string default 'application/json'
exportinge_responsetype t_training_response
raisingzcx_ibmc_service_exception

Train a custom language model

Initiates the training of a custom language model with new resources such as corpora, grammars, and custom words. After adding, modifying, or deleting resources for a custom language model, use this method to begin the actual @@ -2067,17 +2478,33 @@ and the current load on the service. The method returns an HTTP 200 response code to indicate that the training process has begun.

- You can monitor the status of the training by using the **Get a custom language - model** method to poll the model's status. Use a loop to check the status - every 10 seconds. The method returns a `LanguageModel` object that includes - `status` and `progress` fields. A status of `available` means that the custom - model is trained and ready to use. The service cannot accept subsequent - training requests or requests to add new resources until the existing request - completes.
+ You can monitor the status of the training by using the [Get a custom language + model](#getlanguagemodel) method to poll the model's status. Use a loop to + check the status every 10 seconds. If you added custom words directly to a + custom model that is based on a next-generation model, allow for some minutes + of extra training time for the model.
+
+ The method returns a `LanguageModel` object that includes `status` and + `progress` fields. A status of `available` means that the custom model is + trained and ready to use. The service cannot accept subsequent training + requests or requests to add new resources until the existing request completes. +
+
+ For custom models that are based on improved base language models, training also + performs an automatic upgrade to a newer version of the base model. You do not + need to use the [Upgrade a custom language model](#upgradelanguagemodel) method + to perform the upgrade.

- **See also:** [Train the custom language + **See also:**
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
+ * [Train the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC - reate#trainModel-language).
+ reate#trainModel-language)
+ * [Upgrading custom language models that are based on improved next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + pgrade#custom-upgrade-language-ng)

### Training failures

@@ -2097,19 +2524,27 @@ the request. You must make the request with credentials for the instance of the service that owns the custom model.
i_word_type_to_add - The type of words from the custom language model's words resource on which - to train the model:
+ _For custom models that are based on previous-generation models_, the type of + words from the custom language model's words resource on which to train + the model:
* `all` (the default) trains the model on all new words, regardless of whether they were extracted from corpora or grammars or were added or modified by the user.
- * `user` trains the model only on new words that were added or modified by the - user directly. The model is not trained on new words extracted from corpora or - grammars. + * `user` trains the model only on custom words that were added or modified by + the user directly. The model is not trained on new words extracted from corpora + or grammars.
+
+ _For custom models that are based on next-generation models_, the service + ignores the parameter. The words resource contains only custom words that the + user adds or modifies directly, so the parameter is unnecessary.
i_customization_weight Specifies a customization weight for the custom language model. The customization weight tells the service how much weight to give to words from the custom language model compared to those from the base model for speech - recognition. Specify a value between 0.0 and 1.0; the default is 0.3.
+ recognition. Specify a value between 0.0 and 1.0. The default value is:
+ * 0.3 for previous-generation models
+ * 0.2 for most next-generation models
+ * 0.1 for next-generation English and Japanese models

The default value yields the best performance in general. Assign a higher value if your audio makes frequent use of OOV words from the custom model. Use @@ -2119,14 +2554,26 @@
The value that you assign is used for all recognition requests that use the model. You can override it for any recognition request by specifying a - customization weight for that request. + customization weight for that request.
+
+ See [Using customization + weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-language + Use#weight). +
i_strict + If `false`, allows training of the custom language model to proceed as long as + the model contains at least one valid resource. The method returns an array of + `TrainingWarning` objects that lists any invalid resources. By default + (`true`), training of a custom language model fails (status code 400) if the + model contains one or more invalid resources (corpus files, grammar files, or + custom words). e_response Service return value of type T_TRAINING_RESPONSE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
unregister_callback
importingi_callback_urltype STRING
raisingzcx_ibmc_service_exception

Unregister a callback

- Unregisters a callback URL that was previously allowlisted with a **Register a - callback** request for use with the asynchronous interface. Once unregistered, - the URL can no longer be used with asynchronous recognition requests.
+
public instance
unregister_callback
importingi_callback_urltype string
raisingzcx_ibmc_service_exception

Unregister a callback

+ Unregisters a callback URL that was previously allowlisted with a [Register a + callback](#registercallback) request for use with the asynchronous interface. + Once unregistered, the URL can no longer be used with asynchronous recognition + requests.

**See also:** [Unregistering a callback URL](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#unreg @@ -2135,7 +2582,7 @@
Parameters
i_callback_url The callback URL that is to be unregistered.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
upgrade_acoustic_model
importingi_customization_idtype STRING
i_custom_language_model_idtype STRING optional
i_forcetype BOOLEAN default C_BOOLEAN_FALSE
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Upgrade a custom acoustic model

+
public instance
upgrade_acoustic_model
importingi_customization_idtype string
i_custom_language_model_idtype string optional
i_forcetype boolean default c_boolean_false
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Upgrade a custom acoustic model

Initiates the upgrade of a custom acoustic model to the latest version of its base language model. The upgrade method is asynchronous. It can take on the order of minutes or hours to complete depending on the amount of data in the @@ -2147,14 +2594,16 @@
The method returns an HTTP 200 response code to indicate that the upgrade process has begun successfully. You can monitor the status of the upgrade by - using the **Get a custom acoustic model** method to poll the model's - status. The method returns an `AcousticModel` object that includes `status` and - `progress` fields. Use a loop to check the status once a minute. While it is - being upgraded, the custom model has the status `upgrading`. When the upgrade - is complete, the model resumes the status that it had prior to upgrade. The - service cannot upgrade a model while it is handling another request for the - model. The service cannot accept subsequent requests for the model until the - existing upgrade request completes.
+ using the [Get a custom acoustic model](#getacousticmodel) method to poll the + model's status. The method returns an `AcousticModel` object that includes + `status` and `progress` fields. Use a loop to check the status once a minute. +
+
+ While it is being upgraded, the custom model has the status `upgrading`. When + the upgrade is complete, the model resumes the status that it had prior to + upgrade. The service cannot upgrade a model while it is handling another + request for the model. The service cannot accept subsequent requests for the + model until the existing upgrade request completes.

If the custom acoustic model was trained with a separately created custom language model, you must use the `custom_language_model_id` parameter to @@ -2163,9 +2612,13 @@ parameter if the custom acoustic model was not trained with a custom language model.

+ **Note:** Acoustic model customization is supported only for use with + previous-generation models. It is not supported for next-generation models. +
+
**See also:** [Upgrading a custom acoustic - model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customUpg - rade#upgradeAcoustic). + model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-up + grade#custom-upgrade-acoustic).
Parameters
i_customization_id The customization ID (GUID) of the custom acoustic model that is to be used for @@ -2183,10 +2636,10 @@ the upgrade of a custom acoustic model that is trained with a custom language model, and only if you receive a 400 response code and the message `No input data modified since last training`. See [Upgrading a custom acoustic - model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customUpg - rade#upgradeAcoustic). + model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-up + grade#custom-upgrade-acoustic).
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
upgrade_language_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Upgrade a custom language model

+
public instance
upgrade_language_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Upgrade a custom language model

Initiates the upgrade of a custom language model to the latest version of its base language model. The upgrade method is asynchronous. It can take on the order of minutes to complete depending on the amount of data in the custom @@ -2196,21 +2649,35 @@
The method returns an HTTP 200 response code to indicate that the upgrade process has begun successfully. You can monitor the status of the upgrade by - using the **Get a custom language model** method to poll the model's - status. The method returns a `LanguageModel` object that includes `status` and - `progress` fields. Use a loop to check the status every 10 seconds. While it is - being upgraded, the custom model has the status `upgrading`. When the upgrade - is complete, the model resumes the status that it had prior to upgrade. The - service cannot accept subsequent requests for the model until the upgrade - completes.
-
- **See also:** [Upgrading a custom language - model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customUpg - rade#upgradeLanguage). + using the [Get a custom language model](#getlanguagemodel) method to poll the + model's status. The method returns a `LanguageModel` object that includes + `status` and `progress` fields. Use a loop to check the status every 10 + seconds.
+
+ While it is being upgraded, the custom model has the status `upgrading`. When + the upgrade is complete, the model resumes the status that it had prior to + upgrade. The service cannot accept subsequent requests for the model until the + upgrade completes.
+
+ For custom models that are based on improved base language models, the [Train a + custom language model](#trainlanguagemodel) method also performs an automatic + upgrade to a newer version of the base model. You do not need to use the + upgrade method.
+
+ **See also:**
+ * [Language support for + customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + ustom-support)
+ * [Upgrading a custom language + model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-up + grade#custom-upgrade-language)
+ * [Upgrading custom language models that are based on improved next-generation + models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + pgrade#custom-upgrade-language-ng)
Parameters
i_customization_id The customization ID (GUID) of the custom language model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_text_to_speech_v1.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_text_to_speech_v1.html index 62d64e7..e1fca01 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_text_to_speech_v1.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_text_to_speech_v1.html @@ -1,4 +1,4 @@ -Class ZCL_IBMC_TEXT_TO_SPEECH_V1

Class ZCL_IBMC_TEXT_TO_SPEECH_V1

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Text to Speech

+Class ZCL_IBMC_TEXT_TO_SPEECH_V1

Class ZCL_IBMC_TEXT_TO_SPEECH_V1

public inheriting from zcl_ibmc_service_ext create public

Documentation

Text to Speech

The IBM Watson™ Text to Speech service provides APIs that use IBM's speech-synthesis capabilities to synthesize text into natural-sounding speech in a variety of languages, dialects, and voices. The service supports at least @@ -18,31 +18,187 @@ phonetic translation is based on the SSML phoneme format for representing a word. You can specify a phonetic translation in standard International Phonetic Alphabet (IPA) representation or in the proprietary IBM Symbolic Phonetic - Representation (SPR). The Arabic, Chinese, Dutch, Australian English, and - Korean languages support only IPA.

Types

Visibility and LevelNameDocumentation
publict_create_custom_model (structured type)

- Information about the new custom model.

publict_custom_model (structured type)

- Information about an existing custom model.

publict_custom_models (structured type)

- Information about existing custom models.

publict_empty_response_body type JSONOBJECT

- The empty response from a request.

publict_error_model (structured type)

- The error response from a failed request.

publict_pronunciation (structured type)

- The pronunciation of the specified text.

publict_supported_features (structured type)

+ Representation (SPR). For phonetic translation, the Arabic, Chinese, Dutch, + Australian English, Korean, and Swedish voices support only IPA, not SPR.
+
+ The service also offers a Tune by Example feature that lets you define custom + prompts. You can also define speaker models to improve the quality of your + custom prompts. The service support custom prompts only for US English custom + models and voices.
+
+ Effective **31 March 2022**, all *neural voices* are deprecated. The deprecated + voices remain available to existing users until 31 March 2023, when they will + be removed from the service and the documentation. *No enhanced neural voices + or expressive neural voices are deprecated.*<br/><br/> For more + information, see the [1 March 2023 service + update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + notes#text-to-speech-1march2023) in the release notes for + {{site.data.keyword.texttospeechshort}} for + {{site.data.keyword.cloud_notm}}.{: deprecated}

Types

Visibility and LevelNameDocumentation
publict_create_custom_model (structured type)

+ Information about the new custom model.

publict_custom_model (structured type)

+ Information about an existing custom model.

publict_custom_models (structured type)

+ Information about existing custom models.

publict_empty_response_body type jsonobject

+ The empty response from a request.

publict_error_model (structured type)

+ The error response from a failed request.

publict_inline_object (structured type) No documentation available.
publict_prompt (structured type)

+ Information about a custom prompt.

publict_prompts (structured type)

+ Information about the custom prompts that are defined for a

+ custom model.
publict_prompt_metadata (structured type)

+ Information about the prompt that is to be added to a custom

+ model. The following example of a `PromptMetadata` object includes both the + required prompt text and an optional speaker model ID:
+
+ `{ "prompt_text": "Thank you and good-bye!", + "speaker_id": "823068b2-ed4e-11ea-b6e0-7b6456aa95cc" + }`.
publict_pronunciation (structured type)

+ The pronunciation of the specified text.

publict_speaker (structured type)

+ Information about a speaker model.

publict_speakers (structured type)

+ Information about all speaker models for the service

+ instance.
publict_speaker_custom_model (structured type)

+ A custom models for which the speaker has defined prompts.

publict_speaker_custom_models (structured type)

+ Custom models for which the speaker has defined prompts.

publict_speaker_model (structured type)

+ The speaker ID of the speaker model.

publict_speaker_prompt (structured type)

+ A prompt that a speaker has defined for a custom model.

publict_supported_features (structured type)

Additional service features that are supported with the

- voice.
publict_text (structured type)

+ voice.

publict_text (structured type)

The text to synthesize. Specify either plain text or a

subset of SSML. SSML is an XML-based markup language that provides text annotation for speech-synthesis applications. Pass a maximum of 5 KB of input - text.
publict_translation (structured type)

- Information about the translation for the specified text.

publict_update_custom_model (structured type)

- Information about the updated custom model.

publict_voice (structured type)

- Information about an available voice.

publict_voices (structured type)

- Information about all available voices.

publict_word (structured type)

- Information about a word for the custom model.

publict_words (structured type)

- For the **Add custom words** method, one or more words that

- are to be added or updated for the custom model and the translation for each - specified word.
+ text. For more information, see
+ * [Specifying input + text](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-usingHTTP# + input)
+ * [Understanding + SSML](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-ssml).
publict_translation (structured type)

+ Information about the translation for the specified text.

publict_update_custom_model (structured type)

+ Information about the updated custom model.

publict_voice (structured type)

+ Information about an available voice.

publict_voices (structured type)

+ Information about all available voices.

publict_word (structured type)

+ Information about a word for the custom model.

publict_words (structured type)

+ 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.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_custom_prompt
importingi_customization_idtype string
i_prompt_idtype string
i_metadatatype t_prompt_metadata
i_filetype file
i_file_cttype string default zif_ibmc_service_arch~c_mediatype-all
i_contenttypetype string default 'multipart/form-data'
i_accepttype string default 'application/json'
exportinge_responsetype t_prompt
raisingzcx_ibmc_service_exception

Add a custom prompt

+ Adds a custom prompt to a custom model. A prompt is defined by the text that is + to be spoken, the audio for that text, a unique user-specified ID for the + prompt, and an optional speaker ID. The information is used to generate + prosodic data that is not visible to the user. This data is used by the service + to produce the synthesized audio upon request. You must use credentials for the + instance of the service that owns a custom model to add a prompt to it. You can + add a maximum of 1000 custom prompts to a single custom model.
+
+ You are recommended to assign meaningful values for prompt IDs. For example, use + `goodbye` to identify a prompt that speaks a farewell message. Prompt IDs must + be unique within a given custom model. You cannot define two prompts with the + same name for the same custom model. If you provide the ID of an existing + prompt, the previously uploaded prompt is replaced by the new information. The + existing prompt is reprocessed by using the new text and audio and, if + provided, new speaker model, and the prosody data associated with the prompt is + updated.
+
+ The quality of a prompt is undefined if the language of a prompt does not match + the language of its custom model. This is consistent with any text or SSML that + is specified for a speech synthesis request. The service makes a best-effort + attempt to render the specified text for the prompt; it does not validate that + the language of the text matches the language of the model.
+
+ Adding a prompt is an asynchronous operation. Although it accepts less audio + than speaker enrollment, the service must align the audio with the provided + text. The time that it takes to process a prompt depends on the prompt itself. + The processing time for a reasonably sized prompt generally matches the length + of the audio (for example, it takes 20 seconds to process a 20-second prompt).
- For the **List custom words** method, the words and their translations from the - custom model.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_word
importingi_customization_idtype STRING
i_wordtype STRING
i_translationtype T_TRANSLATION
i_contenttypetype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add a custom word

+
+ For shorter prompts, you can wait for a reasonable amount of time and then check + the status of the prompt with the [Get a custom prompt](#getcustomprompt) + method. For longer prompts, consider using that method to poll the service + every few seconds to determine when the prompt becomes available. No prompt can + be used for speech synthesis if it is in the `processing` or `failed` state. + Only prompts that are in the `available` state can be used for speech + synthesis.
+
+ When it processes a request, the service attempts to align the text and the + audio that are provided for the prompt. The text that is passed with a prompt + must match the spoken audio as closely as possible. Optimally, the text and + audio match exactly. The service does its best to align the specified text with + the audio, and it can often compensate for mismatches between the two. But if + the service cannot effectively align the text and the audio, possibly because + the magnitude of mismatches between the two is too great, processing of the + prompt fails.
+
+ ### Evaluating a prompt
+
+ Always listen to and evaluate a prompt to determine its quality before using it + in production. To evaluate a prompt, include only the single prompt in a speech + synthesis request by using the following SSML extension, in this case for a + prompt whose ID is `goodbye`:
+
+ `<ibm:prompt id="goodbye"/>`
+
+ In some cases, you might need to rerecord and resubmit a prompt as many as five + times to address the following possible problems:
+ * The service might fail to detect a mismatch between the prompt’s text and + audio. The longer the prompt, the greater the chance for misalignment between + its text and audio. Therefore, multiple shorter prompts are preferable to a + single long prompt.
+ * The text of a prompt might include a word that the service does not recognize. + In this case, you can create a custom word and pronunciation pair to tell the + service how to pronounce the word. You must then re-create the prompt.
+ * The quality of the input audio might be insufficient or the service’s + processing of the audio might fail to detect the intended prosody. Submitting + new audio for the prompt can correct these issues.
+
+ If a prompt that is created without a speaker ID does not adequately reflect the + intended prosody, enrolling the speaker and providing a speaker ID for the + prompt is one recommended means of potentially improving the quality of the + prompt. This is especially important for shorter prompts such as + "good-bye" or "thank you," where less audio data makes it + more difficult to match the prosody of the speaker. Custom prompts are + supported only for use with US English custom models and voices.
+
+ **See also:**
+ * [Add a custom + prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-crea + te#tbe-create-add-prompt)
+ * [Evaluate a custom + prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-crea + te#tbe-create-evaluate-prompt)
+ * [Rules for creating custom + prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-rul + es#tbe-rules-prompts) + +
Parameters
i_customization_id + The customization ID (GUID) of the custom model. You must make the request with + credentials for the instance of the service that owns the custom model. +
i_prompt_id + The identifier of the prompt that is to be added to the custom model:
+ * Include a maximum of 49 characters in the ID.
+ * Include only alphanumeric characters and `_` (underscores) in the ID.
+ * Do not include XML sensitive characters (double quotes, single quotes, + ampersands, angle brackets, and slashes) in the ID.
+ * To add a new prompt, the ID must be unique for the specified custom model. + Otherwise, the new information for the prompt overwrites the existing prompt + that has that ID. +
i_metadata + Information about the prompt that is to be added to a custom model. The + following example of a `PromptMetadata` object includes both the required + prompt text and an optional speaker model ID:
+
+ `{ "prompt_text": "Thank you and good-bye!", + "speaker_id": "823068b2-ed4e-11ea-b6e0-7b6456aa95cc" + }`. +
i_file + An audio file that speaks the text of the prompt with intonation and prosody + that matches how you would like the prompt to be spoken.
+ * The prompt audio must be in WAV format and must have a minimum sampling rate + of 16 kHz. The service accepts audio with higher sampling rates. The service + transcodes all audio to 16 kHz before processing it.
+ * The length of the prompt audio is limited to 30 seconds. +
e_response + Service return value of type T_PROMPT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
add_word
importingi_customization_idtype string
i_wordtype string
i_translationtype t_translation
i_contenttypetype string default 'application/json'
raisingzcx_ibmc_service_exception

Add a custom word

Adds a single word and its translation to the specified custom model. Adding a new translation for a word that already exists in a custom model overwrites the word's existing translation. A custom model can contain no more than @@ -82,7 +238,7 @@
i_translation The translation for the word that is to be added or updated.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_words
importingi_customization_idtype STRING
i_custom_wordstype T_WORDS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Add custom words

+
public instance
add_words
importingi_customization_idtype string
i_custom_wordstype t_words
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Add custom words

Adds one or more words and their translations to the specified custom model. Adding a new translation for a word that already exists in a custom model overwrites the word's existing translation. A custom model can contain no @@ -120,7 +276,7 @@
i_custom_words No documentation available.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_custom_model
importingi_create_voice_modeltype T_CREATE_CUSTOM_MODEL
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CUSTOM_MODEL
raisingzcx_ibmc_service_exception

Create a custom model

+
public instance
create_custom_model
importingi_create_voice_modeltype t_create_custom_model
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
exportinge_responsetype t_custom_model
raisingzcx_ibmc_service_exception

Create a custom model

Creates a new empty custom model. You must specify a name for the new custom model. You can optionally specify the language and a description for the new model. The model is owned by the instance of the service whose credentials are @@ -130,30 +286,13 @@ model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customMod els#cuModelsCreate).

- ### Important voice updates
-
- The service's voices underwent significant change on 2 December 2020.
- * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - neural instead of concatenative.
- * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - instead.
- * The `ar-AR` language identifier cannot be used to create a custom model. Use - the `ar-MS` identifier instead.
- * The standard concatenative voices for the following languages are now - deprecated: Brazilian Portuguese, United Kingdom and United States English, - French, German, Italian, Japanese, and Spanish (all dialects).
- * The features expressive SSML, voice transformation SSML, and use of the - `volume` attribute of the `<prosody>` element are deprecated and are not - supported with any of the service's neural voices.
- * All of the service's voices are now customizable and generally available - (GA) for production use.
-
- The deprecated voices and features will continue to function for at least one - year but might be removed at a future date. You are encouraged to migrate to - the equivalent neural voices at your earliest convenience. For more information - about all voice updates, see the [2 December 2020 service + **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + deprecated voices remain available to existing users until 31 March 2023, when + they will be removed from the service and the documentation. *No enhanced + neural voices or expressive neural voices are deprecated.* For more + information, see the [1 March 2023 service update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - notes#December2020) in the release notes. + notes#text-to-speech-1march2023) in the release notes.
Parameters
i_create_voice_model A `CreateCustomModel` object that contains information about the new custom @@ -161,7 +300,77 @@
e_response Service return value of type T_CUSTOM_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_custom_model
importingi_customization_idtype STRING
raisingzcx_ibmc_service_exception

Delete a custom model

+
public instance
create_speaker_model
importingi_speaker_nametype string
i_audiotype file
i_contenttypetype string default 'audio/wav'
i_accepttype string default 'application/json'
exportinge_responsetype t_speaker_model
raisingzcx_ibmc_service_exception

Create a speaker model

+ Creates a new speaker model, which is an optional enrollment token for users who + are to add prompts to custom models. A speaker model contains information about + a user's voice. The service extracts this information from a WAV audio + sample that you pass as the body of the request. Associating a speaker model + with a prompt is optional, but the information that is extracted from the + speaker model helps the service learn about the speaker's voice.
+
+ A speaker model can make an appreciable difference in the quality of prompts, + especially short prompts with relatively little audio, that are associated with + that speaker. A speaker model can help the service produce a prompt with more + confidence; the lack of a speaker model can potentially compromise the quality + of a prompt.
+
+ The gender of the speaker who creates a speaker model does not need to match the + gender of a voice that is used with prompts that are associated with that + speaker model. For example, a speaker model that is created by a male speaker + can be associated with prompts that are spoken by female voices.
+
+ You create a speaker model for a given instance of the service. The new speaker + model is owned by the service instance whose credentials are used to create it. + That same speaker can then be used to create prompts for all custom models + within that service instance. No language is associated with a speaker model, + but each custom model has a single specified language. You can add prompts only + to US English models.
+
+ You specify a name for the speaker when you create it. The name must be unique + among all speaker names for the owning service instance. To re-create a speaker + model for an existing speaker name, you must first delete the existing speaker + model that has that name.
+
+ Speaker enrollment is a synchronous operation. Although it accepts more audio + data than a prompt, the process of adding a speaker is very fast. The service + simply extracts information about the speaker’s voice from the audio. Unlike + prompts, speaker models neither need nor accept a transcription of the audio. + When the call returns, the audio is fully processed and the speaker enrollment + is complete.
+
+ The service returns a speaker ID with the request. A speaker ID is globally + unique identifier (GUID) that you use to identify the speaker in subsequent + requests to the service. Speaker models and the custom prompts with which they + are used are supported only for use with US English custom models and voices. +
+
+ **See also:**
+ * [Create a speaker + model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-creat + e#tbe-create-speaker-model)
+ * [Rules for creating speaker + models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-rule + s#tbe-rules-speakers) + +
Parameters
i_speaker_name + The name of the speaker that is to be added to the service instance.
+ * Include a maximum of 49 characters in the name.
+ * Include only alphanumeric characters and `_` (underscores) in the name.
+ * Do not include XML sensitive characters (double quotes, single quotes, + ampersands, angle brackets, and slashes) in the name.
+ * Do not use the name of an existing speaker that is already defined for the + service instance. +
i_audio + An enrollment audio file that contains a sample of the speaker’s voice.
+ * The enrollment audio must be in WAV format and must have a minimum sampling + rate of 16 kHz. The service accepts audio with higher sampling rates. It + transcodes all audio to 16 kHz before processing it.
+ * The length of the enrollment audio is limited to 1 minute. Speaking one or two + paragraphs of text that include five to ten sentences is recommended. +
e_response + Service return value of type T_SPEAKER_MODEL +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_custom_model
importingi_customization_idtype string
raisingzcx_ibmc_service_exception

Delete a custom model

Deletes the specified custom model. You must use credentials for the instance of the service that owns a model to delete it.

@@ -173,7 +382,51 @@ The customization ID (GUID) of the custom model. You must make the request with credentials for the instance of the service that owns the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
raisingzcx_ibmc_service_exception

Delete labeled data

+
public instance
delete_custom_prompt
importingi_customization_idtype string
i_prompt_idtype string
raisingzcx_ibmc_service_exception

Delete a custom prompt

+ Deletes an existing custom prompt from a custom model. The service deletes the + prompt with the specified ID. You must use credentials for the instance of the + service that owns the custom model from which the prompt is to be deleted. +
+
+ **Caution:** Deleting a custom prompt elicits a 400 response code from synthesis + requests that attempt to use the prompt. Make sure that you do not attempt to + use a deleted prompt in a production application. Custom prompts are supported + only for use with US English custom models and voices.
+
+ **See also:** [Deleting a custom + prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-cust + om-prompts#tbe-custom-prompts-delete). + +
Parameters
i_customization_id + The customization ID (GUID) of the custom model. You must make the request with + credentials for the instance of the service that owns the custom model. +
i_prompt_id + The identifier (name) of the prompt that is to be deleted. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_speaker_model
importingi_speaker_idtype string
raisingzcx_ibmc_service_exception

Delete a speaker model

+ Deletes an existing speaker model from the service instance. The service deletes + the enrolled speaker with the specified speaker ID. You must use credentials + for the instance of the service that owns a speaker model to delete the + speaker.
+
+ Any prompts that are associated with the deleted speaker are not affected by the + speaker's deletion. The prosodic data that defines the quality of a prompt + is established when the prompt is created. A prompt is static and remains + unaffected by deletion of its associated speaker. However, the prompt cannot be + resubmitted or updated with its original speaker once that speaker is deleted. + Speaker models and the custom prompts with which they are used are supported + only for use with US English custom models and voices.
+
+ **See also:** [Deleting a speaker + model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-speak + er-models#tbe-speaker-models-delete). + +
Parameters
i_speaker_id + The speaker ID (GUID) of the speaker model. You must make the request with + service credentials for the instance of the service that owns the speaker + model. +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
delete_user_data
importingi_customer_idtype string
raisingzcx_ibmc_service_exception

Delete labeled data

Deletes all data that is associated with a specified customer ID. The method deletes all data for the customer ID, regardless of the method by which the information was added. The method has no effect if no data is associated with @@ -194,7 +447,7 @@
Parameters
i_customer_id The customer ID for which all data is to be deleted.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_word
importingi_customization_idtype STRING
i_wordtype STRING
raisingzcx_ibmc_service_exception

Delete a custom word

+
public instance
delete_word
importingi_customization_idtype string
i_wordtype string
raisingzcx_ibmc_service_exception

Delete a custom word

Deletes a single word from the specified custom model. You must use credentials for the instance of the service that owns a model to delete its words.

@@ -208,11 +461,12 @@
i_word The word that is to be deleted from the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition public instance
get_custom_model
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CUSTOM_MODEL
raisingzcx_ibmc_service_exception

Get a custom model

+
public instanceget_appname redefinition public instance
get_custom_model
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_custom_model
raisingzcx_ibmc_service_exception

Get a custom model

Gets all information about a specified custom model. In addition to metadata such as the name and description of the custom model, the output includes the - words and their translations as defined in the model. To see just the metadata - for a model, use the **List custom models** method.
+ words and their translations that are defined for the model, as well as any + prompts that are defined for the model. To see just the metadata for a model, + use the [List custom models](#listcustommodels) method.

**See also:** [Querying a custom model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customMod @@ -224,48 +478,58 @@
e_response Service return value of type T_CUSTOM_MODEL
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_pronunciation
importingi_texttype STRING
i_voicetype STRING default 'en-US_MichaelV3Voice'
i_formattype STRING default 'ipa'
i_customization_idtype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_PRONUNCIATION
raisingzcx_ibmc_service_exception

Get pronunciation

+
public instance
get_custom_prompt
importingi_customization_idtype string
i_prompt_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_prompt
raisingzcx_ibmc_service_exception

Get a custom prompt

+ Gets information about a specified custom prompt for a specified custom model. + The information includes the prompt ID, prompt text, status, and optional + speaker ID for each prompt of the custom model. You must use credentials for + the instance of the service that owns the custom model. Custom prompts are + supported only for use with US English custom models and voices.
+
+ **See also:** [Listing custom + prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-cus + tom-prompts#tbe-custom-prompts-list). + +
Parameters
i_customization_id + The customization ID (GUID) of the custom model. You must make the request with + credentials for the instance of the service that owns the custom model. +
i_prompt_id + The identifier (name) of the prompt. +
e_response + Service return value of type T_PROMPT +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_pronunciation
importingi_texttype string
i_voicetype string default 'en-US_MichaelV3Voice'
i_formattype string default 'ipa'
i_customization_idtype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_pronunciation
raisingzcx_ibmc_service_exception

Get pronunciation

Gets the phonetic pronunciation for the specified word. You can request the pronunciation for a specific format. You can also request the pronunciation for a specific voice to see the default translation for the language of that voice or for a specific custom model to see the translation for that model.

+ **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + deprecated voices remain available to existing users until 31 March 2023, when + they will be removed from the service and the documentation. *No enhanced + neural voices or expressive neural voices are deprecated.* For more + information, see the [1 March 2023 service + update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + notes#text-to-speech-1march2023) in the release notes.
+
**See also:** [Querying a word from a language](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-custom - Words#cuWordsQueryLanguage).
-
- ### Important voice updates
-
- The service's voices underwent significant change on 2 December 2020.
- * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - neural instead of concatenative.
- * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - instead.
- * The `ar-AR` language identifier cannot be used to create a custom model. Use - the `ar-MS` identifier instead.
- * The standard concatenative voices for the following languages are now - deprecated: Brazilian Portuguese, United Kingdom and United States English, - French, German, Italian, Japanese, and Spanish (all dialects).
- * The features expressive SSML, voice transformation SSML, and use of the - `volume` attribute of the `<prosody>` element are deprecated and are not - supported with any of the service's neural voices.
- * All of the service's voices are now customizable and generally available - (GA) for production use.
-
- The deprecated voices and features will continue to function for at least one - year but might be removed at a future date. You are encouraged to migrate to - the equivalent neural voices at your earliest convenience. For more information - about all voice updates, see the [2 December 2020 service - update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - notes#December2020) in the release notes. + Words#cuWordsQueryLanguage).
Parameters
i_text The word for which the pronunciation is requested.
i_voice A voice that specifies the language in which the pronunciation is to be - returned. All voices for the same language (for example, `en-US`) return the - same translation. For more information about specifying a voice, see - **Important voice updates** in the method description. + returned. If you omit the `voice` parameter, the service uses the US English + `en-US_MichaelV3Voice` by default. All voices for the same language (for + example, `en-US`) return the same translation.
+
+ _For IBM Cloud Pak for Data,_ if you do not install the `en-US_MichaelV3Voice`, + you must either specify a voice with the request or specify a new default voice + for your installation of the service.
+
+ **See also:** [Using the default + voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-us + e#specify-voice-default).
i_format The phoneme format in which to return the pronunciation. The Arabic, Chinese, Dutch, Australian English, and Korean languages support only IPA. Omit the @@ -281,45 +545,48 @@
e_response Service return value of type T_PRONUNCIATION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_voice
importingi_voicetype STRING
i_customization_idtype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_VOICE
raisingzcx_ibmc_service_exception

Get a voice

+
public instanceget_request_prop redefinition public instanceget_sdk_version_date redefinition public instance
get_speaker_model
importingi_speaker_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_speaker_custom_models
raisingzcx_ibmc_service_exception

Get a speaker model

+ Gets information about all prompts that are defined by a specified speaker for + all custom models that are owned by a service instance. The information is + grouped by the customization IDs of the custom models. For each custom model, + the information lists information about each prompt that is defined for that + custom model by the speaker. You must use credentials for the instance of the + service that owns a speaker model to list its prompts. Speaker models and the + custom prompts with which they are used are supported only for use with US + English custom models and voices.
+
+ **See also:** [Listing the custom prompts for a speaker + model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-speak + er-models#tbe-speaker-models-list-prompts). + +
Parameters
i_speaker_id + The speaker ID (GUID) of the speaker model. You must make the request with + service credentials for the instance of the service that owns the speaker + model. +
e_response + Service return value of type T_SPEAKER_CUSTOM_MODELS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
get_voice
importingi_voicetype string
i_customization_idtype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_voice
raisingzcx_ibmc_service_exception

Get a voice

Gets information about the specified voice. The information includes the name, language, gender, and other details about the voice. Specify a customization ID to obtain information for a custom model that is defined for the language of the specified voice. To list information about all available voices, use the - **List voices** method.
+ [List voices](#listvoices) method.

**See also:** [Listing a specific - voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#li - stVoice).
-
- ### Important voice updates
-
- The service's voices underwent significant change on 2 December 2020.
- * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - neural instead of concatenative.
- * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - instead.
- * The `ar-AR` language identifier cannot be used to create a custom model. Use - the `ar-MS` identifier instead.
- * The standard concatenative voices for the following languages are now - deprecated: Brazilian Portuguese, United Kingdom and United States English, - French, German, Italian, Japanese, and Spanish (all dialects).
- * The features expressive SSML, voice transformation SSML, and use of the - `volume` attribute of the `<prosody>` element are deprecated and are not - supported with any of the service's neural voices.
- * All of the service's voices are now customizable and generally available - (GA) for production use.
-
- The deprecated voices and features will continue to function for at least one - year but might be removed at a future date. You are encouraged to migrate to - the equivalent neural voices at your earliest convenience. For more information - about all voice updates, see the [2 December 2020 service + voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-li + st#list-specific-voice).
+
+ **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + deprecated voices remain available to existing users until 31 March 2023, when + they will be removed from the service and the documentation. *No enhanced + neural voices or expressive neural voices are deprecated.* For more + information, see the [1 March 2023 service update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - notes#December2020) in the release notes. + notes#text-to-speech-1march2023) in the release notes.
Parameters
i_voice - The voice for which information is to be returned. For more information about - specifying a voice, see **Important voice updates** in the method description. + The voice for which information is to be returned.
i_customization_id The customization ID (GUID) of a custom model for which information is to be returned. You must make the request with credentials for the instance of the @@ -328,7 +595,7 @@
e_response Service return value of type T_VOICE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_word
importingi_customization_idtype STRING
i_wordtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRANSLATION
raisingzcx_ibmc_service_exception

Get a custom word

+
public instance
get_word
importingi_customization_idtype string
i_wordtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_translation
raisingzcx_ibmc_service_exception

Get a custom word

Gets the translation for a single word from the specified custom model. The output shows the translation as it is defined in the model. You must use credentials for the instance of the service that owns a model to list its @@ -346,13 +613,13 @@
e_response Service return value of type T_TRANSLATION
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_custom_models
importingi_languagetype STRING optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CUSTOM_MODELS
raisingzcx_ibmc_service_exception

List custom models

+
public instance
list_custom_models
importingi_languagetype string optional
i_accepttype string default 'application/json'
exportinge_responsetype t_custom_models
raisingzcx_ibmc_service_exception

List custom models

Lists metadata such as the name and description for all custom models that are owned by an instance of the service. Specify a language to list the custom - models for that language only. To see the words in addition to the metadata for - a specific custom model, use the **List a custom model** method. You must use - credentials for the instance of the service that owns a model to list - information about it.
+ models for that language only. To see the words and prompts in addition to the + metadata for a specific custom model, use the [Get a custom + model](#getcustommodel) method. You must use credentials for the instance of + the service that owns a model to list information about it.

**See also:** [Querying all custom models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customMo @@ -365,21 +632,64 @@
e_response Service return value of type T_CUSTOM_MODELS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_voices
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_VOICES
raisingzcx_ibmc_service_exception

List voices

+
public instance
list_custom_prompts
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_prompts
raisingzcx_ibmc_service_exception

List custom prompts

+ Lists information about all custom prompts that are defined for a custom model. + The information includes the prompt ID, prompt text, status, and optional + speaker ID for each prompt of the custom model. You must use credentials for + the instance of the service that owns the custom model. The same information + about all of the prompts for a custom model is also provided by the [Get a + custom model](#getcustommodel) method. That method provides complete details + about a specified custom model, including its language, owner, custom words, + and more. Custom prompts are supported only for use with US English custom + models and voices.
+
+ **See also:** [Listing custom + prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-cus + tom-prompts#tbe-custom-prompts-list). + +
Parameters
i_customization_id + The customization ID (GUID) of the custom model. You must make the request with + credentials for the instance of the service that owns the custom model. +
e_response + Service return value of type T_PROMPTS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_speaker_models
importingi_accepttype string default 'application/json'
exportinge_responsetype t_speakers
raisingzcx_ibmc_service_exception

List speaker models

+ Lists information about all speaker models that are defined for a service + instance. The information includes the speaker ID and speaker name of each + defined speaker. You must use credentials for the instance of a service to list + its speakers. Speaker models and the custom prompts with which they are used + are supported only for use with US English custom models and voices.
+
+ **See also:** [Listing speaker + models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-spea + ker-models#tbe-speaker-models-list). + +
Parameters
e_response + Service return value of type T_SPEAKERS +
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. +
public instance
list_voices
importingi_accepttype string default 'application/json'
exportinge_responsetype t_voices
raisingzcx_ibmc_service_exception

List voices

Lists all voices available for use with the service. The information includes the name, language, gender, and other details about the voice. The ordering of the list of voices can change from call to call; do not rely on an alphabetized or static list of voices. To see information about a specific voice, use the - **Get a voice** method.
+ [Get a voice](#getvoice).
+
+ **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + deprecated voices remain available to existing users until 31 March 2023, when + they will be removed from the service and the documentation. *No enhanced + neural voices or expressive neural voices are deprecated.* For more + information, see the [1 March 2023 service + update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + notes#text-to-speech-1march2023) in the release notes.

- **See also:** [Listing all available - voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#l - istVoices). + **See also:** [Listing all + voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-l + ist#list-all-voices)
Parameters
e_response Service return value of type T_VOICES
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_words
importingi_customization_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_WORDS
raisingzcx_ibmc_service_exception

List custom words

+
public instance
list_words
importingi_customization_idtype string
i_accepttype string default 'application/json'
exportinge_responsetype t_words
raisingzcx_ibmc_service_exception

List custom words

Lists all of the words and their translations for the specified custom model. The output shows the translations as they are defined in the model. You must use credentials for the instance of the service that owns a model to list its @@ -395,7 +705,7 @@
e_response Service return value of type T_WORDS
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
synthesize
importingi_texttype T_TEXT
i_accepttype STRING default 'audio/ogg;codecs=opus'
i_voicetype STRING default 'en-US_MichaelV3Voice'
i_customization_idtype STRING optional
i_contenttypetype STRING default 'application/json'
exportinge_responsetype FILE
raisingzcx_ibmc_service_exception

Synthesize audio

+
public instance
synthesize
importingi_texttype t_text
i_accepttype string default 'audio/ogg;codecs=opus'
i_voicetype string default 'en-US_MichaelV3Voice'
i_customization_idtype string optional
i_spell_out_modetype string default 'default'
i_rate_percentagetype integer default 0
i_pitch_percentagetype integer default 0
i_contenttypetype string default 'application/json'
exportinge_responsetype file
raisingzcx_ibmc_service_exception

Synthesize audio

Synthesizes text to audio that is spoken in the specified voice. The service bases its understanding of the language for the input text on the specified voice. Use a voice that matches the language of the input text.
@@ -409,13 +719,22 @@ interface](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-using HTTP#usingHTTP).

+ **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + deprecated voices remain available to existing users until 31 March 2023, when + they will be removed from the service and the documentation. *No enhanced + neural voices or expressive neural voices are deprecated.* For more + information, see the [1 March 2023 service + update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + notes#text-to-speech-1march2023) in the release notes.
+
### Audio formats (accept types)

The service can return audio in the following formats (MIME types).
* Where indicated, you can optionally specify the sampling rate (`rate`) of the - audio. You must specify a sampling rate for the `audio/l16` and `audio/mulaw` - formats. A specified sampling rate must lie in the range of 8 kHz to 192 kHz. - Some formats restrict the sampling rate to certain values, as noted.
+ audio. You must specify a sampling rate for the `audio/alaw`, `audio/l16`, and + `audio/mulaw` formats. A specified sampling rate must lie in the range of 8 kHz + to 192 kHz. Some formats restrict the sampling rate to certain values, as + noted.
* For the `audio/l16` format, you can optionally specify the endianness (`endianness`) of the audio: `endianness=big-endian` or `endianness=little-endian`.
@@ -425,6 +744,7 @@ service returns the audio in Ogg format with the Opus codec (`audio/ogg;codecs=opus`). The service always returns single-channel audio.
+ * `audio/alaw` - You must specify the `rate` of the audio.
* `audio/basic` - The service returns audio with a sampling rate of 8000 Hz.
* `audio/flac` - You can optionally specify the `rate` of the audio. The default @@ -456,34 +776,16 @@ audio. The default sampling rate is 22,050 Hz.

For more information about specifying an audio format, including additional - details about some of the formats, see [Audio - formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audioFo - rmats#audioFormats).
-
- ### Important voice updates
-
- The service's voices underwent significant change on 2 December 2020.
- * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - neural instead of concatenative.
- * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - instead.
- * The `ar-AR` language identifier cannot be used to create a custom model. Use - the `ar-MS` identifier instead.
- * The standard concatenative voices for the following languages are now - deprecated: Brazilian Portuguese, United Kingdom and United States English, - French, German, Italian, Japanese, and Spanish (all dialects).
- * The features expressive SSML, voice transformation SSML, and use of the - `volume` attribute of the `<prosody>` element are deprecated and are not - supported with any of the service's neural voices.
- * All of the service's voices are now customizable and generally available - (GA) for production use.
-
- The deprecated voices and features will continue to function for at least one - year but might be removed at a future date. You are encouraged to migrate to - the equivalent neural voices at your earliest convenience. For more information - about all voice updates, see the [2 December 2020 service - update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - notes#December2020) in the release notes.
+ details about some of the formats, see [Using audio + formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audio-f + ormats).
+
+ **Note:** By default, the service returns audio in the Ogg audio format with the + Opus codec (`audio/ogg;codecs=opus`). However, the Ogg audio format is not + supported with the Safari browser. If you are using the service with the Safari + browser, you must use the `Accept` request header or the `accept` query + parameter specify a different format in which you want the service to return + the audio.

### Warning messages

@@ -503,18 +805,83 @@ about specifying an audio format, see **Audio formats (accept types)** in the method description.
i_voice - The voice to use for synthesis. For more information about specifying a voice, - see **Important voice updates** in the method description. + The voice to use for speech synthesis. If you omit the `voice` parameter, the + service uses the US English `en-US_MichaelV3Voice` by default.
+
+ _For IBM Cloud Pak for Data,_ if you do not install the `en-US_MichaelV3Voice`, + you must either specify a voice with the request or specify a new default voice + for your installation of the service.
+
+ **See also:**
+ * [Languages and + voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices)< + br/> + * [Using the default + voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-us + e#specify-voice-default).
i_customization_id The customization ID (GUID) of a custom model to use for the synthesis. If a custom model is specified, it works only if it matches the language of the indicated voice. You must make the request with credentials for the instance of the service that owns the custom model. Omit the parameter to use the specified voice with no customization. + i_spell_out_mode + *For German voices,* indicates how the service is to spell out strings of + individual letters. To indicate the pace of the spelling, specify one of the + following values:
+ * `default` - The service reads the characters at the rate at which it + synthesizes speech for the request. You can also omit the parameter entirely to + achieve the default behavior.
+ * `singles` - The service reads the characters one at a time, with a brief pause + between each character.
+ * `pairs` - The service reads the characters two at a time, with a brief pause + between each pair.
+ * `triples` - The service reads the characters three at a time, with a brief + pause between each triplet.
+
+ For more information, see [Specifying how strings are spelled + out](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis-p + arams#params-spell-out-mode). +
i_rate_percentage + The percentage change from the default speaking rate of the voice that is used + for speech synthesis. Each voice has a default speaking rate that is optimized + to represent a normal rate of speech. The parameter accepts an integer that + represents the percentage change from the voice's default rate:
+ * Specify a signed negative integer to reduce the speaking rate by that + percentage. For example, -10 reduces the rate by ten percent.
+ * Specify an unsigned or signed positive integer to increase the speaking rate + by that percentage. For example, 10 and +10 increase the rate by ten + percent.
+ * Specify 0 or omit the parameter to get the default speaking rate for the + voice.
+
+ The parameter affects the rate for an entire request.
+
+ For more information, see [Modifying the speaking + rate](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis- + params#params-rate-percentage). +
i_pitch_percentage + The percentage change from the default speaking pitch of the voice that is used + for speech synthesis. Each voice has a default speaking pitch that is optimized + to represent a normal tone of voice. The parameter accepts an integer that + represents the percentage change from the voice's default tone:
+ * Specify a signed negative integer to lower the voice's pitch by that + percentage. For example, -5 reduces the tone by five percent.
+ * Specify an unsigned or signed positive integer to increase the voice's + pitch by that percentage. For example, 5 and +5 increase the tone by five + percent.
+ * Specify 0 or omit the parameter to get the default speaking pitch for the + voice.
+
+ The parameter affects the pitch for an entire request.
+
+ For more information, see [Modifying the speaking + pitch](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis + -params#params-pitch-percentage).
e_response Service return value of type FILE
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_custom_model
importingi_customization_idtype STRING
i_update_voice_modeltype T_UPDATE_CUSTOM_MODEL
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Update a custom model

+
public instance
update_custom_model
importingi_customization_idtype string
i_update_voice_modeltype t_update_custom_model
i_contenttypetype string default 'application/json'
i_accepttype string default 'application/json'
raisingzcx_ibmc_service_exception

Update a custom model

Updates information for the specified custom model. You can update metadata such as the name and description of the model. You can also update the words in the model and their translations. Adding a new translation for a word that already @@ -554,4 +921,4 @@ An `UpdateCustomModel` object that contains information that is to be updated for the custom model.
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_tone_analyzer_v3.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_tone_analyzer_v3.html deleted file mode 100644 index 475c2b7..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_tone_analyzer_v3.html +++ /dev/null @@ -1,122 +0,0 @@ -Class ZCL_IBMC_TONE_ANALYZER_V3

Class ZCL_IBMC_TONE_ANALYZER_V3

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Tone Analyzer

- The IBM Watson™ Tone Analyzer service uses linguistic analysis to detect - emotional and language tones in written text. The service can analyze tone at - both the document and sentence levels. You can use the service to understand - how your written communications are perceived and then to improve the tone of - your communications. Businesses can use the service to learn the tone of their - customers' communications and to respond to each customer appropriately, - or to understand and improve their customer conversations.
-
- **Note:** Request logging is disabled for the Tone Analyzer service. Regardless - of whether you set the `X-Watson-Learning-Opt-Out` request header, the service - does not log or retain data from requests and responses.

Types

Visibility and LevelNameDocumentation
publict_document_analysis (structured type)

- The results of the analysis for the full input content.

publict_error_model (structured type)

- The error response from a failed request.

publict_sentence_analysis (structured type)

- The results of the analysis for the individual sentences of

- the input content.
publict_tone_analysis (structured type)

- The tone analysis results for the input from the

- general-purpose endpoint.
publict_tone_category (structured type)

- The category for a tone from the input content.

publict_tone_chat_input (structured type)

- Input for the customer-engagement endpoint.

publict_tone_chat_score (structured type)

- The score for an utterance from the input content.

publict_tone_input (structured type)

- Input for the general-purpose endpoint.

publict_tone_score (structured type)

- The score for a tone from the input content.

publict_utterance (structured type)

- An utterance for the input of the general-purpose endpoint.

publict_utterance_analyses (structured type)

- The results of the analysis for the utterances of the input

- content.
publict_utterance_analysis (structured type)

- The results of the analysis for an utterance of the input

- content.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instanceget_appname redefinition 
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
tone
importingi_tone_inputtype T_TONE_INPUT
i_content_typetype STRING default 'application/json'
i_sentencestype BOOLEAN default C_BOOLEAN_TRUE
i_tonestype TT_STRING optional
i_content_languagetype STRING default 'en'
i_accept_languagetype STRING default 'en'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TONE_ANALYSIS
raisingzcx_ibmc_service_exception

Analyze general tone

- Use the general-purpose endpoint to analyze the tone of your input content. The - service analyzes the content for emotional and language tones. The method - always analyzes the tone of the full document; by default, it also analyzes the - tone of each individual sentence of the content.
-
- You can submit no more than 128 KB of total input content and no more than 1000 - individual sentences in JSON, plain text, or HTML format. The service analyzes - the first 1000 sentences for document-level analysis and only the first 100 - sentences for sentence-level analysis.
-
- Per the JSON specification, the default character encoding for JSON content is - effectively always UTF-8; per the HTTP specification, the default encoding for - plain text and HTML is ISO-8859-1 (effectively, the ASCII character set). When - specifying a content type of plain text or HTML, include the `charset` - parameter to indicate the character encoding of the input text; for example: - `Content-Type: text/plain;charset=utf-8`. For `text/html`, the service removes - HTML tags and analyzes only the textual content.
-
- **See also:** [Using the general-purpose - endpoint](https://cloud.ibm.com/docs/tone-analyzer?topic=tone-analyzer-utgpe#ut - gpe). - -
Parameters
i_tone_input - JSON, plain text, or HTML input that contains the content to be analyzed. For - JSON input, provide an object of type `ToneInput`. -
i_content_type - The type of the input. A character encoding can be specified by including a - `charset` parameter. For example, 'text/plain;charset=utf-8'. -
i_sentences - Indicates whether the service is to return an analysis of each individual - sentence in addition to its analysis of the full document. If `true` (the - default), the service returns results for each sentence. -
i_tones - **`2017-09-21`:** Deprecated. The service continues to accept the parameter for - backward-compatibility, but the parameter no longer affects the response.
-
- **`2016-05-19`:** A comma-separated list of tones for which the service is to - return its analysis of the input; the indicated tones apply both to the full - document and to individual sentences of the document. You can specify one or - more of the valid values. Omit the parameter to request results for all three - tones. -
i_content_language - The language of the input text for the request: English or French. Regional - variants are treated as their parent language; for example, `en-US` is - interpreted as `en`. The input content must match the specified language. Do - not submit content that contains both languages. You can use different - languages for **Content-Language** and **Accept-Language**.
- * **`2017-09-21`:** Accepts `en` or `fr`.
- * **`2016-05-19`:** Accepts only `en`. -
i_accept_language - The desired language of the response. For two-character arguments, regional - variants are treated as their parent language; for example, `en-US` is - interpreted as `en`. You can use different languages for **Content-Language** - and **Accept-Language**. -
e_response - Service return value of type T_TONE_ANALYSIS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
tone_chat
importingi_utterancestype T_TONE_CHAT_INPUT
i_content_languagetype STRING default 'en'
i_accept_languagetype STRING default 'en'
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_UTTERANCE_ANALYSES
raisingzcx_ibmc_service_exception

Analyze customer-engagement tone

- Use the customer-engagement endpoint to analyze the tone of customer service and - customer support conversations. For each utterance of a conversation, the - method reports the most prevalent subset of the following seven tones: sad, - frustrated, satisfied, excited, polite, impolite, and sympathetic.
-
- If you submit more than 50 utterances, the service returns a warning for the - overall content and analyzes only the first 50 utterances. If you submit a - single utterance that contains more than 500 characters, the service returns an - error for that utterance and does not analyze the utterance. The request fails - if all utterances have more than 500 characters. Per the JSON specification, - the default character encoding for JSON content is effectively always UTF-8. -
-
- **See also:** [Using the customer-engagement - endpoint](https://cloud.ibm.com/docs/tone-analyzer?topic=tone-analyzer-utco#utc - o). - -
Parameters
i_utterances - An object that contains the content to be analyzed. -
i_content_language - The language of the input text for the request: English or French. Regional - variants are treated as their parent language; for example, `en-US` is - interpreted as `en`. The input content must match the specified language. Do - not submit content that contains both languages. You can use different - languages for **Content-Language** and **Accept-Language**.
- * **`2017-09-21`:** Accepts `en` or `fr`.
- * **`2016-05-19`:** Accepts only `en`. -
i_accept_language - The desired language of the response. For two-character arguments, regional - variants are treated as their parent language; for example, `en-US` is - interpreted as `en`. You can use different languages for **Content-Language** - and **Accept-Language**. -
e_response - Service return value of type T_UTTERANCE_ANALYSES -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_util.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_util.html index 7724d27..c818358 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_util.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_util.html @@ -1,20 +1,20 @@ -Class ZCL_IBMC_UTIL

Class ZCL_IBMC_UTIL

public final create public

Documentation

Utilities to connect to IBM Watson

Methods

Visibility and LevelNameDocumentation
public static
convert_datetime_to_timestamp
importingi_datetimetype ZCL_IBMC_SERVICE=>DATETIME
returningvalue(e_timestamp)type TIMESTAMP
Converts datetime format to a timestamp, i.e. yyyy-mm-ddThh:mm:ssZ -> YYYYMMDDHHMMSS +Class ZCL_IBMC_UTIL

Class ZCL_IBMC_UTIL

public final create public

Documentation

Utilities to connect to IBM Watson

Methods

Visibility and LevelNameDocumentation
public static
convert_datetime_to_timestamp
importingi_datetimetype zcl_ibmc_service=>datetime
returningvalue(e_timestamp)type timestamp
Converts datetime format to a timestamp, i.e. yyyy-mm-ddThh:mm:ssZ -> YYYYMMDDHHMMSS
Parameters
i_datetime Input in datetime format.
e_timestamp Timestamp. -
public static
convert_timestamp_to_datetime
importingi_timestamptype TIMESTAMP
returningvalue(e_datetime)type ZCL_IBMC_SERVICE=>DATETIME
Converts a timestamp to datetime format, i.e. YYYYMMDDHHMMSS -> yyyy-mm-ddThh:mm:ssZ +
public static
convert_timestamp_to_datetime
importingi_timestamptype timestamp
returningvalue(e_datetime)type zcl_ibmc_service=>datetime
Converts a timestamp to datetime format, i.e. YYYYMMDDHHMMSS -> yyyy-mm-ddThh:mm:ssZ
Parameters
i_timestamp Timestamp.
e_datetime Datetime format. -
public static
convert_timestamp_to_local
importingiv_timestamptype TIMESTAMP
returningvalue(ev_local)type STRING
Converts a timestamp in UTC to a timestamp in local time. +
public static
convert_timestamp_to_local
importingiv_timestamptype timestamp
returningvalue(ev_local)type string
Converts a timestamp in UTC to a timestamp in local time.
Parameters
iv_timestamp Timestamp (UTC).
ev_local Timestamp (local time). -
public static
get_mimetype_from_extension
importingi_filenametype STRING
returningvalue(e_mimetype)type STRING
Determine MIME type from a file name, e.g. 'docu.txt' -> 'text_/plain'. +public static
get_mimetype_from_extension
importingi_filenametype string
returningvalue(e_mimetype)type string
Determine MIME type from a file name, e.g. 'docu.txt' -> 'text_/plain'.
Parameters
i_filename Filename with extension.
e_mimetype MIME type. -
public static
itab_to_tableschema
importingi_itabtype ANY TABLE
i_dictionarytype ANY optional
i_lower_casetype ZCL_IBMC_SERVICE=>BOOLEAN default ZCL_IBMC_SERVICE=>C_BOOLEAN_FALSE
it_excluded_fieldstype ZCL_IBMC_SERVICE=>TT_STRING optional
returningvalue(e_json)type STRING
Converts an internal table to JSON string in table schema format. +public static
itab_to_tableschema
importingi_itabtype any table
i_dictionarytype any optional
i_lower_casetype zcl_ibmc_service=>boolean default zcl_ibmc_service=>c_boolean_false
it_excluded_fieldstype zcl_ibmc_service=>tt_string optional
returningvalue(e_json)type string
Converts an internal table to JSON string in table schema format. E.g.: '{"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}'
Parameters
i_itab Internal table to be converted. @@ -22,15 +22,15 @@
i_lower_case If set to C_BOOLEAN_TRUE all keys in JSON string will be lower case.
it_excluded_fields Internal table of table fields in I_ITAB that should not occur in result.
e_json JSON string. -
public static
tableschema_to_itab
importingi_jsontype STRING
i_tableschema_keytype STRING optional
exportinge_itabtype ANY TABLE
Converts a JSON string in table schema format to an internal table. +public static
tableschema_to_itab
importingi_jsontype string
i_tableschema_keytype string optional
exportinge_itabtype any table
Converts a JSON string in table schema format to an internal table. E.g.: '{"tableschema_key": {"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}}'
Parameters
i_json JSON string.
i_tableschema_key Key in JSON string that holds the table schema.
e_itab Internal table containing converted data. -
public static
utc_to_timezone
importingi_timestamptype TIMESTAMP
i_timezonetype ZIF_IBMC_SERVICE_ARCH=>TY_TIMEZONE optional
returningvalue(e_timestamp)type TIMESTAMP
Converts a timestamp in UTC to a timestamp in another timezone. +public static
utc_to_timezone
importingi_timestamptype timestamp
i_timezonetype zif_ibmc_service_arch=>ty_timezone optional
returningvalue(e_timestamp)type timestamp
Converts a timestamp in UTC to a timestamp in another timezone.
Parameters
i_timestamp Timestamp (UTC).
i_timezone Time zone
e_timestamp Timestamp in give time zone. -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v3.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v3.html deleted file mode 100644 index a1754f8..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v3.html +++ /dev/null @@ -1,224 +0,0 @@ -Class ZCL_IBMC_VISUAL_RECOGNITION_V3

Class ZCL_IBMC_VISUAL_RECOGNITION_V3

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Visual Recognition

- IBM Watson™ Visual Recognition is discontinued. Existing instances are - supported until 1 December 2021, but as of 7 January 2021, you can't - create instances. Any instance that is provisioned on 1 December 2021 will be - deleted.
- {: deprecated}
-
- The IBM Watson Visual Recognition service uses deep learning algorithms to - identify scenes and objects in images that you upload to the service. You can - create and train a custom classifier to identify subjects that suit your needs. -

Types

Visibility and LevelNameDocumentation
publict_class (structured type)

- A category within a classifier.

publict_classified_image (structured type)

- Results for one image.

publict_classified_images (structured type)

- Results for all images.

publict_classifier (structured type)

- Information about a classifier.

publict_classifiers (structured type)

- A container for the list of classifiers.

publict_classifier_result (structured type)

- Classifier and score combination.

publict_class_result (structured type)

- Result of a class within a classifier.

publict_confidence_score type FLOAT

- Confidence score for the property in the range of 0 to 1. A

- higher score indicates greater likelihood that the class is depicted in the - image. The default threshold for returning scores from a classifier is 0.5.
publict_custom_classes_processed type INTEGER

- Number of custom classes identified in the images.

publict_empty type JSONOBJECT

- Empty object.

publict_error_html (structured type)

- Error information.

publict_error_info (structured type)

- Information about what might have caused a failure, such as

- an image that is too large. Not returned when there is no error.
publict_error_response (structured type)

- Error information.

publict_images_processed type INTEGER

- Number of images processed for the API call.

publict_image_file type STRING

- Relative path of the image file if uploaded directly. Not

- returned when the image is passed by URL.
publict_inline_object (structured type) No documentation available.
publict_inline_object1 (structured type) No documentation available.
publict_inline_object2 (structured type) No documentation available.
publict_resolved_url type STRING

- Fully resolved URL of the image after redirects are

- followed. Not returned when the image is uploaded.
publict_source_url type STRING

- Source of the image before any redirects. Not returned when

- the image is uploaded.
publict_type_hierarchy type STRING

- Knowledge graph of the property. For example,

- `/fruit/pome/apple/eating apple/Granny Smith`. Included only if identified.
publict_warning_info (structured type)

- Information about something that went wrong.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
classify
importingi_images_filetype FILE optional
i_images_filenametype STRING optional
i_images_file_content_typetype STRING optional
i_urltype STRING optional
i_thresholdtype FLOAT optional
i_ownerstype TT_STRING optional
i_classifier_idstype TT_STRING optional
i_accept_languagetype STRING default 'en'
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIED_IMAGES
raisingzcx_ibmc_service_exception

Classify images

- Classify images with built-in or custom classifiers. - -
Parameters
i_images_file - An image file (.gif, .jpg, .png, .tif) or .zip file with images. Maximum image - size is 10 MB. Include no more than 20 images and limit the .zip file to 100 - MB. Encode the image and .zip file names in UTF-8 if they contain non-ASCII - characters. The service assumes UTF-8 encoding if it encounters non-ASCII - characters.
-
- You can also include an image with the **url** parameter. -
i_images_filename - The filename for imagesFile. -
i_images_file_content_type - The content type of imagesFile. -
i_url - The URL of an image (.gif, .jpg, .png, .tif) to analyze. The minimum recommended - pixel density is 32X32 pixels, but the service tends to perform better with - images that are at least 224 x 224 pixels. The maximum image size is 10 - MB.
-
- You can also include images with the **images_file** parameter. -
i_threshold - The minimum score a class must have to be displayed in the response. Set the - threshold to `0.0` to return all identified classes. -
i_owners - The categories of classifiers to apply. The **classifier_ids** parameter - overrides **owners**, so make sure that **classifier_ids** is empty.
- - Use `IBM` to classify against the `default` general classifier. You get the - same result if both **classifier_ids** and **owners** parameters are - empty.
- - Use `me` to classify against all your custom classifiers. However, for better - performance use **classifier_ids** to specify the specific custom classifiers - to apply.
- - Use both `IBM` and `me` to analyze the image against both classifier - categories. -
i_classifier_ids - Which classifiers to apply. Overrides the **owners** parameter. You can specify - both custom and built-in classifier IDs. The built-in `default` classifier is - used if both **classifier_ids** and **owners** parameters are empty.
-
- The following built-in classifier IDs require no training:
- - `default`: Returns classes from thousands of general tags.
- - `food`: Enhances specificity and accuracy for images of food items.
- - `explicit`: Evaluates whether the image might be pornographic. -
i_accept_language - The desired language of parts of the response. See the response for details. -
e_response - Service return value of type T_CLASSIFIED_IMAGES -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_classifier
importingi_nametype STRING
i_positive_examplestype TT_MAP_FILE
i_negative_examplestype FILE optional
i_negative_examples_filenametype STRING optional
i_positive_examples_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_negative_examples_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIER
raisingzcx_ibmc_service_exception

Create a classifier

- Train a new multi-faceted classifier on the uploaded image data. Create your - custom classifier with positive or negative example training images. Include at - least two sets of examples, either two positive example files or one positive - and one negative file. You can upload a maximum of 256 MB per call.
-
- **Tips when creating:**
-
- - If you set the **X-Watson-Learning-Opt-Out** header parameter to `true` when - you create a classifier, the example training images are not stored. Save your - training images locally. For more information, see [Data - collection](#data-collection).
-
- - Encode all names in UTF-8 if they contain non-ASCII characters (.zip and image - file names, and classifier and class names). The service assumes UTF-8 encoding - if it encounters non-ASCII characters. - -
Parameters
i_name - The name of the new classifier. Encode special characters in UTF-8. -
i_positive_examples - A .zip file of images that depict the visual subject of a class in the new - classifier. You can include more than one positive example file in a call.
-
- Specify the parameter name by appending `_positive_examples` to the class name. - For example, `goldenretriever_positive_examples` creates the class - **goldenretriever**. The string cannot contain the following characters: ``$ * - - { } \ | / ' " ` [ ]``.
-
- Include at least 10 images in .jpg or .png format. The minimum recommended image - resolution is 32X32 pixels. The maximum number of images is 10,000 images or - 100 MB per .zip file.
-
- Encode special characters in the file name in UTF-8. -
i_negative_examples - A .zip file of images that do not depict the visual subject of any of the - classes of the new classifier. Must contain a minimum of 10 images.
-
- Encode special characters in the file name in UTF-8. -
i_negative_examples_filename - The filename for negativeExamples. -
e_response - Service return value of type T_CLASSIFIER -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_classifier
importingi_classifier_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a classifier

- -
Parameters
i_classifier_id - The ID of the classifier. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete labeled data

- Deletes all data associated with a specified customer ID. The method has no - effect if no data is associated with the customer ID.
-
- You associate a customer ID with data by passing the `X-Watson-Metadata` header - with a request that passes data. For more information about personal data and - customer IDs, see [Information - security](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recognitio - n-information-security). - -
Parameters
i_customer_id - The customer ID for which all data is to be deleted. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition 
public instance
get_classifier
importingi_classifier_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIER
raisingzcx_ibmc_service_exception

Retrieve classifier details

- Retrieve information about a custom classifier. - -
Parameters
i_classifier_id - The ID of the classifier. -
e_response - Service return value of type T_CLASSIFIER -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_core_ml_model
importingi_classifier_idtype STRING
i_accepttype STRING default 'application/octet-stream'
exportinge_responsetype FILE
raisingzcx_ibmc_service_exception

Retrieve a Core ML model of a classifier

- Download a Core ML model file (.mlmodel) of a custom classifier that returns - <tt>"core_ml_enabled": true</tt> in the classifier - details. - -
Parameters
i_classifier_id - The ID of the classifier. -
e_response - Service return value of type FILE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
list_classifiers
importingi_verbosetype BOOLEAN optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIERS
raisingzcx_ibmc_service_exception

Retrieve a list of classifiers

- -
Parameters
i_verbose - Specify `true` to return details about the classifiers. Omit this parameter to - return a brief list of classifiers. -
e_response - Service return value of type T_CLASSIFIERS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_classifier
importingi_classifier_idtype STRING
i_positive_examplestype TT_MAP_FILE optional
i_negative_examplestype FILE optional
i_negative_examples_filenametype STRING optional
i_positive_examples_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_negative_examples_cttype STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_CLASSIFIER
raisingzcx_ibmc_service_exception

Update a classifier

- Update a custom classifier by adding new positive or negative classes or by - adding new images to existing classes. You must supply at least one set of - positive or negative examples. For details, see [Updating custom - classifiers](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recogni - tion-customizing#updating-custom-classifiers).
-
- Encode all names in UTF-8 if they contain non-ASCII characters (.zip and image - file names, and classifier and class names). The service assumes UTF-8 encoding - if it encounters non-ASCII characters.
-
- **Tips about retraining:**
-
- - You can't update the classifier if the **X-Watson-Learning-Opt-Out** - header parameter was set to `true` when the classifier was created. Training - images are not stored in that case. Instead, create another classifier. For - more information, see [Data collection](#data-collection).
-
- - Don't make retraining calls on a classifier until the status is ready. - When you submit retraining requests in parallel, the last request overwrites - the previous requests. The `retrained` property shows the last time the - classifier retraining finished. - -
Parameters
i_classifier_id - The ID of the classifier. -
i_positive_examples - A .zip file of images that depict the visual subject of a class in the - classifier. The positive examples create or update classes in the classifier. - You can include more than one positive example file in a call.
-
- Specify the parameter name by appending `_positive_examples` to the class name. - For example, `goldenretriever_positive_examples` creates the class - `goldenretriever`. The string cannot contain the following characters: ``$ * - - { } \ | / ' " ` [ ]``.
-
- Include at least 10 images in .jpg or .png format. The minimum recommended image - resolution is 32X32 pixels. The maximum number of images is 10,000 images or - 100 MB per .zip file.
-
- Encode special characters in the file name in UTF-8. -
i_negative_examples - A .zip file of images that do not depict the visual subject of any of the - classes of the new classifier. Must contain a minimum of 10 images.
-
- Encode special characters in the file name in UTF-8. -
i_negative_examples_filename - The filename for negativeExamples. -
e_response - Service return value of type T_CLASSIFIER -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v4.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v4.html deleted file mode 100644 index d3c7a9f..0000000 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_visual_recognition_v4.html +++ /dev/null @@ -1,319 +0,0 @@ -Class ZCL_IBMC_VISUAL_RECOGNITION_V4

Class ZCL_IBMC_VISUAL_RECOGNITION_V4

public inheriting from ZCL_IBMC_SERVICE_EXT create public

Documentation

Visual Recognition v4

- IBM Watson™ Visual Recognition is discontinued. Existing instances are - supported until 1 December 2021, but as of 7 January 2021, you can't - create instances. Any instance that is provisioned on 1 December 2021 will be - deleted.
- {: deprecated}
-
- Provide images to the IBM Watson Visual Recognition service for analysis. The - service detects objects based on a set of images with training data.

Types

Visibility and LevelNameDocumentation
publict_analyze_response (structured type)

- Results for all images.

publict_base_collection (structured type)

- Base details about a collection.

publict_base_object (structured type)

- Details about an object and its location.

publict_base_training_data_objects (structured type)

- Container for the training data.

publict_collection (structured type)

- Details about a collection.

publict_collections_list (structured type)

- A container for the list of collections.

publict_collection_objects (structured type)

- The objects in a collection that are detected in an image.

publict_collection_training_status (structured type)

- Training status information for the collection.

publict_detected_objects (structured type)

- Container for the list of collections that have objects

- detected in an image.
publict_empty type JSONOBJECT

- Empty response.

publict_error (structured type)

- Details about an error.

publict_error_response (structured type)

- A container for the list of request-level problems.

publict_error_target (structured type)

- Details about the specific area of the problem.

publict_image (structured type)

- Details about an image.

publict_image_details (structured type)

- Details about an image.

publict_image_details_list (structured type)

- List of information about the images.

publict_image_dimensions (structured type)

- Height and width of an image.

publict_image_source (structured type)

- The source type of the image.

publict_image_summary (structured type)

- Basic information about an image.

publict_image_summary_list (structured type)

- List of images.

publict_inline_object (structured type) No documentation available.
publict_inline_object1 (structured type) No documentation available.
publict_jpeg_image type FILE

- A file returned in the response.

publict_location (structured type)

- Defines the location of the bounding box around the object.

publict_object_detail (structured type)

- Details about an object in the collection.

publict_object_detail_location (structured type)

- Defines the location of the bounding box around the object.

publict_object_metadata (structured type)

- Basic information about an object.

publict_object_metadata_list (structured type)

- List of objects.

publict_object_training_status (structured type)

- Training status for the objects in the collection.

publict_training_data_object (structured type)

- Details about the training data.

publict_training_data_objects (structured type)

- Training data for all objects.

publict_training_event (structured type)

- Details about the training event.

publict_training_events (structured type)

- Details about the training events.

publict_training_status (structured type)

- Training status information for the collection.

publict_update_object_metadata (structured type)

- Basic information about an updated object.

publict_warning (structured type)

- Details about a problem.

Constants

Visibility and LevelNameDocumentation
public staticc_abapname_dictionary (structured type)

Map ABAP identifiers to service identifiers.

public staticc_required_fields (structured type)

List of required fields per type.

Methods

Visibility and LevelNameDocumentation
public instance
add_images
importingi_collection_idtype STRING
i_images_filetype TT_FILE_WITH_METADATA optional
i_image_urltype TT_STRING optional
i_training_datatype STRING optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_IMAGE_DETAILS_LIST
raisingzcx_ibmc_service_exception

Add images

- Add images to a collection by URL, by file, or both.
-
- Encode the image and .zip file names in UTF-8 if they contain non-ASCII - characters. The service assumes UTF-8 encoding if it encounters non-ASCII - characters. - -
Parameters
i_collection_id - The identifier of the collection. -
i_images_file - An array of image files (.jpg or .png) or .zip files with images.
- - Include a maximum of 20 images in a request.
- - Limit the .zip file to 100 MB.
- - Limit each image file to 10 MB.
-
- You can also include an image with the **image_url** parameter. -
i_image_url - The array of URLs of image files (.jpg or .png).
- - Include a maximum of 20 images in a request.
- - Limit each image file to 10 MB.
- - Minimum width and height is 30 pixels, but the service tends to perform better - with images that are at least 300 x 300 pixels. Maximum is 5400 pixels for - either height or width.
-
- You can also include images with the **images_file** parameter. -
i_training_data - Training data for a single image. Include training data only if you add one - image with the request.
-
- The `object` property can contain alphanumeric, underscore, hyphen, space, and - dot characters. It cannot begin with the reserved prefix `sys-` and must be no - longer than 32 characters. -
e_response - Service return value of type T_IMAGE_DETAILS_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
add_image_training_data
importingi_collection_idtype STRING
i_image_idtype STRING
i_training_datatype T_BASE_TRAINING_DATA_OBJECTS
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_DATA_OBJECTS
raisingzcx_ibmc_service_exception

Add training data to an image

- Add, update, or delete training data for an image. Encode the object name in - UTF-8 if it contains non-ASCII characters. The service assumes UTF-8 encoding - if it encounters non-ASCII characters.
-
- Elements in the request replace the existing elements.
-
- - To update the training data, provide both the unchanged and the new or changed - values.
-
- - To delete the training data, provide an empty value for the training data. - -
Parameters
i_collection_id - The identifier of the collection. -
i_image_id - The identifier of the image. -
i_training_data - Training data. Elements in the request replace the existing elements. -
e_response - Service return value of type T_TRAINING_DATA_OBJECTS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
analyze
importingi_collection_idstype TT_STRING
i_featurestype TT_STRING
i_images_filetype TT_FILE_WITH_METADATA optional
i_image_urltype TT_STRING optional
i_thresholdtype FLOAT optional
i_contenttypetype STRING default 'multipart/form-data'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_ANALYZE_RESPONSE
raisingzcx_ibmc_service_exception

Analyze images

- Analyze images by URL, by file, or both against your own collection. Make sure - that **training_status.objects.ready** is `true` for the feature before you use - a collection to analyze images.
-
- Encode the image and .zip file names in UTF-8 if they contain non-ASCII - characters. The service assumes UTF-8 encoding if it encounters non-ASCII - characters. - -
Parameters
i_collection_ids - The IDs of the collections to analyze. -
i_features - The features to analyze. -
i_images_file - An array of image files (.jpg or .png) or .zip files with images.
- - Include a maximum of 20 images in a request.
- - Limit the .zip file to 100 MB.
- - Limit each image file to 10 MB.
-
- You can also include an image with the **image_url** parameter. -
i_image_url - An array of URLs of image files (.jpg or .png).
- - Include a maximum of 20 images in a request.
- - Limit each image file to 10 MB.
- - Minimum width and height is 30 pixels, but the service tends to perform better - with images that are at least 300 x 300 pixels. Maximum is 5400 pixels for - either height or width.
-
- You can also include images with the **images_file** parameter. -
i_threshold - The minimum score a feature must have to be returned. -
e_response - Service return value of type T_ANALYZE_RESPONSE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
create_collection
importingi_collection_infotype T_BASE_COLLECTION
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Create a collection

- Create a collection that can be used to store images.
-
- To create a collection without specifying a name and description, include an - empty JSON object in the request body.
-
- Encode the name and description in UTF-8 if they contain non-ASCII characters. - The service assumes UTF-8 encoding if it encounters non-ASCII characters. - -
Parameters
i_collection_info - The new collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_collection
importingi_collection_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete a collection

- Delete a collection from the service instance. - -
Parameters
i_collection_id - The identifier of the collection. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_image
importingi_collection_idtype STRING
i_image_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete an image

- Delete one image from a collection. - -
Parameters
i_collection_id - The identifier of the collection. -
i_image_id - The identifier of the image. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_object
importingi_collection_idtype STRING
i_objecttype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete an object

- Delete one object from a collection. A successful request deletes the training - data from all images that use the object. - -
Parameters
i_collection_id - The identifier of the collection. -
i_object - The name of the object. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
delete_user_data
importingi_customer_idtype STRING
i_accepttype STRING default 'application/json'
raisingzcx_ibmc_service_exception

Delete labeled data

- Deletes all data associated with a specified customer ID. The method has no - effect if no data is associated with the customer ID.
-
- You associate a customer ID with data by passing the `X-Watson-Metadata` header - with a request that passes data. For more information about personal data and - customer IDs, see [Information - security](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recognitio - n-information-security). - -
Parameters
i_customer_id - The customer ID for which all data is to be deleted. -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_appname redefinition 
public instance
get_collection
importingi_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Get collection details

- Get details of one collection. - -
Parameters
i_collection_id - The identifier of the collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_image_details
importingi_collection_idtype STRING
i_image_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_IMAGE_DETAILS
raisingzcx_ibmc_service_exception

Get image details

- Get the details of an image in a collection. - -
Parameters
i_collection_id - The identifier of the collection. -
i_image_id - The identifier of the image. -
e_response - Service return value of type T_IMAGE_DETAILS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_jpeg_image
importingi_collection_idtype STRING
i_image_idtype STRING
i_sizetype STRING default 'full'
i_accepttype STRING default 'image/jpeg'
exportinge_responsetype FILE
raisingzcx_ibmc_service_exception

Get a JPEG file of an image

- Download a JPEG representation of an image. - -
Parameters
i_collection_id - The identifier of the collection. -
i_image_id - The identifier of the image. -
i_size - The image size. Specify `thumbnail` to return a version that maintains the - original aspect ratio but is no larger than 200 pixels in the larger dimension. - For example, an original 800 x 1000 image is resized to 160 x 200 pixels. -
e_response - Service return value of type FILE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_model_file
importingi_collection_idtype STRING
i_featuretype STRING
i_model_formattype STRING
i_accepttype STRING default 'application/octet-stream'
exportinge_responsetype FILE
raisingzcx_ibmc_service_exception

Get a model

- Download a model that you can deploy to detect objects in images. The collection - must include a generated model, which is indicated in the response for the - collection details as `"rscnn_ready": true`. If the value is `false`, - train or retrain the collection to generate the model.
-
- Currently, the model format is specific to Android apps. For more information - about how to deploy the model to your app, see the [Watson Visual Recognition - on Android](https://github.com/matt-ny/rscnn) project in GitHub. - -
Parameters
i_collection_id - The identifier of the collection. -
i_feature - The feature for the model. -
i_model_format - The format of the returned model. -
e_response - Service return value of type FILE -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
get_object_metadata
importingi_collection_idtype STRING
i_objecttype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_OBJECT_METADATA
raisingzcx_ibmc_service_exception

Get object metadata

- Get the number of bounding boxes for a single object in a collection. - -
Parameters
i_collection_id - The identifier of the collection. -
i_object - The name of the object. -
e_response - Service return value of type T_OBJECT_METADATA -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instanceget_request_prop redefinition 
public instanceget_sdk_version_date redefinition 
public instance
get_training_usage
importingi_start_timetype DATE optional
i_end_timetype DATE optional
i_accepttype STRING default 'application/json'
exportinge_responsetype T_TRAINING_EVENTS
raisingzcx_ibmc_service_exception

Get training usage

- Information about the completed training events. You can use this information to - determine how close you are to the training limits for the month. - -
Parameters
i_start_time - The earliest day to include training events. Specify dates in YYYY-MM-DD format. - If empty or not specified, the earliest training event is included. -
i_end_time - The most recent day to include training events. Specify dates in YYYY-MM-DD - format. All events for the day are included. If empty or not specified, the - current day is used. Specify the same value as `start_time` to request events - for a single day. -
e_response - Service return value of type T_TRAINING_EVENTS -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_collections
importingi_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTIONS_LIST
raisingzcx_ibmc_service_exception

List collections

- Retrieves a list of collections for the service instance. - -
Parameters
e_response - Service return value of type T_COLLECTIONS_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_images
importingi_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_IMAGE_SUMMARY_LIST
raisingzcx_ibmc_service_exception

List images

- Retrieves a list of images in a collection. - -
Parameters
i_collection_id - The identifier of the collection. -
e_response - Service return value of type T_IMAGE_SUMMARY_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
list_object_metadata
importingi_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_OBJECT_METADATA_LIST
raisingzcx_ibmc_service_exception

List object metadata

- Retrieves a list of object names in a collection. - -
Parameters
i_collection_id - The identifier of the collection. -
e_response - Service return value of type T_OBJECT_METADATA_LIST -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
train
importingi_collection_idtype STRING
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Train a collection

- Start training on images in a collection. The collection must have enough - training data and untrained data (the **training_status.objects.data_changed** - is `true`). If training is in progress, the request queues the next training - job. - -
Parameters
i_collection_id - The identifier of the collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_collection
importingi_collection_idtype STRING
i_collection_infotype T_BASE_COLLECTION optional
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_COLLECTION
raisingzcx_ibmc_service_exception

Update a collection

- Update the name or description of a collection.
-
- Encode the name and description in UTF-8 if they contain non-ASCII characters. - The service assumes UTF-8 encoding if it encounters non-ASCII characters. - -
Parameters
i_collection_id - The identifier of the collection. -
i_collection_info - The updated collection. -
e_response - Service return value of type T_COLLECTION -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
public instance
update_object_metadata
importingi_collection_idtype STRING
i_objecttype STRING
i_updateobjectmetadatatype T_UPDATE_OBJECT_METADATA
i_contenttypetype STRING default 'application/json'
i_accepttype STRING default 'application/json'
exportinge_responsetype T_UPDATE_OBJECT_METADATA
raisingzcx_ibmc_service_exception

Update an object name

- Update the name of an object. A successful request updates the training data for - all images that use the object. - -
Parameters
i_collection_id - The identifier of the collection. -
i_object - The name of the object. -
i_updateobjectmetadata - No documentation available. -
e_response - Service return value of type T_UPDATE_OBJECT_METADATA -
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. -
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/classes/zcx_ibmc_service_exception.html b/docs/ABAPDoc/abapdoc/zibmc/classes/zcx_ibmc_service_exception.html index 14e8b20..562c4ed 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/classes/zcx_ibmc_service_exception.html +++ b/docs/ABAPDoc/abapdoc/zibmc/classes/zcx_ibmc_service_exception.html @@ -1 +1 @@ -Class ZCX_IBMC_SERVICE_EXCEPTION

Class ZCX_IBMC_SERVICE_EXCEPTION

public inheriting from CX_STATIC_CHECK final create public

Documentation

IBM Cloud Service Exception

Interfaces

if_t100_dyn_msg
if_t100_message

Attributes

Visibility and LevelNameDocumentation
public instancep_http_reason type STRING  
public instancep_http_status type STRING  
public instancep_msg_json type STRING  

Methods

Visibility and LevelNameDocumentation
public instance
constructor
importingtextidlike IF_T100_MESSAGE=>T100KEY optional
previouslike PREVIOUS optional
p_msg_jsontype STRING optional
p_http_statustype STRING optional
p_http_reasontype STRING optional
CONSTRUCTOR
public instanceif_message~get_longtext redefinition 
public instanceif_message~get_text redefinition 
\ No newline at end of file +Class ZCX_IBMC_SERVICE_EXCEPTION

Class ZCX_IBMC_SERVICE_EXCEPTION

public inheriting from cx_static_check final create public

Documentation

IBM Cloud Service Exception

Interfaces

if_t100_dyn_msg
if_t100_message

Attributes

Visibility and LevelNameDocumentation
public instancep_http_reason type string  
public instancep_http_status type string  
public instancep_msg_json type string  

Methods

Visibility and LevelNameDocumentation
public instance
constructor
importingtextidlike if_t100_message=>t100key optional
previouslike previous optional
p_msg_jsontype string optional
p_http_statustype string optional
p_http_reasontype string optional
CONSTRUCTOR
public instanceif_message~get_longtext redefinition 
public instanceif_message~get_text redefinition 
\ No newline at end of file diff --git a/docs/ABAPDoc/abapdoc/zibmc/interfaces/zif_ibmc_service_arch.html b/docs/ABAPDoc/abapdoc/zibmc/interfaces/zif_ibmc_service_arch.html index 83e31af..a0a1d82 100644 --- a/docs/ABAPDoc/abapdoc/zibmc/interfaces/zif_ibmc_service_arch.html +++ b/docs/ABAPDoc/abapdoc/zibmc/interfaces/zif_ibmc_service_arch.html @@ -1 +1 @@ -Interface ZIF_IBMC_SERVICE_ARCH

Interface ZIF_IBMC_SERVICE_ARCH

public

Documentation

IBM Watson SDK Platform-specifics

Types

Visibility and LevelNameDocumentation
publicboolean (typing) 
publicchar (typing) 
publicts_access_token (structured type) 
publicts_form_part (structured type) 
publicts_header (structured type) 
publicts_http_status (structured type) 
publicts_request_prop (structured type) 
publicts_url (structured type) 
publictt_form_part TYPE standard table of TS_FORM_PART with non-unique default key 
publictt_header TYPE standard table of ts_header with non-unique default key 
publictt_string TYPE standard table of string with non-unique default key 
publicty_ssl_id (typing) 
publicty_timezone (typing) 

Constants

Visibility and LevelNameDocumentation
public staticc_datatype (structured type)  
public staticc_header_accept type STRING value 'Accept' 
public staticc_header_content_disposition type STRING value 'Content-Disposition' 
public staticc_header_content_type type STRING value 'Content-Type' 
public staticc_mediatype (structured type)  
public staticc_method_create type CHAR value 'c' 
public staticc_method_delete type CHAR value 'd' 
public staticc_method_get type CHAR value 'g' 
public staticc_method_post type CHAR value 'p' 
public staticc_method_put type CHAR value 'u' 
\ No newline at end of file +Interface ZIF_IBMC_SERVICE_ARCH

Interface ZIF_IBMC_SERVICE_ARCH

public

Documentation

IBM Watson SDK Platform-specifics

Types

Visibility and LevelNameDocumentation
publicboolean (typing) 
publicchar (typing) 
publicts_access_token (structured type) 
publicts_form_part (structured type) 
publicts_header (structured type) 
publicts_http_status (structured type) 
publicts_request_prop (structured type) 
publicts_url (structured type) 
publictt_form_part type standard table of ts_form_part with non-unique default key 
publictt_header type standard table of ts_header with non-unique default key 
publictt_string type standard table of string with non-unique default key 
publicty_ssl_id (typing) 
publicty_timezone (typing) 

Constants

Visibility and LevelNameDocumentation
public staticc_datatype (structured type)  
public staticc_header_accept type string value 'Accept' 
public staticc_header_content_disposition type string value 'Content-Disposition' 
public staticc_header_content_type type string value 'Content-Type' 
public staticc_mediatype (structured type)  
public staticc_method_create type char value 'c' 
public staticc_method_delete type char value 'd' 
public staticc_method_get type char value 'g' 
public staticc_method_patch type char value 'm' 
public staticc_method_post type char value 'p' 
public staticc_method_put type char value 'u' 
\ No newline at end of file diff --git a/docs/ABAPDoc/htmldesign/stylesheet.css b/docs/ABAPDoc/htmldesign/stylesheet.css index 30680b5..d16c62c 100644 --- a/docs/ABAPDoc/htmldesign/stylesheet.css +++ b/docs/ABAPDoc/htmldesign/stylesheet.css @@ -6,7 +6,8 @@ td { border: 1px solid black; padding: 3px; } h2 { font-size: 22px; } h4 { font-size: 18px; } h5 { font-size: 13px; font-weight: bold; margin-bottom: 5px; } -a { color: black; } +a { color: darkblue; text-decoration: none} +a:hover { color: blue; text-decoration: underline} #header { border-bottom: 3px solid grey; background-color: ghostwhite; width: 100%; padding: 4px; padding-left: 8px; } #headerTitle { padding: 5px; font-size: 22px } #content { margin: 8px; } @@ -20,11 +21,15 @@ a { color: black; } .parametersTable { border: 0px; } .fieldName {} .methodName {} +.typeName {} +.eventName {} .parameterName {} .exceptionName {} .objectName { text-transform: uppercase; } +.className { font-weight: normal; } .interfaceName { font-weight: normal; } .exceptions { border: 0px; width: auto; } .exceptions td { border: 0px; padding: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 5px; } .abapDocComment p { margin-top: 0px; } +.abapDocLink { font-style: italic } .shorttext { margin-top: 0px; } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 023ae78..b37f9f7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,17 +15,11 @@

ABAP SDK for IBM Watson: API Reference

Watson serviceVersionABAP Class Name Watson AssistantV1ZCL_IBMC_ASSISTANT_V1 Watson AssistantV2ZCL_IBMC_ASSISTANT_V2 - Compare and ComplyV1ZCL_IBMC_COMPARE_COMPLY_V1 - DiscoveryV1ZCL_IBMC_DISCOVERY_V1 + DiscoveryV2ZCL_IBMC_DISCOVERY_V2 Language TranslatorV3ZCL_IBMC_LANG_TRANSLATOR_V3 - Natural Language ClassifierV1ZCL_IBMC_NAT_LANG_CLASS_V1 Natural Language UnderstandingV1ZCL_IBMC_NAT_LANG_UNDRSTND_V1 - Personality InsightsV3ZCL_IBMC_PERSONAL_INSIGHTS_V3 Speech to TextV1ZCL_IBMC_SPEECH_TO_TEXT_V1 Text to SpeechV1ZCL_IBMC_TEXT_TO_SPEECH_V1 - Tone AnalyzerV3ZCL_IBMC_TONE_ANALYZER_V3 - Visual RecognitionV3ZCL_IBMC_VISUAL_RECOGNITION_V3 - Visual RecognitionV4ZCL_IBMC_VISUAL_RECOGNITION_V4 diff --git a/src/zcl_ibmc_assistant_v1.clas.abap b/src/zcl_ibmc_assistant_v1.clas.abap index 2c97de7..306dcf5 100644 --- a/src/zcl_ibmc_assistant_v1.clas.abap +++ b/src/zcl_ibmc_assistant_v1.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ public section. "! The type of action to invoke. TYPE type STRING, "! A map of key/value pairs to be provided to the action. - PARAMETERS type MAP, + PARAMETERS type JSONOBJECT, "! The location in the dialog context where the result of the action is stored. RESULT_VARIABLE type STRING, "! The name of the context variable that the client application will use to pass in @@ -68,9 +68,9 @@ public section. NONE_OF_THE_ABOVE_PROMPT type STRING, "! Whether the disambiguation feature is enabled for the workspace. ENABLED type BOOLEAN, - "! The sensitivity of the disambiguation feature to intent detection conflicts. Set - "! to **high** if you want the disambiguation feature to be triggered more often. - "! This can be useful for testing or demonstration purposes. + "! 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 type STRING, "! Whether the order in which disambiguation suggestions are presented should be "! randomized (but still influenced by relative confidence). @@ -116,12 +116,20 @@ public section. "! If you specify `jump_to`, then you must also specify a value for the "! `dialog_node` property. BEHAVIOR type STRING, - "! The ID of the dialog node to process next. This parameter is required if + "! The unique ID of the dialog node to process next. This parameter is required if "! **behavior**=`jump_to`. DIALOG_NODE type STRING, "! Which part of the dialog node to process next. SELECTOR type STRING, end of T_DIALOG_NODE_NEXT_STEP. + types: + "!

+ "! An object describing an error that occurred during

+ "! processing of an asynchronous operation. + begin of T_STATUS_ERROR, + "! The text of the error message. + MESSAGE type STRING, + end of T_STATUS_ERROR. types: "! No documentation available. T_DIALOG_NODE_OUTPUT_GENERIC type JSONOBJECT. @@ -151,9 +159,12 @@ public section. types: "! No documentation available. begin of T_DIALOG_NODE, - "! The dialog node ID. This string must conform to the following restrictions:
- "! - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot - "! characters. + "! The unique ID of the dialog node. This is an internal identifier used to refer + "! to the dialog node from other dialog nodes and in the diagnostic information + "! included with message responses.
+ "!
+ "! This string can contain only Unicode alphanumeric, space, underscore, hyphen, + "! and dot characters. DIALOG_NODE type STRING, "! The description of the dialog node. This string cannot contain carriage return, "! newline, or tab characters. @@ -161,11 +172,11 @@ public section. "! The condition that will trigger the dialog node. This string cannot contain "! carriage return, newline, or tab characters. CONDITIONS type STRING, - "! The ID of the parent dialog node. This property is omitted if the dialog node - "! has no parent. + "! The unique ID of the parent dialog node. This property is omitted if the dialog + "! node has no parent. PARENT type STRING, - "! The ID of the previous sibling dialog node. This property is omitted if the - "! dialog node has no previous sibling. + "! The unique ID of the previous sibling dialog node. This property is omitted if + "! the dialog node has no previous sibling. PREVIOUS_SIBLING type STRING, "! The output of the dialog node. For more information about how to specify dialog "! node output, see the @@ -175,13 +186,17 @@ public section. "! The context for the dialog node. CONTEXT type T_DIALOG_NODE_CONTEXT, "! The metadata for the dialog node. - METADATA type MAP, + METADATA type JSONOBJECT, "! The next step to execute following this dialog node. NEXT_STEP type T_DIALOG_NODE_NEXT_STEP, - "! The alias used to identify the dialog node. This string must conform to the - "! following restrictions:
- "! - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot - "! characters. + "! A human-readable name for the dialog node. If the node is included in + "! disambiguation, this title is used to populate the **label** property of the + "! corresponding suggestion in the `suggestion` response type (unless it is + "! overridden by the **user_label** property). The title is also used to populate + "! the **topic** property in the `connect_to_agent` response type.
+ "!
+ "! This string can contain only Unicode alphanumeric, space, underscore, hyphen, + "! and dot characters. TITLE type STRING, "! How the dialog node is processed. TYPE type STRING, @@ -198,7 +213,8 @@ public section. "! Whether the user can digress to top-level nodes while filling out slots. DIGRESS_OUT_SLOTS type STRING, "! A label that can be displayed externally to describe the purpose of the node to - "! users. + "! users. If set, this label is used to identify the node in disambiguation + "! responses (overriding the value of the **title** property). USER_LABEL type STRING, "! Whether the dialog node should be excluded from disambiguation suggestions. "! Valid only when **type**=`standard` or `frame`. @@ -219,7 +235,7 @@ public section. "! - It cannot consist of only whitespace characters. VALUE type STRING, "! Any metadata related to the entity value. - METADATA type MAP, + METADATA type JSONOBJECT, "! Specifies the type of entity value. TYPE type STRING, "! An array of synonyms for the entity value. A value can specify either synonyms @@ -239,6 +255,20 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, end of T_VALUE. + types: + "!

+ "! An object containing properties that indicate how many

+ "! intents, entities, and dialog nodes are defined in the workspace. This property + "! is included only in responses from the **Export workspace asynchronously** + "! method, and only when the **verbose** query parameter is set to `true`. + begin of T_WORKSPACE_COUNTS, + "! The number of intents defined in the workspace. + INTENT type INTEGER, + "! The number of entities defined in the workspace. + ENTITY type INTEGER, + "! The number of nodes defined in the workspace. + NODE type INTEGER, + end of T_WORKSPACE_COUNTS. types: "!

"! A webhook that can be used by dialog nodes to make

@@ -306,6 +336,22 @@ public section. "! An array of user input examples for the intent. EXAMPLES type STANDARD TABLE OF T_EXAMPLE WITH NON-UNIQUE DEFAULT KEY, end of T_INTENT. + types: + "!

+ "! Workspace settings related to the version of the training

+ "! algorithms currently used by the skill. + begin of T_WS_SYSTEM_SETTINGS_NLP, + "! The policy the skill follows for selecting the algorithm version to use. For + "! more information, see the + "! [documentation](/docs/watson-assistant?topic=watson-assistant-algorithm-version + "! ).
+ "!
+ "! On IBM Cloud, you can specify `latest`, `previous`, or `beta`.
+ "!
+ "! On IBM Cloud Pak for Data, you can specify either `beta` or the date of the + "! version you want to use, in `YYYY-MM-DD` format. + MODEL type STRING, + end of T_WS_SYSTEM_SETTINGS_NLP. types: "!

"! Workspace settings related to the Watson Assistant user

@@ -324,7 +370,7 @@ public section. "! Workspace settings related to the disambiguation feature. DISAMBIGUATION type T_WS_SYSTM_STTNGS_DSMBGTN, "! For internal use only. - HUMAN_AGENT_ASSIST type MAP, + HUMAN_AGENT_ASSIST type JSONOBJECT, "! Whether spelling correction is enabled for the workspace. SPELLING_SUGGESTIONS type BOOLEAN, "! Whether autocorrection is enabled for the workspace. If spelling correction is @@ -338,6 +384,9 @@ public section. SYSTEM_ENTITIES type T_WS_SYSTM_STTNGS_SYSTM_ENTTS, "! Workspace settings related to detection of irrelevant input. OFF_TOPIC type T_WS_SYSTEM_SETTINGS_OFF_TOPIC, + "! Workspace settings related to the version of the training algorithms currently + "! used by the skill. + NLP type T_WS_SYSTEM_SETTINGS_NLP, end of T_WORKSPACE_SYSTEM_SETTINGS. types: "! No documentation available. @@ -367,7 +416,7 @@ public section. "! newline, or tab characters. DESCRIPTION type STRING, "! Any metadata related to the entity. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether to use fuzzy matching for the entity. FUZZY_MATCH type BOOLEAN, "! The timestamp for creation of the object. @@ -400,22 +449,68 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, "! Any metadata related to the workspace. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether training data from the workspace (including artifacts such as intents "! and entities) can be used by IBM for general service improvements. `true` "! indicates that workspace training data is not to be used. LEARNING_OPT_OUT type BOOLEAN, "! Global settings for the workspace. SYSTEM_SETTINGS type T_WORKSPACE_SYSTEM_SETTINGS, - "! The current status of the workspace. + "! 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. STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, "! No documentation available. WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY, "! An array of intents. INTENTS type STANDARD TABLE OF T_INTENT WITH NON-UNIQUE DEFAULT KEY, "! An array of objects describing the entities for the workspace. ENTITIES type STANDARD TABLE OF T_ENTITY WITH NON-UNIQUE DEFAULT KEY, + "! An object containing properties that indicate how many intents, entities, and + "! dialog nodes are defined in the workspace. This property is included only in + "! responses from the **Export workspace asynchronously** method, and only when + "! the **verbose** query parameter is set to `true`. + COUNTS type T_WORKSPACE_COUNTS, end of T_WORKSPACE. + types: + "! No documentation available. + begin of T_RESPONSE_GENERIC_CHANNEL, + "! A channel for which the response is intended.
+ "!
+ "! **Note:** On IBM Cloud Pak for Data, only `chat` is supported. + CHANNEL type STRING, + end of T_RESPONSE_GENERIC_CHANNEL. + types: + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_VIDEO, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the video. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the video cannot be seen. + ALT_TEXT type STRING, + end of T_RUNTIME_RESPONSE_TYPE_VIDEO. types: "! No documentation available. begin of T_SYNONYM, @@ -431,7 +526,8 @@ public section. end of T_SYNONYM. types: "!

- "! The pagination data for the returned objects.

+ "! The pagination data for the returned objects. For more

+ "! information about using pagination, see [Pagination](#pagination). begin of T_PAGINATION, "! The URL that will return the same page of results. REFRESH_URL type STRING, @@ -452,7 +548,8 @@ public section. begin of T_SYNONYM_COLLECTION, "! An array of synonyms. SYNONYMS type STANDARD TABLE OF T_SYNONYM WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_SYNONYM_COLLECTION. types: @@ -617,8 +714,6 @@ public section. "! A decimal percentage that represents Watson's confidence in the recognized "! entity. CONFIDENCE type NUMBER, - "! Any metadata for the entity. - METADATA type MAP, "! The recognized capture groups for the entity, as defined by the entity pattern. GROUPS type STANDARD TABLE OF T_CAPTURE_GROUP WITH NON-UNIQUE DEFAULT KEY, "! An object containing detailed information about the entity recognized in the @@ -647,7 +742,9 @@ public section. begin of T_RUNTIME_INTENT, "! The name of the recognized intent. INTENT type STRING, - "! A decimal percentage that represents Watson's confidence in the intent. + "! A decimal percentage that represents Watson's confidence in the intent. If + "! you are specifying an intent as part of a request, but you do not have a + "! calculated confidence value, specify `1`. CONFIDENCE type DOUBLE, end of T_RUNTIME_INTENT. types: @@ -678,21 +775,23 @@ public section. VALUE type T_DIA_ND_OUTPUT_OPT_ELEM_VALUE, end of T_DIA_NODE_OUTPUT_OPT_ELEMENT. types: - "!

- "! An object that describes a response with response type

- "! `option`. + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_OPTION, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, "! The title or introductory text to show before the response. TITLE type STRING, - "! The description to show with the the response. + "! The description to show with the response. DESCRIPTION type STRING, "! The preferred type of control to display. PREFERENCE type STRING, "! An array of objects describing the options from which the user can choose. OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_OPTION. types: "! No documentation available. @@ -702,9 +801,7 @@ public section. TEXT type STRING, end of T_DIA_ND_OTPT_TEXT_VALUES_ELEM. types: - "!

- "! An object that describes a response with response type

- "! `text`. + "! No documentation available. begin of T_DIA_ND_OUTPUT_RESP_TYPE_TEXT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -717,6 +814,8 @@ public section. "! The delimiter to use as a separator between responses when "! `selection_policy`=`multiline`. DELIMITER type STRING, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OUTPUT_RESP_TYPE_TEXT. types: "! No documentation available. @@ -741,6 +840,91 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, end of T_BASE_WORKSPACE. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_VD, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the video. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the video cannot be seen. + ALT_TEXT type STRING, + end of T_RT_RESP_GNRC_RT_RESP_TYP_VD. + types: + "!

+ "! Information for transferring to the web chat integration.

+ begin of T_CHANNEL_TRANSFER_TARGET_CHAT, + "! The URL of the target web chat. + URL type STRING, + end of T_CHANNEL_TRANSFER_TARGET_CHAT. + types: + "!

+ "! An object specifying target channels available for the

+ "! transfer. Each property of this object represents an available transfer target. + "! Currently, the only supported property is **chat**, representing the web chat + "! integration. + begin of T_CHANNEL_TRANSFER_TARGET, + "! Information for transferring to the web chat integration. + CHAT type T_CHANNEL_TRANSFER_TARGET_CHAT, + end of T_CHANNEL_TRANSFER_TARGET. + types: + "!

+ "! Information used by an integration to transfer the

+ "! conversation to a different channel. + begin of T_CHANNEL_TRANSFER_INFO, + "! An object specifying target channels available for the transfer. Each property + "! of this object represents an available transfer target. Currently, the only + "! supported property is **chat**, representing the web chat integration. + TARGET type T_CHANNEL_TRANSFER_TARGET, + end of T_CHANNEL_TRANSFER_INFO. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_RESP_TYP_CHNNL_1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The `channel_transfer` response type is not supported on IBM Cloud + "! Pak for Data. + RESPONSE_TYPE type STRING, + "! The message to display to the user when initiating a channel transfer. + MESSAGE_TO_USER type STRING, + "! Information used by an integration to transfer the conversation to a different + "! channel. + TRANSFER_INFO type T_CHANNEL_TRANSFER_INFO, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DIA_ND_OTPT_RESP_TYP_CHNNL_1. + types: + "! No documentation available. + begin of T_RT_RESP_TYPE_CHANNEL_TRANS, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The `channel_transfer` response type is not supported on IBM Cloud + "! Pak for Data. + RESPONSE_TYPE type STRING, + "! The message to display to the user when initiating a channel transfer. + MESSAGE_TO_USER type STRING, + "! Information used by an integration to transfer the conversation to a different + "! channel. + TRANSFER_INFO type T_CHANNEL_TRANSFER_INFO, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended only for a built-in + "! integration and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_TYPE_CHANNEL_TRANS. types: "! No documentation available. begin of T_BASE_ENTITY, @@ -754,7 +938,7 @@ public section. "! newline, or tab characters. DESCRIPTION type STRING, "! Any metadata related to the entity. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether to use fuzzy matching for the entity. FUZZY_MATCH type BOOLEAN, "! The timestamp for creation of the object. @@ -763,15 +947,17 @@ public section. UPDATED type DATETIME, end of T_BASE_ENTITY. types: - "!

- "! An object that describes a response with response type

- "! `text`. + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_TEXT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, "! The text of the response. TEXT type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_TEXT. types: "! No documentation available. @@ -831,6 +1017,25 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, end of T_UPDATE_EXAMPLE. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_RESP_TYPE_IFRAME, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the embeddable content. + SOURCE type STRING, + "! An optional title to show before the response. + TITLE type STRING, + "! An optional description to show with the response. + DESCRIPTION type STRING, + "! The URL of an image that shows a preview of the embedded content. + IMAGE_URL type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DIA_ND_OTPT_RESP_TYPE_IFRAME. types: "!

"! An object describing a contextual entity mention.

@@ -844,24 +1049,40 @@ public section. LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, end of T_ENTITY_MENTION. types: - "!

- "! An object that describes a response with response type

- "! `image`. + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_IMG, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The URL of the image. + "! The `https:` URL of the image. SOURCE type STRING, "! The title or introductory text to show before the response. TITLE type STRING, - "! The description to show with the the response. + "! The description to show with the response. DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! Descriptive text that can be used for screen readers or other situations where + "! the image cannot be seen. + ALT_TEXT type STRING, end of T_RT_RESP_GNRC_RT_RESP_TYP_IMG. types: - "!

- "! An object that describes a response with response type

- "! `text`. + "! No documentation available. + begin of T_RT_RESP_TYPE_USER_DEFINED, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! An object containing any properties for the user-defined response type. + USER_DEFINED type JSONOBJECT, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_TYPE_USER_DEFINED. + types: + "! No documentation available. begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -874,11 +1095,11 @@ public section. "! The delimiter to use as a separator between responses when "! `selection_policy`=`multiline`. DELIMITER type STRING, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP1. types: - "!

- "! An object that describes a response with response type

- "! `search_skill`. + "! No documentation available. begin of T_DIA_ND_OTPT_RESP_TYP_SRCH_S1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel.
@@ -901,18 +1122,22 @@ public section. FILTER type STRING, "! The version of the Discovery service API to use for the query. DISCOVERY_VERSION type STRING, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_RESP_TYP_SRCH_S1. types: "! No documentation available. begin of T_EXAMPLE_COLLECTION, "! An array of objects describing the examples defined for the intent. EXAMPLES type STANDARD TABLE OF T_EXAMPLE WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_EXAMPLE_COLLECTION. types: "!

- "! The pagination data for the returned objects.

+ "! The pagination data for the returned objects. For more

+ "! information about using pagination, see [Pagination](#pagination). begin of T_LOG_PAGINATION, "! The URL that will return the next page of results, if any. NEXT_URL type STRING, @@ -936,9 +1161,7 @@ public section. TARGET type MAP, end of T_DIA_ND_OTPT_CNNCT_T_AGNT_TR1. types: - "!

- "! An object that describes a response with response type

- "! `connect_to_agent`. + "! No documentation available. begin of T_RT_RESP_TYP_CONNECT_TO_AGENT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -959,15 +1182,17 @@ public section. "! property of the relevant node or the **topic** property of the dialog node "! response. TOPIC type STRING, - "! The ID of the dialog node that the **topic** property is taken from. The + "! The unique ID of the dialog node that the **topic** property is taken from. The "! **topic** property is populated using the value of the dialog node's "! **title** property. DIALOG_NODE type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_TYP_CONNECT_TO_AGENT. types: - "!

- "! An object that describes a response with response type

- "! `connect_to_agent`. + "! No documentation available. begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP5, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -984,6 +1209,8 @@ public section. "! Routing or other contextual information to be used by target service desk "! systems. TRANSFER_INFO type T_DIA_ND_OTPT_CNNCT_T_AGNT_TR1, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP5. types: "! No documentation available. @@ -994,7 +1221,7 @@ public section. "! - It cannot consist of only whitespace characters. VALUE type STRING, "! Any metadata related to the entity value. - METADATA type MAP, + METADATA type JSONOBJECT, "! Specifies the type of entity value. TYPE type STRING, "! An array of synonyms for the entity value. A value can specify either synonyms @@ -1014,11 +1241,34 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, end of T_CREATE_VALUE. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_CH1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The `channel_transfer` response type is not supported on IBM Cloud + "! Pak for Data. + RESPONSE_TYPE type STRING, + "! The message to display to the user when initiating a channel transfer. + MESSAGE_TO_USER type STRING, + "! Information used by an integration to transfer the conversation to a different + "! channel. + TRANSFER_INFO type T_CHANNEL_TRANSFER_INFO, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended only for a built-in + "! integration and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_CH1. types: "!

"! An object defining the message input, intents, and entities

"! to be sent to the Watson Assistant service if the user selects the - "! corresponding disambiguation option. + "! corresponding disambiguation option.
+ "!
+ "! **Note:** These properties must be included in the request body of the next + "! message sent to the assistant. Do not modify or remove any of the included + "! properties. begin of T_DIALOG_SUGGESTION_VALUE, "! An input object that includes the input text. INPUT type T_MESSAGE_INPUT, @@ -1031,19 +1281,22 @@ public section. "! No documentation available. begin of T_DIALOG_SUGGESTION, "! The user-facing label for the disambiguation option. This label is taken from - "! the **title** or **user_label** property of the corresponding dialog node, - "! depending on the disambiguation options. + "! the **title** or **user_label** property of the corresponding dialog node. LABEL type STRING, "! An object defining the message input, intents, and entities to be sent to the "! Watson Assistant service if the user selects the corresponding disambiguation - "! option. + "! option.
+ "!
+ "! **Note:** These properties must be included in the request body of the next + "! message sent to the assistant. Do not modify or remove any of the included + "! properties. VALUE type T_DIALOG_SUGGESTION_VALUE, "! The dialog output that will be returned from the Watson Assistant service if the "! user selects the corresponding option. - OUTPUT type MAP, - "! The ID of the dialog node that the **label** property is taken from. The + OUTPUT type JSONOBJECT, + "! The unique ID of the dialog node that the **label** property is taken from. The "! **label** property is populated using the value of the dialog node's - "! **user_label** property. + "! **title** or **user_label** property. DIALOG_NODE type STRING, end of T_DIALOG_SUGGESTION. types: @@ -1058,7 +1311,7 @@ public section. "! - It cannot consist of only whitespace characters. VALUE type STRING, "! Any metadata related to the entity value. - METADATA type MAP, + METADATA type JSONOBJECT, "! Specifies the type of entity value. TYPE type STRING, "! An array of synonyms for the entity value. A value can specify either synonyms @@ -1125,15 +1378,26 @@ public section. "! No documentation available. begin of T_WORKSPACE_REFERENCE, "! Any metadata related to the workspace. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether training data from the workspace (including artifacts such as intents "! and entities) can be used by IBM for general service improvements. `true` "! indicates that workspace training data is not to be used. LEARNING_OPT_OUT type BOOLEAN, "! Global settings for the workspace. SYSTEM_SETTINGS type T_WORKSPACE_SYSTEM_SETTINGS, - "! The current status of the workspace. + "! 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. STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, "! No documentation available. WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY, end of T_WORKSPACE_REFERENCE. @@ -1142,19 +1406,32 @@ public section. begin of T_VALUE_COLLECTION, "! An array of entity values. VALUES type STANDARD TABLE OF T_VALUE WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_VALUE_COLLECTION. types: "! No documentation available. begin of T_DIALOG_NODE_VISITED_DETAILS, - "! A dialog node that was triggered during processing of the input message. + "! The unique ID of a dialog node that was triggered during processing of the input + "! message. DIALOG_NODE type STRING, "! The title of the dialog node. TITLE type STRING, "! The conditions that trigger the dialog node. CONDITIONS type STRING, end of T_DIALOG_NODE_VISITED_DETAILS. + types: + "!

+ "! An object that identifies the dialog element that generated

+ "! the error message. + begin of T_LOG_MESSAGE_SOURCE, + "! A string that indicates the type of dialog element that generated the error + "! message. + TYPE type STRING, + "! The unique identifier of the dialog node that generated the error message. + DIALOG_NODE type STRING, + end of T_LOG_MESSAGE_SOURCE. types: "!

"! Log message details.

@@ -1163,6 +1440,10 @@ public section. LEVEL type STRING, "! The text of the log message. MSG type STRING, + "! A code that indicates the category to which the error message belongs. + CODE type STRING, + "! An object that identifies the dialog element that generated the error message. + SOURCE type T_LOG_MESSAGE_SOURCE, end of T_LOG_MESSAGE. types: "! No documentation available. @@ -1182,8 +1463,6 @@ public section. NODES_VISITED_DETAILS type STANDARD TABLE OF T_DIALOG_NODE_VISITED_DETAILS WITH NON-UNIQUE DEFAULT KEY, "! An array of up to 50 messages logged with the request. LOG_MESSAGES type STANDARD TABLE OF T_LOG_MESSAGE WITH NON-UNIQUE DEFAULT KEY, - "! An array of responses to the user. - TEXT type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! Output intended for any channel. It is the responsibility of the client "! application to implement the supported response types. GENERIC type STANDARD TABLE OF T_RUNTIME_RESPONSE_GENERIC WITH NON-UNIQUE DEFAULT KEY, @@ -1195,24 +1474,42 @@ public section. INPUT type STANDARD TABLE OF T_BULK_CLASSIFY_UTTERANCE WITH NON-UNIQUE DEFAULT KEY, end of T_BULK_CLASSIFY_INPUT. types: - "!

- "! An object that describes a response with response type

- "! `image`. + "! No documentation available. begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP3, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The URL of the image. + "! The `https:` URL of the image. SOURCE type STRING, "! An optional title to show before the response. TITLE type STRING, "! An optional description to show with the response. DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! Descriptive text that can be used for screen readers or other situations where + "! the image cannot be seen. + ALT_TEXT type STRING, end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP3. types: - "!

- "! An object that describes a response with response type

- "! `connect_to_agent`. + "! No documentation available. + begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP7, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The `channel_transfer` response type is not supported on IBM Cloud + "! Pak for Data. + RESPONSE_TYPE type STRING, + "! The message to display to the user when initiating a channel transfer. + MESSAGE_TO_USER type STRING, + "! Information used by an integration to transfer the conversation to a different + "! channel. + TRANSFER_INFO type T_CHANNEL_TRANSFER_INFO, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP7. + types: + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_CN1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1233,10 +1530,14 @@ public section. "! property of the relevant node or the **topic** property of the dialog node "! response. TOPIC type STRING, - "! The ID of the dialog node that the **topic** property is taken from. The + "! The unique ID of the dialog node that the **topic** property is taken from. The "! **topic** property is populated using the value of the dialog node's "! **title** property. DIALOG_NODE type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_CN1. types: "!

@@ -1244,7 +1545,8 @@ public section. begin of T_DIALOG_NODE_COLLECTION, "! An array of objects describing the dialog nodes defined for the workspace. DIALOG_NODES type STANDARD TABLE OF T_DIALOG_NODE WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_DIALOG_NODE_COLLECTION. types: @@ -1256,9 +1558,15 @@ public section. DEPLOYMENT type STRING, "! A string value that identifies the user who is interacting with the workspace. "! The client must provide a unique identifier for each individual end user who - "! accesses the application. For Plus and Premium plans, this user ID is used to + "! accesses the application. For user-based plans, this user ID is used to "! identify unique users for billing purposes. This string cannot contain carriage - "! return, newline, or tab characters. + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.conversation_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property at the root of + "! the message body. If **user_id** is specified in both locations in a message + "! request, the value specified at the root is used. USER_ID type STRING, end of T_MESSAGE_CONTEXT_METADATA. types: @@ -1266,10 +1574,12 @@ public section. "! State information for the conversation. To maintain state,

"! include the context from the previous response. begin of T_CONTEXT, - "! The unique identifier of the conversation. + "! The unique identifier of the conversation. The conversation ID cannot contain + "! any of the following characters: `+` `=` `&&` `||` `>` `<` `!` `(` `)` + "! `{` `}` `[` `]` `^` `"` `~` `*` `?` `:` `\` `/`. CONVERSATION_ID type STRING, "! For internal use only. - SYSTEM type MAP, + SYSTEM type JSONOBJECT, "! Metadata related to the message. METADATA type T_MESSAGE_CONTEXT_METADATA, end of T_CONTEXT. @@ -1296,6 +1606,18 @@ public section. OUTPUT type T_OUTPUT_DATA, "! An array of objects describing any actions requested by the dialog node. ACTIONS type STANDARD TABLE OF T_DIALOG_NODE_ACTION WITH NON-UNIQUE DEFAULT KEY, + "! A string value that identifies the user who is interacting with the workspace. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.conversation_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the context + "! metadata. If **user_id** is specified in both locations in a message request, + "! the value specified at the root is used. + USER_ID type STRING, end of T_MESSAGE_RESPONSE. types: "! No documentation available. @@ -1306,7 +1628,7 @@ public section. "! - It cannot consist of only whitespace characters. VALUE type STRING, "! Any metadata related to the entity value. - METADATA type MAP, + METADATA type JSONOBJECT, "! Specifies the type of entity value. TYPE type STRING, "! An array of synonyms for the entity value. A value can specify either synonyms @@ -1339,7 +1661,7 @@ public section. "! newline, or tab characters. DESCRIPTION type STRING, "! Any metadata related to the entity. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether to use fuzzy matching for the entity. FUZZY_MATCH type BOOLEAN, "! The timestamp for creation of the object. @@ -1352,9 +1674,12 @@ public section. types: "! No documentation available. begin of T_UPDATE_DIALOG_NODE, - "! The dialog node ID. This string must conform to the following restrictions:
- "! - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot - "! characters. + "! The unique ID of the dialog node. This is an internal identifier used to refer + "! to the dialog node from other dialog nodes and in the diagnostic information + "! included with message responses.
+ "!
+ "! This string can contain only Unicode alphanumeric, space, underscore, hyphen, + "! and dot characters. DIALOG_NODE type STRING, "! The description of the dialog node. This string cannot contain carriage return, "! newline, or tab characters. @@ -1362,11 +1687,11 @@ public section. "! The condition that will trigger the dialog node. This string cannot contain "! carriage return, newline, or tab characters. CONDITIONS type STRING, - "! The ID of the parent dialog node. This property is omitted if the dialog node - "! has no parent. + "! The unique ID of the parent dialog node. This property is omitted if the dialog + "! node has no parent. PARENT type STRING, - "! The ID of the previous sibling dialog node. This property is omitted if the - "! dialog node has no previous sibling. + "! The unique ID of the previous sibling dialog node. This property is omitted if + "! the dialog node has no previous sibling. PREVIOUS_SIBLING type STRING, "! The output of the dialog node. For more information about how to specify dialog "! node output, see the @@ -1376,13 +1701,17 @@ public section. "! The context for the dialog node. CONTEXT type T_DIALOG_NODE_CONTEXT, "! The metadata for the dialog node. - METADATA type MAP, + METADATA type JSONOBJECT, "! The next step to execute following this dialog node. NEXT_STEP type T_DIALOG_NODE_NEXT_STEP, - "! The alias used to identify the dialog node. This string must conform to the - "! following restrictions:
- "! - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot - "! characters. + "! A human-readable name for the dialog node. If the node is included in + "! disambiguation, this title is used to populate the **label** property of the + "! corresponding suggestion in the `suggestion` response type (unless it is + "! overridden by the **user_label** property). The title is also used to populate + "! the **topic** property in the `connect_to_agent` response type.
+ "!
+ "! This string can contain only Unicode alphanumeric, space, underscore, hyphen, + "! and dot characters. TITLE type STRING, "! How the dialog node is processed. TYPE type STRING, @@ -1399,7 +1728,8 @@ public section. "! Whether the user can digress to top-level nodes while filling out slots. DIGRESS_OUT_SLOTS type STRING, "! A label that can be displayed externally to describe the purpose of the node to - "! users. + "! users. If set, this label is used to identify the node in disambiguation + "! responses (overriding the value of the **title** property). USER_LABEL type STRING, "! Whether the dialog node should be excluded from disambiguation suggestions. "! Valid only when **type**=`standard` or `frame`. @@ -1412,9 +1742,7 @@ public section. UPDATED type DATETIME, end of T_UPDATE_DIALOG_NODE. types: - "!

- "! An object that describes a response with response type

- "! `pause`. + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_PAUSE, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1423,11 +1751,26 @@ public section. TIME type INTEGER, "! Whether to send a "user is typing" event during the pause. TYPING type BOOLEAN, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_PAUSE. types: - "!

- "! An object that describes a response with response type

- "! `connect_to_agent`. + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_US1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! An object containing any properties for the user-defined response type. + USER_DEFINED type JSONOBJECT, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_US1. + types: + "! No documentation available. begin of T_DIA_ND_OTPT_RESP_TYP_CNNCT_1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1444,11 +1787,52 @@ public section. "! Routing or other contextual information to be used by target service desk "! systems. TRANSFER_INFO type T_DIA_ND_OTPT_CNNCT_T_AGNT_TR1, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_RESP_TYP_CNNCT_1. types: - "!

- "! An object that describes a response with response type

- "! `pause`. + "! No documentation available. + begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OT10, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the audio clip. + SOURCE type STRING, + "! An optional title to show before the response. + TITLE type STRING, + "! An optional description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the audio player cannot be seen. + ALT_TEXT type STRING, + end of T_DIA_ND_OTPT_GNRC_DIA_ND_OT10. + types: + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_IFRAME, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the embeddable content. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the response. + DESCRIPTION type STRING, + "! The URL of an image that shows a preview of the embedded content. + IMAGE_URL type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RUNTIME_RESPONSE_TYPE_IFRAME. + types: + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_PS, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1457,6 +1841,10 @@ public section. TIME type INTEGER, "! Whether to send a "user is typing" event during the pause. TYPING type BOOLEAN, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_PS. types: "! No documentation available. @@ -1500,7 +1888,7 @@ public section. "! newline, or tab characters. DESCRIPTION type STRING, "! Any metadata related to the entity. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether to use fuzzy matching for the entity. FUZZY_MATCH type BOOLEAN, "! The timestamp for creation of the object. @@ -1533,15 +1921,26 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, "! Any metadata related to the workspace. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether training data from the workspace (including artifacts such as intents "! and entities) can be used by IBM for general service improvements. `true` "! indicates that workspace training data is not to be used. LEARNING_OPT_OUT type BOOLEAN, "! Global settings for the workspace. SYSTEM_SETTINGS type T_WORKSPACE_SYSTEM_SETTINGS, - "! The current status of the workspace. + "! 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. STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, "! No documentation available. WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY, "! An array of objects defining the intents for the workspace. @@ -1554,7 +1953,8 @@ public section. begin of T_COUNTEREXAMPLE_COLLECTION, "! An array of objects describing the examples marked as irrelevant input. COUNTEREXAMPLES type STANDARD TABLE OF T_COUNTEREXAMPLE WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_COUNTEREXAMPLE_COLLECTION. types: @@ -1606,7 +2006,8 @@ public section. begin of T_ENTITY_COLLECTION, "! An array of objects describing the entities defined for the workspace. ENTITIES type STANDARD TABLE OF T_ENTITY WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_ENTITY_COLLECTION. types: @@ -1614,13 +2015,12 @@ public section. begin of T_INTENT_COLLECTION, "! An array of objects describing the intents defined for the workspace. INTENTS type STANDARD TABLE OF T_INTENT WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_INTENT_COLLECTION. types: - "!

- "! An object that describes a response with response type

- "! `pause`. + "! No documentation available. begin of T_DIA_ND_OTPT_RESP_TYPE_PAUSE, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1630,11 +2030,11 @@ public section. "! Whether to send a "user is typing" event during the pause. Ignored if "! the channel does not support this event. TYPING type BOOLEAN, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_RESP_TYPE_PAUSE. types: - "!

- "! An object that describes a response with response type

- "! `suggestion`. + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_SG1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1644,21 +2044,28 @@ public section. "! An array of objects describing the possible matching dialog nodes from which the "! user can choose. SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_SG1. types: - "!

- "! An object that describes a response with response type

- "! `image`. + "! No documentation available. begin of T_DIA_ND_OUTPUT_RESP_TYPE_IMG, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The URL of the image. + "! The `https:` URL of the image. SOURCE type STRING, "! An optional title to show before the response. TITLE type STRING, "! An optional description to show with the response. DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! Descriptive text that can be used for screen readers or other situations where + "! the image cannot be seen. + ALT_TEXT type STRING, end of T_DIA_ND_OUTPUT_RESP_TYPE_IMG. types: "! No documentation available. @@ -1671,9 +2078,29 @@ public section. CODE type INTEGER, end of T_ERROR_RESPONSE. types: - "!

- "! An object that describes a response with response type

- "! `option`. + "! No documentation available. + begin of T_DIA_ND_OTPT_RESP_TYPE_AUDIO, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the audio clip. + SOURCE type STRING, + "! An optional title to show before the response. + TITLE type STRING, + "! An optional description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the audio player cannot be seen. + ALT_TEXT type STRING, + end of T_DIA_ND_OTPT_RESP_TYPE_AUDIO. + types: + "! No documentation available. begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP4, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1687,7 +2114,21 @@ public section. "! An array of objects describing the options from which the user can choose. You "! can include up to 20 options. OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP4. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP8, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! An object containing any properties for the user-defined response type. The + "! total size of this object cannot exceed 5000 bytes. + USER_DEFINED type JSONOBJECT, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP8. types: "! No documentation available. begin of T_BASE_MESSAGE, @@ -1709,11 +2150,21 @@ public section. OUTPUT type T_OUTPUT_DATA, "! An array of objects describing any actions requested by the dialog node. ACTIONS type STANDARD TABLE OF T_DIALOG_NODE_ACTION WITH NON-UNIQUE DEFAULT KEY, + "! A string value that identifies the user who is interacting with the workspace. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.conversation_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the context + "! metadata. If **user_id** is specified in both locations in a message request, + "! the value specified at the root is used. + USER_ID type STRING, end of T_BASE_MESSAGE. types: - "!

- "! An object that describes a response with response type

- "! `suggestion`. + "! No documentation available. begin of T_RT_RESPONSE_TYPE_SUGGESTION, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1723,13 +2174,18 @@ public section. "! An array of objects describing the possible matching dialog nodes from which the "! user can choose. SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESPONSE_TYPE_SUGGESTION. types: "! No documentation available. begin of T_ENTITY_MENTION_COLLECTION, "! An array of objects describing the entity mentions defined for an entity. EXAMPLES type STANDARD TABLE OF T_ENTITY_MENTION WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_ENTITY_MENTION_COLLECTION. types: @@ -1746,20 +2202,22 @@ public section. UPDATED type DATETIME, end of T_UPDATE_SYNONYM. types: - "!

- "! An object that describes a response with response type

- "! `text`. + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_TXT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, "! The text of the response. TEXT type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_TXT. types: "!

"! For internal use only.

- T_SYSTEM_RESPONSE type MAP. + T_SYSTEM_RESPONSE type JSONOBJECT. types: "! No documentation available. begin of T_BASE_INTENT, @@ -1778,9 +2236,7 @@ public section. UPDATED type DATETIME, end of T_BASE_INTENT. types: - "!

- "! An object that describes a response with response type

- "! `pause`. + "! No documentation available. begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP2, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1790,6 +2246,8 @@ public section. "! Whether to send a "user is typing" event during the pause. Ignored if "! the channel does not support this event. TYPING type BOOLEAN, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP2. types: "! No documentation available. @@ -1853,9 +2311,7 @@ public section. SPECIFIC_YEAR type NUMBER, end of T_RT_ENTTY_INTRPRTTN_SYS_DATE. types: - "!

- "! An object that describes a response with response type

- "! `search_skill`. + "! No documentation available. begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP6, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel.
@@ -1878,11 +2334,33 @@ public section. FILTER type STRING, "! The version of the Discovery service API to use for the query. DISCOVERY_VERSION type STRING, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP6. types: - "!

- "! An object that describes a response with response type

- "! `option`. + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_AUDIO, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the audio clip. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the audio player cannot be seen. + ALT_TEXT type STRING, + end of T_RUNTIME_RESPONSE_TYPE_AUDIO. + types: + "! No documentation available. begin of T_DIA_ND_OUTPUT_RESP_TYPE_OPT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1896,7 +2374,31 @@ public section. "! An array of objects describing the options from which the user can choose. You "! can include up to 20 options. OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_DIA_ND_OUTPUT_RESP_TYPE_OPT. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_RESP_TYPE_VIDEO, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the video. + SOURCE type STRING, + "! An optional title to show before the response. + TITLE type STRING, + "! An optional description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the video cannot be seen. + ALT_TEXT type STRING, + end of T_DIA_ND_OTPT_RESP_TYPE_VIDEO. types: "! No documentation available. begin of T_BASE_COUNTEREXAMPLE, @@ -1911,20 +2413,44 @@ public section. UPDATED type DATETIME, end of T_BASE_COUNTEREXAMPLE. types: - "!

- "! An object that describes a response with response type

- "! `image`. + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_IMAGE, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The URL of the image. + "! The `https:` URL of the image. SOURCE type STRING, "! The title or introductory text to show before the response. TITLE type STRING, - "! The description to show with the the response. + "! The description to show with the response. DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! Descriptive text that can be used for screen readers or other situations where + "! the image cannot be seen. + ALT_TEXT type STRING, end of T_RUNTIME_RESPONSE_TYPE_IMAGE. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OT11, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the embeddable content. + SOURCE type STRING, + "! An optional title to show before the response. + TITLE type STRING, + "! An optional description to show with the response. + DESCRIPTION type STRING, + "! The URL of an image that shows a preview of the embedded content. + IMAGE_URL type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DIA_ND_OTPT_GNRC_DIA_ND_OT11. types: "! No documentation available. begin of T_UPDATE_WORKSPACE, @@ -1948,15 +2474,26 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, "! Any metadata related to the workspace. - METADATA type MAP, + METADATA type JSONOBJECT, "! Whether training data from the workspace (including artifacts such as intents "! and entities) can be used by IBM for general service improvements. `true` "! indicates that workspace training data is not to be used. LEARNING_OPT_OUT type BOOLEAN, "! Global settings for the workspace. SYSTEM_SETTINGS type T_WORKSPACE_SYSTEM_SETTINGS, - "! The current status of the workspace. + "! 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. STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, "! No documentation available. WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY, "! An array of objects defining the intents for the workspace. @@ -1967,9 +2504,12 @@ public section. types: "! No documentation available. begin of T_BASE_DIALOG_NODE, - "! The dialog node ID. This string must conform to the following restrictions:
- "! - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot - "! characters. + "! The unique ID of the dialog node. This is an internal identifier used to refer + "! to the dialog node from other dialog nodes and in the diagnostic information + "! included with message responses.
+ "!
+ "! This string can contain only Unicode alphanumeric, space, underscore, hyphen, + "! and dot characters. DIALOG_NODE type STRING, "! The description of the dialog node. This string cannot contain carriage return, "! newline, or tab characters. @@ -1977,11 +2517,11 @@ public section. "! The condition that will trigger the dialog node. This string cannot contain "! carriage return, newline, or tab characters. CONDITIONS type STRING, - "! The ID of the parent dialog node. This property is omitted if the dialog node - "! has no parent. + "! The unique ID of the parent dialog node. This property is omitted if the dialog + "! node has no parent. PARENT type STRING, - "! The ID of the previous sibling dialog node. This property is omitted if the - "! dialog node has no previous sibling. + "! The unique ID of the previous sibling dialog node. This property is omitted if + "! the dialog node has no previous sibling. PREVIOUS_SIBLING type STRING, "! The output of the dialog node. For more information about how to specify dialog "! node output, see the @@ -1991,13 +2531,17 @@ public section. "! The context for the dialog node. CONTEXT type T_DIALOG_NODE_CONTEXT, "! The metadata for the dialog node. - METADATA type MAP, + METADATA type JSONOBJECT, "! The next step to execute following this dialog node. NEXT_STEP type T_DIALOG_NODE_NEXT_STEP, - "! The alias used to identify the dialog node. This string must conform to the - "! following restrictions:
- "! - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot - "! characters. + "! A human-readable name for the dialog node. If the node is included in + "! disambiguation, this title is used to populate the **label** property of the + "! corresponding suggestion in the `suggestion` response type (unless it is + "! overridden by the **user_label** property). The title is also used to populate + "! the **topic** property in the `connect_to_agent` response type.
+ "!
+ "! This string can contain only Unicode alphanumeric, space, underscore, hyphen, + "! and dot characters. TITLE type STRING, "! How the dialog node is processed. TYPE type STRING, @@ -2014,7 +2558,8 @@ public section. "! Whether the user can digress to top-level nodes while filling out slots. DIGRESS_OUT_SLOTS type STRING, "! A label that can be displayed externally to describe the purpose of the node to - "! users. + "! users. If set, this label is used to identify the node in disambiguation + "! responses (overriding the value of the **title** property). USER_LABEL type STRING, "! Whether the dialog node should be excluded from disambiguation suggestions. "! Valid only when **type**=`standard` or `frame`. @@ -2026,6 +2571,28 @@ public section. "! The timestamp for the most recent update to the object. UPDATED type DATETIME, end of T_BASE_DIALOG_NODE. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_AD, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the audio clip. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the audio player cannot be seen. + ALT_TEXT type STRING, + end of T_RT_RESP_GNRC_RT_RESP_TYP_AD. types: "!

"! A request sent to the workspace, including the user input

@@ -2052,6 +2619,18 @@ public section. OUTPUT type T_OUTPUT_DATA, "! An array of objects describing any actions requested by the dialog node. ACTIONS type STANDARD TABLE OF T_DIALOG_NODE_ACTION WITH NON-UNIQUE DEFAULT KEY, + "! A string value that identifies the user who is interacting with the workspace. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.conversation_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the context + "! metadata. If **user_id** is specified in both locations in a message request, + "! the value specified at the root is used. + USER_ID type STRING, end of T_MESSAGE_REQUEST. types: "! No documentation available. @@ -2091,9 +2670,32 @@ public section. begin of T_LOG_COLLECTION, "! An array of objects describing log events. LOGS type STANDARD TABLE OF T_LOG WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_LOG_PAGINATION, end of T_LOG_COLLECTION. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP9, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the video. + SOURCE type STRING, + "! An optional title to show before the response. + TITLE type STRING, + "! An optional description to show with the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the video cannot be seen. + ALT_TEXT type STRING, + end of T_DIA_ND_OTPT_GNRC_DIA_ND_OTP9. types: "! No documentation available. begin of T_AUDIT_PROPERTIES, @@ -2108,7 +2710,8 @@ public section. "! An array of objects describing the workspaces associated with the service "! instance. WORKSPACES type STANDARD TABLE OF T_WORKSPACE WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). PAGINATION type T_PAGINATION, end of T_WORKSPACE_COLLECTION. types: @@ -2125,22 +2728,55 @@ public section. UPDATED type DATETIME, end of T_BASE_SYNONYM. types: - "!

- "! An object that describes a response with response type

- "! `option`. + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_IF1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the embeddable content. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the response. + DESCRIPTION type STRING, + "! The URL of an image that shows a preview of the embedded content. + IMAGE_URL type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_IF1. + types: + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_OPT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, "! The title or introductory text to show before the response. TITLE type STRING, - "! The description to show with the the response. + "! The description to show with the response. DESCRIPTION type STRING, "! The preferred type of control to display. PREFERENCE type STRING, "! An array of objects describing the options from which the user can choose. OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_OPT. + types: + "! No documentation available. + begin of T_DIA_ND_OTPT_RESP_TYP_USR_DF1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! An object containing any properties for the user-defined response type. The + "! total size of this object cannot exceed 5000 bytes. + USER_DEFINED type JSONOBJECT, + "! An array of objects specifying channels for which the response is intended. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DIA_ND_OTPT_RESP_TYP_USR_DF1. types: "!

"! For internal use only.

@@ -2155,20 +2791,25 @@ constants: T_WS_SYSTM_STTNGS_DSMBGTN type string value '|', T_DIALOG_NODE_OUTPUT_MODIFIERS type string value '|', T_DIALOG_NODE_NEXT_STEP type string value '|BEHAVIOR|', + T_STATUS_ERROR type string value '|', T_DIALOG_NODE_OUTPUT type string value '|', T_DIALOG_NODE_CONTEXT type string value '|', T_DIALOG_NODE type string value '|DIALOG_NODE|', T_VALUE type string value '|VALUE|TYPE|', + T_WORKSPACE_COUNTS type string value '|', T_WEBHOOK type string value '|URL|NAME|', T_WS_SYSTM_STTNGS_SYSTM_ENTTS type string value '|', T_MENTION type string value '|ENTITY|LOCATION|', T_EXAMPLE type string value '|TEXT|', T_INTENT type string value '|INTENT|', + T_WS_SYSTEM_SETTINGS_NLP type string value '|', T_WS_SYSTEM_SETTINGS_TOOLING type string value '|', T_WORKSPACE_SYSTEM_SETTINGS type string value '|', T_COUNTEREXAMPLE type string value '|TEXT|', T_ENTITY type string value '|ENTITY|', - T_WORKSPACE type string value '|NAME|LANGUAGE|WORKSPACE_ID|LEARNING_OPT_OUT|', + T_WORKSPACE type string value '|NAME|LANGUAGE|LEARNING_OPT_OUT|', + T_RESPONSE_GENERIC_CHANNEL type string value '|', + T_RUNTIME_RESPONSE_TYPE_VIDEO type string value '|RESPONSE_TYPE|SOURCE|', T_SYNONYM type string value '|SYNONYM|', T_PAGINATION type string value '|REFRESH_URL|', T_SYNONYM_COLLECTION type string value '|SYNONYMS|PAGINATION|', @@ -2177,20 +2818,28 @@ constants: T_CAPTURE_GROUP type string value '|GROUP|', T_RUNTIME_ENTITY_ALTERNATIVE type string value '|', T_RUNTIME_ENTITY_ROLE type string value '|', - T_RUNTIME_ENTITY type string value '|ENTITY|LOCATION|VALUE|', - T_RUNTIME_INTENT type string value '|INTENT|CONFIDENCE|', + T_RUNTIME_ENTITY type string value '|ENTITY|VALUE|', + T_RUNTIME_INTENT type string value '|INTENT|', T_DIA_ND_OUTPUT_OPT_ELEM_VALUE type string value '|', T_DIA_NODE_OUTPUT_OPT_ELEMENT type string value '|LABEL|VALUE|', T_RUNTIME_RESPONSE_TYPE_OPTION type string value '|RESPONSE_TYPE|TITLE|OPTIONS|', T_DIA_ND_OTPT_TEXT_VALUES_ELEM type string value '|', T_DIA_ND_OUTPUT_RESP_TYPE_TEXT type string value '|RESPONSE_TYPE|VALUES|', T_BASE_WORKSPACE type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_VD type string value '|RESPONSE_TYPE|SOURCE|', + T_CHANNEL_TRANSFER_TARGET_CHAT type string value '|', + T_CHANNEL_TRANSFER_TARGET type string value '|', + T_CHANNEL_TRANSFER_INFO type string value '|TARGET|', + T_DIA_ND_OTPT_RESP_TYP_CHNNL_1 type string value '|RESPONSE_TYPE|MESSAGE_TO_USER|TRANSFER_INFO|', + T_RT_RESP_TYPE_CHANNEL_TRANS type string value '|RESPONSE_TYPE|MESSAGE_TO_USER|TRANSFER_INFO|', T_BASE_ENTITY type string value '|', T_RUNTIME_RESPONSE_TYPE_TEXT type string value '|RESPONSE_TYPE|TEXT|', T_RT_ENTTY_INTRPRTTN_SYS_TIME type string value '|', T_UPDATE_EXAMPLE type string value '|', + T_DIA_ND_OTPT_RESP_TYPE_IFRAME type string value '|RESPONSE_TYPE|SOURCE|', T_ENTITY_MENTION type string value '|TEXT|INTENT|LOCATION|', T_RT_RESP_GNRC_RT_RESP_TYP_IMG type string value '|RESPONSE_TYPE|SOURCE|', + T_RT_RESP_TYPE_USER_DEFINED type string value '|RESPONSE_TYPE|USER_DEFINED|', T_DIA_ND_OTPT_GNRC_DIA_ND_OTP1 type string value '|RESPONSE_TYPE|VALUES|', T_DIA_ND_OTPT_RESP_TYP_SRCH_S1 type string value '|RESPONSE_TYPE|QUERY|QUERY_TYPE|', T_EXAMPLE_COLLECTION type string value '|EXAMPLES|PAGINATION|', @@ -2200,6 +2849,7 @@ constants: T_RT_RESP_TYP_CONNECT_TO_AGENT type string value '|RESPONSE_TYPE|', T_DIA_ND_OTPT_GNRC_DIA_ND_OTP5 type string value '|RESPONSE_TYPE|', T_CREATE_VALUE type string value '|VALUE|', + T_RT_RESP_GNRC_RT_RESP_TYP_CH1 type string value '|RESPONSE_TYPE|MESSAGE_TO_USER|TRANSFER_INFO|', T_DIALOG_SUGGESTION_VALUE type string value '|', T_DIALOG_SUGGESTION type string value '|LABEL|VALUE|', T_UPDATE_VALUE type string value '|', @@ -2210,20 +2860,25 @@ constants: T_WORKSPACE_REFERENCE type string value '|', T_VALUE_COLLECTION type string value '|VALUES|PAGINATION|', T_DIALOG_NODE_VISITED_DETAILS type string value '|', - T_LOG_MESSAGE type string value '|LEVEL|MSG|', - T_OUTPUT_DATA type string value '|LOG_MESSAGES|TEXT|', + T_LOG_MESSAGE_SOURCE type string value '|', + T_LOG_MESSAGE type string value '|LEVEL|MSG|CODE|', + T_OUTPUT_DATA type string value '|LOG_MESSAGES|', T_BULK_CLASSIFY_INPUT type string value '|INPUT|', T_DIA_ND_OTPT_GNRC_DIA_ND_OTP3 type string value '|RESPONSE_TYPE|SOURCE|', + T_DIA_ND_OTPT_GNRC_DIA_ND_OTP7 type string value '|RESPONSE_TYPE|MESSAGE_TO_USER|TRANSFER_INFO|', T_RT_RESP_GNRC_RT_RESP_TYP_CN1 type string value '|RESPONSE_TYPE|', T_DIALOG_NODE_COLLECTION type string value '|DIALOG_NODES|PAGINATION|', T_MESSAGE_CONTEXT_METADATA type string value '|', T_CONTEXT type string value '|', - T_MESSAGE_RESPONSE type string value '|INPUT|INTENTS|ENTITIES|CONTEXT|OUTPUT|', + T_MESSAGE_RESPONSE type string value '|INPUT|INTENTS|ENTITIES|CONTEXT|OUTPUT|USER_ID|', T_BASE_VALUE type string value '|', T_UPDATE_ENTITY type string value '|', T_UPDATE_DIALOG_NODE type string value '|', T_RUNTIME_RESPONSE_TYPE_PAUSE type string value '|RESPONSE_TYPE|TIME|', + T_RT_RESP_GNRC_RT_RESP_TYP_US1 type string value '|RESPONSE_TYPE|USER_DEFINED|', T_DIA_ND_OTPT_RESP_TYP_CNNCT_1 type string value '|RESPONSE_TYPE|', + T_DIA_ND_OTPT_GNRC_DIA_ND_OT10 type string value '|RESPONSE_TYPE|SOURCE|', + T_RUNTIME_RESPONSE_TYPE_IFRAME type string value '|RESPONSE_TYPE|SOURCE|', T_RT_RESP_GNRC_RT_RESP_TYP_PS type string value '|RESPONSE_TYPE|TIME|', T_ERROR_DETAIL type string value '|MESSAGE|', T_CREATE_INTENT type string value '|INTENT|', @@ -2239,7 +2894,9 @@ constants: T_RT_RESP_GNRC_RT_RESP_TYP_SG1 type string value '|RESPONSE_TYPE|TITLE|SUGGESTIONS|', T_DIA_ND_OUTPUT_RESP_TYPE_IMG type string value '|RESPONSE_TYPE|SOURCE|', T_ERROR_RESPONSE type string value '|ERROR|CODE|', + T_DIA_ND_OTPT_RESP_TYPE_AUDIO type string value '|RESPONSE_TYPE|SOURCE|', T_DIA_ND_OTPT_GNRC_DIA_ND_OTP4 type string value '|RESPONSE_TYPE|TITLE|OPTIONS|', + T_DIA_ND_OTPT_GNRC_DIA_ND_OTP8 type string value '|RESPONSE_TYPE|USER_DEFINED|', T_BASE_MESSAGE type string value '|', T_RT_RESPONSE_TYPE_SUGGESTION type string value '|RESPONSE_TYPE|TITLE|SUGGESTIONS|', T_ENTITY_MENTION_COLLECTION type string value '|EXAMPLES|PAGINATION|', @@ -2249,19 +2906,26 @@ constants: T_DIA_ND_OTPT_GNRC_DIA_ND_OTP2 type string value '|RESPONSE_TYPE|TIME|', T_RT_ENTTY_INTRPRTTN_SYS_DATE type string value '|', T_DIA_ND_OTPT_GNRC_DIA_ND_OTP6 type string value '|RESPONSE_TYPE|QUERY|QUERY_TYPE|', + T_RUNTIME_RESPONSE_TYPE_AUDIO type string value '|RESPONSE_TYPE|SOURCE|', T_DIA_ND_OUTPUT_RESP_TYPE_OPT type string value '|RESPONSE_TYPE|TITLE|OPTIONS|', + T_DIA_ND_OTPT_RESP_TYPE_VIDEO type string value '|RESPONSE_TYPE|SOURCE|', T_BASE_COUNTEREXAMPLE type string value '|', T_RUNTIME_RESPONSE_TYPE_IMAGE type string value '|RESPONSE_TYPE|SOURCE|', + T_DIA_ND_OTPT_GNRC_DIA_ND_OT11 type string value '|RESPONSE_TYPE|SOURCE|', T_UPDATE_WORKSPACE type string value '|', T_BASE_DIALOG_NODE type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_AD type string value '|RESPONSE_TYPE|SOURCE|', T_MESSAGE_REQUEST type string value '|', T_LOG type string value '|REQUEST|RESPONSE|LOG_ID|REQUEST_TIMESTAMP|RESPONSE_TIMESTAMP|WORKSPACE_ID|LANGUAGE|', T_BASE_OUTPUT type string value '|', T_LOG_COLLECTION type string value '|LOGS|PAGINATION|', + T_DIA_ND_OTPT_GNRC_DIA_ND_OTP9 type string value '|RESPONSE_TYPE|SOURCE|', T_AUDIT_PROPERTIES type string value '|', T_WORKSPACE_COLLECTION type string value '|WORKSPACES|PAGINATION|', T_BASE_SYNONYM type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_IF1 type string value '|RESPONSE_TYPE|SOURCE|', T_RT_RESP_GNRC_RT_RESP_TYP_OPT type string value '|RESPONSE_TYPE|TITLE|OPTIONS|', + T_DIA_ND_OTPT_RESP_TYP_USR_DF1 type string value '|RESPONSE_TYPE|USER_DEFINED|', __DUMMY type string value SPACE, end of C_REQUIRED_FIELDS . @@ -2301,6 +2965,7 @@ constants: INTENTS type string value 'intents', ENTITIES type string value 'entities', ALTERNATE_INTENTS type string value 'alternate_intents', + USER_ID type string value 'user_id', NODES_VISITED type string value 'nodes_visited', NODES_VISITED_DETAILS type string value 'nodes_visited_details', SYNONYM type string value 'synonym', @@ -2316,6 +2981,9 @@ constants: COUNTEREXAMPLE type string value 'counterexample', GROUP type string value 'group', LOCATION type string value 'location', + TARGET type string value 'target', + CHAT type string value 'chat', + URL type string value 'url', CONVERSATION_ID type string value 'conversation_id', SYSTEM type string value 'system', PAGINATION type string value 'pagination', @@ -2325,6 +2993,7 @@ constants: LEARNING_OPT_OUT type string value 'learning_opt_out', SYSTEM_SETTINGS type string value 'system_settings', STATUS type string value 'status', + STATUS_ERRORS type string value 'status_errors', WEBHOOKS type string value 'webhooks', PARAMETERS type string value 'parameters', RESULT_VARIABLE type string value 'result_variable', @@ -2337,12 +3006,16 @@ constants: OVERWRITE type string value 'overwrite', LABEL type string value 'label', RESPONSE_TYPE type string value 'response_type', + SOURCE type string value 'source', + CHANNELS type string value 'channels', + CHANNEL_OPTIONS type string value 'channel_options', + ALT_TEXT type string value 'alt_text', + MESSAGE_TO_USER type string value 'message_to_user', + TRANSFER_INFO type string value 'transfer_info', MESSAGE_TO_HUMAN_AGENT type string value 'message_to_human_agent', AGENT_AVAILABLE type string value 'agent_available', AGENT_UNAVAILABLE type string value 'agent_unavailable', - TRANSFER_INFO type string value 'transfer_info', - TARGET type string value 'target', - SOURCE type string value 'source', + IMAGE_URL type string value 'image_url', PREFERENCE type string value 'preference', OPTIONS type string value 'options', TIME type string value 'time', @@ -2353,6 +3026,7 @@ constants: DISCOVERY_VERSION type string value 'discovery_version', SELECTION_POLICY type string value 'selection_policy', DELIMITER type string value 'delimiter', + USER_DEFINED type string value 'user_defined', PATH type string value 'path', ERROR type string value 'error', ERRORS type string value 'errors', @@ -2369,7 +3043,6 @@ constants: MATCHED type string value 'matched', NEXT_CURSOR type string value 'next_cursor', DEPLOYMENT type string value 'deployment', - USER_ID type string value 'user_id', SPELLING_SUGGESTIONS type string value 'spelling_suggestions', SPELLING_AUTO_CORRECT type string value 'spelling_auto_correct', SUGGESTED_TEXT type string value 'suggested_text', @@ -2378,6 +3051,7 @@ constants: REFRESH_URL type string value 'refresh_url', TOTAL type string value 'total', REFRESH_CURSOR type string value 'refresh_cursor', + CHANNEL type string value 'channel', CONFIDENCE type string value 'confidence', GROUPS type string value 'groups', INTERPRETATION type string value 'interpretation', @@ -2411,14 +3085,16 @@ constants: TIMEZONE type string value 'timezone', TOPIC type string value 'topic', SUGGESTIONS type string value 'suggestions', - URL type string value 'url', HEADERS type string value 'headers', + COUNTS type string value 'counts', WORKSPACES type string value 'workspaces', + NODE type string value 'node', TOOLING type string value 'tooling', DISAMBIGUATION type string value 'disambiguation', HUMAN_AGENT_ASSIST type string value 'human_agent_assist', SYSTEM_ENTITIES type string value 'system_entities', OFF_TOPIC type string value 'off_topic', + NLP type string value 'nlp', PROMPT type string value 'prompt', NONE_OF_THE_ABOVE_PROMPT type string value 'none_of_the_above_prompt', ENABLED type string value 'enabled', @@ -2426,6 +3102,7 @@ constants: RANDOMIZE type string value 'randomize', MAX_SUGGESTIONS type string value 'max_suggestions', SUGGESTION_TEXT_POLICY type string value 'suggestion_text_policy', + MODEL type string value 'model', STORE_GENERIC_RESPONSES type string value 'store_generic_responses', end of C_ABAPNAME_DICTIONARY . @@ -2478,7 +3155,7 @@ constants: "! method is useful for testing and comparing the performance of different "! workspaces.
"!
- "! This method is available only with Premium plans. + "! This method is available only with Enterprise with Data Isolation plans. "! "! @parameter I_WORKSPACE_ID | "! Unique identifier of the workspace. @@ -2522,7 +3199,7 @@ constants: "! methods LIST_WORKSPACES importing - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -2534,7 +3211,10 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

Create workspace

"! Create a workspace based on component objects. You must provide workspace - "! components defining the content of the new workspace. + "! components defining the content of the new workspace.
+ "!
+ "! **Note:** The new workspace data cannot be larger than 1.5 MB. For larger + "! requests, use the **Create workspace asynchronously** method. "! "! @parameter I_BODY | "! No documentation available. @@ -2589,7 +3269,10 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

Update workspace

"! Update an existing workspace with new or modified data. You must provide - "! component objects defining the content of the updated workspace. + "! component objects defining the content of the updated workspace.
+ "!
+ "! **Note:** The new workspace data cannot be larger than 1.5 MB. For larger + "! requests, use the **Update workspace asynchronously** method. "! "! @parameter I_WORKSPACE_ID | "! Unique identifier of the workspace. @@ -2642,6 +3325,111 @@ constants: !I_accept type string default 'application/json' raising ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create workspace asynchronously

+ "! Create a workspace asynchronously based on component objects. You must provide + "! workspace components defining the content of the new workspace.
+ "!
+ "! A successful call to this method only initiates asynchronous creation of the + "! workspace. The new workspace is not available until processing completes. To + "! check the status of the asynchronous operation, use the **Get information about + "! a workspace** method. + "! + "! @parameter I_BODY | + "! No documentation available. + "! @parameter E_RESPONSE | + "! Service return value of type T_WORKSPACE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_WORKSPACE_ASYNC + importing + !I_BODY type T_CREATE_WORKSPACE optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_WORKSPACE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update workspace asynchronously

+ "! Update an existing workspace asynchronously with new or modified data. You must + "! provide component objects defining the content of the updated workspace.
+ "!
+ "! A successful call to this method only initiates an asynchronous update of the + "! workspace. The updated workspace is not available until processing completes. + "! To check the status of the asynchronous operation, use the **Get information + "! about a workspace** method. + "! + "! @parameter I_WORKSPACE_ID | + "! Unique identifier of the workspace. + "! @parameter I_BODY | + "! Valid data defining the new and updated workspace content.
+ "!
+ "! The maximum size for this data is 50MB. If you need to import a larger amount of + "! workspace data, consider importing components such as intents and entities + "! using separate operations. + "! @parameter I_APPEND | + "! Whether the new data is to be appended to the existing data in the object. If + "! **append**=`false`, elements included in the new data completely replace the + "! corresponding existing elements, including all subelements. For example, if the + "! new data for a workspace includes **entities** and **append**=`false`, all + "! existing entities in the workspace are discarded and replaced with the new + "! entities.
+ "!
+ "! If **append**=`true`, existing elements are preserved, and the new elements are + "! added. If any elements in the new data collide with existing elements, the + "! update request fails. + "! @parameter E_RESPONSE | + "! Service return value of type T_WORKSPACE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_WORKSPACE_ASYNC + importing + !I_WORKSPACE_ID type STRING + !I_BODY type T_UPDATE_WORKSPACE optional + !I_APPEND type BOOLEAN default c_boolean_false + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_WORKSPACE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Export workspace asynchronously

+ "! Export the entire workspace asynchronously, including all workspace + "! content.
+ "!
+ "! A successful call to this method only initiates an asynchronous export. The + "! exported JSON data is not available until processing completes. After the + "! initial request is submitted, you can continue to poll by calling the same + "! request again and checking the value of the **status** property. When + "! processing has completed, the request returns the exported JSON data. Remember + "! that the usual rate limits apply. + "! + "! @parameter I_WORKSPACE_ID | + "! Unique identifier of the workspace. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter I_SORT | + "! Indicates how the returned workspace data will be sorted. Specify `sort=stable` + "! to sort all workspace objects by unique identifier, in ascending alphabetical + "! order. + "! @parameter I_VERBOSE | + "! Whether the response should include the `counts` property, which indicates how + "! many of each component (such as intents and entities) the workspace contains. + "! @parameter E_RESPONSE | + "! Service return value of type T_WORKSPACE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods EXPORT_WORKSPACE_ASYNC + importing + !I_WORKSPACE_ID type STRING + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_SORT type STRING optional + !I_VERBOSE type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_WORKSPACE + raising + ZCX_IBMC_SERVICE_EXCEPTION . "!

List intents

"! List the intents for a workspace. @@ -2675,7 +3463,7 @@ constants: importing !I_WORKSPACE_ID type STRING !I_EXPORT type BOOLEAN default c_boolean_false - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -2841,7 +3629,7 @@ constants: importing !I_WORKSPACE_ID type STRING !I_INTENT type STRING - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -2990,7 +3778,7 @@ constants: methods LIST_COUNTEREXAMPLES importing !I_WORKSPACE_ID type STRING - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -3133,7 +3921,7 @@ constants: importing !I_WORKSPACE_ID type STRING !I_EXPORT type BOOLEAN default c_boolean_false - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -3334,7 +4122,7 @@ constants: !I_WORKSPACE_ID type STRING !I_ENTITY type STRING !I_EXPORT type BOOLEAN default c_boolean_false - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -3514,7 +4302,7 @@ constants: !I_WORKSPACE_ID type STRING !I_ENTITY type STRING !I_VALUE type STRING - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -3676,7 +4464,7 @@ constants: methods LIST_DIALOG_NODES importing !I_WORKSPACE_ID type STRING - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false !I_SORT type STRING optional !I_CURSOR type STRING optional @@ -3720,7 +4508,7 @@ constants: "! @parameter I_WORKSPACE_ID | "! Unique identifier of the workspace. "! @parameter I_DIALOG_NODE | - "! The dialog node ID (for example, `get_order`). + "! The dialog node ID (for example, `node_1_1479323581900`). "! @parameter I_INCLUDE_AUDIT | "! Whether to include the audit properties (`created` and `updated` timestamps) in "! the response. @@ -3747,7 +4535,7 @@ constants: "! @parameter I_WORKSPACE_ID | "! Unique identifier of the workspace. "! @parameter I_DIALOG_NODE | - "! The dialog node ID (for example, `get_order`). + "! The dialog node ID (for example, `node_1_1479323581900`). "! @parameter I_BODY | "! The updated content of the dialog node.
"!
@@ -3781,7 +4569,7 @@ constants: "! @parameter I_WORKSPACE_ID | "! Unique identifier of the workspace. "! @parameter I_DIALOG_NODE | - "! The dialog node ID (for example, `get_order`). + "! The dialog node ID (for example, `node_1_1479323581900`). "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! methods DELETE_DIALOG_NODE @@ -3793,7 +4581,14 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

List log events in a workspace

- "! List the events from the log of a specific workspace. + "! List the events from the log of a specific workspace.
+ "!
+ "! This method requires Manager access.
+ "!
+ "! **Note:** If you use the **cursor** parameter to retrieve results one page at a + "! time, subsequent requests must be no more than 5 minutes apart. Any returned + "! value for the **cursor** parameter becomes invalid after 5 minutes. For more + "! information about using pagination, see [Pagination](#pagination). "! "! @parameter I_WORKSPACE_ID | "! Unique identifier of the workspace. @@ -3818,7 +4613,7 @@ constants: !I_WORKSPACE_ID type STRING !I_SORT type STRING optional !I_FILTER type STRING optional - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_CURSOR type STRING optional !I_accept type string default 'application/json' exporting @@ -3826,13 +4621,19 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . "!

List log events in all workspaces

- "! List the events from the logs of all workspaces in the service instance. + "! List the events from the logs of all workspaces in the service instance.
+ "!
+ "! **Note:** If you use the **cursor** parameter to retrieve results one page at a + "! time, subsequent requests must be no more than 5 minutes apart. Any returned + "! value for the **cursor** parameter becomes invalid after 5 minutes. For more + "! information about using pagination, see [Pagination](#pagination). "! "! @parameter I_FILTER | "! A cacheable parameter that limits the results to those matching the specified "! filter. You must specify a filter query that includes a value for `language`, "! as well as a value for `request.context.system.assistant_id`, `workspace_id`, - "! or `request.context.metadata.deployment`. For more information, see the + "! or `request.context.metadata.deployment`. These required filters must be + "! specified using the exact match (`::`) operator. For more information, see the "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-ref "! erence#filter-reference). "! @parameter I_SORT | @@ -3850,7 +4651,7 @@ constants: importing !I_FILTER type STRING !I_SORT type STRING optional - !I_PAGE_LIMIT type INTEGER optional + !I_PAGE_LIMIT type INTEGER default 100 !I_CURSOR type STRING optional !I_accept type string default 'application/json' exporting @@ -3866,7 +4667,14 @@ constants: "! with a request that passes data. For more information about personal data and "! customer IDs, see [Information "! security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-secu - "! rity#information-security). + "! rity#information-security).
+ "!
+ "! **Note:** This operation is intended only for deleting data associated with a + "! single specific customer, not for deleting data associated with multiple + "! customers or for any other purpose. For more information, see [Labeling and + "! deleting data in Watson + "! Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-sec + "! urity#information-security-gdpr-wa). "! "! @parameter I_CUSTOMER_ID | "! The customer ID for which all data is to be deleted. @@ -3944,7 +4752,7 @@ endmethod. * +-------------------------------------------------------------------------------------- method get_sdk_version_date. - e_sdk_version_date = '20210312144425'. + e_sdk_version_date = '20231212104228'. endmethod. @@ -4025,13 +4833,24 @@ method MESSAGE. concatenate lv_body lv_bodyparam into lv_body. endif. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -4114,13 +4933,24 @@ method BULK_CLASSIFY. concatenate lv_body lv_bodyparam into lv_body. endif. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -4145,16 +4975,231 @@ endmethod. * ---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_IBMC_ASSISTANT_V1->LIST_WORKSPACES * +-------------------------------------------------------------------------------------------------+ -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) * | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_WORKSPACE_COLLECTION +* | [<---] E_RESPONSE TYPE T_WORKSPACE_COLLECTION +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_WORKSPACES. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/workspaces'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_PAGE_LIMIT is supplied. + lv_queryparam = i_PAGE_LIMIT. + add_query_parameter( + exporting + i_parameter = `page_limit` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_COUNT is supplied. + lv_queryparam = i_INCLUDE_COUNT. + add_query_parameter( + exporting + i_parameter = `include_count` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_SORT is supplied. + lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sort` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CURSOR is supplied. + lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `cursor` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->CREATE_WORKSPACE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_BODY TYPE T_CREATE_WORKSPACE(optional) +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_WORKSPACE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_WORKSPACE. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/workspaces'. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_BODY is initial. + lv_datatype = get_datatype( i_BODY ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_BODY to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->GET_WORKSPACE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_WORKSPACE_ID TYPE STRING +* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_SORT TYPE STRING(optional) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_WORKSPACE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method LIST_WORKSPACES. +method GET_WORKSPACE. data: ls_request_prop type ts_request_prop, @@ -4163,7 +5208,8 @@ method LIST_WORKSPACES. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v1/workspaces'. + ls_request_prop-url-path = '/v1/workspaces/{workspace_id}'. + replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case. " standard headers ls_request_prop-header_accept = I_accept. @@ -4175,21 +5221,22 @@ method LIST_WORKSPACES. data: lv_queryparam type string. - if i_PAGE_LIMIT is supplied. - lv_queryparam = i_PAGE_LIMIT. + if i_EXPORT is supplied. + lv_queryparam = i_EXPORT. add_query_parameter( exporting - i_parameter = `page_limit` + i_parameter = `export` i_value = lv_queryparam + i_is_boolean = c_boolean_true changing c_url = ls_request_prop-url ) ##NO_TEXT. endif. - if i_INCLUDE_COUNT is supplied. - lv_queryparam = i_INCLUDE_COUNT. + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. add_query_parameter( exporting - i_parameter = `include_count` + i_parameter = `include_audit` i_value = lv_queryparam i_is_boolean = c_boolean_true changing @@ -4206,27 +5253,6 @@ method LIST_WORKSPACES. c_url = ls_request_prop-url ) ##NO_TEXT. endif. - if i_CURSOR is supplied. - lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `cursor` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_INCLUDE_AUDIT is supplied. - lv_queryparam = i_INCLUDE_AUDIT. - add_query_parameter( - exporting - i_parameter = `include_audit` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - @@ -4248,16 +5274,18 @@ method LIST_WORKSPACES. endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->CREATE_WORKSPACE +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->UPDATE_WORKSPACE * +-------------------------------------------------------------------------------------------------+ -* | [--->] I_BODY TYPE T_CREATE_WORKSPACE(optional) +* | [--->] I_WORKSPACE_ID TYPE STRING +* | [--->] I_BODY TYPE T_UPDATE_WORKSPACE(optional) +* | [--->] I_APPEND TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_contenttype TYPE string (default ='application/json') * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_WORKSPACE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method CREATE_WORKSPACE. +method UPDATE_WORKSPACE. data: ls_request_prop type ts_request_prop, @@ -4266,7 +5294,8 @@ method CREATE_WORKSPACE. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v1/workspaces'. + ls_request_prop-url-path = '/v1/workspaces/{workspace_id}'. + replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case. " standard headers ls_request_prop-header_content_type = I_contenttype. @@ -4279,6 +5308,17 @@ method CREATE_WORKSPACE. data: lv_queryparam type string. + if i_APPEND is supplied. + lv_queryparam = i_APPEND. + add_query_parameter( + exporting + i_parameter = `append` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + if i_INCLUDE_AUDIT is supplied. lv_queryparam = i_INCLUDE_AUDIT. add_query_parameter( @@ -4320,13 +5360,24 @@ method CREATE_WORKSPACE. concatenate lv_body lv_bodyparam into lv_body. endif. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -4348,17 +5399,13 @@ method CREATE_WORKSPACE. endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->GET_WORKSPACE +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->DELETE_WORKSPACE * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING -* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_SORT TYPE STRING(optional) * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_WORKSPACE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method GET_WORKSPACE. +method DELETE_WORKSPACE. data: ls_request_prop type ts_request_prop, @@ -4376,49 +5423,104 @@ method GET_WORKSPACE. changing c_url = ls_request_prop-url ). - " process query parameters + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->CREATE_WORKSPACE_ASYNC +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_BODY TYPE T_CREATE_WORKSPACE(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_WORKSPACE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_WORKSPACE_ASYNC. + data: - lv_queryparam type string. + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. - if i_EXPORT is supplied. - lv_queryparam = i_EXPORT. - add_query_parameter( - exporting - i_parameter = `export` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. + ls_request_prop-url-path = '/v1/workspaces_async'. - if i_INCLUDE_AUDIT is supplied. - lv_queryparam = i_INCLUDE_AUDIT. - add_query_parameter( - exporting - i_parameter = `include_audit` - i_value = lv_queryparam - i_is_boolean = c_boolean_true + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. + c_url = ls_request_prop-url ). - if i_SORT is supplied. - lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `sort` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_BODY is initial. + lv_datatype = get_datatype( i_BODY ). - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_BODY to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). " retrieve JSON data @@ -4433,18 +5535,17 @@ method GET_WORKSPACE. endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->UPDATE_WORKSPACE +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->UPDATE_WORKSPACE_ASYNC * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_BODY TYPE T_UPDATE_WORKSPACE(optional) * | [--->] I_APPEND TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_contenttype TYPE string (default ='application/json') * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_WORKSPACE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method UPDATE_WORKSPACE. +method UPDATE_WORKSPACE_ASYNC. data: ls_request_prop type ts_request_prop, @@ -4453,7 +5554,7 @@ method UPDATE_WORKSPACE. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v1/workspaces/{workspace_id}'. + ls_request_prop-url-path = '/v1/workspaces_async/{workspace_id}'. replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case. " standard headers @@ -4478,17 +5579,6 @@ method UPDATE_WORKSPACE. c_url = ls_request_prop-url ) ##NO_TEXT. endif. - if i_INCLUDE_AUDIT is supplied. - lv_queryparam = i_INCLUDE_AUDIT. - add_query_parameter( - exporting - i_parameter = `include_audit` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - @@ -4519,13 +5609,24 @@ method UPDATE_WORKSPACE. concatenate lv_body lv_bodyparam into lv_body. endif. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -4547,13 +5648,17 @@ method UPDATE_WORKSPACE. endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->DELETE_WORKSPACE +* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->EXPORT_WORKSPACE_ASYNC * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_SORT TYPE STRING(optional) +* | [--->] I_VERBOSE TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_WORKSPACE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method DELETE_WORKSPACE. +method EXPORT_WORKSPACE_ASYNC. data: ls_request_prop type ts_request_prop, @@ -4562,7 +5667,7 @@ method DELETE_WORKSPACE. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v1/workspaces/{workspace_id}'. + ls_request_prop-url-path = '/v1/workspaces_async/{workspace_id}/export'. replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case. " standard headers @@ -4571,17 +5676,59 @@ method DELETE_WORKSPACE. changing c_url = ls_request_prop-url ). + " process query parameters + data: + lv_queryparam type string. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_SORT is supplied. + lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sort` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + if i_VERBOSE is supplied. + lv_queryparam = i_VERBOSE. + add_query_parameter( + exporting + i_parameter = `verbose` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). endmethod. @@ -4591,7 +5738,7 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -4778,13 +5925,24 @@ method CREATE_INTENT. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -4968,13 +6126,24 @@ method UPDATE_INTENT. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5042,7 +6211,7 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_INTENT TYPE STRING -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -5221,13 +6390,24 @@ method CREATE_EXAMPLE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5391,13 +6571,24 @@ method UPDATE_EXAMPLE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5466,7 +6657,7 @@ endmethod. * | Instance Public Method ZCL_IBMC_ASSISTANT_V1->LIST_COUNTEREXAMPLES * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -5642,13 +6833,24 @@ method CREATE_COUNTEREXAMPLE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5808,13 +7010,24 @@ method UPDATE_COUNTEREXAMPLE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5882,7 +7095,7 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -6069,13 +7282,24 @@ method CREATE_ENTITY. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -6259,13 +7483,24 @@ method UPDATE_ENTITY. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -6411,7 +7646,7 @@ endmethod. * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_ENTITY TYPE STRING * | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -6601,13 +7836,24 @@ method CREATE_VALUE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -6795,13 +8041,24 @@ method UPDATE_VALUE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -6872,7 +8129,7 @@ endmethod. * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_ENTITY TYPE STRING * | [--->] I_VALUE TYPE STRING -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -7054,13 +8311,24 @@ method CREATE_SYNONYM. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -7228,13 +8496,24 @@ method UPDATE_SYNONYM. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -7305,7 +8584,7 @@ endmethod. * | Instance Public Method ZCL_IBMC_ASSISTANT_V1->LIST_DIALOG_NODES * +-------------------------------------------------------------------------------------------------+ * | [--->] I_WORKSPACE_ID TYPE STRING -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_CURSOR TYPE STRING(optional) @@ -7481,13 +8760,24 @@ method CREATE_DIALOG_NODE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -7647,13 +8937,24 @@ method UPDATE_DIALOG_NODE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -7722,7 +9023,7 @@ endmethod. * | [--->] I_WORKSPACE_ID TYPE STRING * | [--->] I_SORT TYPE STRING(optional) * | [--->] I_FILTER TYPE STRING(optional) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_CURSOR TYPE STRING(optional) * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_LOG_COLLECTION @@ -7815,7 +9116,7 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_FILTER TYPE STRING * | [--->] I_SORT TYPE STRING(optional) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) * | [--->] I_CURSOR TYPE STRING(optional) * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_LOG_COLLECTION diff --git a/src/zcl_ibmc_assistant_v1.clas.xml b/src/zcl_ibmc_assistant_v1.clas.xml index 9b799e7..e6ff2e5 100644 --- a/src/zcl_ibmc_assistant_v1.clas.xml +++ b/src/zcl_ibmc_assistant_v1.clas.xml @@ -66,6 +66,12 @@ E Create workspace + + ZCL_IBMC_ASSISTANT_V1 + CREATE_WORKSPACE_ASYNC + E + Create workspace asynchronously + ZCL_IBMC_ASSISTANT_V1 DELETE_COUNTEREXAMPLE @@ -120,6 +126,12 @@ E Delete workspace + + ZCL_IBMC_ASSISTANT_V1 + EXPORT_WORKSPACE_ASYNC + E + Export workspace asynchronously + ZCL_IBMC_ASSISTANT_V1 GET_COUNTEREXAMPLE @@ -288,6 +300,12 @@ E Update workspace + + ZCL_IBMC_ASSISTANT_V1 + UPDATE_WORKSPACE_ASYNC + E + Update workspace asynchronously + diff --git a/src/zcl_ibmc_assistant_v2.clas.abap b/src/zcl_ibmc_assistant_v2.clas.abap index c13cbe4..6ee7277 100644 --- a/src/zcl_ibmc_assistant_v2.clas.abap +++ b/src/zcl_ibmc_assistant_v2.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,70 @@ class ZCL_IBMC_ASSISTANT_V2 DEFINITION create public . public section. + types: + "! No documentation available. + begin of T_RESPONSE_GENERIC_CHANNEL, + "! A channel for which the response is intended. + CHANNEL type STRING, + end of T_RESPONSE_GENERIC_CHANNEL. + types: + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_VIDEO, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the video. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the video cannot be seen. + ALT_TEXT type STRING, + end of T_RUNTIME_RESPONSE_TYPE_VIDEO. + types: + "! No documentation available. + begin of T_TURN_EVENT_ACTION_SOURCE, + "! The type of turn event. + TYPE type STRING, + "! An action that was visited during processing of the message. + ACTION type STRING, + "! The title of the action. + ACTION_TITLE type STRING, + "! The condition that triggered the dialog node. + CONDITION type STRING, + end of T_TURN_EVENT_ACTION_SOURCE. + types: + "! No documentation available. + begin of T_TURN_EVENT_SEARCH_ERROR, + "! Any error message returned by a failed call to a search skill. + MESSAGE type STRING, + end of T_TURN_EVENT_SEARCH_ERROR. + types: + "! No documentation available. + begin of T_TURN_EVENT_SEARCH, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! No documentation available. + ERROR type T_TURN_EVENT_SEARCH_ERROR, + end of T_TURN_EVENT_SEARCH. + types: + "! No documentation available. + T_MSSG_OUTPUT_DEBUG_TURN_EVENT type JSONOBJECT. + types: + "!

+ "! An object that identifies the dialog element that generated

+ "! the error message. + T_LOG_MESSAGE_SOURCE type JSONOBJECT. types: "!

"! Dialog log message details.

@@ -32,49 +96,47 @@ public section. LEVEL type STRING, "! The text of the log message. MESSAGE type STRING, + "! A code that indicates the category to which the error message belongs. + CODE type STRING, + "! An object that identifies the dialog element that generated the error message. + SOURCE type T_LOG_MESSAGE_SOURCE, end of T_DIALOG_LOG_MESSAGE. types: - "! No documentation available. - begin of T_DIALOG_NODES_VISITED, - "! A dialog node that was triggered during processing of the input message. + "!

+ "! An objects containing detailed diagnostic information about

+ "! a dialog node that was visited during processing of the input message. + begin of T_DIALOG_NODE_VISITED, + "! A dialog node that was visited during processing of the input message. DIALOG_NODE type STRING, "! The title of the dialog node. TITLE type STRING, "! The conditions that trigger the dialog node. CONDITIONS type STRING, - end of T_DIALOG_NODES_VISITED. + end of T_DIALOG_NODE_VISITED. types: "!

"! Additional detailed information about a message response and

"! how it was generated. begin of T_MESSAGE_OUTPUT_DEBUG, - "! An array of objects containing detailed diagnostic information about the nodes - "! that were triggered during processing of the input message. - NODES_VISITED type STANDARD TABLE OF T_DIALOG_NODES_VISITED WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects containing detailed diagnostic information about dialog + "! nodes that were visited during processing of the input message. + NODES_VISITED type STANDARD TABLE OF T_DIALOG_NODE_VISITED WITH NON-UNIQUE DEFAULT KEY, "! An array of up to 50 messages logged with the request. LOG_MESSAGES type STANDARD TABLE OF T_DIALOG_LOG_MESSAGE WITH NON-UNIQUE DEFAULT KEY, "! Assistant sets this to true when this message response concludes or interrupts a "! dialog. BRANCH_EXITED type BOOLEAN, - "! When `branch_exited` is set to `true` by the Assistant, the + "! 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 type STRING, + "! An array of objects containing detailed diagnostic information about dialog + "! nodes and actions that were visited during processing of the input + "! message.
+ "!
+ "! This property is present only if the assistant has an action skill. + TURN_EVENTS type STANDARD TABLE OF T_MSSG_OUTPUT_DEBUG_TURN_EVENT WITH NON-UNIQUE DEFAULT KEY, end of T_MESSAGE_OUTPUT_DEBUG. - types: - "! No documentation available. - begin of T_RT_ENTTY_INTRPRTTN_SYS_NUM, - "! A recognized numeric value, represented as an integer or double. - NUMERIC_VALUE type NUMBER, - "! 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`). - RANGE_LINK type STRING, - "! The type of numeric value recognized in the user input (`integer` or - "! `rational`). - SUBTYPE type STRING, - end of T_RT_ENTTY_INTRPRTTN_SYS_NUM. types: "! No documentation available. begin of T_RT_ENTITY_INTERPRETATION, @@ -230,8 +292,6 @@ public section. "! A decimal percentage that represents Watson's confidence in the recognized "! entity. CONFIDENCE type NUMBER, - "! Any metadata for the entity. - METADATA type MAP, "! The recognized capture groups for the entity, as defined by the entity pattern. GROUPS type STANDARD TABLE OF T_CAPTURE_GROUP WITH NON-UNIQUE DEFAULT KEY, "! An object containing detailed information about the entity recognized in the @@ -254,7 +314,37 @@ public section. "! 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. ROLE type T_RUNTIME_ENTITY_ROLE, + "! The skill that recognized the entity value. Currently, the only possible values + "! are `main skill` for the dialog skill (if enabled) and `actions skill` for the + "! action skill.
+ "!
+ "! This property is present only if the assistant has both a dialog skill and an + "! action skill. + SKILL type STRING, end of T_RUNTIME_ENTITY. + types: + "!

+ "! An optional object containing analytics data. Currently,

+ "! this data is used only for events sent to the Segment extension. + begin of T_REQUEST_ANALYTICS, + "! The browser that was used to send the message that triggered the event. + BROWSER type STRING, + "! The type of device that was used to send the message that triggered the event. + DEVICE type STRING, + "! The URL of the web page that was used to send the message that triggered the + "! event. + PAGEURL type STRING, + end of T_REQUEST_ANALYTICS. + types: + "!

+ "! A reference to a media file to be sent as an attachment with

+ "! the message. + begin of T_MESSAGE_INPUT_ATTACHMENT, + "! The URL of the media file. + URL type STRING, + "! The media content type (such as a MIME type) of the attachment. + MEDIA_TYPE type STRING, + end of T_MESSAGE_INPUT_ATTACHMENT. types: "!

"! Optional properties that control how the assistant responds.

@@ -292,14 +382,30 @@ public section. begin of T_RUNTIME_INTENT, "! The name of the recognized intent. INTENT type STRING, - "! A decimal percentage that represents Watson's confidence in the intent. + "! A decimal percentage that represents Watson's confidence in the intent. If + "! you are specifying an intent as part of a request, but you do not have a + "! calculated confidence value, specify `1`. CONFIDENCE type DOUBLE, + "! The skill that identified the intent. Currently, the only possible values are + "! `main skill` for the dialog skill (if enabled) and `actions skill` for the + "! action skill.
+ "!
+ "! This property is present only if the assistant has both a dialog skill and an + "! action skill. + SKILL type STRING, end of T_RUNTIME_INTENT. types: "!

"! An input object that includes the input text.

begin of T_MESSAGE_INPUT, - "! The type of user input. Currently, only text input is supported. + "! 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. MESSAGE_TYPE type STRING, "! The text of the user input. This string cannot contain carriage return, newline, "! or tab characters. @@ -314,6 +420,15 @@ public section. ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY, "! For internal use only. SUGGESTION_ID type STRING, + "! An array of multimedia attachments to be sent with the message. Attachments are + "! not processed by the assistant itself, but can be sent to external services by + "! webhooks.
+ "!
+ "! **Note:** Attachments are not supported on IBM Cloud Pak for Data. + ATTACHMENTS type STANDARD TABLE OF T_MESSAGE_INPUT_ATTACHMENT WITH NON-UNIQUE DEFAULT KEY, + "! An optional object containing analytics data. Currently, this data is used only + "! for events sent to the Segment extension. + ANALYTICS type T_REQUEST_ANALYTICS, "! Optional properties that control how the assistant responds. OPTIONS type T_MESSAGE_INPUT_OPTIONS, end of T_MESSAGE_INPUT. @@ -335,9 +450,7 @@ public section. VALUE type T_DIA_ND_OUTPUT_OPT_ELEM_VALUE, end of T_DIA_NODE_OUTPUT_OPT_ELEMENT. types: - "!

- "! An object that describes a response with response type

- "! `option`. + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_OPTION, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -350,194 +463,366 @@ public section. PREFERENCE type STRING, "! An array of objects describing the options from which the user can choose. OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_OPTION. types: "!

- "! An object defining the message input to be sent to the

- "! assistant if the user selects the corresponding disambiguation option. - begin of T_DIALOG_SUGGESTION_VALUE, - "! An input object that includes the input text. - INPUT type T_MESSAGE_INPUT, - end of T_DIALOG_SUGGESTION_VALUE. + "! An object describing an error that occurred during

+ "! processing of an asynchronous operation. + begin of T_STATUS_ERROR, + "! The text of the error message. + MESSAGE type STRING, + end of T_STATUS_ERROR. types: - "! No documentation available. - begin of T_DIALOG_SUGGESTION, - "! The user-facing label for the suggestion. This label is taken from the **title** - "! or **user_label** property of the corresponding dialog node, depending on the - "! disambiguation options. - LABEL type STRING, - "! An object defining the message input to be sent to the assistant if the user - "! selects the corresponding disambiguation option. - VALUE type T_DIALOG_SUGGESTION_VALUE, - "! The dialog output that will be returned from the Watson Assistant service if the - "! user selects the corresponding option. - OUTPUT type MAP, - end of T_DIALOG_SUGGESTION. + "!

+ "! The messages included with responses from the search

+ "! integration. + begin of T_SEARCH_SETTINGS_MESSAGES, + "! The message to include in the response to a successful query. + SUCCESS type STRING, + "! The message to include in the response when the query encounters an error. + ERROR type STRING, + "! The message to include in the response when there is no result from the query. + NO_RESULT type STRING, + end of T_SEARCH_SETTINGS_MESSAGES. types: "!

- "! Detailed information about how an autolearned model affected

- "! the response. - begin of T_MSSG_OTPT_DBG_AT_LEARN_MODEL, - "! Whether the model was consulted successfully. - OUTCOME type STRING, - "! How the model was applied. - MODEL_TYPE type STRING, - "! Unique identifier of the autolearned model. - MODEL_ID type STRING, - "! Possible responses the assistant would have returned with autolearning applied, - "! either as disambiguation suggestions or alternate responses. Included only if - "! the response was generated with autolearning in preview mode. (Preview mode - "! means that autolearning is enabled, but is not being applied.). - SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, - end of T_MSSG_OTPT_DBG_AT_LEARN_MODEL. + "! The mapping between fields in the Watson Discovery

+ "! collection and properties in the search response. + begin of T_SRCH_SETTINGS_SCHEMA_MAPPING, + "! The field in the collection to map to the **url** property of the response. + URL type STRING, + "! The field in the collection to map to the **body** property in the response. + BODY type STRING, + "! The field in the collection to map to the **title** property for the schema. + TITLE type STRING, + end of T_SRCH_SETTINGS_SCHEMA_MAPPING. types: "!

- "! Detailed information about how autolearning (if enabled)

- "! affected the response.
+ "! Authentication information for the Watson Discovery service.

+ "! For more information, see the [Watson Discovery + "! documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + "!
"!
- "! **Note:** Autolearning is a beta feature. - begin of T_MSSG_OUTPUT_DEBUG_AUTO_LEARN, - "! Whether autolearning was in preview mode when the message was processed. Preview - "! mode means that autolearning is enabled, but the autolearned model is not being - "! applied. - PREVIEW type BOOLEAN, - "! Detailed information about how an autolearned model affected the response. - DISAMBIGUATION type T_MSSG_OTPT_DBG_AT_LEARN_MODEL, - "! Detailed information about how an autolearned model affected the response. - ALTERNATE_RESPONSES type T_MSSG_OTPT_DBG_AT_LEARN_MODEL, - end of T_MSSG_OUTPUT_DEBUG_AUTO_LEARN. + "! **Note:** You must specify either **basic** or **bearer**, but not both. + begin of T_SRCH_STTNGS_DSCVRY_ATHNTCTN, + "! The HTTP basic authentication credentials for Watson Discovery. Specify your + "! Watson Discovery API key in the format `apikey:{apikey}`. + BASIC type STRING, + "! The authentication bearer token for Watson Discovery. + BEARER type STRING, + end of T_SRCH_STTNGS_DSCVRY_ATHNTCTN. types: "!

- "! An object containing segments of text from search results

- "! with query-matching text highlighted using HTML `<em>` tags. - begin of T_SEARCH_RESULT_HIGHLIGHT, - "! An array of strings containing segments taken from body text in the search - "! results, with query-matching substrings highlighted. - BODY type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! An array of strings containing segments taken from title text in the search - "! results, with query-matching substrings highlighted. - TITLE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! An array of strings containing segments taken from URLs in the search results, - "! with query-matching substrings highlighted. - URL type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_SEARCH_RESULT_HIGHLIGHT. + "! Configuration settings for the Watson Discovery service

+ "! instance used by the search integration. + begin of T_SEARCH_SETTINGS_DISCOVERY, + "! The ID for the Watson Discovery service instance. + INSTANCE_ID type STRING, + "! The ID for the Watson Discovery project. + PROJECT_ID type STRING, + "! The URL for the Watson Discovery service instance. + URL type STRING, + "! The maximum number of primary results to include in the response. + MAX_PRIMARY_RESULTS type INTEGER, + "! The maximum total number of primary and additional results to include in the + "! response. + MAX_TOTAL_RESULTS type INTEGER, + "! The minimum confidence threshold for included results. Any results with a + "! confidence below this threshold will be discarded. + CONFIDENCE_THRESHOLD type DOUBLE, + "! Whether to include the most relevant passages of text in the **highlight** + "! property of each result. + HIGHLIGHT type BOOLEAN, + "! Whether to use the answer finding feature to emphasize answers within + "! highlighted passages. This property is ignored if **highlight**=`false`.
+ "!
+ "! **Notes:**
+ "! - Answer finding is available only if the search skill is connected to a + "! Discovery v2 service instance.
+ "! - Answer finding is not supported on IBM Cloud Pak for Data. + FIND_ANSWERS type BOOLEAN, + "! Authentication information for the Watson Discovery service. For more + "! information, see the [Watson Discovery + "! documentation](https://cloud.ibm.com/apidocs/discovery-data#authentication). + "!
+ "!
+ "! **Note:** You must specify either **basic** or **bearer**, but not both. + AUTHENTICATION type T_SRCH_STTNGS_DSCVRY_ATHNTCTN, + end of T_SEARCH_SETTINGS_DISCOVERY. types: "!

- "! An object that describes a response with response type

- "! `suggestion`. - begin of T_RT_RESP_GNRC_RT_RESP_TYP_SG1, - "! The type of response returned by the dialog node. The specified response type - "! must be supported by the client application or channel. - RESPONSE_TYPE type STRING, - "! The title or introductory text to show before the response. - TITLE type STRING, - "! An array of objects describing the possible matching dialog nodes from which the - "! user can choose. - SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, - end of T_RT_RESP_GNRC_RT_RESP_TYP_SG1. + "! An object describing the search skill configuration.

+ begin of T_SEARCH_SETTINGS, + "! Configuration settings for the Watson Discovery service instance used by the + "! search integration. + DISCOVERY type T_SEARCH_SETTINGS_DISCOVERY, + "! The messages included with responses from the search integration. + MESSAGES type T_SEARCH_SETTINGS_MESSAGES, + "! The mapping between fields in the Watson Discovery collection and properties in + "! the search response. + SCHEMA_MAPPING type T_SRCH_SETTINGS_SCHEMA_MAPPING, + end of T_SEARCH_SETTINGS. types: - "! No documentation available. - begin of T_ERROR_DETAIL, - "! Description of a specific constraint violation. - MESSAGE type STRING, - "! The location of the constraint violation. + "!

+ "! A warning describing an error in the search skill

+ "! configuration. + begin of T_SEARCH_SKILL_WARNING, + "! The error code. + CODE type STRING, + "! The location of the error in the search skill configuration object. PATH type STRING, - end of T_ERROR_DETAIL. + "! The error message. + MESSAGE type STRING, + end of T_SEARCH_SKILL_WARNING. types: "! No documentation available. - begin of T_ERROR_RESPONSE, - "! General description of an error. - ERROR type STRING, - "! Collection of specific constraint violations associated with the error. - ERRORS type STANDARD TABLE OF T_ERROR_DETAIL WITH NON-UNIQUE DEFAULT KEY, - "! HTTP status code for the error response. - CODE type INTEGER, - end of T_ERROR_RESPONSE. + begin of T_SKILL_IMPORT, + "! The name of the skill. This string cannot contain carriage return, newline, or + "! tab characters. + NAME type STRING, + "! The description of the skill. This string cannot contain carriage return, + "! newline, or tab characters. + DESCRIPTION type STRING, + "! An object containing the conversational content of an action or dialog skill. + WORKSPACE type JSONOBJECT, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! 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. + STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! Included only if **status**=`Failed`. + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, + "! The description of the failed asynchronous operation. Included only if + "! **status**=`Failed`. + STATUS_DESCRIPTION type STRING, + "! For internal use only. + DIALOG_SETTINGS type JSONOBJECT, + "! The unique identifier of the assistant the skill is associated with. + ASSISTANT_ID type STRING, + "! The unique identifier of the workspace that contains the skill content. Included + "! only for action and dialog skills. + WORKSPACE_ID type STRING, + "! The unique identifier of the environment where the skill is defined. For action + "! and dialog skills, this is always the draft environment. + ENVIRONMENT_ID type STRING, + "! Whether the skill is structurally valid. + VALID type BOOLEAN, + "! The name that will be given to the next snapshot that is created for the skill. + "! A snapshot of each versionable skill is saved for each new release of an + "! assistant. + NEXT_SNAPSHOT_VERSION type STRING, + "! An object describing the search skill configuration. + SEARCH_SETTINGS type T_SEARCH_SETTINGS, + "! An array of warnings describing errors with the search skill configuration. + "! Included only for search skills. + WARNINGS type STANDARD TABLE OF T_SEARCH_SKILL_WARNING WITH NON-UNIQUE DEFAULT KEY, + "! The language of the skill. + LANGUAGE type STRING, + "! The type of skill. + TYPE type STRING, + end of T_SKILL_IMPORT. types: "!

- "! An object containing search result metadata from the

- "! Discovery service. - begin of T_SEARCH_RESULT_METADATA, - "! The confidence score for the given result. For more information about how the - "! confidence is calculated, see the Discovery service - "! [documentation](../discovery#query-your-collection). - CONFIDENCE type DOUBLE, - "! An unbounded measure of the relevance of a particular result, dependent on the - "! query and matching document. A higher score indicates a greater match to the - "! query parameters. - SCORE type DOUBLE, - end of T_SEARCH_RESULT_METADATA. + "! Status information about the skills for the assistant.

+ "! Included in responses only if **status**=`Available`. + begin of T_ASSISTANT_STATE, + "! Whether the action skill is disabled in the draft environment. + ACTION_DISABLED type BOOLEAN, + "! Whether the dialog skill is disabled in the draft environment. + DIALOG_DISABLED type BOOLEAN, + end of T_ASSISTANT_STATE. types: "! No documentation available. - begin of T_SEARCH_RESULT, - "! The unique identifier of the document in the Discovery service collection.
- "!
- "! This property is included in responses from search skills, which are available - "! only to Plus or Premium plan users. - ID type STRING, - "! An object containing search result metadata from the Discovery service. - RESULT_METADATA type T_SEARCH_RESULT_METADATA, - "! A description of the search result. This is taken from an abstract, summary, or - "! highlight field in the Discovery service response, as specified in the search - "! skill configuration. - BODY type STRING, - "! The title of the search result. This is taken from a title or name field in the - "! Discovery service response, as specified in the search skill configuration. + begin of T_SKILLS_IMPORT, + "! The assistant ID of the assistant. + ASSISTANT_ID type STRING, + "! 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. + STATUS type STRING, + "! The description of the failed asynchronous operation. Included only if + "! **status**=`Failed`. + STATUS_DESCRIPTION type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! Included only if **status**=`Failed`. + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects describing the skills for the assistant. Included in + "! responses only if **status**=`Available`. + ASSISTANT_SKILLS type STANDARD TABLE OF T_SKILL_IMPORT WITH NON-UNIQUE DEFAULT KEY, + "! Status information about the skills for the assistant. Included in responses + "! only if **status**=`Available`. + ASSISTANT_STATE type T_ASSISTANT_STATE, + end of T_SKILLS_IMPORT. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_3, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! Whether the step collects a customer response. + HAS_QUESTION type BOOLEAN, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_3. + types: + "! No documentation available. + begin of T_SKILL, + "! The name of the skill. This string cannot contain carriage return, newline, or + "! tab characters. + NAME type STRING, + "! The description of the skill. This string cannot contain carriage return, + "! newline, or tab characters. + DESCRIPTION type STRING, + "! An object containing the conversational content of an action or dialog skill. + WORKSPACE type JSONOBJECT, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! 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. + STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! Included only if **status**=`Failed`. + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, + "! The description of the failed asynchronous operation. Included only if + "! **status**=`Failed`. + STATUS_DESCRIPTION type STRING, + "! For internal use only. + DIALOG_SETTINGS type JSONOBJECT, + "! The unique identifier of the assistant the skill is associated with. + ASSISTANT_ID type STRING, + "! The unique identifier of the workspace that contains the skill content. Included + "! only for action and dialog skills. + WORKSPACE_ID type STRING, + "! The unique identifier of the environment where the skill is defined. For action + "! and dialog skills, this is always the draft environment. + ENVIRONMENT_ID type STRING, + "! Whether the skill is structurally valid. + VALID type BOOLEAN, + "! The name that will be given to the next snapshot that is created for the skill. + "! A snapshot of each versionable skill is saved for each new release of an + "! assistant. + NEXT_SNAPSHOT_VERSION type STRING, + "! An object describing the search skill configuration. + SEARCH_SETTINGS type T_SEARCH_SETTINGS, + "! An array of warnings describing errors with the search skill configuration. + "! Included only for search skills. + WARNINGS type STANDARD TABLE OF T_SEARCH_SKILL_WARNING WITH NON-UNIQUE DEFAULT KEY, + "! The language of the skill. + LANGUAGE type STRING, + "! The type of skill. + TYPE type STRING, + end of T_SKILL. + types: + "!

+ "! The search skill orchestration settings for the environment.

+ begin of T_BASE_ENV_ORCHESTRATION, + "! Whether assistants deployed to the environment fall back to a search skill when + "! responding to messages that do not match any intent. If no search skill is + "! configured for the assistant, this property is ignored. + SEARCH_SKILL_FALLBACK type BOOLEAN, + end of T_BASE_ENV_ORCHESTRATION. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_VD, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the video. + SOURCE type STRING, + "! The title or introductory text to show before the response. TITLE type STRING, - "! The URL of the original data object in its native data source. - URL type STRING, - "! An object containing segments of text from search results with query-matching - "! text highlighted using HTML `<em>` tags. - HIGHLIGHT type T_SEARCH_RESULT_HIGHLIGHT, - end of T_SEARCH_RESULT. + "! The description to show with the the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the video cannot be seen. + ALT_TEXT type STRING, + end of T_RT_RESP_GNRC_RT_RESP_TYP_VD. types: "!

- "! Optional properties that control how the assistant responds.

- begin of T_MESSAGE_INPUT_OPT_STATELESS, - "! Whether to restart dialog processing at the root of the dialog, regardless of - "! any previously visited nodes. **Note:** This does not affect `turn_count` or - "! any other context variables. - RESTART type BOOLEAN, - "! Whether to return more than one intent. Set to `true` to return all matching - "! intents. - ALTERNATE_INTENTS type BOOLEAN, - "! Spelling correction options for the message. Any options specified on an - "! individual message override the settings configured for the skill. - SPELLING type T_MESSAGE_INPUT_OPT_SPELLING, - "! Whether to return additional diagnostic information. Set to `true` to return - "! additional information in the `output.debug` property. - DEBUG type BOOLEAN, - end of T_MESSAGE_INPUT_OPT_STATELESS. + "! Information for transferring to the web chat integration.

+ begin of T_CHANNEL_TRANSFER_TARGET_CHAT, + "! The URL of the target web chat. + URL type STRING, + end of T_CHANNEL_TRANSFER_TARGET_CHAT. types: "!

- "! An input object that includes the input text.

- begin of T_BASE_MESSAGE_INPUT, - "! The type of user input. Currently, only text input is supported. - MESSAGE_TYPE type STRING, - "! The text of the user input. This string cannot contain carriage return, newline, - "! or tab characters. - TEXT type STRING, - "! Intents to use when evaluating the user input. Include intents from the previous - "! response to continue using those intents rather than trying to recognize - "! intents in the new input. - INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY, - "! Entities to use when evaluating the message. Include entities from the previous - "! response to continue using those entities rather than detecting entities in the - "! new input. - ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY, - "! For internal use only. - SUGGESTION_ID type STRING, - end of T_BASE_MESSAGE_INPUT. + "! An object specifying target channels available for the

+ "! transfer. Each property of this object represents an available transfer target. + "! Currently, the only supported property is **chat**, representing the web chat + "! integration. + begin of T_CHANNEL_TRANSFER_TARGET, + "! Information for transferring to the web chat integration. + CHAT type T_CHANNEL_TRANSFER_TARGET_CHAT, + end of T_CHANNEL_TRANSFER_TARGET. types: "!

- "! An object that describes a response with response type

- "! `text`. + "! Information used by an integration to transfer the

+ "! conversation to a different channel. + begin of T_CHANNEL_TRANSFER_INFO, + "! An object specifying target channels available for the transfer. Each property + "! of this object represents an available transfer target. Currently, the only + "! supported property is **chat**, representing the web chat integration. + TARGET type T_CHANNEL_TRANSFER_TARGET, + end of T_CHANNEL_TRANSFER_INFO. + types: + "! No documentation available. + begin of T_RT_RESP_TYPE_CHANNEL_TRANS, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The `channel_transfer` response type is not supported on IBM Cloud + "! Pak for Data. + RESPONSE_TYPE type STRING, + "! The message to display to the user when initiating a channel transfer. + MESSAGE_TO_USER type STRING, + "! Information used by an integration to transfer the conversation to a different + "! channel. + TRANSFER_INFO type T_CHANNEL_TRANSFER_INFO, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_TYPE_CHANNEL_TRANS. + types: + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_TEXT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, "! The text of the response. TEXT type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_TEXT. types: "! No documentation available. @@ -547,13 +832,21 @@ public section. "! The type of action to invoke. TYPE type STRING, "! A map of key/value pairs to be provided to the action. - PARAMETERS type MAP, + PARAMETERS type JSONOBJECT, "! The location in the dialog context where the result of the action is stored. RESULT_VARIABLE type STRING, "! The name of the context variable that the client application will use to pass in "! credentials for the action. CREDENTIALS type STRING, end of T_DIALOG_NODE_ACTION. + types: + "!

+ "! An object describing the release that is currently deployed

+ "! in the environment. + begin of T_BASE_ENV_RELEASE_REFERENCE, + "! The name of the deployed release. + RELEASE type STRING, + end of T_BASE_ENV_RELEASE_REFERENCE. types: "! No documentation available. begin of T_RT_ENTTY_INTRPRTTN_SYS_TIME, @@ -597,83 +890,225 @@ public section. "! A recognized time zone mentioned as part of a time value (for example, `EST`). TIMEZONE type STRING, end of T_RT_ENTTY_INTRPRTTN_SYS_TIME. + types: + "! No documentation available. + begin of T_RELEASE_SKILL, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! The type of the skill. + TYPE type STRING, + "! The name of the skill snapshot that is saved as part of the release (for + "! example, `draft` or `1`). + SNAPSHOT type STRING, + end of T_RELEASE_SKILL. types: "!

- "! Built-in system properties that apply to all skills used by

- "! the assistant. - begin of T_MSSG_CONTEXT_GLOBAL_SYSTEM, - "! The user time zone. The assistant uses the time zone to correctly resolve - "! relative time references. - TIMEZONE type STRING, - "! A string value that identifies the user who is interacting with the assistant. - "! The client must provide a unique identifier for each individual end user who - "! accesses the application. For Plus and Premium plans, this user ID is used to - "! identify unique users for billing purposes. This string cannot contain carriage - "! return, newline, or tab characters. - USER_ID type STRING, - "! A counter that is automatically incremented with each turn of the conversation. - "! A value of 1 indicates that this is the the first turn of a new conversation, - "! which can affect the behavior of some skills (for example, triggering the start - "! node of a dialog). - TURN_COUNT type INTEGER, - "! 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. - LOCALE type 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 + "! An object identifying the versionable content objects (such

+ "! as skill snapshots) that are included in the release. + begin of T_RELEASE_CONTENT, + "! The skill snapshots that are included in the release. + SKILLS type STANDARD TABLE OF T_RELEASE_SKILL WITH NON-UNIQUE DEFAULT KEY, + end of T_RELEASE_CONTENT. + types: + "! No documentation available. + begin of T_ENVIRONMENT_REFERENCE, + "! The name of the environment. + NAME type STRING, + "! The unique identifier of the environment. + ENVIRONMENT_ID type STRING, + "! The type of the environment. All environments other than the draft and live + "! environments have the type `staging`. + ENVIRONMENT type STRING, + end of T_ENVIRONMENT_REFERENCE. + types: + "! No documentation available. + begin of T_RELEASE, + "! The name of the release. The name is the version number (an integer), returned + "! as a string. + RELEASE type STRING, + "! The description of the release. + DESCRIPTION type STRING, + "! An array of objects describing the environments where this release has been + "! deployed. + ENVIRONMENT_REFERENCES type STANDARD TABLE OF T_ENVIRONMENT_REFERENCE WITH NON-UNIQUE DEFAULT KEY, + "! An object identifying the versionable content objects (such as skill snapshots) + "! that are included in the release. + CONTENT type T_RELEASE_CONTENT, + "! 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. + STATUS type STRING, + "! The timestamp for creation of the object. + CREATED type DATETIME, + "! The timestamp for the most recent update to the object. + UPDATED type DATETIME, + end of T_RELEASE. + types: + "! No documentation available. + begin of T_INTEGRATION_REFERENCE, + "! The integration ID of the integration. + INTEGRATION_ID type STRING, + "! The type of the integration. + TYPE type STRING, + end of T_INTEGRATION_REFERENCE. + types: + "! No documentation available. + begin of T_ENVIRONMENT_SKILL, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! The type of the skill. + TYPE 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. + DISABLED type BOOLEAN, + "! The name of the skill snapshot that is deployed to the environment (for example, + "! `draft` or `1`). + SNAPSHOT type STRING, + "! The type of skill identified by the skill reference. The possible values are + "! `main skill` (for a dialog skill), `actions skill`, and `search skill`. + SKILL_REFERENCE type STRING, + end of T_ENVIRONMENT_SKILL. + types: + "! No documentation available. + begin of T_UPDATE_ENVIRONMENT, + "! The name of the environment. + NAME type STRING, + "! The description of the environment. + DESCRIPTION type STRING, + "! The assistant ID of the assistant the environment is associated with. + ASSISTANT_ID type STRING, + "! The environment ID of the environment. + ENVIRONMENT_ID type STRING, + "! The type of the environment. All environments other than the `draft` and `live` + "! environments have the type `staging`. + ENVIRONMENT type STRING, + "! An object describing the release that is currently deployed in the environment. + RELEASE_REFERENCE type T_BASE_ENV_RELEASE_REFERENCE, + "! The search skill orchestration settings for the environment. + ORCHESTRATION type T_BASE_ENV_ORCHESTRATION, + "! The session inactivity timeout setting for the environment (in seconds). + SESSION_TIMEOUT type INTEGER, + "! An array of objects describing the integrations that exist in the environment. + INTEGRATION_REFERENCES type STANDARD TABLE OF T_INTEGRATION_REFERENCE WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects identifying the skills (such as action and dialog) that + "! exist in the environment. + SKILL_REFERENCES type STANDARD TABLE OF T_ENVIRONMENT_SKILL WITH NON-UNIQUE DEFAULT KEY, + "! The timestamp for creation of the object. + CREATED type DATETIME, + "! The timestamp for the most recent update to the object. + UPDATED type DATETIME, + end of T_UPDATE_ENVIRONMENT. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_2, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The reason the action finished processing. + REASON type STRING, + "! The state of all action variables at the time the action finished. + ACTION_VARIABLES type JSONOBJECT, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_2. + types: + "!

+ "! Autolearning options for the message. For more information

+ "! about autolearning, see the + "! [documentation](/docs/watson-assistant?topic=watson-assistant-autolearn).
+ "!
+ "! **Note:** Autolearning is a beta feature. + begin of T_MESSAGE_INPUT_OPT_AUTO_LEARN, + "! Whether the message should be used for autolearning. Specify `false` to exclude + "! a message from autolearning (for example, if you are running tests on a + "! production assistant).
+ "!
+ "! If specified, this option overrides the **Autolearn in live environment** + "! setting for the assistant. (This option does not apply to environments other + "! than the live environment.). + LEARN type BOOLEAN, + "! Whether the autolearned model should be applied when responding to the message. + "! You can use this option to compare responses with and without autolearning. + "! This option can be used for messages sent to any environment. + APPLY type BOOLEAN, + end of T_MESSAGE_INPUT_OPT_AUTO_LEARN. + types: + "!

+ "! Built-in system properties that apply to all skills used by

+ "! the assistant. + begin of T_MSSG_CONTEXT_GLOBAL_SYSTEM, + "! The user time zone. The assistant uses the time zone to correctly resolve + "! relative time references. + TIMEZONE type STRING, + "! A string value that identifies the user who is interacting with the assistant. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.global.session_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property at the root of + "! the message body. If **user_id** is specified in both locations in a message + "! request, the value specified at the root is used. + USER_ID type STRING, + "! A counter that is automatically incremented with each turn of the conversation. + "! A value of 1 indicates that this is the the first turn of a new conversation, + "! which can affect the behavior of some skills (for example, triggering the start + "! node of a dialog). + TURN_COUNT type INTEGER, + "! 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. + LOCALE type 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 news articles.
"!
"! This value must be a UTC time value formatted according to ISO 8601 (for - "! example, `2019-06-26T12:00:00Z` for noon on 26 June 2019.
+ "! example, `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021).
"!
"! This property is included only if the new system entities are enabled for the "! skill. REFERENCE_TIME type STRING, + "! The time at which the session started. With the stateful `message` method, the + "! start time is always present, and is set by the service based on the time the + "! session was created. With the stateless `message` method, the start time is set + "! by the service in the response to the first message, and should be returned as + "! part of the context with each subsequent message in the session.
+ "!
+ "! This value is a UTC time value formatted according to ISO 8601 (for example, + "! `2021-06-26T12:00:00Z` for noon UTC on 26 June 2021). + SESSION_START_TIME type STRING, + "! An encoded string that represents the configuration state of the assistant at + "! the beginning of the conversation. If you are using the stateless `message` + "! method, save this value and then send it in the context of the subsequent + "! message request to avoid disruptions if there are configuration changes during + "! the conversation (such as a change to a skill the assistant uses). + STATE type STRING, + "! For internal use only. + SKIP_USER_INPUT type BOOLEAN, end of T_MSSG_CONTEXT_GLOBAL_SYSTEM. types: "!

"! Session context data that is shared by all skills used by

- "! the Assistant. + "! the assistant. begin of T_MESSAGE_CONTEXT_GLOBAL, "! Built-in system properties that apply to all skills used by the assistant. SYSTEM type T_MSSG_CONTEXT_GLOBAL_SYSTEM, "! The session ID. SESSION_ID type STRING, end of T_MESSAGE_CONTEXT_GLOBAL. - types: - "!

- "! Autolearning options for the message.


- "!
- "! **Note:** Autolearning is a beta feature. - begin of T_MESSAGE_INPUT_OPT_AUTO_LEARN, - "! Whether the message should be used for autolearning. Specify `false` to exclude - "! a message from autolearning (for example, if you are running tests on a - "! production assistant). If autolearning is not enabled for the dialog skill, - "! this option is ignored. - LEARN type BOOLEAN, - "! Whether the autolearned model should be applied when responding to the message. - "! You can use this option to compare responses with and without autolearning. If - "! autolearning is not enabled for the dialog skill, this option is ignored. - APPLY type BOOLEAN, - end of T_MESSAGE_INPUT_OPT_AUTO_LEARN. - types: - "! No documentation available. - begin of T_MESSAGE_CONTEXT, - "! Session context data that is shared by all skills used by the Assistant. - GLOBAL type T_MESSAGE_CONTEXT_GLOBAL, - "! Information specific to particular skills used by the assistant.
- "!
- "! **Note:** Currently, only a single child property is supported, containing - "! variables that apply to the dialog skill used by the assistant. - SKILLS type MAP, - end of T_MESSAGE_CONTEXT. types: "!

"! System context data used by the skill.

@@ -687,102 +1122,136 @@ public section. end of T_MESSAGE_CONTEXT_SKILL_SYSTEM. types: "!

- "! Session context data that is shared by all skills used by

- "! the Assistant. - begin of T_MSSG_CNTXT_GLOBAL_STATELESS, - "! Built-in system properties that apply to all skills used by the assistant. - SYSTEM type T_MSSG_CONTEXT_GLOBAL_SYSTEM, - "! The unique identifier of the session. - SESSION_ID type STRING, - end of T_MSSG_CNTXT_GLOBAL_STATELESS. - types: - "! No documentation available. - begin of T_MESSAGE_CONTEXT_STATELESS, - "! Session context data that is shared by all skills used by the Assistant. - GLOBAL type T_MSSG_CNTXT_GLOBAL_STATELESS, - "! Information specific to particular skills used by the assistant.
- "!
- "! **Note:** Currently, only a single child property is supported, containing - "! variables that apply to the dialog skill used by the assistant. - SKILLS type MAP, - end of T_MESSAGE_CONTEXT_STATELESS. + "! Context variables that are used by the action skill.

+ begin of T_MESSAGE_CONTEXT_SKILL_ACTION, + "! An object containing any arbitrary variables that can be read and written by a + "! particular skill. + USER_DEFINED type JSONOBJECT, + "! System context data used by the skill. + SYSTEM type T_MESSAGE_CONTEXT_SKILL_SYSTEM, + "! An object containing action variables. Action variables can be accessed only by + "! steps in the same action, and do not persist after the action ends. + ACTION_VARIABLES type JSONOBJECT, + "! An object containing skill variables. (In the Watson Assistant user interface, + "! skill variables are called _session variables_.) Skill variables can be + "! accessed by any action and persist for the duration of the session. + SKILL_VARIABLES type JSONOBJECT, + end of T_MESSAGE_CONTEXT_SKILL_ACTION. types: "!

- "! An input object that includes the input text.

- begin of T_MESSAGE_INPUT_STATELESS, - "! The type of user input. Currently, only text input is supported. - MESSAGE_TYPE type STRING, - "! The text of the user input. This string cannot contain carriage return, newline, - "! or tab characters. - TEXT type STRING, - "! Intents to use when evaluating the user input. Include intents from the previous - "! response to continue using those intents rather than trying to recognize - "! intents in the new input. - INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY, - "! Entities to use when evaluating the message. Include entities from the previous - "! response to continue using those entities rather than detecting entities in the - "! new input. - ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY, - "! For internal use only. - SUGGESTION_ID type STRING, - "! Optional properties that control how the assistant responds. - OPTIONS type T_MESSAGE_INPUT_OPT_STATELESS, - end of T_MESSAGE_INPUT_STATELESS. + "! Context variables that are used by the dialog skill.

+ begin of T_MESSAGE_CONTEXT_SKILL_DIALOG, + "! An object containing any arbitrary variables that can be read and written by a + "! particular skill. + USER_DEFINED type JSONOBJECT, + "! System context data used by the skill. + SYSTEM type T_MESSAGE_CONTEXT_SKILL_SYSTEM, + end of T_MESSAGE_CONTEXT_SKILL_DIALOG. types: "!

- "! A stateless message request formatted for the Watson

- "! Assistant service. - begin of T_MESSAGE_REQUEST_STATELESS, - "! An input object that includes the input text. - INPUT type T_MESSAGE_INPUT_STATELESS, - "! Context data for the conversation. You can use this property to set or modify - "! context variables, which can also be accessed by dialog nodes. The context is - "! not stored by the assistant. To maintain session state, include the context - "! from the previous response.
- "!
- "! **Note:** The total size of the context data for a stateless session cannot - "! exceed 250KB. - CONTEXT type T_MESSAGE_CONTEXT_STATELESS, - end of T_MESSAGE_REQUEST_STATELESS. + "! Context data specific to particular skills used by the

+ "! assistant. + begin of T_MESSAGE_CONTEXT_SKILLS, + "! Context variables that are used by the dialog skill. + MAIN_SKILL type T_MESSAGE_CONTEXT_SKILL_DIALOG, + "! Context variables that are used by the action skill. + ACTIONS_SKILL type T_MESSAGE_CONTEXT_SKILL_ACTION, + end of T_MESSAGE_CONTEXT_SKILLS. types: - "!

- "! An object that describes a response with response type

- "! `image`. + "! No documentation available. + begin of T_MESSAGE_CONTEXT, + "! Session context data that is shared by all skills used by the assistant. + GLOBAL type T_MESSAGE_CONTEXT_GLOBAL, + "! Context data specific to particular skills used by the assistant. + SKILLS type T_MESSAGE_CONTEXT_SKILLS, + "! An object containing context data that is specific to particular integrations. + "! For more information, see the + "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-int + "! egrations). + INTEGRATIONS type JSONOBJECT, + end of T_MESSAGE_CONTEXT. + types: + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_IMG, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The URL of the image. + "! The `https:` URL of the image. SOURCE type STRING, "! The title to show before the response. TITLE type STRING, "! The description to show with the the response. DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! Descriptive text that can be used for screen readers or other situations where + "! the image cannot be seen. + ALT_TEXT type STRING, end of T_RT_RESP_GNRC_RT_RESP_TYP_IMG. + types: + "! No documentation available. + begin of T_TURN_EVENT_NODE_SOURCE, + "! The type of turn event. + TYPE type STRING, + "! A dialog node that was visited during processing of the input message. + DIALOG_NODE type STRING, + "! The title of the dialog node. + TITLE type STRING, + "! The condition that triggered the dialog node. + CONDITION type STRING, + end of T_TURN_EVENT_NODE_SOURCE. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_8, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_NODE_SOURCE, + "! The reason the dialog node was visited. + REASON type STRING, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_8. types: "!

- "! An object that describes a response with response type

- "! `suggestion`. - begin of T_RT_RESPONSE_TYPE_SUGGESTION, + "! Session context data that is shared by all skills used by

+ "! the assistant. + begin of T_MSSG_CNTXT_GLOBAL_STATELESS, + "! Built-in system properties that apply to all skills used by the assistant. + SYSTEM type T_MSSG_CONTEXT_GLOBAL_SYSTEM, + "! The unique identifier of the session. + SESSION_ID type STRING, + end of T_MSSG_CNTXT_GLOBAL_STATELESS. + types: + "! No documentation available. + begin of T_MESSAGE_CONTEXT_STATELESS, + "! Session context data that is shared by all skills used by the assistant. + GLOBAL type T_MSSG_CNTXT_GLOBAL_STATELESS, + "! Context data specific to particular skills used by the assistant. + SKILLS type T_MESSAGE_CONTEXT_SKILLS, + "! An object containing context data that is specific to particular integrations. + "! For more information, see the + "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-int + "! egrations). + INTEGRATIONS type JSONOBJECT, + end of T_MESSAGE_CONTEXT_STATELESS. + types: + "! No documentation available. + begin of T_RT_RESP_TYPE_USER_DEFINED, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The title or introductory text to show before the response. - TITLE type STRING, - "! An array of objects describing the possible matching dialog nodes from which the - "! user can choose. - SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, - end of T_RT_RESPONSE_TYPE_SUGGESTION. - types: - "!

- "! The user input utterance to classify.

- begin of T_BULK_CLASSIFY_UTTERANCE, - "! The text of the input utterance. - TEXT type STRING, - end of T_BULK_CLASSIFY_UTTERANCE. + "! An object containing any properties for the user-defined response type. + USER_DEFINED type JSONOBJECT, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_TYPE_USER_DEFINED. types: "!

- "! The pagination data for the returned objects.

+ "! The pagination data for the returned objects. For more

+ "! information about using pagination, see [Pagination](#pagination). begin of T_LOG_PAGINATION, "! The URL that will return the next page of results, if any. NEXT_URL type STRING, @@ -791,17 +1260,6 @@ public section. "! A token identifying the next page of results. NEXT_CURSOR type STRING, end of T_LOG_PAGINATION. - types: - "!

- "! An object that describes a response with response type

- "! `text`. - begin of T_RT_RESP_GNRC_RT_RESP_TYP_TXT, - "! The type of response returned by the dialog node. The specified response type - "! must be supported by the client application or channel. - RESPONSE_TYPE type STRING, - "! The text of the response. - TEXT type STRING, - end of T_RT_RESP_GNRC_RT_RESP_TYP_TXT. types: "! No documentation available. begin of T_AGENT_AVAILABILITY_MESSAGE, @@ -817,9 +1275,7 @@ public section. TARGET type MAP, end of T_DIA_ND_OTPT_CNNCT_T_AGNT_TR1. types: - "!

- "! An object that describes a response with response type

- "! `connect_to_agent`. + "! No documentation available. begin of T_RT_RESP_TYP_CONNECT_TO_AGENT, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -840,10 +1296,11 @@ public section. "! property of the relevant node or the **topic** property of the dialog node "! response. TOPIC type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_TYP_CONNECT_TO_AGENT. - types: - "! No documentation available. - T_RUNTIME_RESPONSE_GENERIC type JSONOBJECT. types: "!

"! Properties describing any spelling corrections in the user

@@ -860,6 +1317,9 @@ public section. "! spelling correction is enabled and autocorrection is disabled. SUGGESTED_TEXT type STRING, end of T_MESSAGE_OUTPUT_SPELLING. + types: + "! No documentation available. + T_RUNTIME_RESPONSE_GENERIC type JSONOBJECT. types: "!

"! Assistant output to be rendered or processed by the client.

@@ -880,11 +1340,60 @@ public section. "! An object containing any custom properties included in the response. This object "! includes any arbitrary properties defined in the dialog JSON editor as part of "! the dialog node output. - USER_DEFINED type MAP, + USER_DEFINED type JSONOBJECT, "! Properties describing any spelling corrections in the user input that was "! received. SPELLING type T_MESSAGE_OUTPUT_SPELLING, end of T_MESSAGE_OUTPUT. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_CH1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The `channel_transfer` response type is not supported on IBM Cloud + "! Pak for Data. + RESPONSE_TYPE type STRING, + "! The message to display to the user when initiating a channel transfer. + MESSAGE_TO_USER type STRING, + "! Information used by an integration to transfer the conversation to a different + "! channel. + TRANSFER_INFO type T_CHANNEL_TRANSFER_INFO, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_CH1. + types: + "!

+ "! An object defining the message input to be sent to the

+ "! assistant if the user selects the corresponding disambiguation option.
+ "!
+ "! **Note:** This entire message input object must be included in the request body + "! of the next message sent to the assistant. Do not modify or remove any of the + "! included properties. + begin of T_DIALOG_SUGGESTION_VALUE, + "! An input object that includes the input text. + INPUT type T_MESSAGE_INPUT, + end of T_DIALOG_SUGGESTION_VALUE. + types: + "! No documentation available. + begin of T_DIALOG_SUGGESTION, + "! The user-facing label for the suggestion. This label is taken from the **title** + "! or **user_label** property of the corresponding dialog node, depending on the + "! disambiguation options. + LABEL type STRING, + "! An object defining the message input to be sent to the assistant if the user + "! selects the corresponding disambiguation option.
+ "!
+ "! **Note:** This entire message input object must be included in the request body + "! of the next message sent to the assistant. Do not modify or remove any of the + "! included properties. + VALUE type T_DIALOG_SUGGESTION_VALUE, + "! The dialog output that will be returned from the Watson Assistant service if the + "! user selects the corresponding option. + OUTPUT type JSONOBJECT, + end of T_DIALOG_SUGGESTION. types: "!

"! Optional properties that control how the assistant responds.

@@ -905,71 +1414,29 @@ public section. T_EMPTY_RESPONSE type JSONOBJECT. types: "! No documentation available. - begin of T_SESSION_RESPONSE, - "! The session ID. - SESSION_ID type STRING, - end of T_SESSION_RESPONSE. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_DT, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + end of T_RT_RESP_GNRC_RT_RESP_TYP_DT. types: "! No documentation available. - begin of T_RT_ENTTY_INTRPRTTN_SYS_DATE, - "! The calendar used to represent a recognized date (for example, `Gregorian`). - CALENDAR_TYPE type STRING, - "! A unique identifier used to associate a time and date. If the user input - "! contains a date and time that are mentioned together (for example, `Today at - "! 5`, the same **datetime_link** value is returned for both the `@sys-date` - "! and `@sys-time` entities). - DATETIME_LINK type STRING, - "! A locale-specific holiday name (such as `thanksgiving` or `christmas`). This - "! property is included when a `@sys-date` entity is recognized based on a - "! holiday name in the user input. - FESTIVAL type STRING, - "! The precision or duration of a time range specified by a recognized - "! `@sys-time` or `@sys-date` entity. - GRANULARITY type 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`). - RANGE_LINK type STRING, - "! The word in the user input that indicates that a `sys-date` or `sys-time` entity - "! is part of an implied range where only one date or time is specified (for - "! example, `since` or `until`). - RANGE_MODIFIER type STRING, - "! A recognized mention of a relative day, represented numerically as an offset - "! from the current date (for example, `-1` for `yesterday` or `10` for `in ten - "! days`). - RELATIVE_DAY type NUMBER, - "! A recognized mention of a relative month, represented numerically as an offset - "! from the current month (for example, `1` for `next month` or `-3` for `three - "! months ago`). - RELATIVE_MONTH type NUMBER, - "! A recognized mention of a relative week, represented numerically as an offset - "! from the current week (for example, `2` for `in two weeks` or `-1` for `last - "! week). - RELATIVE_WEEK type NUMBER, - "! A recognized mention of a relative date range for a weekend, represented - "! numerically as an offset from the current weekend (for example, `0` for `this - "! weekend` or `-1` for `last weekend`). - RELATIVE_WEEKEND type NUMBER, - "! A recognized mention of a relative year, represented numerically as an offset - "! from the current year (for example, `1` for `next year` or `-5` for `five years - "! ago`). - RELATIVE_YEAR type NUMBER, - "! A recognized mention of a specific date, represented numerically as the date - "! within the month (for example, `30` for `June 30`.). - SPECIFIC_DAY type NUMBER, - "! A recognized mention of a specific day of the week as a lowercase string (for - "! example, `monday`). - SPECIFIC_DAY_OF_WEEK type STRING, - "! A recognized mention of a specific month, represented numerically (for example, - "! `7` for `July`). - SPECIFIC_MONTH type NUMBER, - "! A recognized mention of a specific quarter, represented numerically (for - "! example, `3` for `the third quarter`). - SPECIFIC_QUARTER type NUMBER, - "! A recognized mention of a specific year (for example, `2016`). - SPECIFIC_YEAR type NUMBER, - end of T_RT_ENTTY_INTRPRTTN_SYS_DATE. + begin of T_TURN_EVENT_CALLOUT_CALLOUT, + "! The type of callout. Currently, the only supported value is + "! `integration_interaction` (for calls to extensions). + TYPE type STRING, + "! For internal use only. + INTERNAL type JSONOBJECT, + "! The name of the variable where the callout result is stored. + RESULT_VARIABLE type STRING, + end of T_TURN_EVENT_CALLOUT_CALLOUT. + types: + "!

+ "! The user input utterance to classify.

+ begin of T_BULK_CLASSIFY_UTTERANCE, + "! The text of the input utterance. + TEXT type STRING, + end of T_BULK_CLASSIFY_UTTERANCE. types: "! No documentation available. begin of T_BULK_CLASSIFY_OUTPUT, @@ -987,6 +1454,36 @@ public section. "! input utterances. OUTPUT type STANDARD TABLE OF T_BULK_CLASSIFY_OUTPUT WITH NON-UNIQUE DEFAULT KEY, end of T_BULK_CLASSIFY_RESPONSE. + types: + "! No documentation available. + begin of T_ENVIRONMENT, + "! The name of the environment. + NAME type STRING, + "! The description of the environment. + DESCRIPTION type STRING, + "! The assistant ID of the assistant the environment is associated with. + ASSISTANT_ID type STRING, + "! The environment ID of the environment. + ENVIRONMENT_ID type STRING, + "! The type of the environment. All environments other than the `draft` and `live` + "! environments have the type `staging`. + ENVIRONMENT type STRING, + "! An object describing the release that is currently deployed in the environment. + RELEASE_REFERENCE type T_BASE_ENV_RELEASE_REFERENCE, + "! The search skill orchestration settings for the environment. + ORCHESTRATION type T_BASE_ENV_ORCHESTRATION, + "! The session inactivity timeout setting for the environment (in seconds). + SESSION_TIMEOUT type INTEGER, + "! An array of objects describing the integrations that exist in the environment. + INTEGRATION_REFERENCES type STANDARD TABLE OF T_INTEGRATION_REFERENCE WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects identifying the skills (such as action and dialog) that + "! exist in the environment. + SKILL_REFERENCES type STANDARD TABLE OF T_ENVIRONMENT_SKILL WITH NON-UNIQUE DEFAULT KEY, + "! The timestamp for creation of the object. + CREATED type DATETIME, + "! The timestamp for the most recent update to the object. + UPDATED type DATETIME, + end of T_ENVIRONMENT. types: "! No documentation available. begin of T_BULK_CLASSIFY_INPUT, @@ -994,24 +1491,77 @@ public section. INPUT type STANDARD TABLE OF T_BULK_CLASSIFY_UTTERANCE WITH NON-UNIQUE DEFAULT KEY, end of T_BULK_CLASSIFY_INPUT. types: - "!

- "! An object that describes a response with response type

- "! `image`. - begin of T_RUNTIME_RESPONSE_TYPE_IMAGE, - "! The type of response returned by the dialog node. The specified response type - "! must be supported by the client application or channel. - RESPONSE_TYPE type STRING, - "! The URL of the image. - SOURCE type STRING, - "! The title to show before the response. - TITLE type STRING, - "! The description to show with the the response. + "! No documentation available. + begin of T_BASE_ENVIRONMENT, + "! The name of the environment. + NAME type STRING, + "! The description of the environment. DESCRIPTION type STRING, - end of T_RUNTIME_RESPONSE_TYPE_IMAGE. + "! The assistant ID of the assistant the environment is associated with. + ASSISTANT_ID type STRING, + "! The environment ID of the environment. + ENVIRONMENT_ID type STRING, + "! The type of the environment. All environments other than the `draft` and `live` + "! environments have the type `staging`. + ENVIRONMENT type STRING, + "! An object describing the release that is currently deployed in the environment. + RELEASE_REFERENCE type T_BASE_ENV_RELEASE_REFERENCE, + "! The search skill orchestration settings for the environment. + ORCHESTRATION type T_BASE_ENV_ORCHESTRATION, + "! The session inactivity timeout setting for the environment (in seconds). + SESSION_TIMEOUT type INTEGER, + "! An array of objects describing the integrations that exist in the environment. + INTEGRATION_REFERENCES type STANDARD TABLE OF T_INTEGRATION_REFERENCE WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects identifying the skills (such as action and dialog) that + "! exist in the environment. + SKILL_REFERENCES type STANDARD TABLE OF T_ENVIRONMENT_SKILL WITH NON-UNIQUE DEFAULT KEY, + "! The timestamp for creation of the object. + CREATED type DATETIME, + "! The timestamp for the most recent update to the object. + UPDATED type DATETIME, + end of T_BASE_ENVIRONMENT. types: "!

- "! An object that describes a response with response type

- "! `connect_to_agent`. + "! An object that identifies the dialog element that generated

+ "! the error message. + begin of T_LOG_MESSAGE_SOURCE_HANDLER, + "! A string that indicates the type of dialog element that generated the error + "! message. + TYPE type STRING, + "! The unique identifier of the action that generated the error message. + ACTION type STRING, + "! The unique identifier of the step that generated the error message. + STEP type STRING, + "! The unique identifier of the handler that generated the error message. + HANDLER type STRING, + end of T_LOG_MESSAGE_SOURCE_HANDLER. + types: + "! No documentation available. + begin of T_BASE_MESSAGE_CONTEXT_SKILL, + "! An object containing any arbitrary variables that can be read and written by a + "! particular skill. + USER_DEFINED type JSONOBJECT, + "! System context data used by the skill. + SYSTEM type T_MESSAGE_CONTEXT_SKILL_SYSTEM, + end of T_BASE_MESSAGE_CONTEXT_SKILL. + types: + "! No documentation available. + begin of T_TURN_EVENT_ACTION_FINISHED, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The reason the action finished processing. + REASON type STRING, + "! The state of all action variables at the time the action finished. + ACTION_VARIABLES type JSONOBJECT, + end of T_TURN_EVENT_ACTION_FINISHED. + types: + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_CN1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1032,6 +1582,10 @@ public section. "! property of the relevant node or the **topic** property of the dialog node "! response. TOPIC type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_CN1. types: "!

@@ -1046,53 +1600,93 @@ public section. "! **return_context**=`true` in the message request. Full context is always "! included in logs. CONTEXT type T_MESSAGE_CONTEXT, + "! A string value that identifies the user who is interacting with the assistant. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.global.session_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the global + "! system context. + USER_ID type STRING, end of T_MESSAGE_RESPONSE. types: - "!

- "! A stateful message request formatted for the Watson

- "! Assistant service. - begin of T_MESSAGE_REQUEST, - "! An input object that includes the input text. - INPUT type T_MESSAGE_INPUT, - "! Context data for the conversation. You can use this property to set or modify - "! context variables, which can also be accessed by dialog nodes. The context is - "! stored by the assistant on a per-session basis.
- "!
- "! **Note:** The total size of the context data stored for a stateful session - "! cannot exceed 100KB. - CONTEXT type T_MESSAGE_CONTEXT, - end of T_MESSAGE_REQUEST. + "! No documentation available. + begin of T_TURN_EVENT_CALLOUT_ERROR, + "! Any error message returned by a failed call to an external service. + MESSAGE type STRING, + end of T_TURN_EVENT_CALLOUT_ERROR. types: "! No documentation available. - begin of T_LOG, - "! A unique identifier for the logged event. - LOG_ID type STRING, - "! A stateful message request formatted for the Watson Assistant service. - REQUEST type T_MESSAGE_REQUEST, - "! A response from the Watson Assistant service. - RESPONSE type T_MESSAGE_RESPONSE, - "! Unique identifier of the assistant. - ASSISTANT_ID type STRING, - "! The ID of the session the message was part of. - SESSION_ID type STRING, - "! The unique identifier of the skill that responded to the message. + begin of T_TURN_EVENT_CALLOUT, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! No documentation available. + CALLOUT type T_TURN_EVENT_CALLOUT_CALLOUT, + "! No documentation available. + ERROR type T_TURN_EVENT_CALLOUT_ERROR, + end of T_TURN_EVENT_CALLOUT. + types: + "! No documentation available. + begin of T_ASSISTANT_SKILL, + "! The skill ID of the skill. SKILL_ID type STRING, - "! The name of the snapshot (dialog skill version) that responded to the message - "! (for example, `draft`). - SNAPSHOT type STRING, - "! The timestamp for receipt of the message. - REQUEST_TIMESTAMP type STRING, - "! The timestamp for the system response to the message. - RESPONSE_TIMESTAMP type STRING, - "! The language of the assistant to which the message request was made. + "! The type of the skill. + TYPE type STRING, + end of T_ASSISTANT_SKILL. + types: + "! No documentation available. + begin of T_ASSISTANT_DATA, + "! The unique identifier of the assistant. + ASSISTANT_ID type STRING, + "! The name of the assistant. This string cannot contain carriage return, newline, + "! or tab characters. + NAME type STRING, + "! The description of the assistant. This string cannot contain carriage return, + "! newline, or tab characters. + DESCRIPTION type STRING, + "! The language of the assistant. LANGUAGE type STRING, - "! The customer ID specified for the message, if any. - CUSTOMER_ID type STRING, - end of T_LOG. + "! An array of skill references identifying the skills associated with the + "! assistant. + ASSISTANT_SKILLS type STANDARD TABLE OF T_ASSISTANT_SKILL WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects describing the environments defined for the assistant. + ASSISTANT_ENVIRONMENTS type STANDARD TABLE OF T_ENVIRONMENT_REFERENCE WITH NON-UNIQUE DEFAULT KEY, + end of T_ASSISTANT_DATA. types: "!

- "! An object that describes a response with response type

- "! `pause`. + "! The pagination data for the returned objects. For more

+ "! information about using pagination, see [Pagination](#pagination). + begin of T_PAGINATION, + "! The URL that will return the same page of results. + REFRESH_URL type STRING, + "! The URL that will return the next page of results. + NEXT_URL type STRING, + "! The total number of objects that satisfy the request. This total includes all + "! results, not just those included in the current page. + TOTAL type INTEGER, + "! Reserved for future use. + MATCHED type INTEGER, + "! A token identifying the current page of results. + REFRESH_CURSOR type STRING, + "! A token identifying the next page of results. + NEXT_CURSOR type STRING, + end of T_PAGINATION. + types: + "! No documentation available. + begin of T_ENVIRONMENT_COLLECTION, + "! An array of objects describing the environments associated with an assistant. + ENVIRONMENTS type STANDARD TABLE OF T_ENVIRONMENT WITH NON-UNIQUE DEFAULT KEY, + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). + PAGINATION type T_PAGINATION, + end of T_ENVIRONMENT_COLLECTION. + types: + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_PAUSE, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1101,19 +1695,96 @@ public section. TIME type INTEGER, "! Whether to send a "user is typing" event during the pause. TYPING type BOOLEAN, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_PAUSE. types: "! No documentation available. - begin of T_LOG_COLLECTION, - "! An array of objects describing log events. - LOGS type STANDARD TABLE OF T_LOG WITH NON-UNIQUE DEFAULT KEY, - "! The pagination data for the returned objects. - PAGINATION type T_LOG_PAGINATION, - end of T_LOG_COLLECTION. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_US1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! An object containing any properties for the user-defined response type. + USER_DEFINED type JSONOBJECT, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_US1. + types: + "!

+ "! An object containing segments of text from search results

+ "! with query-matching text highlighted using HTML `<em>` tags. + begin of T_SEARCH_RESULT_HIGHLIGHT, + "! An array of strings containing segments taken from body text in the search + "! results, with query-matching substrings highlighted. + BODY type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! An array of strings containing segments taken from title text in the search + "! results, with query-matching substrings highlighted. + TITLE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! An array of strings containing segments taken from URLs in the search results, + "! with query-matching substrings highlighted. + URL type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_SEARCH_RESULT_HIGHLIGHT. + types: + "!

+ "! An object containing search result metadata from the

+ "! Discovery service. + begin of T_SEARCH_RESULT_METADATA, + "! The confidence score for the given result, as returned by the Discovery service. + "! + CONFIDENCE type DOUBLE, + "! An unbounded measure of the relevance of a particular result, dependent on the + "! query and matching document. A higher score indicates a greater match to the + "! query parameters. + SCORE type DOUBLE, + end of T_SEARCH_RESULT_METADATA. types: "!

- "! An object that describes a response with response type

- "! `search`. + "! An object specifing a segment of text that was identified as

+ "! a direct answer to the search query. + begin of T_SEARCH_RESULT_ANSWER, + "! The text of the answer. + TEXT type STRING, + "! The confidence score for the answer, as returned by the Discovery service. + CONFIDENCE type DOUBLE, + end of T_SEARCH_RESULT_ANSWER. + types: + "! No documentation available. + begin of T_SEARCH_RESULT, + "! The unique identifier of the document in the Discovery service collection.
+ "!
+ "! This property is included in responses from search skills, which are available + "! only to Plus or Enterprise plan users. + ID type STRING, + "! An object containing search result metadata from the Discovery service. + RESULT_METADATA type T_SEARCH_RESULT_METADATA, + "! A description of the search result. This is taken from an abstract, summary, or + "! highlight field in the Discovery service response, as specified in the search + "! skill configuration. + BODY type STRING, + "! The title of the search result. This is taken from a title or name field in the + "! Discovery service response, as specified in the search skill configuration. + TITLE type STRING, + "! The URL of the original data object in its native data source. + URL type STRING, + "! An object containing segments of text from search results with query-matching + "! text highlighted using HTML `<em>` tags. + HIGHLIGHT type T_SEARCH_RESULT_HIGHLIGHT, + "! An array specifying segments of text within the result that were identified as + "! direct answers to the search query. Currently, only the single answer with the + "! highest confidence (if any) is returned.
+ "!
+ "! **Notes:**
+ "! - Answer finding is available only if the search skill is connected to a + "! Discovery v2 service instance.
+ "! - Answer finding is not supported on IBM Cloud Pak for Data. + ANSWERS type STANDARD TABLE OF T_SEARCH_RESULT_ANSWER WITH NON-UNIQUE DEFAULT KEY, + end of T_SEARCH_RESULT. + types: + "! No documentation available. begin of T_RUNTIME_RESPONSE_TYPE_SEARCH, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1127,19 +1798,42 @@ public section. "! An array of objects that contains additional search results that can be "! displayed to the user upon request. ADDITIONAL_RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RUNTIME_RESPONSE_TYPE_SEARCH. types: - "!

- "! Information specific to particular skills used by the

- "! assistant.
- "!
- "! **Note:** Currently, only a single child property is supported, containing - "! variables that apply to the dialog skill used by the assistant. - T_MESSAGE_CONTEXT_SKILLS type MAP. + "! No documentation available. + begin of T_SKILLS_EXPORT, + "! An array of objects describing the skills for the assistant. Included in + "! responses only if **status**=`Available`. + ASSISTANT_SKILLS type STANDARD TABLE OF T_SKILL WITH NON-UNIQUE DEFAULT KEY, + "! Status information about the skills for the assistant. Included in responses + "! only if **status**=`Available`. + ASSISTANT_STATE type T_ASSISTANT_STATE, + end of T_SKILLS_EXPORT. types: - "!

- "! An object that describes a response with response type

- "! `pause`. + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_IFRAME, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the embeddable content. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the the response. + DESCRIPTION type STRING, + "! The URL of an image that shows a preview of the embedded content. + IMAGE_URL type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RUNTIME_RESPONSE_TYPE_IFRAME. + types: + "! No documentation available. begin of T_RT_RESP_GNRC_RT_RESP_TYP_PS, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. @@ -1148,6 +1842,10 @@ public section. TIME type INTEGER, "! Whether to send a "user is typing" event during the pause. TYPING type BOOLEAN, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, end of T_RT_RESP_GNRC_RT_RESP_TYP_PS. types: "!

@@ -1159,134 +1857,969 @@ public section. "! variables. The context is not stored by the assistant; to maintain session "! state, include the context from the response in the next message. CONTEXT type T_MESSAGE_CONTEXT_STATELESS, + "! A string value that identifies the user who is interacting with the assistant. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.global.session_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the global + "! system context. + USER_ID type STRING, end of T_MESSAGE_RESPONSE_STATELESS. + types: + "! No documentation available. + begin of T_ERROR_DETAIL, + "! Description of a specific constraint violation. + MESSAGE type STRING, + "! The location of the constraint violation. + PATH type STRING, + end of T_ERROR_DETAIL. + types: + "! No documentation available. + begin of T_TURN_EVENT_HANDLER_VISITED, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + end of T_TURN_EVENT_HANDLER_VISITED. types: "!

"! Session context data that is shared by all skills used by

- "! the Assistant. + "! the assistant. begin of T_BASE_MESSAGE_CONTEXT_GLOBAL, "! Built-in system properties that apply to all skills used by the assistant. SYSTEM type T_MSSG_CONTEXT_GLOBAL_SYSTEM, end of T_BASE_MESSAGE_CONTEXT_GLOBAL. types: "!

- "! Contains information specific to a particular skill used by

- "! the Assistant. The property name must be the same as the name of the skill (for - "! example, `main skill`). - begin of T_MESSAGE_CONTEXT_SKILL, - "! Arbitrary variables that can be read and written by a particular skill. - USER_DEFINED type MAP, - "! System context data used by the skill. - SYSTEM type T_MESSAGE_CONTEXT_SKILL_SYSTEM, - end of T_MESSAGE_CONTEXT_SKILL. + "! An object that identifies the dialog element that generated

+ "! the error message. + begin of T_LOG_MESSAGE_SOURCE_DIA_NODE, + "! A string that indicates the type of dialog element that generated the error + "! message. + TYPE type STRING, + "! The unique identifier of the dialog node that generated the error message. + DIALOG_NODE type STRING, + end of T_LOG_MESSAGE_SOURCE_DIA_NODE. types: - "!

- "! An object that describes a response with response type

- "! `search`. - begin of T_RT_RESP_GNRC_RT_RESP_TYP_SR1, + "! No documentation available. + begin of T_RT_ENTTY_INTRPRTTN_SYS_NUM, + "! A recognized numeric value, represented as an integer or double. + NUMERIC_VALUE type NUMBER, + "! 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`). + RANGE_LINK type STRING, + "! The type of numeric value recognized in the user input (`integer` or + "! `rational`). + SUBTYPE type STRING, + end of T_RT_ENTTY_INTRPRTTN_SYS_NUM. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_SG1, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, - "! The title or introductory text to show before the response. This text is defined - "! in the search skill configuration. - HEADER type STRING, - "! An array of objects that contains the search results to be displayed in the - "! initial response to the user. - PRIMARY_RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY, - "! An array of objects that contains additional search results that can be - "! displayed to the user upon request. - ADDITIONAL_RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_RT_RESP_GNRC_RT_RESP_TYP_SR1. + "! The title or introductory text to show before the response. + TITLE type STRING, + "! An array of objects describing the possible matching dialog nodes from which the + "! user can choose. + SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_SG1. + types: + "! No documentation available. + begin of T_ERROR_RESPONSE, + "! General description of an error. + ERROR type STRING, + "! Collection of specific constraint violations associated with the error. + ERRORS type STANDARD TABLE OF T_ERROR_DETAIL WITH NON-UNIQUE DEFAULT KEY, + "! HTTP status code for the error response. + CODE type INTEGER, + end of T_ERROR_RESPONSE. types: "!

- "! An object that describes a response with response type

- "! `option`. - begin of T_RT_RESP_GNRC_RT_RESP_TYP_OPT, + "! Optional properties that control how the assistant responds.

+ begin of T_MESSAGE_INPUT_OPT_STATELESS, + "! Whether to restart dialog processing at the root of the dialog, regardless of + "! any previously visited nodes. **Note:** This does not affect `turn_count` or + "! any other context variables. + RESTART type BOOLEAN, + "! Whether to return more than one intent. Set to `true` to return all matching + "! intents. + ALTERNATE_INTENTS type BOOLEAN, + "! Spelling correction options for the message. Any options specified on an + "! individual message override the settings configured for the skill. + SPELLING type T_MESSAGE_INPUT_OPT_SPELLING, + "! Whether to return additional diagnostic information. Set to `true` to return + "! additional information in the `output.debug` property. + DEBUG type BOOLEAN, + end of T_MESSAGE_INPUT_OPT_STATELESS. + types: + "!

+ "! An input object that includes the input text.

+ begin of T_BASE_MESSAGE_INPUT, + "! 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. + MESSAGE_TYPE type STRING, + "! The text of the user input. This string cannot contain carriage return, newline, + "! or tab characters. + TEXT type STRING, + "! Intents to use when evaluating the user input. Include intents from the previous + "! response to continue using those intents rather than trying to recognize + "! intents in the new input. + INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY, + "! Entities to use when evaluating the message. Include entities from the previous + "! response to continue using those entities rather than detecting entities in the + "! new input. + ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + SUGGESTION_ID type STRING, + "! An array of multimedia attachments to be sent with the message. Attachments are + "! not processed by the assistant itself, but can be sent to external services by + "! webhooks.
+ "!
+ "! **Note:** Attachments are not supported on IBM Cloud Pak for Data. + ATTACHMENTS type STANDARD TABLE OF T_MESSAGE_INPUT_ATTACHMENT WITH NON-UNIQUE DEFAULT KEY, + "! An optional object containing analytics data. Currently, this data is used only + "! for events sent to the Segment extension. + ANALYTICS type T_REQUEST_ANALYTICS, + end of T_BASE_MESSAGE_INPUT. + types: + "! No documentation available. + begin of T_UPDATE_SKILL, + "! The name of the skill. This string cannot contain carriage return, newline, or + "! tab characters. + NAME type STRING, + "! The description of the skill. This string cannot contain carriage return, + "! newline, or tab characters. + DESCRIPTION type STRING, + "! An object containing the conversational content of an action or dialog skill. + WORKSPACE type JSONOBJECT, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! 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. + STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! Included only if **status**=`Failed`. + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, + "! The description of the failed asynchronous operation. Included only if + "! **status**=`Failed`. + STATUS_DESCRIPTION type STRING, + "! For internal use only. + DIALOG_SETTINGS type JSONOBJECT, + "! The unique identifier of the assistant the skill is associated with. + ASSISTANT_ID type STRING, + "! The unique identifier of the workspace that contains the skill content. Included + "! only for action and dialog skills. + WORKSPACE_ID type STRING, + "! The unique identifier of the environment where the skill is defined. For action + "! and dialog skills, this is always the draft environment. + ENVIRONMENT_ID type STRING, + "! Whether the skill is structurally valid. + VALID type BOOLEAN, + "! The name that will be given to the next snapshot that is created for the skill. + "! A snapshot of each versionable skill is saved for each new release of an + "! assistant. + NEXT_SNAPSHOT_VERSION type STRING, + "! An object describing the search skill configuration. + SEARCH_SETTINGS type T_SEARCH_SETTINGS, + "! An array of warnings describing errors with the search skill configuration. + "! Included only for search skills. + WARNINGS type STANDARD TABLE OF T_SEARCH_SKILL_WARNING WITH NON-UNIQUE DEFAULT KEY, + end of T_UPDATE_SKILL. + types: + "! No documentation available. + begin of T_BASE_SKILL, + "! The name of the skill. This string cannot contain carriage return, newline, or + "! tab characters. + NAME type STRING, + "! The description of the skill. This string cannot contain carriage return, + "! newline, or tab characters. + DESCRIPTION type STRING, + "! An object containing the conversational content of an action or dialog skill. + WORKSPACE type JSONOBJECT, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! 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. + STATUS type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! Included only if **status**=`Failed`. + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, + "! The description of the failed asynchronous operation. Included only if + "! **status**=`Failed`. + STATUS_DESCRIPTION type STRING, + "! For internal use only. + DIALOG_SETTINGS type JSONOBJECT, + "! The unique identifier of the assistant the skill is associated with. + ASSISTANT_ID type STRING, + "! The unique identifier of the workspace that contains the skill content. Included + "! only for action and dialog skills. + WORKSPACE_ID type STRING, + "! The unique identifier of the environment where the skill is defined. For action + "! and dialog skills, this is always the draft environment. + ENVIRONMENT_ID type STRING, + "! Whether the skill is structurally valid. + VALID type BOOLEAN, + "! The name that will be given to the next snapshot that is created for the skill. + "! A snapshot of each versionable skill is saved for each new release of an + "! assistant. + NEXT_SNAPSHOT_VERSION type STRING, + "! An object describing the search skill configuration. + SEARCH_SETTINGS type T_SEARCH_SETTINGS, + "! An array of warnings describing errors with the search skill configuration. + "! Included only for search skills. + WARNINGS type STANDARD TABLE OF T_SEARCH_SKILL_WARNING WITH NON-UNIQUE DEFAULT KEY, + end of T_BASE_SKILL. + types: + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_DATE, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + end of T_RUNTIME_RESPONSE_TYPE_DATE. + types: + "! No documentation available. + begin of T_RELEASE_COLLECTION, + "! An array of objects describing the releases associated with an assistant. + RELEASES type STANDARD TABLE OF T_RELEASE WITH NON-UNIQUE DEFAULT KEY, + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). + PAGINATION type T_PAGINATION, + end of T_RELEASE_COLLECTION. + types: + "! No documentation available. + begin of T_ASSISTANT_COLLECTION, + "! An array of objects describing the assistants associated with the instance. + ASSISTANTS type STANDARD TABLE OF T_ASSISTANT_DATA WITH NON-UNIQUE DEFAULT KEY, + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). + PAGINATION type T_PAGINATION, + end of T_ASSISTANT_COLLECTION. + types: + "! No documentation available. + begin of T_TURN_EVENT_NODE_VISITED, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_NODE_SOURCE, + "! The reason the dialog node was visited. + REASON type STRING, + end of T_TURN_EVENT_NODE_VISITED. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_5, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_5. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_6, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! No documentation available. + CALLOUT type T_TURN_EVENT_CALLOUT_CALLOUT, + "! No documentation available. + ERROR type T_TURN_EVENT_CALLOUT_ERROR, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_6. + types: + "!

+ "! An input object that includes the input text.

+ begin of T_MESSAGE_INPUT_STATELESS, + "! 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. + MESSAGE_TYPE type STRING, + "! The text of the user input. This string cannot contain carriage return, newline, + "! or tab characters. + TEXT type STRING, + "! Intents to use when evaluating the user input. Include intents from the previous + "! response to continue using those intents rather than trying to recognize + "! intents in the new input. + INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY, + "! Entities to use when evaluating the message. Include entities from the previous + "! response to continue using those entities rather than detecting entities in the + "! new input. + ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + SUGGESTION_ID type STRING, + "! An array of multimedia attachments to be sent with the message. Attachments are + "! not processed by the assistant itself, but can be sent to external services by + "! webhooks.
+ "!
+ "! **Note:** Attachments are not supported on IBM Cloud Pak for Data. + ATTACHMENTS type STANDARD TABLE OF T_MESSAGE_INPUT_ATTACHMENT WITH NON-UNIQUE DEFAULT KEY, + "! An optional object containing analytics data. Currently, this data is used only + "! for events sent to the Segment extension. + ANALYTICS type T_REQUEST_ANALYTICS, + "! Optional properties that control how the assistant responds. + OPTIONS type T_MESSAGE_INPUT_OPT_STATELESS, + end of T_MESSAGE_INPUT_STATELESS. + types: + "!

+ "! A stateless message request formatted for the Watson

+ "! Assistant service. + begin of T_MESSAGE_REQUEST_STATELESS, + "! An input object that includes the input text. + INPUT type T_MESSAGE_INPUT_STATELESS, + "! Context data for the conversation. You can use this property to set or modify + "! context variables, which can also be accessed by dialog nodes. The context is + "! not stored by the assistant. To maintain session state, include the context + "! from the previous response.
+ "!
+ "! **Note:** The total size of the context data for a stateless session cannot + "! exceed 250KB. + CONTEXT type T_MESSAGE_CONTEXT_STATELESS, + "! A string value that identifies the user who is interacting with the assistant. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.global.session_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the global + "! system context. If **user_id** is specified in both locations in a message + "! request, the value specified at the root is used. + USER_ID type STRING, + end of T_MESSAGE_REQUEST_STATELESS. + types: + "! No documentation available. + begin of T_RT_RESPONSE_TYPE_SUGGESTION, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! An array of objects describing the possible matching dialog nodes from which the + "! user can choose. + SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESPONSE_TYPE_SUGGESTION. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_4, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! Whether the step was answered in response to a prompt from the assistant. If + "! this property is `false`, the user provided the answer without visiting the + "! step. + PROMPTED type BOOLEAN, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_4. + types: + "!

+ "! An object that identifies the dialog element that generated

+ "! the error message. + begin of T_LOG_MESSAGE_SOURCE_STEP, + "! A string that indicates the type of dialog element that generated the error + "! message. + TYPE type STRING, + "! The unique identifier of the action that generated the error message. + ACTION type STRING, + "! The unique identifier of the step that generated the error message. + STEP type STRING, + end of T_LOG_MESSAGE_SOURCE_STEP. + types: + "! No documentation available. + begin of T_TURN_EVENT_STEP_ANSWERED, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! Whether the step was answered in response to a prompt from the assistant. If + "! this property is `false`, the user provided the answer without visiting the + "! step. + PROMPTED type BOOLEAN, + end of T_TURN_EVENT_STEP_ANSWERED. + types: + "! No documentation available. + begin of T_SKILLS_ASYNC_REQUEST_STATUS, + "! The assistant ID of the assistant. + ASSISTANT_ID type STRING, + "! 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. + STATUS type STRING, + "! The description of the failed asynchronous operation. Included only if + "! **status**=`Failed`. + STATUS_DESCRIPTION type STRING, + "! An array of messages about errors that caused an asynchronous operation to fail. + "! Included only if **status**=`Failed`. + STATUS_ERRORS type STANDARD TABLE OF T_STATUS_ERROR WITH NON-UNIQUE DEFAULT KEY, + end of T_SKILLS_ASYNC_REQUEST_STATUS. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_TXT, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The text of the response. + TEXT type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_TXT. + types: + "! No documentation available. + begin of T_SESSION_RESPONSE, + "! The session ID. + SESSION_ID type STRING, + end of T_SESSION_RESPONSE. + types: + "! No documentation available. + begin of T_RT_ENTTY_INTRPRTTN_SYS_DATE, + "! The calendar used to represent a recognized date (for example, `Gregorian`). + CALENDAR_TYPE type STRING, + "! A unique identifier used to associate a time and date. If the user input + "! contains a date and time that are mentioned together (for example, `Today at + "! 5`, the same **datetime_link** value is returned for both the `@sys-date` + "! and `@sys-time` entities). + DATETIME_LINK type STRING, + "! A locale-specific holiday name (such as `thanksgiving` or `christmas`). This + "! property is included when a `@sys-date` entity is recognized based on a + "! holiday name in the user input. + FESTIVAL type STRING, + "! The precision or duration of a time range specified by a recognized + "! `@sys-time` or `@sys-date` entity. + GRANULARITY type 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`). + RANGE_LINK type STRING, + "! The word in the user input that indicates that a `sys-date` or `sys-time` entity + "! is part of an implied range where only one date or time is specified (for + "! example, `since` or `until`). + RANGE_MODIFIER type STRING, + "! A recognized mention of a relative day, represented numerically as an offset + "! from the current date (for example, `-1` for `yesterday` or `10` for `in ten + "! days`). + RELATIVE_DAY type NUMBER, + "! A recognized mention of a relative month, represented numerically as an offset + "! from the current month (for example, `1` for `next month` or `-3` for `three + "! months ago`). + RELATIVE_MONTH type NUMBER, + "! A recognized mention of a relative week, represented numerically as an offset + "! from the current week (for example, `2` for `in two weeks` or `-1` for `last + "! week). + RELATIVE_WEEK type NUMBER, + "! A recognized mention of a relative date range for a weekend, represented + "! numerically as an offset from the current weekend (for example, `0` for `this + "! weekend` or `-1` for `last weekend`). + RELATIVE_WEEKEND type NUMBER, + "! A recognized mention of a relative year, represented numerically as an offset + "! from the current year (for example, `1` for `next year` or `-5` for `five years + "! ago`). + RELATIVE_YEAR type NUMBER, + "! A recognized mention of a specific date, represented numerically as the date + "! within the month (for example, `30` for `June 30`.). + SPECIFIC_DAY type NUMBER, + "! A recognized mention of a specific day of the week as a lowercase string (for + "! example, `monday`). + SPECIFIC_DAY_OF_WEEK type STRING, + "! A recognized mention of a specific month, represented numerically (for example, + "! `7` for `July`). + SPECIFIC_MONTH type NUMBER, + "! A recognized mention of a specific quarter, represented numerically (for + "! example, `3` for `the third quarter`). + SPECIFIC_QUARTER type NUMBER, + "! A recognized mention of a specific year (for example, `2016`). + SPECIFIC_YEAR type NUMBER, + end of T_RT_ENTTY_INTRPRTTN_SYS_DATE. + types: + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_AUDIO, "! The type of response returned by the dialog node. The specified response type "! must be supported by the client application or channel. RESPONSE_TYPE type STRING, + "! The `https:` URL of the audio clip. + SOURCE type STRING, "! The title or introductory text to show before the response. TITLE type STRING, "! The description to show with the the response. DESCRIPTION type STRING, - "! The preferred type of control to display. - PREFERENCE type STRING, - "! An array of objects describing the options from which the user can choose. - OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, - end of T_RT_RESP_GNRC_RT_RESP_TYP_OPT. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_DIALOG_LOG_MESSAGE type string value '|LEVEL|MESSAGE|', - T_DIALOG_NODES_VISITED type string value '|', - T_MESSAGE_OUTPUT_DEBUG type string value '|', - T_RT_ENTTY_INTRPRTTN_SYS_NUM type string value '|', - T_RT_ENTITY_INTERPRETATION type string value '|', - T_MESSAGE_INPUT_OPT_SPELLING type string value '|', - T_CAPTURE_GROUP type string value '|GROUP|', - T_RUNTIME_ENTITY_ALTERNATIVE type string value '|', - T_RUNTIME_ENTITY_ROLE type string value '|', - T_RUNTIME_ENTITY type string value '|ENTITY|LOCATION|VALUE|', - T_MESSAGE_INPUT_OPTIONS type string value '|', - T_RUNTIME_INTENT type string value '|INTENT|CONFIDENCE|', + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the audio player cannot be seen. + ALT_TEXT type STRING, + end of T_RUNTIME_RESPONSE_TYPE_AUDIO. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_7, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! No documentation available. + ERROR type T_TURN_EVENT_SEARCH_ERROR, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_7. + types: + "!

+ "! An object that identifies the dialog element that generated

+ "! the error message. + begin of T_LOG_MESSAGE_SOURCE_ACTION, + "! A string that indicates the type of dialog element that generated the error + "! message. + TYPE type STRING, + "! The unique identifier of the action that generated the error message. + ACTION type STRING, + end of T_LOG_MESSAGE_SOURCE_ACTION. + types: + "! No documentation available. + begin of T_RUNTIME_RESPONSE_TYPE_IMAGE, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the image. + SOURCE type STRING, + "! The title to show before the response. + TITLE type STRING, + "! The description to show with the the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! Descriptive text that can be used for screen readers or other situations where + "! the image cannot be seen. + ALT_TEXT type STRING, + end of T_RUNTIME_RESPONSE_TYPE_IMAGE. + types: + "! No documentation available. + begin of T_TURN_EVENT_STEP_VISITED, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! Whether the step collects a customer response. + HAS_QUESTION type BOOLEAN, + end of T_TURN_EVENT_STEP_VISITED. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_AD, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the audio clip. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the the response. + DESCRIPTION type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + "! For internal use only. + CHANNEL_OPTIONS type JSONOBJECT, + "! Descriptive text that can be used for screen readers or other situations where + "! the audio player cannot be seen. + ALT_TEXT type STRING, + end of T_RT_RESP_GNRC_RT_RESP_TYP_AD. + types: + "! No documentation available. + begin of T_TURN_EVENT_ACTION_VISITED, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The reason the action was visited. + REASON type STRING, + "! The variable where the result of the call to the action is stored. Included only + "! if **reason**=`subaction_return`. + RESULT_VARIABLE type STRING, + end of T_TURN_EVENT_ACTION_VISITED. + types: + "!

+ "! A stateful message request formatted for the Watson

+ "! Assistant service. + begin of T_MESSAGE_REQUEST, + "! An input object that includes the input text. + INPUT type T_MESSAGE_INPUT, + "! Context data for the conversation. You can use this property to set or modify + "! context variables, which can also be accessed by dialog nodes. The context is + "! stored by the assistant on a per-session basis.
+ "!
+ "! **Note:** The total size of the context data stored for a stateful session + "! cannot exceed 100KB. + CONTEXT type T_MESSAGE_CONTEXT, + "! A string value that identifies the user who is interacting with the assistant. + "! The client must provide a unique identifier for each individual end user who + "! accesses the application. For user-based plans, this user ID is used to + "! identify unique users for billing purposes. This string cannot contain carriage + "! return, newline, or tab characters. If no value is specified in the input, + "! **user_id** is automatically set to the value of + "! **context.global.session_id**.
+ "!
+ "! **Note:** This property is the same as the **user_id** property in the global + "! system context. If **user_id** is specified in both locations, the value + "! specified at the root is used. + USER_ID type STRING, + end of T_MESSAGE_REQUEST. + types: + "! No documentation available. + begin of T_LOG, + "! A unique identifier for the logged event. + LOG_ID type STRING, + "! A stateful message request formatted for the Watson Assistant service. + REQUEST type T_MESSAGE_REQUEST, + "! A response from the Watson Assistant service. + RESPONSE type T_MESSAGE_RESPONSE, + "! Unique identifier of the assistant. + ASSISTANT_ID type STRING, + "! The ID of the session the message was part of. + SESSION_ID type STRING, + "! The unique identifier of the skill that responded to the message. + SKILL_ID type STRING, + "! The name of the snapshot (dialog skill version) that responded to the message + "! (for example, `draft`). + SNAPSHOT type STRING, + "! The timestamp for receipt of the message. + REQUEST_TIMESTAMP type STRING, + "! The timestamp for the system response to the message. + RESPONSE_TIMESTAMP type STRING, + "! The language of the assistant to which the message request was made. + LANGUAGE type STRING, + "! The customer ID specified for the message, if any. + CUSTOMER_ID type STRING, + end of T_LOG. + types: + "! No documentation available. + begin of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_1, + "! The type of turn event. + EVENT type STRING, + "! No documentation available. + SOURCE type T_TURN_EVENT_ACTION_SOURCE, + "! The time when the action started processing the message. + ACTION_START_TIME type STRING, + "! The type of condition (if any) that is defined for the action. + CONDITION_TYPE type STRING, + "! The reason the action was visited. + REASON type STRING, + "! The variable where the result of the call to the action is stored. Included only + "! if **reason**=`subaction_return`. + RESULT_VARIABLE type STRING, + end of T_MSSG_OTPT_DBG_TRN_EVNT_TRN_1. + types: + "! No documentation available. + begin of T_LOG_COLLECTION, + "! An array of objects describing log events. + LOGS type STANDARD TABLE OF T_LOG WITH NON-UNIQUE DEFAULT KEY, + "! The pagination data for the returned objects. For more information about using + "! pagination, see [Pagination](#pagination). + PAGINATION type T_LOG_PAGINATION, + end of T_LOG_COLLECTION. + types: + "! No documentation available. + begin of T_BASE_SKILL_REFERENCE, + "! The skill ID of the skill. + SKILL_ID type STRING, + "! The type of the skill. + TYPE type STRING, + end of T_BASE_SKILL_REFERENCE. + types: + "!

+ "! A request to deploy a release to the specified environment.

+ begin of T_DEPLOY_RELEASE_REQUEST, + "! The environment ID of the environment where the release is to be deployed. + ENVIRONMENT_ID type STRING, + end of T_DEPLOY_RELEASE_REQUEST. + types: + "! No documentation available. + begin of T_AUDIT_PROPERTIES, + "! The timestamp for creation of the object. + CREATED type DATETIME, + "! The timestamp for the most recent update to the object. + UPDATED type DATETIME, + end of T_AUDIT_PROPERTIES. + types: + "! No documentation available. + begin of T_CREATE_SESSION, + "! An optional object containing analytics data. Currently, this data is used only + "! for events sent to the Segment extension. + ANALYTICS type T_REQUEST_ANALYTICS, + end of T_CREATE_SESSION. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_SR1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The title or introductory text to show before the response. This text is defined + "! in the search skill configuration. + HEADER type STRING, + "! An array of objects that contains the search results to be displayed in the + "! initial response to the user. + PRIMARY_RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects that contains additional search results that can be + "! displayed to the user upon request. + ADDITIONAL_RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_SR1. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_IF1, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The `https:` URL of the embeddable content. + SOURCE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the the response. + DESCRIPTION type STRING, + "! The URL of an image that shows a preview of the embedded content. + IMAGE_URL type STRING, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_IF1. + types: + "! No documentation available. + begin of T_RT_RESP_GNRC_RT_RESP_TYP_OPT, + "! The type of response returned by the dialog node. The specified response type + "! must be supported by the client application or channel. + RESPONSE_TYPE type STRING, + "! The title or introductory text to show before the response. + TITLE type STRING, + "! The description to show with the the response. + DESCRIPTION type STRING, + "! The preferred type of control to display. + PREFERENCE type STRING, + "! An array of objects describing the options from which the user can choose. + OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of objects specifying channels for which the response is intended. If + "! **channels** is present, the response is intended for a built-in integration + "! and should not be handled by an API client. + CHANNELS type STANDARD TABLE OF T_RESPONSE_GENERIC_CHANNEL WITH NON-UNIQUE DEFAULT KEY, + end of T_RT_RESP_GNRC_RT_RESP_TYP_OPT. + +constants: + "!

List of required fields per type.

+ begin of C_REQUIRED_FIELDS, + T_RESPONSE_GENERIC_CHANNEL type string value '|', + T_RUNTIME_RESPONSE_TYPE_VIDEO type string value '|RESPONSE_TYPE|SOURCE|', + T_TURN_EVENT_ACTION_SOURCE type string value '|', + T_TURN_EVENT_SEARCH_ERROR type string value '|', + T_TURN_EVENT_SEARCH type string value '|', + T_DIALOG_LOG_MESSAGE type string value '|LEVEL|MESSAGE|CODE|', + T_DIALOG_NODE_VISITED type string value '|', + T_MESSAGE_OUTPUT_DEBUG type string value '|', + T_RT_ENTITY_INTERPRETATION type string value '|', + T_MESSAGE_INPUT_OPT_SPELLING type string value '|', + T_CAPTURE_GROUP type string value '|GROUP|', + T_RUNTIME_ENTITY_ALTERNATIVE type string value '|', + T_RUNTIME_ENTITY_ROLE type string value '|', + T_RUNTIME_ENTITY type string value '|ENTITY|VALUE|', + T_REQUEST_ANALYTICS type string value '|', + T_MESSAGE_INPUT_ATTACHMENT type string value '|URL|', + T_MESSAGE_INPUT_OPTIONS type string value '|', + T_RUNTIME_INTENT type string value '|INTENT|', T_MESSAGE_INPUT type string value '|', T_DIA_ND_OUTPUT_OPT_ELEM_VALUE type string value '|', T_DIA_NODE_OUTPUT_OPT_ELEMENT type string value '|LABEL|VALUE|', T_RUNTIME_RESPONSE_TYPE_OPTION type string value '|RESPONSE_TYPE|TITLE|OPTIONS|', - T_DIALOG_SUGGESTION_VALUE type string value '|', - T_DIALOG_SUGGESTION type string value '|LABEL|VALUE|', - T_MSSG_OTPT_DBG_AT_LEARN_MODEL type string value '|', - T_MSSG_OUTPUT_DEBUG_AUTO_LEARN type string value '|', - T_SEARCH_RESULT_HIGHLIGHT type string value '|', - T_RT_RESP_GNRC_RT_RESP_TYP_SG1 type string value '|RESPONSE_TYPE|TITLE|SUGGESTIONS|', - T_ERROR_DETAIL type string value '|MESSAGE|', - T_ERROR_RESPONSE type string value '|ERROR|CODE|', - T_SEARCH_RESULT_METADATA type string value '|', - T_SEARCH_RESULT type string value '|ID|RESULT_METADATA|', - T_MESSAGE_INPUT_OPT_STATELESS type string value '|', - T_BASE_MESSAGE_INPUT type string value '|', + T_STATUS_ERROR type string value '|', + T_SEARCH_SETTINGS_MESSAGES type string value '|SUCCESS|ERROR|NO_RESULT|', + T_SRCH_SETTINGS_SCHEMA_MAPPING type string value '|URL|BODY|TITLE|', + T_SRCH_STTNGS_DSCVRY_ATHNTCTN type string value '|', + T_SEARCH_SETTINGS_DISCOVERY type string value '|INSTANCE_ID|PROJECT_ID|URL|AUTHENTICATION|', + T_SEARCH_SETTINGS type string value '|DISCOVERY|MESSAGES|SCHEMA_MAPPING|', + T_SEARCH_SKILL_WARNING type string value '|', + T_SKILL_IMPORT type string value '|LANGUAGE|TYPE|', + T_ASSISTANT_STATE type string value '|ACTION_DISABLED|DIALOG_DISABLED|', + T_SKILLS_IMPORT type string value '|ASSISTANT_SKILLS|ASSISTANT_STATE|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_3 type string value '|', + T_SKILL type string value '|LANGUAGE|TYPE|', + T_BASE_ENV_ORCHESTRATION type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_VD type string value '|RESPONSE_TYPE|SOURCE|', + T_CHANNEL_TRANSFER_TARGET_CHAT type string value '|', + T_CHANNEL_TRANSFER_TARGET type string value '|', + T_CHANNEL_TRANSFER_INFO type string value '|TARGET|', + T_RT_RESP_TYPE_CHANNEL_TRANS type string value '|RESPONSE_TYPE|MESSAGE_TO_USER|TRANSFER_INFO|', T_RUNTIME_RESPONSE_TYPE_TEXT type string value '|RESPONSE_TYPE|TEXT|', T_DIALOG_NODE_ACTION type string value '|NAME|RESULT_VARIABLE|', + T_BASE_ENV_RELEASE_REFERENCE type string value '|', T_RT_ENTTY_INTRPRTTN_SYS_TIME type string value '|', + T_RELEASE_SKILL type string value '|SKILL_ID|', + T_RELEASE_CONTENT type string value '|', + T_ENVIRONMENT_REFERENCE type string value '|', + T_RELEASE type string value '|', + T_INTEGRATION_REFERENCE type string value '|', + T_ENVIRONMENT_SKILL type string value '|SKILL_ID|', + T_UPDATE_ENVIRONMENT type string value '|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_2 type string value '|', + T_MESSAGE_INPUT_OPT_AUTO_LEARN type string value '|', T_MSSG_CONTEXT_GLOBAL_SYSTEM type string value '|', T_MESSAGE_CONTEXT_GLOBAL type string value '|', - T_MESSAGE_INPUT_OPT_AUTO_LEARN type string value '|', - T_MESSAGE_CONTEXT type string value '|', T_MESSAGE_CONTEXT_SKILL_SYSTEM type string value '|', + T_MESSAGE_CONTEXT_SKILL_ACTION type string value '|', + T_MESSAGE_CONTEXT_SKILL_DIALOG type string value '|', + T_MESSAGE_CONTEXT_SKILLS type string value '|', + T_MESSAGE_CONTEXT type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_IMG type string value '|RESPONSE_TYPE|SOURCE|', + T_TURN_EVENT_NODE_SOURCE type string value '|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_8 type string value '|', T_MSSG_CNTXT_GLOBAL_STATELESS type string value '|', T_MESSAGE_CONTEXT_STATELESS type string value '|', - T_MESSAGE_INPUT_STATELESS type string value '|', - T_MESSAGE_REQUEST_STATELESS type string value '|', - T_RT_RESP_GNRC_RT_RESP_TYP_IMG type string value '|RESPONSE_TYPE|SOURCE|', - T_RT_RESPONSE_TYPE_SUGGESTION type string value '|RESPONSE_TYPE|TITLE|SUGGESTIONS|', - T_BULK_CLASSIFY_UTTERANCE type string value '|TEXT|', + T_RT_RESP_TYPE_USER_DEFINED type string value '|RESPONSE_TYPE|USER_DEFINED|', T_LOG_PAGINATION type string value '|', - T_RT_RESP_GNRC_RT_RESP_TYP_TXT type string value '|RESPONSE_TYPE|TEXT|', T_AGENT_AVAILABILITY_MESSAGE type string value '|', T_DIA_ND_OTPT_CNNCT_T_AGNT_TR1 type string value '|', T_RT_RESP_TYP_CONNECT_TO_AGENT type string value '|RESPONSE_TYPE|', T_MESSAGE_OUTPUT_SPELLING type string value '|', T_MESSAGE_OUTPUT type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_CH1 type string value '|RESPONSE_TYPE|MESSAGE_TO_USER|TRANSFER_INFO|', + T_DIALOG_SUGGESTION_VALUE type string value '|', + T_DIALOG_SUGGESTION type string value '|LABEL|VALUE|', T_BASE_MESSAGE_INPUT_OPTIONS type string value '|', - T_SESSION_RESPONSE type string value '|SESSION_ID|', - T_RT_ENTTY_INTRPRTTN_SYS_DATE type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_DT type string value '|RESPONSE_TYPE|', + T_TURN_EVENT_CALLOUT_CALLOUT type string value '|', + T_BULK_CLASSIFY_UTTERANCE type string value '|TEXT|', T_BULK_CLASSIFY_OUTPUT type string value '|', T_BULK_CLASSIFY_RESPONSE type string value '|', + T_ENVIRONMENT type string value '|SESSION_TIMEOUT|SKILL_REFERENCES|', T_BULK_CLASSIFY_INPUT type string value '|INPUT|', - T_RUNTIME_RESPONSE_TYPE_IMAGE type string value '|RESPONSE_TYPE|SOURCE|', + T_BASE_ENVIRONMENT type string value '|', + T_LOG_MESSAGE_SOURCE_HANDLER type string value '|TYPE|ACTION|HANDLER|', + T_BASE_MESSAGE_CONTEXT_SKILL type string value '|', + T_TURN_EVENT_ACTION_FINISHED type string value '|', T_RT_RESP_GNRC_RT_RESP_TYP_CN1 type string value '|RESPONSE_TYPE|', - T_MESSAGE_RESPONSE type string value '|OUTPUT|', - T_MESSAGE_REQUEST type string value '|', - T_LOG type string value '|LOG_ID|REQUEST|RESPONSE|ASSISTANT_ID|SESSION_ID|SKILL_ID|SNAPSHOT|REQUEST_TIMESTAMP|RESPONSE_TIMESTAMP|LANGUAGE|', + T_MESSAGE_RESPONSE type string value '|OUTPUT|USER_ID|', + T_TURN_EVENT_CALLOUT_ERROR type string value '|', + T_TURN_EVENT_CALLOUT type string value '|', + T_ASSISTANT_SKILL type string value '|SKILL_ID|', + T_ASSISTANT_DATA type string value '|LANGUAGE|', + T_PAGINATION type string value '|REFRESH_URL|', + T_ENVIRONMENT_COLLECTION type string value '|ENVIRONMENTS|PAGINATION|', T_RUNTIME_RESPONSE_TYPE_PAUSE type string value '|RESPONSE_TYPE|TIME|', - T_LOG_COLLECTION type string value '|LOGS|PAGINATION|', + T_RT_RESP_GNRC_RT_RESP_TYP_US1 type string value '|RESPONSE_TYPE|USER_DEFINED|', + T_SEARCH_RESULT_HIGHLIGHT type string value '|', + T_SEARCH_RESULT_METADATA type string value '|', + T_SEARCH_RESULT_ANSWER type string value '|TEXT|CONFIDENCE|', + T_SEARCH_RESULT type string value '|ID|RESULT_METADATA|', T_RUNTIME_RESPONSE_TYPE_SEARCH type string value '|RESPONSE_TYPE|HEADER|PRIMARY_RESULTS|ADDITIONAL_RESULTS|', + T_SKILLS_EXPORT type string value '|ASSISTANT_SKILLS|ASSISTANT_STATE|', + T_RUNTIME_RESPONSE_TYPE_IFRAME type string value '|RESPONSE_TYPE|SOURCE|', T_RT_RESP_GNRC_RT_RESP_TYP_PS type string value '|RESPONSE_TYPE|TIME|', T_MESSAGE_RESPONSE_STATELESS type string value '|OUTPUT|CONTEXT|', + T_ERROR_DETAIL type string value '|MESSAGE|', + T_TURN_EVENT_HANDLER_VISITED type string value '|', T_BASE_MESSAGE_CONTEXT_GLOBAL type string value '|', - T_MESSAGE_CONTEXT_SKILL type string value '|', + T_LOG_MESSAGE_SOURCE_DIA_NODE type string value '|TYPE|DIALOG_NODE|', + T_RT_ENTTY_INTRPRTTN_SYS_NUM type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_SG1 type string value '|RESPONSE_TYPE|TITLE|SUGGESTIONS|', + T_ERROR_RESPONSE type string value '|ERROR|CODE|', + T_MESSAGE_INPUT_OPT_STATELESS type string value '|', + T_BASE_MESSAGE_INPUT type string value '|', + T_UPDATE_SKILL type string value '|', + T_BASE_SKILL type string value '|', + T_RUNTIME_RESPONSE_TYPE_DATE type string value '|RESPONSE_TYPE|', + T_RELEASE_COLLECTION type string value '|RELEASES|PAGINATION|', + T_ASSISTANT_COLLECTION type string value '|ASSISTANTS|PAGINATION|', + T_TURN_EVENT_NODE_VISITED type string value '|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_5 type string value '|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_6 type string value '|', + T_MESSAGE_INPUT_STATELESS type string value '|', + T_MESSAGE_REQUEST_STATELESS type string value '|', + T_RT_RESPONSE_TYPE_SUGGESTION type string value '|RESPONSE_TYPE|TITLE|SUGGESTIONS|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_4 type string value '|', + T_LOG_MESSAGE_SOURCE_STEP type string value '|TYPE|ACTION|STEP|', + T_TURN_EVENT_STEP_ANSWERED type string value '|', + T_SKILLS_ASYNC_REQUEST_STATUS type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_TXT type string value '|RESPONSE_TYPE|TEXT|', + T_SESSION_RESPONSE type string value '|SESSION_ID|', + T_RT_ENTTY_INTRPRTTN_SYS_DATE type string value '|', + T_RUNTIME_RESPONSE_TYPE_AUDIO type string value '|RESPONSE_TYPE|SOURCE|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_7 type string value '|', + T_LOG_MESSAGE_SOURCE_ACTION type string value '|TYPE|ACTION|', + T_RUNTIME_RESPONSE_TYPE_IMAGE type string value '|RESPONSE_TYPE|SOURCE|', + T_TURN_EVENT_STEP_VISITED type string value '|', + T_RT_RESP_GNRC_RT_RESP_TYP_AD type string value '|RESPONSE_TYPE|SOURCE|', + T_TURN_EVENT_ACTION_VISITED type string value '|', + T_MESSAGE_REQUEST type string value '|', + T_LOG type string value '|LOG_ID|REQUEST|RESPONSE|ASSISTANT_ID|SESSION_ID|SKILL_ID|SNAPSHOT|REQUEST_TIMESTAMP|RESPONSE_TIMESTAMP|LANGUAGE|', + T_MSSG_OTPT_DBG_TRN_EVNT_TRN_1 type string value '|', + T_LOG_COLLECTION type string value '|LOGS|PAGINATION|', + T_BASE_SKILL_REFERENCE type string value '|SKILL_ID|', + T_DEPLOY_RELEASE_REQUEST type string value '|ENVIRONMENT_ID|', + T_AUDIT_PROPERTIES type string value '|', + T_CREATE_SESSION type string value '|', T_RT_RESP_GNRC_RT_RESP_TYP_SR1 type string value '|RESPONSE_TYPE|HEADER|PRIMARY_RESULTS|ADDITIONAL_RESULTS|', + T_RT_RESP_GNRC_RT_RESP_TYP_IF1 type string value '|RESPONSE_TYPE|SOURCE|', T_RT_RESP_GNRC_RT_RESP_TYP_OPT type string value '|RESPONSE_TYPE|TITLE|OPTIONS|', __DUMMY type string value SPACE, end of C_REQUIRED_FIELDS . @@ -1295,6 +2828,31 @@ constants: "!

Map ABAP identifiers to service identifiers.

begin of C_ABAPNAME_DICTIONARY, MESSAGE type string value 'message', + ASSISTANTS type string value 'assistants', + PAGINATION type string value 'pagination', + ASSISTANT_ID type string value 'assistant_id', + NAME type string value 'name', + DESCRIPTION type string value 'description', + LANGUAGE type string value 'language', + ASSISTANT_SKILLS type string value 'assistant_skills', + ASSISTANT_SKILL type string value 'assistant_skill', + ASSISTANT_ENVIRONMENTS type string value 'assistant_environments', + ASSISTANT_ENVIRONMENT type string value 'assistant_environment', + SKILL_ID type string value 'skill_id', + TYPE type string value 'type', + ACTION_DISABLED type string value 'action_disabled', + DIALOG_DISABLED type string value 'dialog_disabled', + CREATED type string value 'created', + UPDATED type string value 'updated', + ENVIRONMENT_ID type string value 'environment_id', + ENVIRONMENT type string value 'environment', + RELEASE_REFERENCE type string value 'release_reference', + ORCHESTRATION type string value 'orchestration', + SESSION_TIMEOUT type string value 'session_timeout', + INTEGRATION_REFERENCES type string value 'integration_references', + INTEGRATION_REFERENCE type string value 'integration_reference', + SKILL_REFERENCES type string value 'skill_references', + SKILL_REFERENCE type string value 'skill_reference', SYSTEM type string value 'system', MESSAGE_TYPE type string value 'message_type', TEXT type string value 'text', @@ -1303,51 +2861,77 @@ constants: ENTITIES type string value 'entities', ENTITY type string value 'entity', SUGGESTION_ID type string value 'suggestion_id', + ATTACHMENTS type string value 'attachments', + ANALYTICS type string value 'analytics', RESTART type string value 'restart', ALTERNATE_INTENTS type string value 'alternate_intents', SPELLING type string value 'spelling', + USER_DEFINED type string value 'user_defined', + INNER type string value 'inner', + WORKSPACE type string value 'workspace', + STATUS type string value 'status', + STATUS_ERRORS type string value 'status_errors', + STATUS_DESCRIPTION type string value 'status_description', + DIALOG_SETTINGS type string value 'dialog_settings', + WORKSPACE_ID type string value 'workspace_id', + VALID type string value 'valid', + NEXT_SNAPSHOT_VERSION type string value 'next_snapshot_version', + SEARCH_SETTINGS type string value 'search_settings', + WARNINGS type string value 'warnings', INPUT type string value 'input', OUTPUT type string value 'output', + TARGET type string value 'target', + CHAT type string value 'chat', + URL type string value 'url', LEVEL type string value 'level', - NAME type string value 'name', - TYPE type string value 'type', + CODE type string value 'code', + SOURCE type string value 'source', PARAMETERS type string value 'parameters', - INNER type string value 'inner', RESULT_VARIABLE type string value 'result_variable', CREDENTIALS type string value 'credentials', - TARGET type string value 'target', LABEL type string value 'label', VALUE type string value 'value', + DIALOG_NODE type string value 'dialog_node', + TITLE type string value 'title', + CONDITIONS type string value 'conditions', + ENVIRONMENTS type string value 'environments', + DISABLED type string value 'disabled', + SNAPSHOT type string value 'snapshot', PATH type string value 'path', ERROR type string value 'error', ERRORS type string value 'errors', - CODE type string value 'code', + INTEGRATION_ID type string value 'integration_id', LOG_ID type string value 'log_id', REQUEST type string value 'request', RESPONSE type string value 'response', - ASSISTANT_ID type string value 'assistant_id', SESSION_ID type string value 'session_id', - SKILL_ID type string value 'skill_id', - SNAPSHOT type string value 'snapshot', REQUEST_TIMESTAMP type string value 'request_timestamp', RESPONSE_TIMESTAMP type string value 'response_timestamp', - LANGUAGE type string value 'language', CUSTOMER_ID type string value 'customer_id', LOGS type string value 'logs', - PAGINATION type string value 'pagination', + ACTION type string value 'action', + STEP type string value 'step', + HANDLER type string value 'handler', NEXT_URL type string value 'next_url', MATCHED type string value 'matched', NEXT_CURSOR type string value 'next_cursor', GLOBAL type string value 'global', SKILLS type string value 'skills', + INTEGRATIONS type string value 'integrations', + ACTION_VARIABLES type string value 'action_variables', + SKILL_VARIABLES type string value 'skill_variables', TIMEZONE type string value 'timezone', USER_ID type string value 'user_id', TURN_COUNT type string value 'turn_count', LOCALE type string value 'locale', REFERENCE_TIME type string value 'reference_time', - USER_DEFINED type string value 'user_defined', + SESSION_START_TIME type string value 'session_start_time', STATE type string value 'state', + SKIP_USER_INPUT type string value 'skip_user_input', + MAIN_SKILL type string value 'main skill', + ACTIONS_SKILL type string value 'actions skill', OPTIONS type string value 'options', + MEDIA_TYPE type string value 'media_type', DEBUG type string value 'debug', RETURN_CONTEXT type string value 'return_context', EXPORT type string value 'export', @@ -1361,22 +2945,28 @@ constants: LOG_MESSAGES type string value 'log_messages', BRANCH_EXITED type string value 'branch_exited', BRANCH_EXITED_REASON type string value 'branch_exited_reason', - PREVIEW type string value 'preview', - DISAMBIGUATION type string value 'disambiguation', - ALTERNATE_RESPONSES type string value 'alternate_responses', - OUTCOME type string value 'outcome', - MODEL_TYPE type string value 'model_type', - MODEL_ID type string value 'model_id', + TURN_EVENTS type string value 'turn_events', ORIGINAL_TEXT type string value 'original_text', SUGGESTED_TEXT type string value 'suggested_text', CONTEXT type string value 'context', + REFRESH_URL type string value 'refresh_url', + TOTAL type string value 'total', + REFRESH_CURSOR type string value 'refresh_cursor', + RELEASE type string value 'release', + ENVIRONMENT_REFERENCES type string value 'environment_references', + CONTENT type string value 'content', + RELEASES type string value 'releases', + BROWSER type string value 'browser', + DEVICE type string value 'device', + PAGEURL type string value 'pageUrl', + CHANNEL type string value 'channel', LOCATION type string value 'location', CONFIDENCE type string value 'confidence', - METADATA type string value 'metadata', GROUPS type string value 'groups', INTERPRETATION type string value 'interpretation', ALTERNATIVES type string value 'alternatives', ROLE type string value 'role', + SKILL type string value 'skill', CALENDAR_TYPE type string value 'calendar_type', DATETIME_LINK type string value 'datetime_link', FESTIVAL type string value 'festival', @@ -1403,14 +2993,16 @@ constants: SPECIFIC_MINUTE type string value 'specific_minute', SPECIFIC_SECOND type string value 'specific_second', RESPONSE_TYPE type string value 'response_type', + CHANNELS type string value 'channels', + CHANNEL_OPTIONS type string value 'channel_options', + ALT_TEXT type string value 'alt_text', + MESSAGE_TO_USER type string value 'message_to_user', + TRANSFER_INFO type string value 'transfer_info', MESSAGE_TO_HUMAN_AGENT type string value 'message_to_human_agent', AGENT_AVAILABLE type string value 'agent_available', AGENT_UNAVAILABLE type string value 'agent_unavailable', - TRANSFER_INFO type string value 'transfer_info', TOPIC type string value 'topic', - SOURCE type string value 'source', - TITLE type string value 'title', - DESCRIPTION type string value 'description', + IMAGE_URL type string value 'image_url', PREFERENCE type string value 'preference', TIME type string value 'time', TYPING type string value 'typing', @@ -1420,12 +3012,36 @@ constants: ID type string value 'id', RESULT_METADATA type string value 'result_metadata', BODY type string value 'body', - URL type string value 'url', HIGHLIGHT type string value 'highlight', + ANSWERS type string value 'answers', SCORE type string value 'score', + DISCOVERY type string value 'discovery', + MESSAGES type string value 'messages', + SCHEMA_MAPPING type string value 'schema_mapping', + INSTANCE_ID type string value 'instance_id', + PROJECT_ID type string value 'project_id', + MAX_PRIMARY_RESULTS type string value 'max_primary_results', + MAX_TOTAL_RESULTS type string value 'max_total_results', + CONFIDENCE_THRESHOLD type string value 'confidence_threshold', + FIND_ANSWERS type string value 'find_answers', + AUTHENTICATION type string value 'authentication', + BASIC type string value 'basic', + BEARER type string value 'bearer', + SUCCESS type string value 'success', + NO_RESULT type string value 'no_result', + ASSISTANT_STATE type string value 'assistant_state', + EVENT type string value 'event', + ACTION_START_TIME type string value 'action_start_time', + CONDITION_TYPE type string value 'condition_type', + REASON type string value 'reason', + ACTION_TITLE type string value 'action_title', + CONDITION type string value 'condition', + CALLOUT type string value 'callout', + INTERNAL type string value 'internal', + PROMPTED type string value 'prompted', + HAS_QUESTION type string value 'has_question', + SEARCH_SKILL_FALLBACK type string value 'search_skill_fallback', GROUP type string value 'group', - DIALOG_NODE type string value 'dialog_node', - CONDITIONS type string value 'conditions', end of C_ABAPNAME_DICTIONARY . @@ -1437,29 +3053,122 @@ constants: redefinition . - "!

Create a session

- "! Create a new session. A session is used to send user input to a skill and - "! receive responses. It also maintains the state of the conversation. A session - "! persists until it is deleted, or until it times out because of inactivity. (For - "! more information, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - "! settings). - "! - "! @parameter I_ASSISTANT_ID | - "! Unique identifier of the assistant. To find the assistant ID in the Watson - "! Assistant user interface, open the assistant settings and click **API - "! Details**. For information about creating assistants, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - "! add#assistant-add-task).
+ "!

Create an assistant

+ "! Create a new assistant.
"!
- "! **Note:** Currently, the v2 API does not support creating assistants. + "! This method is available only with Enterprise plans. + "! + "! @parameter I_REQUEST | + "! The properties of the new assistant. "! @parameter E_RESPONSE | - "! Service return value of type T_SESSION_RESPONSE + "! Service return value of type T_ASSISTANT_DATA + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_ASSISTANT + importing + !I_REQUEST type T_ASSISTANT_DATA optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ASSISTANT_DATA + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

List assistants

+ "! List the assistants associated with a Watson Assistant service instance.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_PAGE_LIMIT | + "! The number of records to return in each page of results. + "! @parameter I_INCLUDE_COUNT | + "! Whether to include information about the number of records that satisfy the + "! request, regardless of the page limit. If this parameter is `true`, the + "! `pagination` object in the response includes the `total` property. + "! @parameter I_SORT | + "! The attribute by which returned assistants will be sorted. To reverse the sort + "! order, prefix the value with a minus sign (`-`). + "! @parameter I_CURSOR | + "! A token identifying the page of results to retrieve. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_ASSISTANT_COLLECTION + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_ASSISTANTS + importing + !I_PAGE_LIMIT type INTEGER default 100 + !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false + !I_SORT type STRING optional + !I_CURSOR type STRING optional + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ASSISTANT_COLLECTION + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete assistant

+ "! Delete an assistant.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_ASSISTANT + importing + !I_ASSISTANT_ID type STRING + !I_accept type string default 'application/json' + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Create a session

+ "! Create a new session. A session is used to send user input to a skill and + "! receive responses. It also maintains the state of the conversation. A session + "! persists until it is deleted, or until it times out because of inactivity. (For + "! more information, see the + "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- + "! settings). + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_CREATESESSION | + "! No documentation available. + "! @parameter E_RESPONSE | + "! Service return value of type T_SESSION_RESPONSE "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! methods CREATE_SESSION importing !I_ASSISTANT_ID type STRING + !I_CREATESESSION type T_CREATE_SESSION optional + !I_contenttype type string default 'application/json' !I_accept type string default 'application/json' exporting !E_RESPONSE type T_SESSION_RESPONSE @@ -1472,13 +3181,19 @@ constants: "! settings)). "! "! @parameter I_ASSISTANT_ID | - "! Unique identifier of the assistant. To find the assistant ID in the Watson - "! Assistant user interface, open the assistant settings and click **API - "! Details**. For information about creating assistants, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - "! add#assistant-add-task).
+ "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
"!
- "! **Note:** Currently, the v2 API does not support creating assistants. + "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. "! @parameter I_SESSION_ID | "! Unique identifier of the session. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -1497,13 +3212,19 @@ constants: "! session. "! "! @parameter I_ASSISTANT_ID | - "! Unique identifier of the assistant. To find the assistant ID in the Watson - "! Assistant user interface, open the assistant settings and click **API - "! Details**. For information about creating assistants, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - "! add#assistant-add-task).
+ "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
"!
- "! **Note:** Currently, the v2 API does not support creating assistants. + "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. "! @parameter I_SESSION_ID | "! Unique identifier of the session. "! @parameter I_REQUEST | @@ -1529,13 +3250,19 @@ constants: "! (including context data) managed by your application. "! "! @parameter I_ASSISTANT_ID | - "! Unique identifier of the assistant. To find the assistant ID in the Watson - "! Assistant user interface, open the assistant settings and click **API - "! Details**. For information about creating assistants, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - "! add#assistant-add-task).
+ "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
"!
- "! **Note:** Currently, the v2 API does not support creating assistants. + "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. "! @parameter I_REQUEST | "! The message to be sent. This includes the user's input, context data, and "! optional content such as intents and entities. @@ -1560,7 +3287,7 @@ constants: "! method is useful for testing and comparing the performance of different skills "! or skill versions.
"!
- "! This method is available only with Premium plans. + "! This method is available only with Enterprise with Data Isolation plans. "! "! @parameter I_SKILL_ID | "! Unique identifier of the skill. To find the skill ID in the Watson Assistant @@ -1574,7 +3301,7 @@ constants: methods BULK_CLASSIFY importing !I_SKILL_ID type STRING - !I_REQUEST type T_BULK_CLASSIFY_INPUT optional + !I_REQUEST type T_BULK_CLASSIFY_INPUT !I_contenttype type string default 'application/json' !I_accept type string default 'application/json' exporting @@ -1582,152 +3309,2031 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . - "!

List log events for an assistant

- "! List the events from the log of an assistant.
- "!
- "! This method is available only with Premium plans. - "! - "! @parameter I_ASSISTANT_ID | - "! Unique identifier of the assistant. To find the assistant ID in the Watson - "! Assistant user interface, open the assistant settings and click **API - "! Details**. For information about creating assistants, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-assistant- - "! add#assistant-add-task).
- "!
- "! **Note:** Currently, the v2 API does not support creating assistants. - "! @parameter I_SORT | - "! How to sort the returned log events. You can sort by **request_timestamp**. To - "! reverse the sort order, prefix the parameter value with a minus sign (`-`). - "! @parameter I_FILTER | - "! A cacheable parameter that limits the results to those matching the specified - "! filter. For more information, see the - "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-ref - "! erence#filter-reference). - "! @parameter I_PAGE_LIMIT | - "! The number of records to return in each page of results. - "! @parameter I_CURSOR | - "! A token identifying the page of results to retrieve. - "! @parameter E_RESPONSE | - "! Service return value of type T_LOG_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_LOGS - importing - !I_ASSISTANT_ID type STRING - !I_SORT type STRING optional - !I_FILTER type STRING optional - !I_PAGE_LIMIT type INTEGER optional - !I_CURSOR type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LOG_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . + "!

List log events for an assistant

+ "! List the events from the log of an assistant.
+ "!
+ "! This method requires Manager access, and is available only with Plus and + "! Enterprise plans.
+ "!
+ "! **Note:** If you use the **cursor** parameter to retrieve results one page at a + "! time, subsequent requests must be no more than 5 minutes apart. Any returned + "! value for the **cursor** parameter becomes invalid after 5 minutes. For more + "! information about using pagination, see [Pagination](#pagination). + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_SORT | + "! How to sort the returned log events. You can sort by **request_timestamp**. To + "! reverse the sort order, prefix the parameter value with a minus sign (`-`). + "! @parameter I_FILTER | + "! A cacheable parameter that limits the results to those matching the specified + "! filter. For more information, see the + "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-ref + "! erence#filter-reference). + "! @parameter I_PAGE_LIMIT | + "! The number of records to return in each page of results. + "! @parameter I_CURSOR | + "! A token identifying the page of results to retrieve. + "! @parameter E_RESPONSE | + "! Service return value of type T_LOG_COLLECTION + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_LOGS + importing + !I_ASSISTANT_ID type STRING + !I_SORT type STRING optional + !I_FILTER type STRING optional + !I_PAGE_LIMIT type INTEGER default 100 + !I_CURSOR type STRING optional + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_LOG_COLLECTION + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Delete labeled data

+ "! Deletes all data associated with a specified customer ID. The method has no + "! effect if no data is associated with the customer ID.
+ "!
+ "! You associate a customer ID with data by passing the `X-Watson-Metadata` header + "! with a request that passes data. For more information about personal data and + "! customer IDs, see [Information + "! security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-secu + "! rity#information-security).
+ "!
+ "! **Note:** This operation is intended only for deleting data associated with a + "! single specific customer, not for deleting data associated with multiple + "! customers or for any other purpose. For more information, see [Labeling and + "! deleting data in Watson + "! Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-sec + "! urity#information-security-gdpr-wa). + "! + "! @parameter I_CUSTOMER_ID | + "! The customer ID for which all data is to be deleted. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_USER_DATA + importing + !I_CUSTOMER_ID type STRING + !I_accept type string default 'application/json' + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List environments

+ "! List the environments associated with an assistant.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_PAGE_LIMIT | + "! The number of records to return in each page of results. + "! @parameter I_INCLUDE_COUNT | + "! Whether to include information about the number of records that satisfy the + "! request, regardless of the page limit. If this parameter is `true`, the + "! `pagination` object in the response includes the `total` property. + "! @parameter I_SORT | + "! The attribute by which returned environments will be sorted. To reverse the sort + "! order, prefix the value with a minus sign (`-`). + "! @parameter I_CURSOR | + "! A token identifying the page of results to retrieve. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENVIRONMENT_COLLECTION + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_ENVIRONMENTS + importing + !I_ASSISTANT_ID type STRING + !I_PAGE_LIMIT type INTEGER default 100 + !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false + !I_SORT type STRING optional + !I_CURSOR type STRING optional + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENVIRONMENT_COLLECTION + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get environment

+ "! Get information about an environment. For more information about environments, + "! see + "! [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assista + "! nt-publish-overview#environments).
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_ENVIRONMENT_ID | + "! Unique identifier of the environment. To find the environment ID in the Watson + "! Assistant user interface, open the environment settings and click **API + "! Details**. **Note:** Currently, the API does not support creating environments. + "! + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENVIRONMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_ENVIRONMENT + importing + !I_ASSISTANT_ID type STRING + !I_ENVIRONMENT_ID type STRING + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENVIRONMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update environment

+ "! Update an environment with new or modified data. For more information about + "! environments, see + "! [Environments](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assista + "! nt-publish-overview#environments).
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_ENVIRONMENT_ID | + "! Unique identifier of the environment. To find the environment ID in the Watson + "! Assistant user interface, open the environment settings and click **API + "! Details**. **Note:** Currently, the API does not support creating environments. + "! + "! @parameter I_UPDATEENVIRONMENT | + "! The updated properties of the environment. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENVIRONMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_ENVIRONMENT + importing + !I_ASSISTANT_ID type STRING + !I_ENVIRONMENT_ID type STRING + !I_UPDATEENVIRONMENT type T_UPDATE_ENVIRONMENT optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENVIRONMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Create release

+ "! Create a new release using the current content of the dialog and action skills + "! in the draft environment. (In the Watson Assistant user interface, a release is + "! called a *version*.)
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_RELEASE | + "! An object describing the release. + "! @parameter E_RESPONSE | + "! Service return value of type T_RELEASE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_RELEASE + importing + !I_ASSISTANT_ID type STRING + !I_RELEASE type T_RELEASE optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_RELEASE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

List releases

+ "! List the releases associated with an assistant. (In the Watson Assistant user + "! interface, a release is called a *version*.)
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_PAGE_LIMIT | + "! The number of records to return in each page of results. + "! @parameter I_INCLUDE_COUNT | + "! Whether to include information about the number of records that satisfy the + "! request, regardless of the page limit. If this parameter is `true`, the + "! `pagination` object in the response includes the `total` property. + "! @parameter I_SORT | + "! The attribute by which returned workspaces will be sorted. To reverse the sort + "! order, prefix the value with a minus sign (`-`). + "! @parameter I_CURSOR | + "! A token identifying the page of results to retrieve. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_RELEASE_COLLECTION + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_RELEASES + importing + !I_ASSISTANT_ID type STRING + !I_PAGE_LIMIT type INTEGER default 100 + !I_INCLUDE_COUNT type BOOLEAN default c_boolean_false + !I_SORT type STRING optional + !I_CURSOR type STRING optional + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_RELEASE_COLLECTION + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get release

+ "! Get information about a release.
+ "!
+ "! Release data is not available until publishing of the release completes. If + "! publishing is still in progress, you can continue to poll by calling the same + "! request again and checking the value of the **status** property. When + "! processing has completed, the request returns the release data.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_RELEASE | + "! Unique identifier of the release. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_RELEASE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_RELEASE + importing + !I_ASSISTANT_ID type STRING + !I_RELEASE type STRING + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_RELEASE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete release

+ "! Delete a release. (In the Watson Assistant user interface, a release is called a + "! *version*.)
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_RELEASE | + "! Unique identifier of the release. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_RELEASE + importing + !I_ASSISTANT_ID type STRING + !I_RELEASE type STRING + !I_accept type string default 'application/json' + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Deploy release

+ "! Update the environment with the content of the release. All snapshots saved as + "! part of the release become active in the environment.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_RELEASE | + "! Unique identifier of the release. + "! @parameter I_REQUEST | + "! An input object that identifies the environment where the release is to be + "! deployed. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENVIRONMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DEPLOY_RELEASE + importing + !I_ASSISTANT_ID type STRING + !I_RELEASE type STRING + !I_REQUEST type T_DEPLOY_RELEASE_REQUEST + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENVIRONMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Get skill

+ "! Get information about a skill.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_SKILL_ID | + "! Unique identifier of the skill. To find the skill ID in the Watson Assistant + "! user interface, open the skill settings and click **API Details**. + "! @parameter E_RESPONSE | + "! Service return value of type T_SKILL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_SKILL + importing + !I_ASSISTANT_ID type STRING + !I_SKILL_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SKILL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update skill

+ "! Update a skill with new or modified data.
+ "!
+ "! **Note:** The update is performed asynchronously; you can see the status of + "! the update by calling the **Get skill** method and checking the value of the + "! **status** property.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_SKILL_ID | + "! Unique identifier of the skill. To find the skill ID in the Watson Assistant + "! user interface, open the skill settings and click **API Details**. + "! @parameter I_UPDATESKILL | + "! The updated properties of the skill. + "! @parameter E_RESPONSE | + "! Service return value of type T_SKILL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_SKILL + importing + !I_ASSISTANT_ID type STRING + !I_SKILL_ID type STRING + !I_UPDATESKILL type T_UPDATE_SKILL + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SKILL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Export skills

+ "! Asynchronously export the action skill and dialog skill (if enabled) for the + "! assistant. Use this method to save all skill data so that you can import it to + "! a different assistant using the **Import skills** method.
+ "!
+ "! A successful call to this method only initiates an asynchronous export. The + "! exported JSON data is not available until processing completes.
+ "!
+ "! After the initial request is submitted, you can poll the status of the + "! operation by calling the same request again and checking the value of the + "! **status** property. If an error occurs (indicated by a **status** value of + "! `Failed`), the `status_description` property provides more information about + "! the error, and the `status_errors` property contains an array of error messages + "! that caused the failure.
+ "!
+ "! When processing has completed, the request returns the exported JSON data. + "! Remember that the usual rate limits apply.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_SKILLS_EXPORT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods EXPORT_SKILLS + importing + !I_ASSISTANT_ID type STRING + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SKILLS_EXPORT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Import skills

+ "! Asynchronously import skills into an existing assistant from a previously + "! exported file.
+ "!
+ "! The request body for this method should contain the response data that was + "! received from a previous call to the **Export skills** method, without + "! modification.
+ "!
+ "! A successful call to this method initiates an asynchronous import. The updated + "! skills belonging to the assistant are not available until processing completes. + "! To check the status of the asynchronous import operation, use the **Get status + "! of skills import** method.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter I_SKILLSIMPORT | + "! An input object that contains the skills to import. + "! @parameter I_INCLUDE_AUDIT | + "! Whether to include the audit properties (`created` and `updated` timestamps) in + "! the response. + "! @parameter E_RESPONSE | + "! Service return value of type T_SKILLS_ASYNC_REQUEST_STATUS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods IMPORT_SKILLS + importing + !I_ASSISTANT_ID type STRING + !I_SKILLSIMPORT type T_SKILLS_IMPORT + !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SKILLS_ASYNC_REQUEST_STATUS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get status of skills import

+ "! Retrieve the status of an asynchronous import operation previously initiated by + "! using the **Import skills** method.
+ "!
+ "! This method is available only with Enterprise plans. + "! + "! @parameter I_ASSISTANT_ID | + "! The assistant ID or the environment ID of the environment where the assistant is + "! deployed, depending on the type of request:
+ "! - For message, session, and log requests, specify the environment ID of the + "! environment where the assistant is deployed.
+ "! - For all other requests, specify the assistant ID of the assistant.
+ "!
+ "! To find the environment ID or assistant ID in the Watson Assistant user + "! interface, open the assistant settings and scroll to the **Environments** + "! section.
+ "!
+ "! **Note:** If you are using the classic Watson Assistant experience, always use + "! the assistant ID. To find the assistant ID in the user interface, open the + "! assistant settings and click API Details. + "! @parameter E_RESPONSE | + "! Service return value of type T_SKILLS_ASYNC_REQUEST_STATUS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods IMPORT_SKILLS_STATUS + importing + !I_ASSISTANT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SKILLS_ASYNC_REQUEST_STATUS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + +protected section. + +private section. + +ENDCLASS. + +class ZCL_IBMC_ASSISTANT_V2 IMPLEMENTATION. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_APPNAME +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_APPNAME TYPE STRING +* +-------------------------------------------------------------------------------------- + method GET_APPNAME. + + e_appname = 'Watson Assistant v2'. + + endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Protected Method ZCL_IBMC_ASSISTANT_V2->GET_REQUEST_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) +* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP +* +-------------------------------------------------------------------------------------- +method GET_REQUEST_PROP. + + data: + lv_auth_method type string ##NEEDED. + + e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). + + lv_auth_method = i_auth_method. + if lv_auth_method eq c_default. + lv_auth_method = 'IAM'. + endif. + if lv_auth_method is initial. + e_request_prop-auth_basic = c_boolean_false. + e_request_prop-auth_oauth = c_boolean_false. + e_request_prop-auth_apikey = c_boolean_false. + elseif lv_auth_method eq 'IAM'. + e_request_prop-auth_name = 'IAM'. + e_request_prop-auth_type = 'apiKey'. + e_request_prop-auth_headername = 'Authorization'. + e_request_prop-auth_query = c_boolean_false. + e_request_prop-auth_header = c_boolean_true. + else. + endif. + + e_request_prop-url-protocol = 'https'. + e_request_prop-url-host = 'api.us-south.assistant.watson.cloud.ibm.com'. + e_request_prop-url-path_base = ''. + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_SDK_VERSION_DATE +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_SDK_VERSION_DATE TYPE STRING +* +-------------------------------------------------------------------------------------- + method get_sdk_version_date. + + e_sdk_version_date = '20231212104231'. + + endmethod. + + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->CREATE_ASSISTANT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST TYPE T_ASSISTANT_DATA(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ASSISTANT_DATA +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_ASSISTANT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants'. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_REQUEST is initial. + lv_datatype = get_datatype( i_REQUEST ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_REQUEST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'request' i_value = i_REQUEST ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_REQUEST to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->LIST_ASSISTANTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) +* | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_SORT TYPE STRING(optional) +* | [--->] I_CURSOR TYPE STRING(optional) +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ASSISTANT_COLLECTION +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_ASSISTANTS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_PAGE_LIMIT is supplied. + lv_queryparam = i_PAGE_LIMIT. + add_query_parameter( + exporting + i_parameter = `page_limit` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_COUNT is supplied. + lv_queryparam = i_INCLUDE_COUNT. + add_query_parameter( + exporting + i_parameter = `include_count` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_SORT is supplied. + lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sort` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CURSOR is supplied. + lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `cursor` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DELETE_ASSISTANT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_ASSISTANT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->CREATE_SESSION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_CREATESESSION TYPE T_CREATE_SESSION(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_SESSION_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_SESSION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/sessions'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_CREATESESSION is initial. + lv_datatype = get_datatype( i_CREATESESSION ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_CREATESESSION i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'CreateSession' i_value = i_CREATESESSION ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_CREATESESSION to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DELETE_SESSION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_SESSION_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_SESSION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/sessions/{session_id}'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + replace all occurrences of `{session_id}` in ls_request_prop-url-path with i_SESSION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->MESSAGE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_SESSION_ID TYPE STRING +* | [--->] I_REQUEST TYPE T_MESSAGE_REQUEST(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_MESSAGE_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method MESSAGE. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/sessions/{session_id}/message'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + replace all occurrences of `{session_id}` in ls_request_prop-url-path with i_SESSION_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_REQUEST is initial. + lv_datatype = get_datatype( i_REQUEST ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_REQUEST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'request' i_value = i_REQUEST ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_REQUEST to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->MESSAGE_STATELESS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_REQUEST TYPE T_MESSAGE_REQUEST_STATELESS(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_MESSAGE_RESPONSE_STATELESS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method MESSAGE_STATELESS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/message'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_REQUEST is initial. + lv_datatype = get_datatype( i_REQUEST ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_REQUEST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'request' i_value = i_REQUEST ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_REQUEST to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->BULK_CLASSIFY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_SKILL_ID TYPE STRING +* | [--->] I_REQUEST TYPE T_BULK_CLASSIFY_INPUT +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_BULK_CLASSIFY_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method BULK_CLASSIFY. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/skills/{skill_id}/workspace/bulk_classify'. + replace all occurrences of `{skill_id}` in ls_request_prop-url-path with i_SKILL_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_REQUEST ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_REQUEST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'request' i_value = i_REQUEST ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_REQUEST to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->LIST_LOGS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_SORT TYPE STRING(optional) +* | [--->] I_FILTER TYPE STRING(optional) +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) +* | [--->] I_CURSOR TYPE STRING(optional) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_LOG_COLLECTION +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_LOGS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/logs'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_SORT is supplied. + lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sort` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_FILTER is supplied. + lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `filter` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_PAGE_LIMIT is supplied. + lv_queryparam = i_PAGE_LIMIT. + add_query_parameter( + exporting + i_parameter = `page_limit` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CURSOR is supplied. + lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `cursor` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DELETE_USER_DATA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CUSTOMER_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_USER_DATA. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/user_data'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + lv_queryparam = escape( val = i_CUSTOMER_ID format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `customer_id` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->LIST_ENVIRONMENTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) +* | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_SORT TYPE STRING(optional) +* | [--->] I_CURSOR TYPE STRING(optional) +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENVIRONMENT_COLLECTION +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_ENVIRONMENTS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/environments'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_PAGE_LIMIT is supplied. + lv_queryparam = i_PAGE_LIMIT. + add_query_parameter( + exporting + i_parameter = `page_limit` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_COUNT is supplied. + lv_queryparam = i_INCLUDE_COUNT. + add_query_parameter( + exporting + i_parameter = `include_count` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_SORT is supplied. + lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sort` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CURSOR is supplied. + lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `cursor` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_ENVIRONMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_ENVIRONMENT_ID TYPE STRING +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENVIRONMENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_ENVIRONMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/environments/{environment_id}'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->UPDATE_ENVIRONMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_ENVIRONMENT_ID TYPE STRING +* | [--->] I_UPDATEENVIRONMENT TYPE T_UPDATE_ENVIRONMENT(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENVIRONMENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_ENVIRONMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/environments/{environment_id}'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_UPDATEENVIRONMENT is initial. + lv_datatype = get_datatype( i_UPDATEENVIRONMENT ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_UPDATEENVIRONMENT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'UpdateEnvironment' i_value = i_UPDATEENVIRONMENT ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_UPDATEENVIRONMENT to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. - "!

Delete labeled data

- "! Deletes all data associated with a specified customer ID. The method has no - "! effect if no data is associated with the customer ID.
- "!
- "! You associate a customer ID with data by passing the `X-Watson-Metadata` header - "! with a request that passes data. For more information about personal data and - "! customer IDs, see [Information - "! security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-secu - "! rity#information-security).
- "!
- "! This operation is limited to 4 requests per minute. For more information, see - "! **Rate limiting**. - "! - "! @parameter I_CUSTOMER_ID | - "! The customer ID for which all data is to be deleted. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_USER_DATA - importing - !I_CUSTOMER_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). -protected section. -private section. + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). -ENDCLASS. +endmethod. -class ZCL_IBMC_ASSISTANT_V2 IMPLEMENTATION. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_APPNAME +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->CREATE_RELEASE * +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_RELEASE TYPE T_RELEASE(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_RELEASE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- - method GET_APPNAME. +method CREATE_RELEASE. - e_appname = 'Watson Assistant v2'. + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. - endmethod. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/releases'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_RELEASE is initial. + lv_datatype = get_datatype( i_RELEASE ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_RELEASE i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'Release' i_value = i_RELEASE ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_RELEASE to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). +endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_ASSISTANT_V2->GET_REQUEST_PROP +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->LIST_RELEASES * +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_PAGE_LIMIT TYPE INTEGER (default =100) +* | [--->] I_INCLUDE_COUNT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_SORT TYPE STRING(optional) +* | [--->] I_CURSOR TYPE STRING(optional) +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_RELEASE_COLLECTION +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. +method LIST_RELEASES. - data: - lv_auth_method type string ##NEEDED. + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/releases'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_PAGE_LIMIT is supplied. + lv_queryparam = i_PAGE_LIMIT. + add_query_parameter( + exporting + i_parameter = `page_limit` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_COUNT is supplied. + lv_queryparam = i_INCLUDE_COUNT. + add_query_parameter( + exporting + i_parameter = `include_count` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_SORT is supplied. + lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sort` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CURSOR is supplied. + lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `cursor` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.assistant.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. -endmethod. -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - e_sdk_version_date = '20210312144427'. + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - endmethod. + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). +endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->CREATE_SESSION +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_RELEASE * +-------------------------------------------------------------------------------------------------+ * | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_RELEASE TYPE STRING +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_SESSION_RESPONSE +* | [<---] E_RESPONSE TYPE T_RELEASE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method CREATE_SESSION. +method GET_RELEASE. data: ls_request_prop type ts_request_prop, @@ -1736,8 +5342,9 @@ method CREATE_SESSION. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/assistants/{assistant_id}/sessions'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/releases/{release}'. replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + replace all occurrences of `{release}` in ls_request_prop-url-path with i_RELEASE ignoring case. " standard headers ls_request_prop-header_accept = I_accept. @@ -1745,15 +5352,28 @@ method CREATE_SESSION. changing c_url = ls_request_prop-url ). + " process query parameters + data: + lv_queryparam type string. + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). " retrieve JSON data @@ -1768,14 +5388,14 @@ method CREATE_SESSION. endmethod. * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DELETE_SESSION +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DELETE_RELEASE * +-------------------------------------------------------------------------------------------------+ * | [--->] I_ASSISTANT_ID TYPE STRING -* | [--->] I_SESSION_ID TYPE STRING +* | [--->] I_RELEASE TYPE STRING * | [--->] I_accept TYPE string (default ='application/json') * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method DELETE_SESSION. +method DELETE_RELEASE. data: ls_request_prop type ts_request_prop, @@ -1784,9 +5404,9 @@ method DELETE_SESSION. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/assistants/{assistant_id}/sessions/{session_id}'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/releases/{release}'. replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. - replace all occurrences of `{session_id}` in ls_request_prop-url-path with i_SESSION_ID ignoring case. + replace all occurrences of `{release}` in ls_request_prop-url-path with i_RELEASE ignoring case. " standard headers ls_request_prop-header_accept = I_accept. @@ -1808,19 +5428,19 @@ method DELETE_SESSION. endmethod. - * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->MESSAGE +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DEPLOY_RELEASE * +-------------------------------------------------------------------------------------------------+ * | [--->] I_ASSISTANT_ID TYPE STRING -* | [--->] I_SESSION_ID TYPE STRING -* | [--->] I_REQUEST TYPE T_MESSAGE_REQUEST(optional) +* | [--->] I_RELEASE TYPE STRING +* | [--->] I_REQUEST TYPE T_DEPLOY_RELEASE_REQUEST +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_contenttype TYPE string (default ='application/json') * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_MESSAGE_RESPONSE +* | [<---] E_RESPONSE TYPE T_ENVIRONMENT * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method MESSAGE. +method DEPLOY_RELEASE. data: ls_request_prop type ts_request_prop, @@ -1829,9 +5449,9 @@ method MESSAGE. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/assistants/{assistant_id}/sessions/{session_id}/message'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/releases/{release}/deploy'. replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. - replace all occurrences of `{session_id}` in ls_request_prop-url-path with i_SESSION_ID ignoring case. + replace all occurrences of `{release}` in ls_request_prop-url-path with i_RELEASE ignoring case. " standard headers ls_request_prop-header_content_type = I_contenttype. @@ -1840,7 +5460,20 @@ method MESSAGE. changing c_url = ls_request_prop-url ). + " process query parameters + data: + lv_queryparam type string. + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. + add_query_parameter( + exporting + i_parameter = `include_audit` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. @@ -1853,7 +5486,6 @@ method MESSAGE. field-symbols: type any. lv_separator = ''. - if not i_REQUEST is initial. lv_datatype = get_datatype( i_REQUEST ). if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or @@ -1871,14 +5503,24 @@ method MESSAGE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1899,17 +5541,17 @@ method MESSAGE. endmethod. + * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->MESSAGE_STATELESS +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->GET_SKILL * +-------------------------------------------------------------------------------------------------+ * | [--->] I_ASSISTANT_ID TYPE STRING -* | [--->] I_REQUEST TYPE T_MESSAGE_REQUEST_STATELESS(optional) -* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_SKILL_ID TYPE STRING * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_MESSAGE_RESPONSE_STATELESS +* | [<---] E_RESPONSE TYPE T_SKILL * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method MESSAGE_STATELESS. +method GET_SKILL. data: ls_request_prop type ts_request_prop, @@ -1918,11 +5560,11 @@ method MESSAGE_STATELESS. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/assistants/{assistant_id}/message'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/skills/{skill_id}'. replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + replace all occurrences of `{skill_id}` in ls_request_prop-url-path with i_SKILL_ID ignoring case. " standard headers - ls_request_prop-header_content_type = I_contenttype. ls_request_prop-header_accept = I_accept. set_default_query_parameters( changing @@ -1933,47 +5575,10 @@ method MESSAGE_STATELESS. - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - if not i_REQUEST is initial. - lv_datatype = get_datatype( i_REQUEST ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_REQUEST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'request' i_value = i_REQUEST ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_REQUEST to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). " retrieve JSON data @@ -1987,18 +5592,18 @@ method MESSAGE_STATELESS. endmethod. - * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->BULK_CLASSIFY +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->UPDATE_SKILL * +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING * | [--->] I_SKILL_ID TYPE STRING -* | [--->] I_REQUEST TYPE T_BULK_CLASSIFY_INPUT(optional) +* | [--->] I_UPDATESKILL TYPE T_UPDATE_SKILL * | [--->] I_contenttype TYPE string (default ='application/json') * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_BULK_CLASSIFY_RESPONSE +* | [<---] E_RESPONSE TYPE T_SKILL * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method BULK_CLASSIFY. +method UPDATE_SKILL. data: ls_request_prop type ts_request_prop, @@ -2007,7 +5612,8 @@ method BULK_CLASSIFY. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/skills/{skill_id}/workspace/bulk_classify'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/skills/{skill_id}'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. replace all occurrences of `{skill_id}` in ls_request_prop-url-path with i_SKILL_ID ignoring case. " standard headers @@ -2030,32 +5636,41 @@ method BULK_CLASSIFY. field-symbols: type any. lv_separator = ''. - if not i_REQUEST is initial. - lv_datatype = get_datatype( i_REQUEST ). + lv_datatype = get_datatype( i_UPDATESKILL ). if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or ls_request_prop-header_content_type cp '*json*'. if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_REQUEST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + lv_bodyparam = abap_to_json( i_value = i_UPDATESKILL i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). else. - lv_bodyparam = abap_to_json( i_name = 'request' i_value = i_REQUEST ). + lv_bodyparam = abap_to_json( i_name = 'UpdateSkill' i_value = i_UPDATESKILL ). endif. lv_body = lv_body && lv_separator && lv_bodyparam. else. - assign i_REQUEST to . + assign i_UPDATESKILL to . lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -2076,20 +5691,16 @@ method BULK_CLASSIFY. endmethod. - * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->LIST_LOGS +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->EXPORT_SKILLS * +-------------------------------------------------------------------------------------------------+ * | [--->] I_ASSISTANT_ID TYPE STRING -* | [--->] I_SORT TYPE STRING(optional) -* | [--->] I_FILTER TYPE STRING(optional) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) -* | [--->] I_CURSOR TYPE STRING(optional) +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LOG_COLLECTION +* | [<---] E_RESPONSE TYPE T_SKILLS_EXPORT * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method LIST_LOGS. +method EXPORT_SKILLS. data: ls_request_prop type ts_request_prop, @@ -2098,7 +5709,7 @@ method LIST_LOGS. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/assistants/{assistant_id}/logs'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/skills_export'. replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. " standard headers @@ -2111,42 +5722,78 @@ method LIST_LOGS. data: lv_queryparam type string. - if i_SORT is supplied. - lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. add_query_parameter( exporting - i_parameter = `sort` + i_parameter = `include_audit` i_value = lv_queryparam + i_is_boolean = c_boolean_true changing c_url = ls_request_prop-url ) ##NO_TEXT. endif. - if i_FILTER is supplied. - lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). - add_query_parameter( + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( exporting - i_parameter = `filter` - i_value = lv_queryparam + i_json = lv_json + i_dictionary = c_abapname_dictionary changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. + c_abap = e_response ). - if i_PAGE_LIMIT is supplied. - lv_queryparam = i_PAGE_LIMIT. - add_query_parameter( - exporting - i_parameter = `page_limit` - i_value = lv_queryparam +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->IMPORT_SKILLS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ASSISTANT_ID TYPE STRING +* | [--->] I_SKILLSIMPORT TYPE T_SKILLS_IMPORT +* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_SKILLS_ASYNC_REQUEST_STATUS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method IMPORT_SKILLS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/skills_import'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. + c_url = ls_request_prop-url ). - if i_CURSOR is supplied. - lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). + " process query parameters + data: + lv_queryparam type string. + + if i_INCLUDE_AUDIT is supplied. + lv_queryparam = i_INCLUDE_AUDIT. add_query_parameter( exporting - i_parameter = `cursor` + i_parameter = `include_audit` i_value = lv_queryparam + i_is_boolean = c_boolean_true changing c_url = ls_request_prop-url ) ##NO_TEXT. endif. @@ -2154,10 +5801,56 @@ method LIST_LOGS. + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_SKILLSIMPORT ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_SKILLSIMPORT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'SkillsImport' i_value = i_SKILLSIMPORT ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_SKILLSIMPORT to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). " retrieve JSON data @@ -2171,15 +5864,15 @@ method LIST_LOGS. endmethod. - * ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->DELETE_USER_DATA +* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->IMPORT_SKILLS_STATUS * +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CUSTOMER_ID TYPE STRING +* | [--->] I_ASSISTANT_ID TYPE STRING * | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_SKILLS_ASYNC_REQUEST_STATUS * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +-------------------------------------------------------------------------------------- -method DELETE_USER_DATA. +method IMPORT_SKILLS_STATUS. data: ls_request_prop type ts_request_prop, @@ -2188,7 +5881,8 @@ method DELETE_USER_DATA. lo_response type to_rest_response, lv_json type string ##NEEDED. - ls_request_prop-url-path = '/v2/user_data'. + ls_request_prop-url-path = '/v2/assistants/{assistant_id}/skills_import/status'. + replace all occurrences of `{assistant_id}` in ls_request_prop-url-path with i_ASSISTANT_ID ignoring case. " standard headers ls_request_prop-header_accept = I_accept. @@ -2196,27 +5890,25 @@ method DELETE_USER_DATA. changing c_url = ls_request_prop-url ). - " process query parameters - data: - lv_queryparam type string. - lv_queryparam = escape( val = i_CUSTOMER_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `customer_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). endmethod. diff --git a/src/zcl_ibmc_assistant_v2.clas.xml b/src/zcl_ibmc_assistant_v2.clas.xml index c994fb3..63dcf9e 100644 --- a/src/zcl_ibmc_assistant_v2.clas.xml +++ b/src/zcl_ibmc_assistant_v2.clas.xml @@ -18,12 +18,36 @@ E Identify intents and entities in multiple user utterances + + ZCL_IBMC_ASSISTANT_V2 + CREATE_ASSISTANT + E + Create an assistant + + + ZCL_IBMC_ASSISTANT_V2 + CREATE_RELEASE + E + Create release + ZCL_IBMC_ASSISTANT_V2 CREATE_SESSION E Create a session + + ZCL_IBMC_ASSISTANT_V2 + DELETE_ASSISTANT + E + Delete assistant + + + ZCL_IBMC_ASSISTANT_V2 + DELETE_RELEASE + E + Delete release + ZCL_IBMC_ASSISTANT_V2 DELETE_SESSION @@ -36,12 +60,72 @@ E Delete labeled data + + ZCL_IBMC_ASSISTANT_V2 + DEPLOY_RELEASE + E + Deploy release + + + ZCL_IBMC_ASSISTANT_V2 + EXPORT_SKILLS + E + Export skills + + + ZCL_IBMC_ASSISTANT_V2 + GET_ENVIRONMENT + E + Get environment + + + ZCL_IBMC_ASSISTANT_V2 + GET_RELEASE + E + Get release + + + ZCL_IBMC_ASSISTANT_V2 + GET_SKILL + E + Get skill + + + ZCL_IBMC_ASSISTANT_V2 + IMPORT_SKILLS + E + Import skills + + + ZCL_IBMC_ASSISTANT_V2 + IMPORT_SKILLS_STATUS + E + Get status of skills import + + + ZCL_IBMC_ASSISTANT_V2 + LIST_ASSISTANTS + E + List assistants + + + ZCL_IBMC_ASSISTANT_V2 + LIST_ENVIRONMENTS + E + List environments + ZCL_IBMC_ASSISTANT_V2 LIST_LOGS E List log events for an assistant + + ZCL_IBMC_ASSISTANT_V2 + LIST_RELEASES + E + List releases + ZCL_IBMC_ASSISTANT_V2 MESSAGE @@ -54,6 +138,18 @@ E Send user input to assistant (stateless) + + ZCL_IBMC_ASSISTANT_V2 + UPDATE_ENVIRONMENT + E + Update environment + + + ZCL_IBMC_ASSISTANT_V2 + UPDATE_SKILL + E + Update skill + diff --git a/src/zcl_ibmc_compare_comply_v1.clas.abap b/src/zcl_ibmc_compare_comply_v1.clas.abap deleted file mode 100644 index 00c81ce..0000000 --- a/src/zcl_ibmc_compare_comply_v1.clas.abap +++ /dev/null @@ -1,2864 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Compare and Comply

-"! IBM Watson™ Compare and Comply analyzes governing documents to provide -"! details about critical aspects of the documents.
-class ZCL_IBMC_COMPARE_COMPLY_V1 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! The numeric location of the identified element in the

- "! document, represented with two integers labeled `begin` and `end`. - begin of T_LOCATION, - "! The element's `begin` index. - BEGIN type LONG, - "! The element's `end` index. - END type LONG, - end of T_LOCATION. - types: - "!

- "! A pair of `nature` and `party` objects. The `nature` object

- "! identifies the effect of the element on the identified `party`, and the `party` - "! object identifies the affected party. - begin of T_LABEL, - "! The identified `nature` of the element. - NATURE type STRING, - "! The identified `party` of the element. - PARTY type STRING, - end of T_LABEL. - types: - "!

- "! Identification of a specific type.

- begin of T_TYPE_LABEL_COMPARISON, - "! A pair of `nature` and `party` objects. The `nature` object identifies the - "! effect of the element on the identified `party`, and the `party` object - "! identifies the affected party. - LABEL type T_LABEL, - end of T_TYPE_LABEL_COMPARISON. - types: - "!

- "! The locations of each paragraph in the input document.

- begin of T_PARAGRAPHS, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_PARAGRAPHS. - types: - "!

- "! Document counts.

- begin of T_DOC_COUNTS, - "! Total number of documents. - TOTAL type INTEGER, - "! Number of pending documents. - PENDING type INTEGER, - "! Number of documents successfully processed. - SUCCESSFUL type INTEGER, - "! Number of documents not successfully processed. - FAILED type INTEGER, - end of T_DOC_COUNTS. - types: - "!

- "! Identification of a specific type.

- begin of T_TYPE_LABEL, - "! A pair of `nature` and `party` objects. The `nature` object identifies the - "! effect of the element on the identified `party`, and the `party` object - "! identifies the affected party. - LABEL type T_LABEL, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The type of modification of the feedback entry in the updated labels response. - MODIFICATION type STRING, - end of T_TYPE_LABEL. - types: - "!

- "! Brief information about the input document.

- begin of T_SHORT_DOC, - "! The title of the input document, if identified. - TITLE type STRING, - "! The MD5 hash of the input document. - HASH type STRING, - end of T_SHORT_DOC. - types: - "!

- "! Information defining an element's subject matter.

- begin of T_CATEGORY, - "! The category of the associated element. - LABEL type STRING, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The type of modification of the feedback entry in the updated labels response. - MODIFICATION type STRING, - end of T_CATEGORY. - types: - "!

- "! The original labeling from the input document, without the

- "! submitted feedback. - begin of T_ORIGINAL_LABELS_OUT, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - end of T_ORIGINAL_LABELS_OUT. - types: - "!

- "! The updated labeling from the input document, accounting for

- "! the submitted feedback. - begin of T_UPDATED_LABELS_OUT, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - end of T_UPDATED_LABELS_OUT. - types: - "!

- "! Pagination details, if required by the length of the output.

- begin of T_PAGINATION, - "! A token identifying the current page of results. - REFRESH_CURSOR type STRING, - "! A token identifying the next page of results. - NEXT_CURSOR type STRING, - "! The URL that returns the current page of results. - REFRESH_URL type STRING, - "! The URL that returns the next page of results. - NEXT_URL type STRING, - "! Reserved for future use. - TOTAL type LONG, - end of T_PAGINATION. - types: - "!

- "! Information returned from the **Add Feedback** method.

- begin of T_FEEDBACK_DATA_OUTPUT, - "! A string identifying the user adding the feedback. The only permitted value is - "! `element_classification`. - FEEDBACK_TYPE type STRING, - "! Brief information about the input document. - DOCUMENT type T_SHORT_DOC, - "! An optional string identifying the model ID. The only permitted value is - "! `contracts`. - MODEL_ID type STRING, - "! An optional string identifying the version of the model used. - MODEL_VERSION type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text to which the feedback applies. - TEXT type STRING, - "! The original labeling from the input document, without the submitted feedback. - ORIGINAL_LABELS type T_ORIGINAL_LABELS_OUT, - "! The updated labeling from the input document, accounting for the submitted - "! feedback. - UPDATED_LABELS type T_UPDATED_LABELS_OUT, - "! Pagination details, if required by the length of the output. - PAGINATION type T_PAGINATION, - end of T_FEEDBACK_DATA_OUTPUT. - types: - "!

- "! List of document attributes.

- begin of T_ATTRIBUTE, - "! The type of attribute. - TYPE type STRING, - "! The text associated with the attribute. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_ATTRIBUTE. - types: - "!

- "! Information defining an element's subject matter.

- begin of T_CATEGORY_COMPARISON, - "! The category of the associated element. - LABEL type STRING, - end of T_CATEGORY_COMPARISON. - types: - "!

- "! Element that does not align semantically between two

- "! compared documents. - begin of T_UNALIGNED_ELEMENT, - "! The label assigned to the document by the value of the `file_1_label` or - "! `file_2_label` parameters on the **Compare two documents** method. - DOCUMENT_LABEL type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text of the element. - TEXT type STRING, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL_COMPARISON WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY_COMPARISON WITH NON-UNIQUE DEFAULT KEY, - "! List of document attributes. - ATTRIBUTES type STANDARD TABLE OF T_ATTRIBUTE WITH NON-UNIQUE DEFAULT KEY, - end of T_UNALIGNED_ELEMENT. - types: - "!

- "! The updated labeling from the input document, accounting for

- "! the submitted feedback. - begin of T_UPDATED_LABELS_IN, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - end of T_UPDATED_LABELS_IN. - types: - "!

- "! An array that contains the `text` value of a row header that

- "! is applicable to this body cell. - T_ROW_HEADER_TEXTS type TT_String. - types: - "!

- "! A list of `begin` and `end` indexes that indicate the

- "! locations of the elements in the input document. - begin of T_ELEMENT_LOCATIONS, - "! An integer that indicates the starting position of the element in the input - "! document. - BEGIN type INTEGER, - "! An integer that indicates the ending position of the element in the input - "! document. - END type INTEGER, - end of T_ELEMENT_LOCATIONS. - types: - "!

- "! The leading sentences in a section or subsection of the

- "! input document. - begin of T_LEADING_SENTENCE, - "! The text of the leading sentence. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! An array of `location` objects that lists the locations of detected leading - "! sentences. - ELEMENT_LOCATIONS type STANDARD TABLE OF T_ELEMENT_LOCATIONS WITH NON-UNIQUE DEFAULT KEY, - end of T_LEADING_SENTENCE. - types: - "!

- "! An array containing one object per section or subsection

- "! detected in the input document. Sections and subsections are not nested; - "! instead, they are flattened out and can be placed back in order by using the - "! `begin` and `end` values of the element and the `level` value of the section. - begin of T_SECTION_TITLES, - "! The text of the section title, if identified. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! An integer indicating the level at which the section is located in the input - "! document. For example, `1` represents a top-level section, `2` represents a - "! subsection within the level `1` section, and so forth. - LEVEL type INTEGER, - "! An array of `location` objects that lists the locations of detected section - "! titles. - ELEMENT_LOCATIONS type STANDARD TABLE OF T_ELEMENT_LOCATIONS WITH NON-UNIQUE DEFAULT KEY, - end of T_SECTION_TITLES. - types: - "!

- "! The structure of the input document.

- begin of T_DOC_STRUCTURE, - "! An array containing one object per section or subsection identified in the input - "! document. - SECTION_TITLES type STANDARD TABLE OF T_SECTION_TITLES WITH NON-UNIQUE DEFAULT KEY, - "! An array containing one object per section or subsection, in parallel with the - "! `section_titles` array, that details the leading sentences in the corresponding - "! section or subsection. - LEADING_SENTENCES type STANDARD TABLE OF T_LEADING_SENTENCE WITH NON-UNIQUE DEFAULT KEY, - "! An array containing one object per paragraph, in parallel with the - "! `section_titles` and `leading_sentences` arrays. - PARAGRAPHS type STANDARD TABLE OF T_PARAGRAPHS WITH NON-UNIQUE DEFAULT KEY, - end of T_DOC_STRUCTURE. - types: - "!

- "! If you provide customization input, the normalized version

- "! of the column header texts according to the customization; otherwise, the same - "! value as `column_header_texts`. - T_COLUMN_HEADER_TEXTS_NORM type TT_String. - types: - "! No documentation available. - begin of T_ERROR_RESPONSE, - "! The HTTP error status code. - CODE type INTEGER, - "! A message describing the error. - ERROR type STRING, - end of T_ERROR_RESPONSE. - types: - "!

- "! A contact.

- begin of T_CONTACT, - "! A string listing the name of the contact. - NAME type STRING, - "! A string listing the role of the contact. - ROLE type STRING, - end of T_CONTACT. - types: - "!

- "! The table's section title, if identified.

- begin of T_SECTION_TITLE, - "! The text of the section title, if identified. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_SECTION_TITLE. - types: - "!

- "! Column-level cells, each applicable as a header to other

- "! cells in the same column as itself, of the current table. - begin of T_COLUMN_HEADERS, - "! The unique ID of the cell in the current table. - CELL_ID type STRING, - "! The location of the column header cell in the current table as defined by its - "! `begin` and `end` offsets, respectfully, in the input document. - LOCATION type JSONOBJECT, - "! The textual contents of this cell from the input document without associated - "! markup content. - TEXT type STRING, - "! If you provide customization input, the normalized version of the cell text - "! according to the customization; otherwise, the same value as `text`. - TEXT_NORMALIZED type STRING, - "! The `begin` index of this cell's `row` location in the current table. - ROW_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `row` location in the current table. - ROW_INDEX_END type LONG, - "! The `begin` index of this cell's `column` location in the current table. - COLUMN_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `column` location in the current table. - COLUMN_INDEX_END type LONG, - end of T_COLUMN_HEADERS. - types: - "!

- "! Text that is related to the contents of the table and that

- "! precedes or follows the current table. - begin of T_CONTEXTS, - "! The related text. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_CONTEXTS. - types: - "!

- "! If identified, the title or caption of the current table of

- "! the form `Table x.: ...`. Empty when no title is identified. When exposed, the - "! `title` is also excluded from the `contexts` array of the same table. - begin of T_TABLE_TITLE, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text of the identified table title or caption. - TEXT type STRING, - end of T_TABLE_TITLE. - types: - "!

- "! Cells that are not table header, column header, or row

- "! header cells. - begin of T_BODY_CELLS, - "! The unique ID of the cell in the current table. - CELL_ID type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The textual contents of this cell from the input document without associated - "! markup content. - TEXT type STRING, - "! The `begin` index of this cell's `row` location in the current table. - ROW_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `row` location in the current table. - ROW_INDEX_END type LONG, - "! The `begin` index of this cell's `column` location in the current table. - COLUMN_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `column` location in the current table. - COLUMN_INDEX_END type LONG, - "! An array that contains the `id` value of a row header that is applicable to this - "! body cell. - ROW_HEADER_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! An array that contains the `text` value of a row header that is applicable to - "! this body cell. - ROW_HEADER_TEXTS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! If you provide customization input, the normalized version of the row header - "! texts according to the customization; otherwise, the same value as - "! `row_header_texts`. - ROW_HEADER_TEXTS_NORMALIZED type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! An array that contains the `id` value of a column header that is applicable to - "! the current cell. - COLUMN_HEADER_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! An array that contains the `text` value of a column header that is applicable to - "! the current cell. - COLUMN_HEADER_TEXTS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! If you provide customization input, the normalized version of the column header - "! texts according to the customization; otherwise, the same value as - "! `column_header_texts`. - COLUMN_HEADER_TEXTS_NORMALIZED type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! No documentation available. - ATTRIBUTES type STANDARD TABLE OF T_ATTRIBUTE WITH NON-UNIQUE DEFAULT KEY, - end of T_BODY_CELLS. - types: - "!

- "! A key in a key-value pair.

- begin of T_KEY, - "! The unique ID of the key in the table. - CELL_ID type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text content of the table cell without HTML markup. - TEXT type STRING, - end of T_KEY. - types: - "!

- "! A value in a key-value pair.

- begin of T_VALUE, - "! The unique ID of the value in the table. - CELL_ID type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text content of the table cell without HTML markup. - TEXT type STRING, - end of T_VALUE. - types: - "!

- "! Key-value pairs detected across cell boundaries.

- begin of T_KEY_VALUE_PAIR, - "! A key in a key-value pair. - KEY type T_KEY, - "! A list of values in a key-value pair. - VALUE type STANDARD TABLE OF T_VALUE WITH NON-UNIQUE DEFAULT KEY, - end of T_KEY_VALUE_PAIR. - types: - "!

- "! The contents of the current table's header.

- begin of T_TABLE_HEADERS, - "! The unique ID of the cell in the current table. - CELL_ID type STRING, - "! The location of the table header cell in the current table as defined by its - "! `begin` and `end` offsets, respectfully, in the input document. - LOCATION type JSONOBJECT, - "! The textual contents of the cell from the input document without associated - "! markup content. - TEXT type STRING, - "! The `begin` index of this cell's `row` location in the current table. - ROW_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `row` location in the current table. - ROW_INDEX_END type LONG, - "! The `begin` index of this cell's `column` location in the current table. - COLUMN_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `column` location in the current table. - COLUMN_INDEX_END type LONG, - end of T_TABLE_HEADERS. - types: - "!

- "! Row-level cells, each applicable as a header to other cells

- "! in the same row as itself, of the current table. - begin of T_ROW_HEADERS, - "! The unique ID of the cell in the current table. - CELL_ID type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The textual contents of this cell from the input document without associated - "! markup content. - TEXT type STRING, - "! If you provide customization input, the normalized version of the cell text - "! according to the customization; otherwise, the same value as `text`. - TEXT_NORMALIZED type STRING, - "! The `begin` index of this cell's `row` location in the current table. - ROW_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `row` location in the current table. - ROW_INDEX_END type LONG, - "! The `begin` index of this cell's `column` location in the current table. - COLUMN_INDEX_BEGIN type LONG, - "! The `end` index of this cell's `column` location in the current table. - COLUMN_INDEX_END type LONG, - end of T_ROW_HEADERS. - types: - "!

- "! The contents of the tables extracted from a document.

- begin of T_TABLES, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The textual contents of the current table from the input document without - "! associated markup content. - TEXT type STRING, - "! The table's section title, if identified. - SECTION_TITLE type T_SECTION_TITLE, - "! If identified, the title or caption of the current table of the form `Table x.: - "! ...`. Empty when no title is identified. When exposed, the `title` is also - "! excluded from the `contexts` array of the same table. - TITLE type T_TABLE_TITLE, - "! An array of table-level cells that apply as headers to all the other cells in - "! the current table. - TABLE_HEADERS type STANDARD TABLE OF T_TABLE_HEADERS WITH NON-UNIQUE DEFAULT KEY, - "! An array of row-level cells, each applicable as a header to other cells in the - "! same row as itself, of the current table. - ROW_HEADERS type STANDARD TABLE OF T_ROW_HEADERS WITH NON-UNIQUE DEFAULT KEY, - "! An array of column-level cells, each applicable as a header to other cells in - "! the same column as itself, of the current table. - COLUMN_HEADERS type STANDARD TABLE OF T_COLUMN_HEADERS WITH NON-UNIQUE DEFAULT KEY, - "! An array of cells that are neither table header nor column header nor row header - "! cells, of the current table with corresponding row and column header - "! associations. - BODY_CELLS type STANDARD TABLE OF T_BODY_CELLS WITH NON-UNIQUE DEFAULT KEY, - "! An array of objects that list text that is related to the table contents and - "! that precedes or follows the current table. - CONTEXTS type STANDARD TABLE OF T_CONTEXTS WITH NON-UNIQUE DEFAULT KEY, - "! An array of key-value pairs identified in the current table. - KEY_VALUE_PAIRS type STANDARD TABLE OF T_KEY_VALUE_PAIR WITH NON-UNIQUE DEFAULT KEY, - end of T_TABLES. - types: - "!

- "! Information about the parsed input document.

- begin of T_DOC_INFO, - "! The full text of the parsed document in HTML format. - HTML type STRING, - "! The title of the parsed document. If the service did not detect a title, the - "! value of this element is `null`. - TITLE type STRING, - "! The MD5 hash of the input document. - HASH type STRING, - end of T_DOC_INFO. - types: - "!

- "! The analysis of the document's tables.

- begin of T_TABLE_RETURN, - "! Information about the parsed input document. - DOCUMENT type T_DOC_INFO, - "! The ID of the model used to extract the table contents. The value for table - "! extraction is `tables`. - MODEL_ID type STRING, - "! The version of the `tables` model ID. - MODEL_VERSION type STRING, - "! Definitions of the tables identified in the input document. - TABLES type STANDARD TABLE OF T_TABLES WITH NON-UNIQUE DEFAULT KEY, - end of T_TABLE_RETURN. - types: - "!

- "! Information about the document and the submitted feedback.

- begin of T_FEEDBACK_RETURN, - "! The unique ID of the feedback object. - FEEDBACK_ID type STRING, - "! An optional string identifying the person submitting feedback. - USER_ID type STRING, - "! An optional comment from the person submitting the feedback. - COMMENT type STRING, - "! Timestamp listing the creation time of the feedback submission. - CREATED type DATETIME, - "! Information returned from the **Add Feedback** method. - FEEDBACK_DATA type T_FEEDBACK_DATA_OUTPUT, - end of T_FEEDBACK_RETURN. - types: - "!

- "! The details of the normalized text, if applicable. This

- "! element is optional; it is returned only if normalized text exists. - begin of T_INTERPRETATION, - "! The value that was located in the normalized text. - VALUE type STRING, - "! An integer or float expressing the numeric value of the `value` key. - NUMERIC_VALUE type NUMBER, - "! A string listing the unit of the value that was found in the normalized - "! text.
- "!
- "! **Note:** The value of `unit` is the [ISO-4217 currency - "! code](https://www.iso.org/iso-4217-currency-codes.html) identified for the - "! currency amount (for example, `USD` or `EUR`). If the service cannot - "! disambiguate a currency symbol (for example, `$` or `£`), the value of `unit` - "! contains the ambiguous symbol as-is. - UNIT type STRING, - end of T_INTERPRETATION. - types: - "!

- "! A monetary amount identified in the input document.

- begin of T_CONTRACT_AMTS, - "! The confidence level in the identification of the contract amount. - CONFIDENCE_LEVEL type STRING, - "! The monetary amount. - TEXT type STRING, - "! The normalized form of the amount, which is listed as a string. This element is - "! optional; it is returned only if normalized text exists. - TEXT_NORMALIZED type STRING, - "! The details of the normalized text, if applicable. This element is optional; it - "! is returned only if normalized text exists. - INTERPRETATION type T_INTERPRETATION, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_CONTRACT_AMTS. - types: - "!

- "! The contract currencies that are declared in the document.

- begin of T_CONTRACT_CURRENCIES, - "! The confidence level in the identification of the contract currency. - CONFIDENCE_LEVEL type STRING, - "! The contract currency. - TEXT type STRING, - "! The normalized form of the contract currency, which is listed as a string in - "! [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) format. This - "! element is optional; it is returned only if normalized text exists. - TEXT_NORMALIZED type STRING, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_CONTRACT_CURRENCIES. - types: - "!

- "! The document's payment duration or durations.

- begin of T_PAYMENT_TERMS, - "! The confidence level in the identification of the payment term. - CONFIDENCE_LEVEL type STRING, - "! The payment term (duration). - TEXT type STRING, - "! The normalized form of the payment term, which is listed as a string. This - "! element is optional; it is returned only if normalized text exists. - TEXT_NORMALIZED type STRING, - "! The details of the normalized text, if applicable. This element is optional; it - "! is returned only if normalized text exists. - INTERPRETATION type T_INTERPRETATION, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_PAYMENT_TERMS. - types: - "!

- "! A component part of the document.

- begin of T_ELEMENT, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text of the element. - TEXT type STRING, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - "! List of document attributes. - ATTRIBUTES type STANDARD TABLE OF T_ATTRIBUTE WITH NON-UNIQUE DEFAULT KEY, - end of T_ELEMENT. - types: - "!

- "! Termination dates identified in the input document.

- begin of T_TERMINATION_DATES, - "! The confidence level in the identification of the termination date. - CONFIDENCE_LEVEL type STRING, - "! The termination date. - TEXT type STRING, - "! The normalized form of the termination date, which is listed as a string. This - "! element is optional; it is returned only if normalized text exists. - TEXT_NORMALIZED type STRING, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_TERMINATION_DATES. - types: - "!

- "! The contract type identified in the input document.

- begin of T_CONTRACT_TYPES, - "! The confidence level in the identification of the contract type. - CONFIDENCE_LEVEL type STRING, - "! The contract type. - TEXT type STRING, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_CONTRACT_TYPES. - types: - "!

- "! An effective date.

- begin of T_EFFECTIVE_DATES, - "! The confidence level in the identification of the effective date. - CONFIDENCE_LEVEL type STRING, - "! The effective date, listed as a string. - TEXT type STRING, - "! The normalized form of the effective date, which is listed as a string. This - "! element is optional; it is returned only if normalized text exists. - TEXT_NORMALIZED type STRING, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_EFFECTIVE_DATES. - types: - "!

- "! A mention of a party.

- begin of T_MENTION, - "! The name of the party. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_MENTION. - types: - "!

- "! A party's address.

- begin of T_ADDRESS, - "! A string listing the address. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_ADDRESS. - types: - "!

- "! A party and its corresponding role, including address and

- "! contact information if identified. - begin of T_PARTIES, - "! The normalized form of the party's name. - PARTY type STRING, - "! A string identifying the party's role. - ROLE type STRING, - "! A string that identifies the importance of the party. - IMPORTANCE type STRING, - "! A list of the party's address or addresses. - ADDRESSES type STANDARD TABLE OF T_ADDRESS WITH NON-UNIQUE DEFAULT KEY, - "! A list of the names and roles of contacts identified in the input document. - CONTACTS type STANDARD TABLE OF T_CONTACT WITH NON-UNIQUE DEFAULT KEY, - "! A list of the party's mentions in the input document. - MENTIONS type STANDARD TABLE OF T_MENTION WITH NON-UNIQUE DEFAULT KEY, - end of T_PARTIES. - types: - "!

- "! Basic information about the input document.

- begin of T_DOCUMENT, - "! Document title, if detected. - TITLE type STRING, - "! The input document converted into HTML format. - HTML type STRING, - "! The MD5 hash value of the input document. - HASH type STRING, - "! The label applied to the input document with the calling method's - "! `file_1_label` or `file_2_label` value. This field is specified only in the - "! output of the **Comparing two documents** method. - LABEL type STRING, - end of T_DOCUMENT. - types: - "!

- "! The duration or durations of the contract.

- begin of T_CONTRACT_TERMS, - "! The confidence level in the identification of the contract term. - CONFIDENCE_LEVEL type STRING, - "! The contract term (duration). - TEXT type STRING, - "! The normalized form of the contract term, which is listed as a string. This - "! element is optional; it is returned only if normalized text exists. - TEXT_NORMALIZED type STRING, - "! The details of the normalized text, if applicable. This element is optional; it - "! is returned only if normalized text exists. - INTERPRETATION type T_INTERPRETATION, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - end of T_CONTRACT_TERMS. - types: - "!

- "! The analysis of objects returned by the **Element

- "! classification** method. - begin of T_CLASSIFY_RETURN, - "! Basic information about the input document. - DOCUMENT type T_DOCUMENT, - "! The analysis model used to classify the input document. For the **Element - "! classification** method, the only valid value is `contracts`. - MODEL_ID type STRING, - "! The version of the analysis model identified by the value of the `model_id` key. - "! - MODEL_VERSION type STRING, - "! Document elements identified by the service. - ELEMENTS type STANDARD TABLE OF T_ELEMENT WITH NON-UNIQUE DEFAULT KEY, - "! The date or dates on which the document becomes effective. - EFFECTIVE_DATES type STANDARD TABLE OF T_EFFECTIVE_DATES WITH NON-UNIQUE DEFAULT KEY, - "! The monetary amounts that identify the total amount of the contract that needs - "! to be paid from one party to another. - CONTRACT_AMOUNTS type STANDARD TABLE OF T_CONTRACT_AMTS WITH NON-UNIQUE DEFAULT KEY, - "! The dates on which the document is to be terminated. - TERMINATION_DATES type STANDARD TABLE OF T_TERMINATION_DATES WITH NON-UNIQUE DEFAULT KEY, - "! The contract type as declared in the document. - CONTRACT_TYPES type STANDARD TABLE OF T_CONTRACT_TYPES WITH NON-UNIQUE DEFAULT KEY, - "! The durations of the contract. - CONTRACT_TERMS type STANDARD TABLE OF T_CONTRACT_TERMS WITH NON-UNIQUE DEFAULT KEY, - "! The document's payment durations. - PAYMENT_TERMS type STANDARD TABLE OF T_PAYMENT_TERMS WITH NON-UNIQUE DEFAULT KEY, - "! The contract currencies as declared in the document. - CONTRACT_CURRENCIES type STANDARD TABLE OF T_CONTRACT_CURRENCIES WITH NON-UNIQUE DEFAULT KEY, - "! Definition of tables identified in the input document. - TABLES type STANDARD TABLE OF T_TABLES WITH NON-UNIQUE DEFAULT KEY, - "! The structure of the input document. - DOCUMENT_STRUCTURE type T_DOC_STRUCTURE, - "! Definitions of the parties identified in the input document. - PARTIES type STANDARD TABLE OF T_PARTIES WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFY_RETURN. - types: - "!

- "! The original labeling from the input document, without the

- "! submitted feedback. - begin of T_ORIGINAL_LABELS_IN, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - end of T_ORIGINAL_LABELS_IN. - types: - "!

- "! Details of semantically aligned elements.

- begin of T_ELEMENT_PAIR, - "! The label of the document (that is, the value of either the `file_1_label` or - "! `file_2_label` parameters) in which the element occurs. - DOCUMENT_LABEL type STRING, - "! The contents of the element. - TEXT type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! Description of the action specified by the element and whom it affects. - TYPES type STANDARD TABLE OF T_TYPE_LABEL_COMPARISON WITH NON-UNIQUE DEFAULT KEY, - "! List of functional categories into which the element falls; in other words, the - "! subject matter of the element. - CATEGORIES type STANDARD TABLE OF T_CATEGORY_COMPARISON WITH NON-UNIQUE DEFAULT KEY, - "! List of document attributes. - ATTRIBUTES type STANDARD TABLE OF T_ATTRIBUTE WITH NON-UNIQUE DEFAULT KEY, - end of T_ELEMENT_PAIR. - types: - "! No documentation available. - begin of T_ALIGNED_ELEMENT, - "! Identifies two elements that semantically align between the compared documents. - ELEMENT_PAIR type STANDARD TABLE OF T_ELEMENT_PAIR WITH NON-UNIQUE DEFAULT KEY, - "! Specifies whether the aligned element is identical. Elements are considered - "! identical despite minor differences such as leading punctuation, - "! end-of-sentence punctuation, whitespace, the presence or absence of definite or - "! indefinite articles, and others. - IDENTICAL_TEXT type BOOLEAN, - "! Hashed values that you can send to IBM to provide feedback or receive support. - PROVENANCE_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Indicates that the elements aligned are contractual clauses of significance. - SIGNIFICANT_ELEMENTS type BOOLEAN, - end of T_ALIGNED_ELEMENT. - types: - "!

- "! The comparison of the two submitted documents.

- begin of T_COMPARE_RETURN, - "! The analysis model used to compare the input documents. For the **Compare two - "! documents** method, the only valid value is `contracts`. - MODEL_ID type STRING, - "! The version of the analysis model identified by the value of the `model_id` key. - "! - MODEL_VERSION type STRING, - "! Information about the documents being compared. - DOCUMENTS type STANDARD TABLE OF T_DOCUMENT WITH NON-UNIQUE DEFAULT KEY, - "! A list of pairs of elements that semantically align between the compared - "! documents. - ALIGNED_ELEMENTS type STANDARD TABLE OF T_ALIGNED_ELEMENT WITH NON-UNIQUE DEFAULT KEY, - "! A list of elements that do not semantically align between the compared - "! documents. - UNALIGNED_ELEMENTS type STANDARD TABLE OF T_UNALIGNED_ELEMENT WITH NON-UNIQUE DEFAULT KEY, - end of T_COMPARE_RETURN. - types: - "!

- "! The HTML converted from an input document.

- begin of T_HTMLRETURN, - "! The number of pages in the input document. - NUM_PAGES type STRING, - "! The author of the input document, if identified. - AUTHOR type STRING, - "! The publication date of the input document, if identified. - PUBLICATION_DATE type STRING, - "! The title of the input document, if identified. - TITLE type STRING, - "! The HTML version of the input document. - HTML type STRING, - end of T_HTMLRETURN. - types: - "!

- "! Feedback data for submission.

- begin of T_FEEDBACK_DATA_INPUT, - "! The type of feedback. The only permitted value is `element_classification`. - FEEDBACK_TYPE type STRING, - "! Brief information about the input document. - DOCUMENT type T_SHORT_DOC, - "! An optional string identifying the model ID. The only permitted value is - "! `contracts`. - MODEL_ID type STRING, - "! An optional string identifying the version of the model used. - MODEL_VERSION type STRING, - "! The numeric location of the identified element in the document, represented with - "! two integers labeled `begin` and `end`. - LOCATION type T_LOCATION, - "! The text on which to submit feedback. - TEXT type STRING, - "! The original labeling from the input document, without the submitted feedback. - ORIGINAL_LABELS type T_ORIGINAL_LABELS_IN, - "! The updated labeling from the input document, accounting for the submitted - "! feedback. - UPDATED_LABELS type T_UPDATED_LABELS_IN, - end of T_FEEDBACK_DATA_INPUT. - types: - "!

- "! An array that contains the `id` value of a row header that

- "! is applicable to this body cell. - T_ROW_HEADER_IDS type TT_String. - types: - "!

- "! The batch-request status.

- begin of T_BATCH_STATUS, - "! The method to be run against the documents. Possible values are - "! `html_conversion`, `element_classification`, and `tables`. - FUNCTION type STRING, - "! The geographical location of the Cloud Object Storage input bucket as listed on - "! the **Endpoint** tab of your COS instance; for example, `us-geo`, `eu-geo`, or - "! `ap-geo`. - INPUT_BUCKET_LOCATION type STRING, - "! The name of the Cloud Object Storage input bucket. - INPUT_BUCKET_NAME type STRING, - "! The geographical location of the Cloud Object Storage output bucket as listed on - "! the **Endpoint** tab of your COS instance; for example, `us-geo`, `eu-geo`, or - "! `ap-geo`. - OUTPUT_BUCKET_LOCATION type STRING, - "! The name of the Cloud Object Storage output bucket. - OUTPUT_BUCKET_NAME type STRING, - "! The unique identifier for the batch request. - BATCH_ID type STRING, - "! Document counts. - DOCUMENT_COUNTS type T_DOC_COUNTS, - "! The status of the batch request. - STATUS type STRING, - "! The creation time of the batch request. - CREATED type DATETIME, - "! The time of the most recent update to the batch request. - UPDATED type DATETIME, - end of T_BATCH_STATUS. - types: - "!

- "! The results of a successful **List Batches** request.

- begin of T_BATCHES, - "! A list of the status of all batch requests. - BATCHES type STANDARD TABLE OF T_BATCH_STATUS WITH NON-UNIQUE DEFAULT KEY, - end of T_BATCHES. - types: - "! No documentation available. - begin of T_INLINE_OBJECT, - "! The document to convert. - FILE type FILE, - end of T_INLINE_OBJECT. - types: - "!

- "! An array that contains the `id` value of a column header

- "! that is applicable to the current cell. - T_COLUMN_HEADER_IDS type TT_String. - types: - "!

- "! If you provide customization input, the normalized version

- "! of the row header texts according to the customization; otherwise, the same - "! value as `row_header_texts`. - T_ROW_HEADER_TEXTS_NORMALIZED type TT_String. - types: - "!

- "! An array that contains the `text` value of a column header

- "! that is applicable to the current cell. - T_COLUMN_HEADER_TEXTS type TT_String. - types: - "!

- "! The status and message of the deletion request.

- begin of T_FEEDBACK_DELETED, - "! HTTP return code. - STATUS type INTEGER, - "! Status message returned from the service. - MESSAGE type STRING, - end of T_FEEDBACK_DELETED. - types: - "!

- "! The feedback to be added to an element in the document.

- begin of T_FEEDBACK_INPUT, - "! An optional string identifying the user. - USER_ID type STRING, - "! An optional comment on or description of the feedback. - COMMENT type STRING, - "! Feedback data for submission. - FEEDBACK_DATA type T_FEEDBACK_DATA_INPUT, - end of T_FEEDBACK_INPUT. - types: - "! No documentation available. - begin of T_INLINE_OBJECT1, - "! The document to classify. - FILE type FILE, - end of T_INLINE_OBJECT1. - types: - "! No documentation available. - begin of T_INLINE_OBJECT2, - "! The document on which to run table extraction. - FILE type FILE, - end of T_INLINE_OBJECT2. - types: - "! No documentation available. - begin of T_INLINE_OBJECT3, - "! The first document to compare. - FILE_1 type FILE, - "! The second document to compare. - FILE_2 type FILE, - end of T_INLINE_OBJECT3. - types: - "! No documentation available. - begin of T_INLINE_OBJECT4, - "! A JSON file containing the input Cloud Object Storage credentials. At a minimum, - "! the credentials must enable `READ` permissions on the bucket defined by the - "! `input_bucket_name` parameter. - INPUT_CREDENTIALS_FILE type FILE, - "! The geographical location of the Cloud Object Storage input bucket as listed on - "! the **Endpoint** tab of your Cloud Object Storage instance; for example, - "! `us-geo`, `eu-geo`, or `ap-geo`. - INPUT_BUCKET_LOCATION type STRING, - "! The name of the Cloud Object Storage input bucket. - INPUT_BUCKET_NAME type STRING, - "! A JSON file that lists the Cloud Object Storage output credentials. At a - "! minimum, the credentials must enable `READ` and `WRITE` permissions on the - "! bucket defined by the `output_bucket_name` parameter. - OUTPUT_CREDENTIALS_FILE type FILE, - "! The geographical location of the Cloud Object Storage output bucket as listed on - "! the **Endpoint** tab of your Cloud Object Storage instance; for example, - "! `us-geo`, `eu-geo`, or `ap-geo`. - OUTPUT_BUCKET_LOCATION type STRING, - "! The name of the Cloud Object Storage output bucket. - OUTPUT_BUCKET_NAME type STRING, - end of T_INLINE_OBJECT4. - types: - "!

- "! The results of a successful **Get Feedback** request for a

- "! single feedback entry. - begin of T_GET_FEEDBACK, - "! A string uniquely identifying the feedback entry. - FEEDBACK_ID type STRING, - "! A timestamp identifying the creation time of the feedback entry. - CREATED type DATETIME, - "! A string containing the user's comment about the feedback entry. - COMMENT type STRING, - "! Information returned from the **Add Feedback** method. - FEEDBACK_DATA type T_FEEDBACK_DATA_OUTPUT, - end of T_GET_FEEDBACK. - types: - "!

- "! The results of a successful **List Feedback** request for

- "! all feedback. - begin of T_FEEDBACK_LIST, - "! A list of all feedback for the document. - FEEDBACK type STANDARD TABLE OF T_GET_FEEDBACK WITH NON-UNIQUE DEFAULT KEY, - end of T_FEEDBACK_LIST. - types: - "!

- "! A list of values in a key-value pair.

- T_VALUES type STANDARD TABLE OF T_VALUE WITH NON-UNIQUE DEFAULT KEY. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_LOCATION type string value '|BEGIN|END|', - T_LABEL type string value '|NATURE|PARTY|', - T_TYPE_LABEL_COMPARISON type string value '|', - T_PARAGRAPHS type string value '|', - T_DOC_COUNTS type string value '|', - T_TYPE_LABEL type string value '|', - T_SHORT_DOC type string value '|', - T_CATEGORY type string value '|', - T_ORIGINAL_LABELS_OUT type string value '|', - T_UPDATED_LABELS_OUT type string value '|', - T_PAGINATION type string value '|', - T_FEEDBACK_DATA_OUTPUT type string value '|', - T_ATTRIBUTE type string value '|', - T_CATEGORY_COMPARISON type string value '|', - T_UNALIGNED_ELEMENT type string value '|', - T_UPDATED_LABELS_IN type string value '|TYPES|CATEGORIES|', - T_ELEMENT_LOCATIONS type string value '|', - T_LEADING_SENTENCE type string value '|', - T_SECTION_TITLES type string value '|', - T_DOC_STRUCTURE type string value '|', - T_ERROR_RESPONSE type string value '|CODE|ERROR|', - T_CONTACT type string value '|', - T_SECTION_TITLE type string value '|', - T_COLUMN_HEADERS type string value '|', - T_CONTEXTS type string value '|', - T_TABLE_TITLE type string value '|', - T_BODY_CELLS type string value '|', - T_KEY type string value '|', - T_VALUE type string value '|', - T_KEY_VALUE_PAIR type string value '|', - T_TABLE_HEADERS type string value '|', - T_ROW_HEADERS type string value '|', - T_TABLES type string value '|', - T_DOC_INFO type string value '|', - T_TABLE_RETURN type string value '|', - T_FEEDBACK_RETURN type string value '|', - T_INTERPRETATION type string value '|', - T_CONTRACT_AMTS type string value '|', - T_CONTRACT_CURRENCIES type string value '|', - T_PAYMENT_TERMS type string value '|', - T_ELEMENT type string value '|', - T_TERMINATION_DATES type string value '|', - T_CONTRACT_TYPES type string value '|', - T_EFFECTIVE_DATES type string value '|', - T_MENTION type string value '|', - T_ADDRESS type string value '|', - T_PARTIES type string value '|', - T_DOCUMENT type string value '|', - T_CONTRACT_TERMS type string value '|', - T_CLASSIFY_RETURN type string value '|', - T_ORIGINAL_LABELS_IN type string value '|TYPES|CATEGORIES|', - T_ELEMENT_PAIR type string value '|', - T_ALIGNED_ELEMENT type string value '|', - T_COMPARE_RETURN type string value '|', - T_HTMLRETURN type string value '|', - T_FEEDBACK_DATA_INPUT type string value '|FEEDBACK_TYPE|LOCATION|TEXT|ORIGINAL_LABELS|UPDATED_LABELS|', - T_BATCH_STATUS type string value '|', - T_BATCHES type string value '|', - T_INLINE_OBJECT type string value '|FILE|', - T_FEEDBACK_DELETED type string value '|', - T_FEEDBACK_INPUT type string value '|FEEDBACK_DATA|', - T_INLINE_OBJECT1 type string value '|FILE|', - T_INLINE_OBJECT2 type string value '|FILE|', - T_INLINE_OBJECT3 type string value '|FILE_1|FILE_2|', - T_INLINE_OBJECT4 type string value '|INPUT_CREDENTIALS_FILE|INPUT_BUCKET_LOCATION|INPUT_BUCKET_NAME|OUTPUT_CREDENTIALS_FILE|OUTPUT_BUCKET_LOCATION|OUTPUT_BUCKET_NAME|', - T_GET_FEEDBACK type string value '|', - T_FEEDBACK_LIST type string value '|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - NUM_PAGES type string value 'num_pages', - AUTHOR type string value 'author', - PUBLICATION_DATE type string value 'publication_date', - TITLE type string value 'title', - HTML type string value 'html', - DOCUMENT type string value 'document', - MODEL_ID type string value 'model_id', - MODEL_VERSION type string value 'model_version', - ELEMENTS type string value 'elements', - EFFECTIVE_DATES type string value 'effective_dates', - CONTRACT_AMOUNTS type string value 'contract_amounts', - TERMINATION_DATES type string value 'termination_dates', - CONTRACT_TYPES type string value 'contract_types', - CONTRACT_TERMS type string value 'contract_terms', - PAYMENT_TERMS type string value 'payment_terms', - CONTRACT_CURRENCIES type string value 'contract_currencies', - TABLES type string value 'tables', - DOCUMENT_STRUCTURE type string value 'document_structure', - PARTIES type string value 'parties', - SECTION_TITLES type string value 'section_titles', - LEADING_SENTENCES type string value 'leading_sentences', - PARAGRAPHS type string value 'paragraphs', - DOCUMENTS type string value 'documents', - ALIGNED_ELEMENTS type string value 'aligned_elements', - UNALIGNED_ELEMENTS type string value 'unaligned_elements', - ELEMENT_PAIR type string value 'element_pair', - IDENTICAL_TEXT type string value 'identical_text', - PROVENANCE_IDS type string value 'provenance_ids', - SIGNIFICANT_ELEMENTS type string value 'significant_elements', - DOCUMENT_LABEL type string value 'document_label', - LOCATION type string value 'location', - TEXT type string value 'text', - TYPES type string value 'types', - CATEGORIES type string value 'categories', - ATTRIBUTES type string value 'attributes', - LABEL type string value 'label', - MODIFICATION type string value 'modification', - HASH type string value 'hash', - CODE type string value 'code', - ERROR type string value 'error', - SECTION_TITLE type string value 'section_title', - TABLE_HEADERS type string value 'table_headers', - ROW_HEADERS type string value 'row_headers', - COLUMN_HEADERS type string value 'column_headers', - BODY_CELLS type string value 'body_cells', - CONTEXTS type string value 'contexts', - KEY_VALUE_PAIRS type string value 'key_value_pairs', - LEVEL type string value 'level', - ELEMENT_LOCATIONS type string value 'element_locations', - BEGIN type string value 'begin', - END type string value 'end', - CELL_ID type string value 'cell_id', - ROW_INDEX_BEGIN type string value 'row_index_begin', - ROW_INDEX_END type string value 'row_index_end', - COLUMN_INDEX_BEGIN type string value 'column_index_begin', - COLUMN_INDEX_END type string value 'column_index_end', - TEXT_NORMALIZED type string value 'text_normalized', - KEY type string value 'key', - VALUE type string value 'value', - ROW_HEADER_IDS type string value 'row_header_ids', - ROW_HEADER_TEXTS type string value 'row_header_texts', - ROW_HEADER_TEXTS_NORMALIZED type string value 'row_header_texts_normalized', - COLUMN_HEADER_IDS type string value 'column_header_ids', - COLUMN_HEADER_TEXTS type string value 'column_header_texts', - COLUMN_HEADER_TEXTS_NORMALIZED type string value 'column_header_texts_normalized', - USER_ID type string value 'user_id', - COMMENT type string value 'comment', - FEEDBACK_DATA type string value 'feedback_data', - FEEDBACK_ID type string value 'feedback_id', - CREATED type string value 'created', - FEEDBACK_TYPE type string value 'feedback_type', - ORIGINAL_LABELS type string value 'original_labels', - UPDATED_LABELS type string value 'updated_labels', - PAGINATION type string value 'pagination', - REFRESH_CURSOR type string value 'refresh_cursor', - NEXT_CURSOR type string value 'next_cursor', - REFRESH_URL type string value 'refresh_url', - NEXT_URL type string value 'next_url', - TOTAL type string value 'total', - FEEDBACK type string value 'feedback', - STATUS type string value 'status', - MESSAGE type string value 'message', - TYPE type string value 'type', - NATURE type string value 'nature', - PARTY type string value 'party', - FUNCTION type string value 'function', - INPUT_BUCKET_LOCATION type string value 'input_bucket_location', - INPUT_BUCKET_NAME type string value 'input_bucket_name', - OUTPUT_BUCKET_LOCATION type string value 'output_bucket_location', - OUTPUT_BUCKET_NAME type string value 'output_bucket_name', - BATCH_ID type string value 'batch_id', - DOCUMENT_COUNTS type string value 'document_counts', - UPDATED type string value 'updated', - BATCHES type string value 'batches', - PENDING type string value 'pending', - SUCCESSFUL type string value 'successful', - FAILED type string value 'failed', - ROLE type string value 'role', - IMPORTANCE type string value 'importance', - ADDRESSES type string value 'addresses', - CONTACTS type string value 'contacts', - MENTIONS type string value 'mentions', - NAME type string value 'name', - CONFIDENCE_LEVEL type string value 'confidence_level', - INTERPRETATION type string value 'interpretation', - NUMERIC_VALUE type string value 'numeric_value', - UNIT type string value 'unit', - FILE type string value 'file', - FILE_1 type string value 'file_1', - FILE_2 type string value 'file_2', - INPUT_CREDENTIALS_FILE type string value 'input_credentials_file', - OUTPUT_CREDENTIALS_FILE type string value 'output_credentials_file', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Convert document to HTML

- "! Converts a document to HTML. - "! - "! @parameter I_FILE | - "! The document to convert. - "! @parameter I_FILE_CONTENT_TYPE | - "! The content type of file. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_HTMLRETURN - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CONVERT_TO_HTML - importing - !I_FILE type FILE - !I_FILE_CONTENT_TYPE type STRING optional - !I_MODEL type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_HTMLRETURN - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Classify the elements of a document

- "! Analyzes the structural and semantic elements of a document. - "! - "! @parameter I_FILE | - "! The document to classify. - "! @parameter I_FILE_CONTENT_TYPE | - "! The content type of file. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFY_RETURN - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CLASSIFY_ELEMENTS - importing - !I_FILE type FILE - !I_FILE_CONTENT_TYPE type STRING optional - !I_MODEL type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFY_RETURN - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Extract a document's tables

- "! Analyzes the tables in a document. - "! - "! @parameter I_FILE | - "! The document on which to run table extraction. - "! @parameter I_FILE_CONTENT_TYPE | - "! The content type of file. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_TABLE_RETURN - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods EXTRACT_TABLES - importing - !I_FILE type FILE - !I_FILE_CONTENT_TYPE type STRING optional - !I_MODEL type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TABLE_RETURN - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Compare two documents

- "! Compares two input documents. Documents must be in the same format. - "! - "! @parameter I_FILE_1 | - "! The first document to compare. - "! @parameter I_FILE_2 | - "! The second document to compare. - "! @parameter I_FILE_1_CONTENT_TYPE | - "! The content type of file1. - "! @parameter I_FILE_2_CONTENT_TYPE | - "! The content type of file2. - "! @parameter I_FILE_1_LABEL | - "! A text label for the first document. - "! @parameter I_FILE_2_LABEL | - "! A text label for the second document. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_COMPARE_RETURN - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods COMPARE_DOCUMENTS - importing - !I_FILE_1 type FILE - !I_FILE_2 type FILE - !I_FILE_1_CONTENT_TYPE type STRING optional - !I_FILE_2_CONTENT_TYPE type STRING optional - !I_FILE_1_LABEL type STRING default 'file_1' - !I_FILE_2_LABEL type STRING default 'file_2' - !I_MODEL type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COMPARE_RETURN - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Add feedback

- "! Adds feedback in the form of _labels_ from a subject-matter expert (SME) to a - "! governing document.
- "! **Important:** Feedback is not immediately incorporated into the training model, - "! nor is it guaranteed to be incorporated at a later date. Instead, submitted - "! feedback is used to suggest future updates to the training model. - "! - "! @parameter I_FEEDBACK_DATA | - "! An object that defines the feedback to be submitted. - "! @parameter E_RESPONSE | - "! Service return value of type T_FEEDBACK_RETURN - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods ADD_FEEDBACK - importing - !I_FEEDBACK_DATA type T_FEEDBACK_INPUT - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_FEEDBACK_RETURN - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List the feedback in a document

- "! Lists the feedback in a document. - "! - "! @parameter I_FEEDBACK_TYPE | - "! An optional string that filters the output to include only feedback with the - "! specified feedback type. The only permitted value is `element_classification`. - "! @parameter I_DOCUMENT_TITLE | - "! An optional string that filters the output to include only feedback from the - "! document with the specified `document_title`. - "! @parameter I_MODEL_ID | - "! An optional string that filters the output to include only feedback with the - "! specified `model_id`. The only permitted value is `contracts`. - "! @parameter I_MODEL_VERSION | - "! An optional string that filters the output to include only feedback with the - "! specified `model_version`. - "! @parameter I_CATEGORY_REMOVED | - "! An optional string in the form of a comma-separated list of categories. If it is - "! specified, the service filters the output to include only feedback that has at - "! least one category from the list removed. - "! @parameter I_CATEGORY_ADDED | - "! An optional string in the form of a comma-separated list of categories. If this - "! is specified, the service filters the output to include only feedback that has - "! at least one category from the list added. - "! @parameter I_CATEGORY_NOT_CHANGED | - "! An optional string in the form of a comma-separated list of categories. If this - "! is specified, the service filters the output to include only feedback that has - "! at least one category from the list unchanged. - "! @parameter I_TYPE_REMOVED | - "! An optional string of comma-separated `nature`:`party` pairs. If this is - "! specified, the service filters the output to include only feedback that has at - "! least one `nature`:`party` pair from the list removed. - "! @parameter I_TYPE_ADDED | - "! An optional string of comma-separated `nature`:`party` pairs. If this is - "! specified, the service filters the output to include only feedback that has at - "! least one `nature`:`party` pair from the list removed. - "! @parameter I_TYPE_NOT_CHANGED | - "! An optional string of comma-separated `nature`:`party` pairs. If this is - "! specified, the service filters the output to include only feedback that has at - "! least one `nature`:`party` pair from the list unchanged. - "! @parameter I_PAGE_LIMIT | - "! An optional integer specifying the number of documents that you want the service - "! to return. - "! @parameter I_CURSOR | - "! An optional string that returns the set of documents after the previous set. Use - "! this parameter with the `page_limit` parameter. - "! @parameter I_SORT | - "! An optional comma-separated list of fields in the document to sort on. You can - "! optionally specify the sort direction by prefixing the value of the field with - "! `-` for descending order or `+` for ascending order (the default). Currently - "! permitted sorting fields are `created`, `user_id`, and `document_title`. - "! @parameter I_INCLUDE_TOTAL | - "! An optional boolean value. If specified as `true`, the `pagination` object in - "! the output includes a value called `total` that gives the total count of - "! feedback created. - "! @parameter E_RESPONSE | - "! Service return value of type T_FEEDBACK_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_FEEDBACK - importing - !I_FEEDBACK_TYPE type STRING optional - !I_DOCUMENT_TITLE type STRING optional - !I_MODEL_ID type STRING optional - !I_MODEL_VERSION type STRING optional - !I_CATEGORY_REMOVED type STRING optional - !I_CATEGORY_ADDED type STRING optional - !I_CATEGORY_NOT_CHANGED type STRING optional - !I_TYPE_REMOVED type STRING optional - !I_TYPE_ADDED type STRING optional - !I_TYPE_NOT_CHANGED type STRING optional - !I_PAGE_LIMIT type INTEGER optional - !I_CURSOR type STRING optional - !I_SORT type STRING optional - !I_INCLUDE_TOTAL type BOOLEAN optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_FEEDBACK_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get a specified feedback entry

- "! Gets a feedback entry with a specified `feedback_id`. - "! - "! @parameter I_FEEDBACK_ID | - "! A string that specifies the feedback entry to be included in the output. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_GET_FEEDBACK - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_FEEDBACK - importing - !I_FEEDBACK_ID type STRING - !I_MODEL type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_GET_FEEDBACK - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a specified feedback entry

- "! Deletes a feedback entry with a specified `feedback_id`. - "! - "! @parameter I_FEEDBACK_ID | - "! A string that specifies the feedback entry to be deleted from the document. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_FEEDBACK_DELETED - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_FEEDBACK - importing - !I_FEEDBACK_ID type STRING - !I_MODEL type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_FEEDBACK_DELETED - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Submit a batch-processing request

- "! Run Compare and Comply methods over a collection of input documents.
- "!
- "! **Important:** Batch processing requires the use of the [IBM Cloud Object - "! Storage - "! service](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-sto - "! rage-about#about-ibm-cloud-object-storage). The use of IBM Cloud Object Storage - "! with Compare and Comply is discussed at [Using batch - "! processing](https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-batc - "! hing#before-you-batch). - "! - "! @parameter I_FUNCTION | - "! The Compare and Comply method to run across the submitted input documents. - "! @parameter I_INPUT_CREDENTIALS_FILE | - "! A JSON file containing the input Cloud Object Storage credentials. At a minimum, - "! the credentials must enable `READ` permissions on the bucket defined by the - "! `input_bucket_name` parameter. - "! @parameter I_INPUT_BUCKET_LOCATION | - "! The geographical location of the Cloud Object Storage input bucket as listed on - "! the **Endpoint** tab of your Cloud Object Storage instance; for example, - "! `us-geo`, `eu-geo`, or `ap-geo`. - "! @parameter I_INPUT_BUCKET_NAME | - "! The name of the Cloud Object Storage input bucket. - "! @parameter I_OUTPUT_CREDENTIALS_FILE | - "! A JSON file that lists the Cloud Object Storage output credentials. At a - "! minimum, the credentials must enable `READ` and `WRITE` permissions on the - "! bucket defined by the `output_bucket_name` parameter. - "! @parameter I_OUTPUT_BUCKET_LOCATION | - "! The geographical location of the Cloud Object Storage output bucket as listed on - "! the **Endpoint** tab of your Cloud Object Storage instance; for example, - "! `us-geo`, `eu-geo`, or `ap-geo`. - "! @parameter I_OUTPUT_BUCKET_NAME | - "! The name of the Cloud Object Storage output bucket. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_BATCH_STATUS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_BATCH - importing - !I_FUNCTION type STRING - !I_INPUT_CREDENTIALS_FILE type FILE - !I_INPUT_BUCKET_LOCATION type STRING - !I_INPUT_BUCKET_NAME type STRING - !I_OUTPUT_CREDENTIALS_FILE type FILE - !I_OUTPUT_BUCKET_LOCATION type STRING - !I_OUTPUT_BUCKET_NAME type STRING - !I_MODEL type STRING optional - !I_INPUT_CREDENTIALS_FILE_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_OUTPUT_CREDENTIALS_FILE_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_BATCH_STATUS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List submitted batch-processing jobs

- "! Lists batch-processing jobs submitted by users. - "! - "! @parameter E_RESPONSE | - "! Service return value of type T_BATCHES - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_BATCHES - importing - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_BATCHES - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get information about a specific batch-processing job

- "! Gets information about a batch-processing job with a specified ID. - "! - "! @parameter I_BATCH_ID | - "! The ID of the batch-processing job whose information you want to retrieve. - "! @parameter E_RESPONSE | - "! Service return value of type T_BATCH_STATUS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_BATCH - importing - !I_BATCH_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_BATCH_STATUS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update a pending or active batch-processing job

- "! Updates a pending or active batch-processing job. You can rescan the input - "! bucket to check for new documents or cancel a job. - "! - "! @parameter I_BATCH_ID | - "! The ID of the batch-processing job you want to update. - "! @parameter I_ACTION | - "! The action you want to perform on the specified batch-processing job. - "! @parameter I_MODEL | - "! The analysis model to be used by the service. For the **Element classification** - "! and **Compare two documents** methods, the default is `contracts`. For the - "! **Extract tables** method, the default is `tables`. These defaults apply to the - "! standalone methods as well as to the methods' use in batch-processing - "! requests. - "! @parameter E_RESPONSE | - "! Service return value of type T_BATCH_STATUS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_BATCH - importing - !I_BATCH_ID type STRING - !I_ACTION type STRING - !I_MODEL type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_BATCH_STATUS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_COMPARE_COMPLY_V1 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Compare and Comply'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_COMPARE_COMPLY_V1->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.compare-comply.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144429'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->CONVERT_TO_HTML -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FILE TYPE FILE -* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_HTMLRETURN -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CONVERT_TO_HTML. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/html_conversion'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_FILE is initial. - lv_extension = get_file_extension( I_file_content_type ). - lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->CLASSIFY_ELEMENTS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FILE TYPE FILE -* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFY_RETURN -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CLASSIFY_ELEMENTS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/element_classification'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_FILE is initial. - lv_extension = get_file_extension( I_file_content_type ). - lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->EXTRACT_TABLES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FILE TYPE FILE -* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TABLE_RETURN -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method EXTRACT_TABLES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/tables'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_FILE is initial. - lv_extension = get_file_extension( I_file_content_type ). - lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->COMPARE_DOCUMENTS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FILE_1 TYPE FILE -* | [--->] I_FILE_2 TYPE FILE -* | [--->] I_FILE_1_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_FILE_2_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_FILE_1_LABEL TYPE STRING (default ='file_1') -* | [--->] I_FILE_2_LABEL TYPE STRING (default ='file_2') -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COMPARE_RETURN -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method COMPARE_DOCUMENTS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/comparison'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_FILE_1_LABEL is supplied. - lv_queryparam = escape( val = i_FILE_1_LABEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `file_1_label` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_FILE_2_LABEL is supplied. - lv_queryparam = escape( val = i_FILE_2_LABEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `file_2_label` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_FILE_1 is initial. - lv_extension = get_file_extension( I_file_1_content_type ). - lv_value = `form-data; name="file_1"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_1_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE_1. - append ls_form_part to lt_form_part. - endif. - - if not i_FILE_2 is initial. - lv_extension = get_file_extension( I_file_2_content_type ). - lv_value = `form-data; name="file_2"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_2_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE_2. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->ADD_FEEDBACK -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FEEDBACK_DATA TYPE T_FEEDBACK_INPUT -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_FEEDBACK_RETURN -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method ADD_FEEDBACK. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/feedback'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_FEEDBACK_DATA ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_FEEDBACK_DATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'feedback_data' i_value = i_FEEDBACK_DATA ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_FEEDBACK_DATA to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->LIST_FEEDBACK -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FEEDBACK_TYPE TYPE STRING(optional) -* | [--->] I_DOCUMENT_TITLE TYPE STRING(optional) -* | [--->] I_MODEL_ID TYPE STRING(optional) -* | [--->] I_MODEL_VERSION TYPE STRING(optional) -* | [--->] I_CATEGORY_REMOVED TYPE STRING(optional) -* | [--->] I_CATEGORY_ADDED TYPE STRING(optional) -* | [--->] I_CATEGORY_NOT_CHANGED TYPE STRING(optional) -* | [--->] I_TYPE_REMOVED TYPE STRING(optional) -* | [--->] I_TYPE_ADDED TYPE STRING(optional) -* | [--->] I_TYPE_NOT_CHANGED TYPE STRING(optional) -* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional) -* | [--->] I_CURSOR TYPE STRING(optional) -* | [--->] I_SORT TYPE STRING(optional) -* | [--->] I_INCLUDE_TOTAL TYPE BOOLEAN(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_FEEDBACK_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_FEEDBACK. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/feedback'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_FEEDBACK_TYPE is supplied. - lv_queryparam = escape( val = i_FEEDBACK_TYPE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `feedback_type` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_DOCUMENT_TITLE is supplied. - lv_queryparam = escape( val = i_DOCUMENT_TITLE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `document_title` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_MODEL_ID is supplied. - lv_queryparam = escape( val = i_MODEL_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_MODEL_VERSION is supplied. - lv_queryparam = escape( val = i_MODEL_VERSION format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model_version` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CATEGORY_REMOVED is supplied. - lv_queryparam = escape( val = i_CATEGORY_REMOVED format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `category_removed` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CATEGORY_ADDED is supplied. - lv_queryparam = escape( val = i_CATEGORY_ADDED format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `category_added` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CATEGORY_NOT_CHANGED is supplied. - lv_queryparam = escape( val = i_CATEGORY_NOT_CHANGED format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `category_not_changed` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_TYPE_REMOVED is supplied. - lv_queryparam = escape( val = i_TYPE_REMOVED format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `type_removed` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_TYPE_ADDED is supplied. - lv_queryparam = escape( val = i_TYPE_ADDED format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `type_added` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_TYPE_NOT_CHANGED is supplied. - lv_queryparam = escape( val = i_TYPE_NOT_CHANGED format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `type_not_changed` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_PAGE_LIMIT is supplied. - lv_queryparam = i_PAGE_LIMIT. - add_query_parameter( - exporting - i_parameter = `page_limit` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CURSOR is supplied. - lv_queryparam = escape( val = i_CURSOR format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `cursor` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SORT is supplied. - lv_queryparam = escape( val = i_SORT format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `sort` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_INCLUDE_TOTAL is supplied. - lv_queryparam = i_INCLUDE_TOTAL. - add_query_parameter( - exporting - i_parameter = `include_total` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->GET_FEEDBACK -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FEEDBACK_ID TYPE STRING -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_GET_FEEDBACK -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_FEEDBACK. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/feedback/{feedback_id}'. - replace all occurrences of `{feedback_id}` in ls_request_prop-url-path with i_FEEDBACK_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->DELETE_FEEDBACK -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FEEDBACK_ID TYPE STRING -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_FEEDBACK_DELETED -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_FEEDBACK. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/feedback/{feedback_id}'. - replace all occurrences of `{feedback_id}` in ls_request_prop-url-path with i_FEEDBACK_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->CREATE_BATCH -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FUNCTION TYPE STRING -* | [--->] I_INPUT_CREDENTIALS_FILE TYPE FILE -* | [--->] I_INPUT_BUCKET_LOCATION TYPE STRING -* | [--->] I_INPUT_BUCKET_NAME TYPE STRING -* | [--->] I_OUTPUT_CREDENTIALS_FILE TYPE FILE -* | [--->] I_OUTPUT_BUCKET_LOCATION TYPE STRING -* | [--->] I_OUTPUT_BUCKET_NAME TYPE STRING -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_INPUT_CREDENTIALS_FILE_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_OUTPUT_CREDENTIALS_FILE_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_BATCH_STATUS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_BATCH. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/batches'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_FUNCTION format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `function` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_INPUT_BUCKET_LOCATION is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="input_bucket_location"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_INPUT_BUCKET_LOCATION. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - if not i_INPUT_BUCKET_NAME is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="input_bucket_name"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_INPUT_BUCKET_NAME. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - if not i_OUTPUT_BUCKET_LOCATION is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="output_bucket_location"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_OUTPUT_BUCKET_LOCATION. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - if not i_OUTPUT_BUCKET_NAME is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="output_bucket_name"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_OUTPUT_BUCKET_NAME. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - - - if not i_INPUT_CREDENTIALS_FILE is initial. - lv_extension = get_file_extension( I_INPUT_CREDENTIALS_FILE_CT ). - lv_value = `form-data; name="input_credentials_file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_INPUT_CREDENTIALS_FILE_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_INPUT_CREDENTIALS_FILE. - append ls_form_part to lt_form_part. - endif. - - if not i_OUTPUT_CREDENTIALS_FILE is initial. - lv_extension = get_file_extension( I_OUTPUT_CREDENTIALS_FILE_CT ). - lv_value = `form-data; name="output_credentials_file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_OUTPUT_CREDENTIALS_FILE_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_OUTPUT_CREDENTIALS_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->LIST_BATCHES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_BATCHES -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_BATCHES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/batches'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->GET_BATCH -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_BATCH_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_BATCH_STATUS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_BATCH. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/batches/{batch_id}'. - replace all occurrences of `{batch_id}` in ls_request_prop-url-path with i_BATCH_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_COMPARE_COMPLY_V1->UPDATE_BATCH -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_BATCH_ID TYPE STRING -* | [--->] I_ACTION TYPE STRING -* | [--->] I_MODEL TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_BATCH_STATUS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_BATCH. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/batches/{batch_id}'. - replace all occurrences of `{batch_id}` in ls_request_prop-url-path with i_BATCH_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_ACTION format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `action` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - if i_MODEL is supplied. - lv_queryparam = escape( val = i_MODEL format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP PUT request - lo_response = HTTP_PUT( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_compare_comply_v1.clas.xml b/src/zcl_ibmc_compare_comply_v1.clas.xml deleted file mode 100644 index a1df9c7..0000000 --- a/src/zcl_ibmc_compare_comply_v1.clas.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - ZCL_IBMC_COMPARE_COMPLY_V1 - E - Compare and Comply - 1 - X - X - X - - - - ZCL_IBMC_COMPARE_COMPLY_V1 - ADD_FEEDBACK - E - Add feedback - - - ZCL_IBMC_COMPARE_COMPLY_V1 - CLASSIFY_ELEMENTS - E - Classify the elements of a document - - - ZCL_IBMC_COMPARE_COMPLY_V1 - COMPARE_DOCUMENTS - E - Compare two documents - - - ZCL_IBMC_COMPARE_COMPLY_V1 - CONVERT_TO_HTML - E - Convert document to HTML - - - ZCL_IBMC_COMPARE_COMPLY_V1 - CREATE_BATCH - E - Submit a batch-processing request - - - ZCL_IBMC_COMPARE_COMPLY_V1 - DELETE_FEEDBACK - E - Delete a specified feedback entry - - - ZCL_IBMC_COMPARE_COMPLY_V1 - EXTRACT_TABLES - E - Extract a document's tables - - - ZCL_IBMC_COMPARE_COMPLY_V1 - GET_BATCH - E - Get information about a specific batch-processing job - - - ZCL_IBMC_COMPARE_COMPLY_V1 - GET_FEEDBACK - E - Get a specified feedback entry - - - ZCL_IBMC_COMPARE_COMPLY_V1 - LIST_BATCHES - E - List submitted batch-processing jobs - - - ZCL_IBMC_COMPARE_COMPLY_V1 - LIST_FEEDBACK - E - List the feedback in a document - - - ZCL_IBMC_COMPARE_COMPLY_V1 - UPDATE_BATCH - E - Update a pending or active batch-processing job - - - - - diff --git a/src/zcl_ibmc_discovery_v1.clas.abap b/src/zcl_ibmc_discovery_v1.clas.abap deleted file mode 100644 index 37173d4..0000000 --- a/src/zcl_ibmc_discovery_v1.clas.abap +++ /dev/null @@ -1,8733 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Discovery

-"! IBM Watson™ Discovery is a cognitive search and content analytics engine -"! that you can add to applications to identify patterns, trends and actionable -"! insights to drive better decision-making. Securely unify structured and -"! unstructured data with pre-enriched content, and use a simplified query -"! language to eliminate the need for manual filtering of results.
-class ZCL_IBMC_DISCOVERY_V1 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! An aggregation produced by Discovery to analyze the input

- "! provided. - begin of T_QUERY_AGGREGATION, - "! The type of aggregation command used. For example: term, filter, max, min, etc. - TYPE type STRING, - "! Array of aggregation results. - RESULTS type STANDARD TABLE OF DATA_REFERENCE WITH NON-UNIQUE DEFAULT KEY, - "! Number of matching results. - MATCHING_RESULTS type INTEGER, - "! Aggregations returned by Discovery. - AGGREGATIONS type STANDARD TABLE OF DATA_REFERENCE WITH NON-UNIQUE DEFAULT KEY, - end of T_QUERY_AGGREGATION. - types: - "!

- "! Aggregation results for the specified query.

- begin of T_AGGREGATION_RESULT, - "! Key that matched the aggregation type. - KEY type STRING, - "! Number of matching results. - MATCHING_RESULTS type INTEGER, - "! Aggregations returned in the case of chained aggregations. - AGGREGATIONS type STANDARD TABLE OF T_QUERY_AGGREGATION WITH NON-UNIQUE DEFAULT KEY, - end of T_AGGREGATION_RESULT. - types: - "!

- "! Training status details.

- begin of T_TRAINING_STATUS, - "! The total number of training examples uploaded to this collection. - TOTAL_EXAMPLES type INTEGER, - "! When `true`, the collection has been successfully trained. - AVAILABLE type BOOLEAN, - "! When `true`, the collection is currently processing training. - PROCESSING type BOOLEAN, - "! When `true`, the collection has a sufficent amount of queries added for training - "! to occur. - MINIMUM_QUERIES_ADDED type BOOLEAN, - "! When `true`, the collection has a sufficent amount of examples added for - "! training to occur. - MINIMUM_EXAMPLES_ADDED type BOOLEAN, - "! When `true`, the collection has a sufficent amount of diversity in labeled - "! results for training to occur. - SUFFICIENT_LABEL_DIVERSITY type BOOLEAN, - "! The number of notices associated with this data set. - NOTICES type INTEGER, - "! The timestamp of when the collection was successfully trained. - SUCCESSFULLY_TRAINED type DATETIME, - "! The timestamp of when the data was uploaded. - DATA_UPDATED type DATETIME, - end of T_TRAINING_STATUS. - types: - "!

- "! Object describing the current status of the wordlist.

- begin of T_TOKEN_DICT_STATUS_RESPONSE, - "! Current wordlist status for the specified collection. - STATUS type STRING, - "! The type for this wordlist. Can be `tokenization_dictionary` or `stopwords`. - TYPE type STRING, - end of T_TOKEN_DICT_STATUS_RESPONSE. - types: - "!

- "! An object specifying the relations enrichment and related

- "! parameters. - begin of T_NLU_ENRICHMENT_RELATIONS, - "! *For use with `natural_language_understanding` enrichments only.* The - "! enrichement model to use with relationship extraction. May be a custom model - "! provided by Watson Knowledge Studio, the default public model is`en-news`. - MODEL type STRING, - end of T_NLU_ENRICHMENT_RELATIONS. - types: - "!

- "! An object specifying the sentiment extraction enrichment and

- "! related parameters. - begin of T_NLU_ENRICHMENT_SENTIMENT, - "! When `true`, sentiment analysis is performed on the entire field. - DOCUMENT type BOOLEAN, - "! A comma-separated list of target strings that will have any associated sentiment - "! analyzed. - TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_NLU_ENRICHMENT_SENTIMENT. - types: - "!

- "! An object specifiying the semantic roles enrichment and

- "! related parameters. - begin of T_NL_ENRICHMENT_SEMANTIC_ROLES, - "! When `true`, entities are extracted from the identified sentence parts. - ENTITIES type BOOLEAN, - "! When `true`, keywords are extracted from the identified sentence parts. - KEYWORDS type BOOLEAN, - "! The maximum number of semantic roles enrichments to extact from each instance of - "! the specified field. - LIMIT type INTEGER, - end of T_NL_ENRICHMENT_SEMANTIC_ROLES. - types: - "!

- "! An object speficying the Entities enrichment and related

- "! parameters. - begin of T_NLU_ENRICHMENT_ENTITIES, - "! When `true`, sentiment analysis of entities will be performed on the specified - "! field. - SENTIMENT type BOOLEAN, - "! When `true`, emotion detection of entities will be performed on the specified - "! field. - EMOTION type BOOLEAN, - "! The maximum number of entities to extract for each instance of the specified - "! field. - LIMIT type INTEGER, - "! When `true`, the number of mentions of each identified entity is recorded. The - "! default is `false`. - MENTIONS type BOOLEAN, - "! When `true`, the types of mentions for each idetifieid entity is recorded. The - "! default is `false`. - MENTION_TYPES type BOOLEAN, - "! When `true`, a list of sentence locations for each instance of each identified - "! entity is recorded. The default is `false`. - SENTENCE_LOCATIONS type BOOLEAN, - "! The enrichement model to use with entity extraction. May be a custom model - "! provided by Watson Knowledge Studio, or the default public model `alchemy`. - MODEL type STRING, - end of T_NLU_ENRICHMENT_ENTITIES. - types: - "!

- "! An object specifying the emotion detection enrichment and

- "! related parameters. - begin of T_NLU_ENRICHMENT_EMOTION, - "! When `true`, emotion detection is performed on the entire field. - DOCUMENT type BOOLEAN, - "! A comma-separated list of target strings that will have any associated emotions - "! detected. - TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_NLU_ENRICHMENT_EMOTION. - types: - "!

- "! An object specifiying the concepts enrichment and related

- "! parameters. - begin of T_NLU_ENRICHMENT_CONCEPTS, - "! The maximum number of concepts enrichments to extact from each instance of the - "! specified field. - LIMIT type INTEGER, - end of T_NLU_ENRICHMENT_CONCEPTS. - types: - "!

- "! An object specifying the Keyword enrichment and related

- "! parameters. - begin of T_NLU_ENRICHMENT_KEYWORDS, - "! When `true`, sentiment analysis of keywords will be performed on the specified - "! field. - SENTIMENT type BOOLEAN, - "! When `true`, emotion detection of keywords will be performed on the specified - "! field. - EMOTION type BOOLEAN, - "! The maximum number of keywords to extract for each instance of the specified - "! field. - LIMIT type INTEGER, - end of T_NLU_ENRICHMENT_KEYWORDS. - types: - "!

- "! Object containing Natural Language Understanding features to

- "! be used. - begin of T_NLU_ENRICHMENT_FEATURES, - "! An object specifying the Keyword enrichment and related parameters. - KEYWORDS type T_NLU_ENRICHMENT_KEYWORDS, - "! An object speficying the Entities enrichment and related parameters. - ENTITIES type T_NLU_ENRICHMENT_ENTITIES, - "! An object specifying the sentiment extraction enrichment and related parameters. - "! - SENTIMENT type T_NLU_ENRICHMENT_SENTIMENT, - "! An object specifying the emotion detection enrichment and related parameters. - EMOTION type T_NLU_ENRICHMENT_EMOTION, - "! An object that indicates the Categories enrichment will be applied to the - "! specified field. - CATEGORIES type MAP, - "! An object specifiying the semantic roles enrichment and related parameters. - SEMANTIC_ROLES type T_NL_ENRICHMENT_SEMANTIC_ROLES, - "! An object specifying the relations enrichment and related parameters. - RELATIONS type T_NLU_ENRICHMENT_RELATIONS, - "! An object specifiying the concepts enrichment and related parameters. - CONCEPTS type T_NLU_ENRICHMENT_CONCEPTS, - end of T_NLU_ENRICHMENT_FEATURES. - types: - "!

- "! An object representing the configuration options to use for

- "! the `natural_language_understanding` enrichments. - begin of T_NLU_ENRICHMENT_OPTIONS, - "! Object containing Natural Language Understanding features to be used. - FEATURES type T_NLU_ENRICHMENT_FEATURES, - "! 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. - LANGUAGE type STRING, - end of T_NLU_ENRICHMENT_OPTIONS. - types: - "!

- "! An object defining a single tokenizaion rule.

- begin of T_TOKEN_DICT_RULE, - "! The string to tokenize. - TEXT type STRING, - "! Array of tokens that the `text` field is split into when found. - TOKENS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Array of tokens that represent the content of the `text` field in an alternate - "! character set. - READINGS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The part of speech that the `text` string belongs to. For example `noun`. Custom - "! parts of speech can be specified. - PART_OF_SPEECH type STRING, - end of T_TOKEN_DICT_RULE. - types: - "!

- "! Tokenization dictionary describing how words are tokenized

- "! during ingestion and at query time. - begin of T_TOKEN_DICT, - "! An array of tokenization rules. Each rule contains, the original `text` string, - "! component `tokens`, any alternate character set `readings`, and which - "! `part_of_speech` the text is from. - TOKENIZATION_RULES type STANDARD TABLE OF T_TOKEN_DICT_RULE WITH NON-UNIQUE DEFAULT KEY, - end of T_TOKEN_DICT. - types: - "! No documentation available. - begin of T_FILTER, - "! The match the aggregated results queried for. - MATCH type STRING, - end of T_FILTER. - types: - "!

- "! Object defining which URL to crawl and how to crawl it.

- begin of T_SOURCE_OPTIONS_WEB_CRAWL, - "! The starting URL to crawl. - URL type STRING, - "! When `true`, crawls of the specified URL are limited to the host part of the - "! **url** field. - LIMIT_TO_STARTING_HOSTS type BOOLEAN, - "! 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. - CRAWL_SPEED type STRING, - "! When `true`, allows the crawl to interact with HTTPS sites with SSL certificates - "! with untrusted signers. - ALLOW_UNTRUSTED_CERTIFICATE type BOOLEAN, - "! The maximum number of hops to make from the initial URL. When a page is crawled - "! each link on that page will also be crawled if it is within the - "! **maximum_hops** from the initial URL. The first page crawled is 0 hops, each - "! link crawled from the first page is 1 hop, each link crawled from those pages - "! is 2 hops, and so on. - MAXIMUM_HOPS type INTEGER, - "! The maximum milliseconds to wait for a response from the web server. - REQUEST_TIMEOUT type INTEGER, - "! When `true`, the crawler will ignore any `robots.txt` encountered by the - "! crawler. This should only ever be done when crawling a web site the user owns. - "! This must be be set to `true` when a **gateway_id** is specied in the - "! **credentials**. - OVERRIDE_ROBOTS_TXT type BOOLEAN, - "! Array of URL's to be excluded while crawling. The crawler will not follow - "! links which contains this string. For example, listing `https://ibm.com/watson` - "! also excludes `https://ibm.com/watson/discovery`. - BLACKLIST type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_SOURCE_OPTIONS_WEB_CRAWL. - types: - "!

- "! An object that indicates the Categories enrichment will be

- "! applied to the specified field. - T_NLU_ENRICHMENT_CATEGORIES type MAP. - types: - "!

- "! Object containing details of the stored credentials.


- "!
- "! Obtain credentials for your source from the administrator of the source. - begin of T_CREDENTIAL_DETAILS, - "! 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`. - CREDENTIAL_TYPE type STRING, - "! The **client_id** of the source that these credentials connect to. Only valid, - "! and required, with a **credential_type** of `oauth2`. - CLIENT_ID type STRING, - "! The **enterprise_id** of the Box site that these credentials connect to. Only - "! valid, and required, with a **source_type** of `box`. - ENTERPRISE_ID type STRING, - "! The **url** of the source that these credentials connect to. Only valid, and - "! required, with a **credential_type** of `username_password`, `noauth`, and - "! `basic`. - URL type STRING, - "! The **username** of the source that these credentials connect to. Only valid, - "! and required, with a **credential_type** of `saml`, `username_password`, - "! `basic`, or `ntlm_v1`. - USERNAME type STRING, - "! The **organization_url** of the source that these credentials connect to. Only - "! valid, and required, with a **credential_type** of `saml`. - ORGANIZATION_URL type STRING, - "! The **site_collection.path** of the source that these credentials connect to. - "! Only valid, and required, with a **source_type** of `sharepoint`. - SITE_COLLECTION_PATH type STRING, - "! The **client_secret** of the source that these credentials connect to. Only - "! valid, and required, with a **credential_type** of `oauth2`. This value is - "! never returned and is only used when creating or modifying **credentials**. - CLIENT_SECRET type STRING, - "! The **public_key_id** of the source that these credentials connect to. Only - "! valid, and required, with a **credential_type** of `oauth2`. This value is - "! never returned and is only used when creating or modifying **credentials**. - PUBLIC_KEY_ID type STRING, - "! The **private_key** of the source that these credentials connect to. Only valid, - "! and required, with a **credential_type** of `oauth2`. This value is never - "! returned and is only used when creating or modifying **credentials**. - PRIVATE_KEY type STRING, - "! The **passphrase** of the source that these credentials connect to. Only valid, - "! and required, with a **credential_type** of `oauth2`. This value is never - "! returned and is only used when creating or modifying **credentials**. - PASSPHRASE type STRING, - "! The **password** of the source that these credentials connect to. Only valid, - "! and required, with **credential_type**s of `saml`, `username_password`, - "! `basic`, or `ntlm_v1`.
- "!
- "! **Note:** When used with a **source_type** of `salesforce`, the password - "! consists of the Salesforce password and a valid Salesforce security token - "! concatenated. This value is never returned and is only used when creating or - "! modifying **credentials**. - PASSWORD type STRING, - "! The ID of the **gateway** to be connected through (when connecting to intranet - "! sites). Only valid with a **credential_type** of `noauth`, `basic`, or - "! `ntlm_v1`. Gateways are created using the - "! `/v1/environments/{environment_id}/gateways` methods. - GATEWAY_ID type STRING, - "! The type of Sharepoint repository to connect to. Only valid, and required, with - "! a **source_type** of `sharepoint`. - SOURCE_VERSION type 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. - WEB_APPLICATION_URL type STRING, - "! The domain used to log in to your OnPrem SharePoint account. Only valid, and - "! required, with a **source_version** of `2016`. - DOMAIN type STRING, - "! The endpoint associated with the cloud object store that your are connecting to. - "! Only valid, and required, with a **credential_type** of `aws4_hmac`. - ENDPOINT type STRING, - "! The access key ID associated with the cloud object store. Only valid, and - "! required, with a **credential_type** of `aws4_hmac`. This value is never - "! returned and is only used when creating or modifying **credentials**. For more - "! infomation, see the [cloud object store - "! documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-obje - "! ct-storage-using-hmac-credentials#using-hmac-credentials). - ACCESS_KEY_ID type STRING, - "! The secret access key associated with the cloud object store. Only valid, and - "! required, with a **credential_type** of `aws4_hmac`. This value is never - "! returned and is only used when creating or modifying **credentials**. For more - "! infomation, see the [cloud object store - "! documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-obje - "! ct-storage-using-hmac-credentials#using-hmac-credentials). - SECRET_ACCESS_KEY type STRING, - end of T_CREDENTIAL_DETAILS. - types: - "!

- "! Object containing credential information.

- begin of T_CREDENTIALS, - "! Unique identifier for this set of credentials. - CREDENTIAL_ID type STRING, - "! 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. - SOURCE_TYPE type STRING, - "! Object containing details of the stored credentials.
- "!
- "! Obtain credentials for your source from the administrator of the source. - CREDENTIAL_DETAILS type T_CREDENTIAL_DETAILS, - "! The current status of this set of credentials. `connected` indicates that the - "! credentials are available to use with the source configuration of a collection. - "! `invalid` refers to the credentials (for example, the password provided has - "! expired) and must be corrected before they can be used with a collection. - STATUS type STRING, - end of T_CREDENTIALS. - types: - "!

- "! Object containing array of credential definitions.

- begin of T_CREDENTIALS_LIST, - "! An array of credential definitions that were created for this instance. - CREDENTIALS type STANDARD TABLE OF T_CREDENTIALS WITH NON-UNIQUE DEFAULT KEY, - end of T_CREDENTIALS_LIST. - types: - "!

- "! Summary of the collection usage in the environment.

- begin of T_COLLECTION_USAGE, - "! Number of active collections in the environment. - AVAILABLE type INTEGER, - "! Total number of collections allowed in the environment. - MAXIMUM_ALLOWED type INTEGER, - end of T_COLLECTION_USAGE. - types: - "!

- "! Summary of the disk usage statistics for the environment.

- begin of T_DISK_USAGE, - "! Number of bytes within the environment's disk capacity that are currently - "! used to store data. - USED_BYTES type INTEGER, - "! Total number of bytes available in the environment's disk capacity. - MAXIMUM_ALLOWED_BYTES type INTEGER, - end of T_DISK_USAGE. - types: - "!

- "! Summary of the document usage statistics for the

- "! environment. - begin of T_ENVIRONMENT_DOCUMENTS, - "! Number of documents indexed for the environment. - AVAILABLE type INTEGER, - "! Total number of documents allowed in the environment's capacity. - MAXIMUM_ALLOWED type INTEGER, - end of T_ENVIRONMENT_DOCUMENTS. - types: - "!

- "! Details about the resource usage and capacity of the

- "! environment. - begin of T_INDEX_CAPACITY, - "! Summary of the document usage statistics for the environment. - DOCUMENTS type T_ENVIRONMENT_DOCUMENTS, - "! Summary of the disk usage statistics for the environment. - DISK_USAGE type T_DISK_USAGE, - "! Summary of the collection usage in the environment. - COLLECTIONS type T_COLLECTION_USAGE, - end of T_INDEX_CAPACITY. - types: - "!

- "! Information about the Continuous Relevancy Training for this

- "! environment. - begin of T_SEARCH_STATUS, - "! Current scope of the training. Always returned as `environment`. - SCOPE type STRING, - "! The current status of Continuous Relevancy Training for this environment. - STATUS type STRING, - "! Long description of the current Continuous Relevancy Training status. - STATUS_DESCRIPTION type STRING, - "! The date stamp of the most recent completed training for this environment. - LAST_TRAINED type DATE, - end of T_SEARCH_STATUS. - types: - "!

- "! Details about an environment.

- begin of T_ENVIRONMENT, - "! Unique identifier for the environment. - ENVIRONMENT_ID type STRING, - "! Name that identifies the environment. - NAME type STRING, - "! Description of the environment. - DESCRIPTION type STRING, - "! Creation date of the environment, in the format - "! `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. - CREATED type DATETIME, - "! Date of most recent environment update, in the format - "! `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. - UPDATED type DATETIME, - "! 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 type STRING, - "! If `true`, the environment contains read-only collections that are maintained by - "! IBM. - READ_ONLY type BOOLEAN, - "! Current size of the environment. - SIZE type 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. - REQUESTED_SIZE type STRING, - "! Details about the resource usage and capacity of the environment. - INDEX_CAPACITY type T_INDEX_CAPACITY, - "! Information about the Continuous Relevancy Training for this environment. - SEARCH_STATUS type T_SEARCH_STATUS, - end of T_ENVIRONMENT. - types: - "!

- "! Response object containing an array of configured

- "! environments. - begin of T_LIST_ENVIRONMENTS_RESPONSE, - "! An array of [environments] that are available for the service instance. - ENVIRONMENTS type STANDARD TABLE OF T_ENVIRONMENT WITH NON-UNIQUE DEFAULT KEY, - end of T_LIST_ENVIRONMENTS_RESPONSE. - types: - "!

- "! Gatway deletion confirmation.

- begin of T_GATEWAY_DELETE, - "! The gateway ID of the deleted gateway. - GATEWAY_ID type STRING, - "! The status of the request. - STATUS type STRING, - end of T_GATEWAY_DELETE. - types: - "!

- "! Training example details.

- begin of T_TRAINING_EXAMPLE, - "! The document ID associated with this training example. - DOCUMENT_ID type STRING, - "! The cross reference associated with this training example. - CROSS_REFERENCE type STRING, - "! The relevance of the training example. - RELEVANCE type INTEGER, - end of T_TRAINING_EXAMPLE. - types: - "!

- "! Training query details.

- begin of T_TRAINING_QUERY, - "! The query ID associated with the training query. - QUERY_ID type STRING, - "! The natural text query for the training query. - NATURAL_LANGUAGE_QUERY type STRING, - "! The filter used on the collection before the **natural_language_query** is - "! applied. - FILTER type STRING, - "! Array of training examples. - EXAMPLES type STANDARD TABLE OF T_TRAINING_EXAMPLE WITH NON-UNIQUE DEFAULT KEY, - end of T_TRAINING_QUERY. - types: - "!

- "! A passage query result.

- begin of T_QUERY_PASSAGES, - "! The unique identifier of the document from which the passage has been extracted. - "! - DOCUMENT_ID type STRING, - "! The confidence score of the passages's analysis. A higher score indicates - "! greater confidence. - PASSAGE_SCORE type DOUBLE, - "! The content of the extracted passage. - PASSAGE_TEXT type STRING, - "! The position of the first character of the extracted passage in the originating - "! field. - START_OFFSET type INTEGER, - "! The position of the last character of the extracted passage in the originating - "! field. - END_OFFSET type INTEGER, - "! The label of the field from which the passage has been extracted. - FIELD type STRING, - end of T_QUERY_PASSAGES. - types: - "!

- "! Object containing normalization operations.

- begin of T_NORMALIZATION_OPERATION, - "! 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). - OPERATION type STRING, - "! The source field for the operation. - SOURCE_FIELD type STRING, - "! The destination field for the operation. - DESTINATION_FIELD type STRING, - end of T_NORMALIZATION_OPERATION. - types: - "!

- "! Font matching configuration.

- begin of T_FONT_SETTING, - "! The HTML heading level that any content with the matching font is converted to. - LEVEL type INTEGER, - "! The minimum size of the font to match. - MIN_SIZE type INTEGER, - "! The maximum size of the font to match. - MAX_SIZE type INTEGER, - "! When `true`, the font is matched if it is bold. - BOLD type BOOLEAN, - "! When `true`, the font is matched if it is italic. - ITALIC type BOOLEAN, - "! The name of the font. - NAME type STRING, - end of T_FONT_SETTING. - types: - "!

- "! Microsoft Word styles to convert into a specified HTML head

- "! level. - begin of T_WORD_STYLE, - "! HTML head level that content matching this style is tagged with. - LEVEL type INTEGER, - "! Array of word style names to convert. - NAMES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_WORD_STYLE. - types: - "!

- "! Object containing heading detection conversion settings for

- "! Microsoft Word documents. - begin of T_WORD_HEADING_DETECTION, - "! Array of font matching configurations. - FONTS type STANDARD TABLE OF T_FONT_SETTING WITH NON-UNIQUE DEFAULT KEY, - "! Array of Microsoft Word styles to convert. - STYLES type STANDARD TABLE OF T_WORD_STYLE WITH NON-UNIQUE DEFAULT KEY, - end of T_WORD_HEADING_DETECTION. - types: - "!

- "! Object containing heading detection conversion settings for

- "! PDF documents. - begin of T_PDF_HEADING_DETECTION, - "! Array of font matching configurations. - FONTS type STANDARD TABLE OF T_FONT_SETTING WITH NON-UNIQUE DEFAULT KEY, - end of T_PDF_HEADING_DETECTION. - types: - "!

- "! A list of PDF conversion settings.

- begin of T_PDF_SETTINGS, - "! Object containing heading detection conversion settings for PDF documents. - HEADING type T_PDF_HEADING_DETECTION, - end of T_PDF_SETTINGS. - types: - "!

- "! Object that defines a box folder to crawl with this

- "! configuration. - begin of T_SOURCE_OPTIONS_FOLDER, - "! The Box user ID of the user who owns the folder to crawl. - OWNER_USER_ID type STRING, - "! The Box folder ID of the folder to crawl. - FOLDER_ID type STRING, - "! The maximum number of documents to crawl for this folder. By default, all - "! documents in the folder are crawled. - LIMIT type INTEGER, - end of T_SOURCE_OPTIONS_FOLDER. - types: - "!

- "! Object defining a cloud object store bucket to crawl.

- begin of T_SOURCE_OPTIONS_BUCKETS, - "! The name of the cloud object store bucket to crawl. - NAME type STRING, - "! The number of documents to crawl from this cloud object store bucket. If not - "! specified, all documents in the bucket are crawled. - LIMIT type INTEGER, - end of T_SOURCE_OPTIONS_BUCKETS. - types: - "!

- "! Object containing the schedule information for the source.

- begin of T_SOURCE_SCHEDULE, - "! When `true`, the source is re-crawled based on the **frequency** field in this - "! object. When `false` the source is not re-crawled; When `false` and connecting - "! to Salesforce the source is crawled annually. - ENABLED type BOOLEAN, - "! The time zone to base source crawl times on. Possible values correspond to the - "! IANA (Internet Assigned Numbers Authority) time zones list. - TIME_ZONE type STRING, - "! 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. - FREQUENCY type STRING, - end of T_SOURCE_SCHEDULE. - types: - "!

- "! Object that defines a Salesforce document object type crawl

- "! with this configuration. - begin of T_SOURCE_OPTIONS_OBJECT, - "! The name of the Salesforce document object to crawl. For example, `case`. - NAME type STRING, - "! The maximum number of documents to crawl for this document object. By default, - "! all documents in the document object are crawled. - LIMIT type INTEGER, - end of T_SOURCE_OPTIONS_OBJECT. - types: - "!

- "! Object that defines a Microsoft SharePoint site collection

- "! to crawl with this configuration. - begin of T_SOURCE_OPTIONS_SITE_COLL, - "! The Microsoft SharePoint Online site collection path to crawl. The path must be - "! be relative to the **organization_url** that was specified in the credentials - "! associated with this source configuration. - SITE_COLLECTION_PATH1 type STRING, - "! The maximum number of documents to crawl for this site collection. By default, - "! all documents in the site collection are crawled. - LIMIT type INTEGER, - end of T_SOURCE_OPTIONS_SITE_COLL. - types: - "!

- "! The **options** object defines which items to crawl from the

- "! source system. - begin of T_SOURCE_OPTIONS, - "! Array of folders to crawl from the Box source. Only valid, and required, when - "! the **type** field of the **source** object is set to `box`. - FOLDERS type STANDARD TABLE OF T_SOURCE_OPTIONS_FOLDER WITH NON-UNIQUE DEFAULT KEY, - "! Array of Salesforce document object types to crawl from the Salesforce source. - "! Only valid, and required, when the **type** field of the **source** object is - "! set to `salesforce`. - OBJECTS type STANDARD TABLE OF T_SOURCE_OPTIONS_OBJECT WITH NON-UNIQUE DEFAULT KEY, - "! Array of Microsoft SharePointoint Online site collections to crawl from the - "! SharePoint source. Only valid and required when the **type** field of the - "! **source** object is set to `sharepoint`. - SITE_COLLECTIONS type STANDARD TABLE OF T_SOURCE_OPTIONS_SITE_COLL WITH NON-UNIQUE DEFAULT KEY, - "! Array of Web page URLs to begin crawling the web from. Only valid and required - "! when the **type** field of the **source** object is set to `web_crawl`. - URLS type STANDARD TABLE OF T_SOURCE_OPTIONS_WEB_CRAWL WITH NON-UNIQUE DEFAULT KEY, - "! Array of cloud object store buckets to begin crawling. Only valid and required - "! when the **type** field of the **source** object is set to - "! `cloud_object_store`, and the **crawl_all_buckets** field is `false` or not - "! specified. - BUCKETS type STANDARD TABLE OF T_SOURCE_OPTIONS_BUCKETS WITH NON-UNIQUE DEFAULT KEY, - "! When `true`, all buckets in the specified cloud object store are crawled. If set - "! to `true`, the **buckets** array must not be specified. - CRAWL_ALL_BUCKETS type BOOLEAN, - end of T_SOURCE_OPTIONS. - types: - "!

- "! Object containing source parameters for the configuration.

- begin of T_SOURCE, - "! 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. - TYPE 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. - "! - CREDENTIAL_ID type STRING, - "! Object containing the schedule information for the source. - SCHEDULE type T_SOURCE_SCHEDULE, - "! The **options** object defines which items to crawl from the source system. - OPTIONS type T_SOURCE_OPTIONS, - end of T_SOURCE. - types: - "!

- "! Object containing an array of XPaths.

- begin of T_XPATH_PATTERNS, - "! An array to XPaths. - XPATHS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_XPATH_PATTERNS. - types: - "!

- "! Options which are specific to a particular enrichment.

- begin of T_ENRICHMENT_OPTIONS, - "! Object containing Natural Language Understanding features to be used. - FEATURES type T_NLU_ENRICHMENT_FEATURES, - "! 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. - LANGUAGE type STRING, - "! *For use with `elements` enrichments only.* The element extraction model to use. - "! Models available are: `contract`. - MODEL type STRING, - end of T_ENRICHMENT_OPTIONS. - types: - "!

- "! 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. - begin of T_ENRICHMENT, - "! Describes what the enrichment step does. - DESCRIPTION type STRING, - "! Field where enrichments will be stored. This field must already exist or be at - "! most 1 level deeper than an existing field. For example, if `text` is a - "! top-level field with no sub-fields, `text.foo` is a valid destination but - "! `text.foo.bar` is not. - DESTINATION_FIELD type STRING, - "! Field to be enriched.
- "!
- "! Arrays can be specified as the **source_field** if the **enrichment** service - "! for this enrichment is set to `natural_language_undstanding`. - SOURCE_FIELD type STRING, - "! Indicates that the enrichments will overwrite the destination_field field if it - "! already exists. - OVERWRITE type BOOLEAN, - "! Name of the enrichment service to call. Current options are - "! `natural_language_understanding` and `elements`.
- "!
- "! When using `natual_language_understanding`, the **options** object must contain - "! Natural Language Understanding options.
- "!
- "! When using `elements` the **options** object must contain Element - "! Classification options. Additionally, when using the `elements` enrichment the - "! configuration specified and files ingested must meet all the criteria specified - "! in [the - "! documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-element-cla - "! ssification#element-classification). - ENRICHMENT type STRING, - "! If true, then most errors generated during the enrichment process will be - "! treated as warnings and will not cause the document to fail processing. - IGNORE_DOWNSTREAM_ERRORS type BOOLEAN, - "! Options which are specific to a particular enrichment. - OPTIONS type T_ENRICHMENT_OPTIONS, - end of T_ENRICHMENT. - types: - "!

- "! A list of Document Segmentation settings.

- begin of T_SEGMENT_SETTINGS, - "! Enables/disables the Document Segmentation feature. - ENABLED type BOOLEAN, - "! Defines the heading level that splits into document segments. Valid values are - "! h1, h2, h3, h4, h5, h6. The content of the header field that the segmentation - "! splits at is used as the **title** field for that segmented result. Only valid - "! if used with a collection that has **enabled** set to `false` in the - "! **smart_document_understanding** object. - SELECTOR_TAGS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Defines the annotated smart document understanding fields that the document is - "! split on. The content of the annotated field that the segmentation splits at is - "! used as the **title** field for that segmented result. For example, if the - "! field `sub-title` is specified, when a document is uploaded each time the smart - "! documement understanding conversion encounters a field of type `sub-title` the - "! document is split at that point and the content of the field used as the title - "! of the remaining content. Thnis split is performed for all instances of the - "! listed fields in the uploaded document. Only valid if used with a collection - "! that has **enabled** set to `true` in the **smart_document_understanding** - "! object. - ANNOTATED_FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_SEGMENT_SETTINGS. - types: - "!

- "! A list of Word conversion settings.

- begin of T_WORD_SETTINGS, - "! Object containing heading detection conversion settings for Microsoft Word - "! documents. - HEADING type T_WORD_HEADING_DETECTION, - end of T_WORD_SETTINGS. - types: - "!

- "! A list of HTML conversion settings.

- begin of T_HTML_SETTINGS, - "! Array of HTML tags that are excluded completely. - EXCLUDE_TAGS_COMPLETELY type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Array of HTML tags which are excluded but still retain content. - EXCLUDE_TAGS_KEEP_CONTENT type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Object containing an array of XPaths. - KEEP_CONTENT type T_XPATH_PATTERNS, - "! Object containing an array of XPaths. - EXCLUDE_CONTENT type T_XPATH_PATTERNS, - "! An array of HTML tag attributes to keep in the converted document. - KEEP_TAG_ATTRIBUTES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Array of HTML tag attributes to exclude. - EXCLUDE_TAG_ATTRIBUTES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_HTML_SETTINGS. - types: - "!

- "! Document conversion settings.

- begin of T_CONVERSIONS, - "! A list of PDF conversion settings. - PDF type T_PDF_SETTINGS, - "! A list of Word conversion settings. - WORD type T_WORD_SETTINGS, - "! A list of HTML conversion settings. - HTML type T_HTML_SETTINGS, - "! A list of Document Segmentation settings. - SEGMENT type T_SEGMENT_SETTINGS, - "! Defines operations that can be used to transform the final output JSON into a - "! normalized form. Operations are executed in the order that they appear in the - "! array. - JSON_NORMALIZATIONS type STANDARD TABLE OF T_NORMALIZATION_OPERATION WITH NON-UNIQUE DEFAULT KEY, - "! When `true`, automatic text extraction from images (this includes images - "! embedded in supported document formats, for example PDF, and suppported image - "! formats, for example TIFF) is performed on documents uploaded to the - "! collection. This field is supported on **Advanced** and higher plans only. - "! **Lite** plans do not support image text recognition. - IMAGE_TEXT_RECOGNITION type BOOLEAN, - end of T_CONVERSIONS. - types: - "!

- "! A custom configuration for the environment.

- begin of T_CONFIGURATION, - "! The unique identifier of the configuration. - CONFIGURATION_ID type STRING, - "! The name of the configuration. - NAME type STRING, - "! The creation date of the configuration in the format - "! yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - CREATED type DATETIME, - "! The timestamp of when the configuration was last updated in the format - "! yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - UPDATED type DATETIME, - "! The description of the configuration, if available. - DESCRIPTION type STRING, - "! Document conversion settings. - CONVERSIONS type T_CONVERSIONS, - "! An array of document enrichment settings for the configuration. - ENRICHMENTS type STANDARD TABLE OF T_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY, - "! Defines operations that can be used to transform the final output JSON into a - "! normalized form. Operations are executed in the order that they appear in the - "! array. - NORMALIZATIONS type STANDARD TABLE OF T_NORMALIZATION_OPERATION WITH NON-UNIQUE DEFAULT KEY, - "! Object containing source parameters for the configuration. - SOURCE type T_SOURCE, - end of T_CONFIGURATION. - types: - "!

- "! Object containing an array of available configurations.

- begin of T_LIST_CONFIGURATIONS_RESPONSE, - "! An array of configurations that are available for the service instance. - CONFIGURATIONS type STANDARD TABLE OF T_CONFIGURATION WITH NON-UNIQUE DEFAULT KEY, - end of T_LIST_CONFIGURATIONS_RESPONSE. - types: - "!

- "! Object containing source crawl status information.

- begin of T_SOURCE_STATUS, - "! 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. - STATUS type STRING, - "! Date in `RFC 3339` format indicating the time of the next crawl attempt. - NEXT_CRAWL type DATETIME, - end of T_SOURCE_STATUS. - types: - "!

- "! Object returned after credentials are deleted.

- begin of T_DELETE_CREDENTIALS, - "! The unique identifier of the credentials that have been deleted. - CREDENTIAL_ID type STRING, - "! The status of the deletion request. - STATUS type STRING, - end of T_DELETE_CREDENTIALS. - types: - "!

- "! A notice produced for the collection.

- begin of T_NOTICE, - "! Identifies the notice. Many notices might have the same ID. This field exists so - "! that user applications can programmatically identify a notice and take - "! automatic corrective action. Typical notice IDs include: `index_failed`, - "! `index_failed_too_many_requests`, `index_failed_incompatible_field`, - "! `index_failed_cluster_unavailable`, `ingestion_timeout`, `ingestion_error`, - "! `bad_request`, `internal_error`, `missing_model`, `unsupported_model`, - "! `smart_document_understanding_failed_incompatible_field`, - "! `smart_document_understanding_failed_internal_error`, - "! `smart_document_understanding_failed_internal_error`, - "! `smart_document_understanding_failed_warning`, - "! `smart_document_understanding_page_error`, - "! `smart_document_understanding_page_warning`. **Note:** This is not a complete - "! list, other values might be returned. - NOTICE_ID type STRING, - "! The creation date of the collection in the format - "! yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - CREATED type DATETIME, - "! Unique identifier of the document. - DOCUMENT_ID type STRING, - "! Unique identifier of the query used for relevance training. - QUERY_ID type STRING, - "! Severity level of the notice. - SEVERITY type STRING, - "! Ingestion or training step in which the notice occurred. Typical step values - "! include: `classify_elements`, `smartDocumentUnderstanding`, `ingestion`, - "! `indexing`, `convert`. **Note:** This is not a complete list, other values - "! might be returned. - STEP type STRING, - "! The description of the notice. - DESCRIPTION type STRING, - end of T_NOTICE. - types: - "!

- "! Information returned after an uploaded document is accepted.

- begin of T_DOCUMENT_ACCEPTED, - "! The unique identifier of the ingested document. - DOCUMENT_ID type STRING, - "! 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 type STRING, - "! Array of notices produced by the document-ingestion process. - NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, - end of T_DOCUMENT_ACCEPTED. - types: - "!

- "! Object describing a specific gateway.

- begin of T_GATEWAY, - "! The gateway ID of the gateway. - GATEWAY_ID type STRING, - "! The user defined name of the gateway. - NAME type STRING, - "! 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 type STRING, - "! The generated **token** for this gateway. The value of this field is used when - "! configuring the remotly installed gateway. - TOKEN type STRING, - "! The generated **token_id** for this gateway. The value of this field is used - "! when configuring the remotly installed gateway. - TOKEN_ID type STRING, - end of T_GATEWAY. - types: - "!

- "! Aggregation result data for the requested metric.

- begin of T_METRIC_AGGREGATION_RESULT, - "! Date in string form representing the start of this interval. - KEY_AS_STRING type DATETIME, - "! Unix epoch time equivalent of the **key_as_string**, that represents the start - "! of this interval. - KEY type LONG, - "! Number of matching results. - MATCHING_RESULTS type INTEGER, - "! The number of queries with associated events divided by the total number of - "! queries for the interval. Only returned with **event_rate** metrics. - EVENT_RATE type DOUBLE, - end of T_METRIC_AGGREGATION_RESULT. - types: - "!

- "! An aggregation analyzing log information for queries and

- "! events. - begin of T_METRIC_AGGREGATION, - "! The measurement interval for this metric. Metric intervals are always 1 day - "! (`1d`). - INTERVAL type STRING, - "! The event type associated with this metric result. This field, when present, - "! will always be `click`. - EVENT_TYPE type STRING, - "! Array of metric aggregation query results. - RESULTS type STANDARD TABLE OF T_METRIC_AGGREGATION_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_METRIC_AGGREGATION. - types: - "!

- "! The response generated from a call to a **metrics** method.

- begin of T_METRIC_RESPONSE, - "! Array of metric aggregations. - AGGREGATIONS type STANDARD TABLE OF T_METRIC_AGGREGATION WITH NON-UNIQUE DEFAULT KEY, - end of T_METRIC_RESPONSE. - types: - "!

- "! Metadata of a query result.

- begin of T_QUERY_RESULT_METADATA, - "! An unbounded measure of the relevance of a particular result, dependent on the - "! query and matching document. A higher score indicates a greater match to the - "! query parameters. - SCORE type DOUBLE, - "! The confidence score for the given result. Calculated based on how relevant the - "! result is estimated to be. confidence can range from `0.0` to `1.0`. The higher - "! the number, the more relevant the document. The `confidence` value for a result - "! was calculated using the model specified in the `document_retrieval_strategy` - "! field of the result set. - CONFIDENCE type DOUBLE, - end of T_QUERY_RESULT_METADATA. - types: - "!

- "! Query result object.

- begin of T_QUERY_NOTICES_RESULT, - "! The unique identifier of the document. - ID type STRING, - "! Metadata of the document. - METADATA type MAP, - "! The collection ID of the collection containing the document for this result. - COLLECTION_ID type STRING, - "! Metadata of a query result. - RESULT_METADATA type T_QUERY_RESULT_METADATA, - "! The internal status code returned by the ingestion subsystem indicating the - "! overall result of ingesting the source document. - CODE type INTEGER, - "! Name of the original source file (if available). - FILENAME type STRING, - "! The type of the original source file. - FILE_TYPE type STRING, - "! The SHA-1 hash of the original source file (formatted as a hexadecimal string). - SHA1 type STRING, - "! Array of notices for the document. - NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, - end of T_QUERY_NOTICES_RESULT. - types: - "!

- "! Each object in the **results** array corresponds to an

- "! individual document returned by the original query. - begin of T_LOG_QRY_RESP_RSLT_DOCS_RSLT, - "! The result rank of this document. A position of `1` indicates that it was the - "! first returned result. - POSITION type INTEGER, - "! The **document_id** of the document that this result represents. - DOCUMENT_ID type STRING, - "! The raw score of this result. A higher score indicates a greater match to the - "! query parameters. - SCORE type DOUBLE, - "! The confidence score of the result's analysis. A higher score indicating - "! greater confidence. - CONFIDENCE type DOUBLE, - "! The **collection_id** of the document represented by this result. - COLLECTION_ID type STRING, - end of T_LOG_QRY_RESP_RSLT_DOCS_RSLT. - types: - "!

- "! Object containing result information that was returned by

- "! the query used to create this log entry. Only returned with logs of type - "! `query`. - begin of T_LOG_QUERY_RESP_RESULT_DOCS, - "! Array of log query response results. - RESULTS type STANDARD TABLE OF T_LOG_QRY_RESP_RSLT_DOCS_RSLT WITH NON-UNIQUE DEFAULT KEY, - "! The number of results returned in the query associate with this log. - COUNT type INTEGER, - end of T_LOG_QUERY_RESP_RESULT_DOCS. - types: - "!

- "! Object containing field details.

- begin of T_FIELD, - "! The name of the field. - FIELD type STRING, - "! The type of the field. - TYPE type STRING, - end of T_FIELD. - types: - "!

- "! Query event data object.

- begin of T_EVENT_DATA, - "! The **environment_id** associated with the query that the event is associated - "! with. - ENVIRONMENT_ID type STRING, - "! The session token that was returned as part of the query results that this event - "! is associated with. - SESSION_TOKEN type STRING, - "! The optional timestamp for the event that was created. If not provided, the time - "! that the event was created in the log was used. - CLIENT_TIMESTAMP type DATETIME, - "! The rank of the result item which the event is associated with. - DISPLAY_RANK type INTEGER, - "! The **collection_id** of the document that this event is associated with. - COLLECTION_ID type STRING, - "! The **document_id** of the document that this event is associated with. - DOCUMENT_ID type STRING, - "! The query identifier stored in the log. The query and any events associated with - "! that query are stored with the same **query_id**. - QUERY_ID type STRING, - end of T_EVENT_DATA. - types: - "!

- "! An object defining the event being created.

- begin of T_CREATE_EVENT_OBJECT, - "! The event type to be created. - TYPE type STRING, - "! Query event data object. - DATA type T_EVENT_DATA, - end of T_CREATE_EVENT_OBJECT. - types: - "! No documentation available. - begin of T_NESTED, - "! The area of the results the aggregation was restricted to. - PATH type STRING, - end of T_NESTED. - types: - "!

- "! Object that describes a long query.

- begin of T_QUERY_LARGE, - "! A cacheable query that excludes documents that don't mention the query - "! content. Filter searches are better for metadata-type searches and for - "! assessing the concepts in the data set. - FILTER type STRING, - "! A query search returns all documents in your data set with full enrichments and - "! full text, but with the most relevant documents listed first. Use a query - "! search when you want to find the most relevant search results. - QUERY type STRING, - "! A natural language query that returns relevant documents by utilizing training - "! data and natural language understanding. - NATURAL_LANGUAGE_QUERY type STRING, - "! A passages query that returns the most relevant passages from the results. - PASSAGES type BOOLEAN, - "! An aggregation search that returns an exact answer by combining query search - "! with filters. Useful for applications to build lists, tables, and time series. - "! For a full list of possible aggregations, see the Query reference. - AGGREGATION type STRING, - "! Number of results to return. - COUNT type INTEGER, - "! A comma-separated list of the portion of the document hierarchy to return. - RETURN type STRING, - "! The number of query results to skip at the beginning. For example, if the total - "! number of results that are returned is 10 and the offset is 8, it returns the - "! last two results. - OFFSET type INTEGER, - "! A comma-separated list of fields in the document to sort on. You can optionally - "! specify a sort direction by prefixing the field with `-` for descending or `+` - "! for ascending. Ascending is the default sort direction if no prefix is - "! specified. This parameter cannot be used in the same query as the **bias** - "! parameter. - SORT type STRING, - "! When true, a highlight field is returned for each result which contains the - "! fields which match the query with `<em></em>` tags around the - "! matching query terms. - HIGHLIGHT type BOOLEAN, - "! A comma-separated list of fields that passages are drawn from. If this parameter - "! not specified, then all top-level fields are included. - PASSAGES_FIELDS type STRING, - "! The maximum number of passages to return. The search returns fewer passages if - "! the requested total is not found. The default is `10`. The maximum is `100`. - PASSAGES_COUNT type INTEGER, - "! The approximate number of characters that any one passage will have. - PASSAGES_CHARACTERS type INTEGER, - "! When `true`, and used with a Watson Discovery News collection, duplicate results - "! (based on the contents of the **title** field) are removed. Duplicate - "! comparison is limited to the current query only; **offset** is not considered. - "! This parameter is currently Beta functionality. - DEDUPLICATE type BOOLEAN, - "! When specified, duplicate results based on the field specified are removed from - "! the returned results. Duplicate comparison is limited to the current query - "! only, **offset** is not considered. This parameter is currently Beta - "! functionality. - DEDUPLICATE_FIELD type STRING, - "! When `true`, results are returned based on their similarity to the document IDs - "! specified in the **similar.document_ids** parameter. - SIMILAR type BOOLEAN, - "! A comma-separated list of document IDs to find similar documents.
- "!
- "! **Tip:** Include the **natural_language_query** parameter to expand the scope of - "! the document similarity search with the natural language query. Other query - "! parameters, such as **filter** and **query**, are subsequently applied and - "! reduce the scope. - SIMILAR_DOCUMENT_IDS type STRING, - "! A comma-separated list of field names that are used as a basis for comparison to - "! identify similar documents. If not specified, the entire document is used for - "! comparison. - SIMILAR_FIELDS type STRING, - "! Field which the returned results will be biased against. The specified field - "! must be either a **date** or **number** format. When a **date** type field is - "! specified returned results are biased towards field values closer to the - "! current date. When a **number** type field is specified, returned results are - "! biased towards higher field values. This parameter cannot be used in the same - "! query as the **sort** parameter. - BIAS type STRING, - end of T_QUERY_LARGE. - types: - "!

- "! Object containing user-defined name.

- begin of T_GATEWAY_NAME, - "! User-defined name. - NAME type STRING, - end of T_GATEWAY_NAME. - types: - "!

- "! Object containing collection document count information.

- begin of T_DOCUMENT_COUNTS, - "! The total number of available documents in the collection. - AVAILABLE type LONG, - "! The number of documents in the collection that are currently being processed. - PROCESSING type LONG, - "! The number of documents in the collection that failed to be ingested. - FAILED type LONG, - "! The number of documents that have been uploaded to the collection, but have not - "! yet started processing. - PENDING type LONG, - end of T_DOCUMENT_COUNTS. - types: - "!

- "! Information about custom smart document understanding fields

- "! that exist in this collection. - begin of T_SDU_STATUS_CUSTOM_FIELDS, - "! The number of custom fields defined for this collection. - DEFINED type LONG, - "! The maximum number of custom fields that are allowed in this collection. - MAXIMUM_ALLOWED type LONG, - end of T_SDU_STATUS_CUSTOM_FIELDS. - types: - "!

- "! Object containing smart document understanding information

- "! for this collection. - begin of T_SDU_STATUS, - "! When `true`, smart document understanding conversion is enabled for this - "! collection. All collections created with a version date after `2019-04-30` have - "! smart document understanding enabled. If `false`, documents added to the - "! collection are converted using the **conversion** settings specified in the - "! configuration associated with the collection. - ENABLED type BOOLEAN, - "! The total number of pages annotated using smart document understanding in this - "! collection. - TOTAL_ANNOTATED_PAGES type LONG, - "! The current number of pages that can be used for training smart document - "! understanding. The `total_pages` number is calculated as the total number of - "! pages identified from the documents listed in the **total_documents** field. - TOTAL_PAGES type LONG, - "! The total number of documents in this collection that can be used to train smart - "! document understanding. For **lite** plan collections, the maximum is the first - "! 20 uploaded documents (not including HTML or JSON documents). For other plans, - "! the maximum is the first 40 uploaded documents (not including HTML or JSON - "! documents). When the maximum is reached, additional documents uploaded to the - "! collection are not considered for training smart document understanding. - TOTAL_DOCUMENTS type LONG, - "! Information about custom smart document understanding fields that exist in this - "! collection. - CUSTOM_FIELDS type T_SDU_STATUS_CUSTOM_FIELDS, - end of T_SDU_STATUS. - types: - "!

- "! Object containing information about the crawl status of this

- "! collection. - begin of T_COLLECTION_CRAWL_STATUS, - "! Object containing source crawl status information. - SOURCE_CRAWL type T_SOURCE_STATUS, - end of T_COLLECTION_CRAWL_STATUS. - types: - "!

- "! Summary of the disk usage statistics for this collection.

- begin of T_COLLECTION_DISK_USAGE, - "! Number of bytes used by the collection. - USED_BYTES type INTEGER, - end of T_COLLECTION_DISK_USAGE. - types: - "!

- "! A collection for storing documents.

- begin of T_COLLECTION, - "! The unique identifier of the collection. - COLLECTION_ID type STRING, - "! The name of the collection. - NAME type STRING, - "! The description of the collection. - DESCRIPTION type STRING, - "! The creation date of the collection in the format - "! yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'. - CREATED type DATETIME, - "! The timestamp of when the collection was last updated in the format - "! yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - UPDATED type DATETIME, - "! The status of the collection. - STATUS type STRING, - "! The unique identifier of the collection's configuration. - CONFIGURATION_ID type STRING, - "! The language of the documents stored in the collection. Permitted values include - "! `en` (English), `de` (German), and `es` (Spanish). - LANGUAGE type STRING, - "! Object containing collection document count information. - DOCUMENT_COUNTS type T_DOCUMENT_COUNTS, - "! Summary of the disk usage statistics for this collection. - DISK_USAGE type T_COLLECTION_DISK_USAGE, - "! Training status details. - TRAINING_STATUS type T_TRAINING_STATUS, - "! Object containing information about the crawl status of this collection. - CRAWL_STATUS type T_COLLECTION_CRAWL_STATUS, - "! Object containing smart document understanding information for this collection. - SMART_DOCUMENT_UNDERSTANDING type T_SDU_STATUS, - end of T_COLLECTION. - types: - "!

- "! Array of Microsoft Word styles to convert.

- T_WORD_STYLES type STANDARD TABLE OF T_WORD_STYLE WITH NON-UNIQUE DEFAULT KEY. - types: - "!

- "! An object representing the configuration options to use for

- "! the `elements` enrichment. - begin of T_ELEMENTS_ENRICHMENT_OPTIONS, - "! *For use with `elements` enrichments only.* The element extraction model to use. - "! Models available are: `contract`. - MODEL type STRING, - end of T_ELEMENTS_ENRICHMENT_OPTIONS. - types: - "!

- "! Object containing information about a new environment.

- begin of T_CREATE_ENVIRONMENT_REQUEST, - "! Name that identifies the environment. - NAME type STRING, - "! Description of the environment. - DESCRIPTION type STRING, - "! Size of the environment. In the Lite plan the default and only accepted value is - "! `LT`, in all other plans the default is `S`. - SIZE type STRING, - end of T_CREATE_ENVIRONMENT_REQUEST. - types: - "!

- "! Object containing specification for a new collection.

- begin of T_CREATE_COLLECTION_REQUEST, - "! The name of the collection to be created. - NAME type STRING, - "! A description of the collection. - DESCRIPTION type STRING, - "! The ID of the configuration in which the collection is to be created. - CONFIGURATION_ID type STRING, - "! The language of the documents stored in the collection, in the form of an ISO - "! 639-1 language code. - LANGUAGE type STRING, - end of T_CREATE_COLLECTION_REQUEST. - types: - "! No documentation available. - begin of T_INLINE_OBJECT, - "! The content of the stopword list to ingest. - STOPWORD_FILE type FILE, - end of T_INLINE_OBJECT. - types: - "!

- "! Query result object.

- begin of T_QUERY_RESULT, - "! The unique identifier of the document. - ID type STRING, - "! Metadata of the document. - METADATA type MAP, - "! The collection ID of the collection containing the document for this result. - COLLECTION_ID type STRING, - "! Metadata of a query result. - RESULT_METADATA type T_QUERY_RESULT_METADATA, - end of T_QUERY_RESULT. - types: - "!

- "! Top hit information for this query.

- begin of T_TOP_HITS_RESULTS, - "! Number of matching results. - MATCHING_RESULTS type INTEGER, - "! Top results returned by the aggregation. - HITS type STANDARD TABLE OF T_QUERY_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_TOP_HITS_RESULTS. - types: - "!

- "! Response object returned when deleting a colleciton.

- begin of T_DELETE_COLLECTION_RESPONSE, - "! The unique identifier of the collection that is being deleted. - COLLECTION_ID type STRING, - "! The status of the collection. The status of a successful deletion operation is - "! `deleted`. - STATUS type STRING, - end of T_DELETE_COLLECTION_RESPONSE. - types: - "! No documentation available. - begin of T_TERM, - "! The field where the aggregation is located in the document. - FIELD type STRING, - "! The number of terms identified. - COUNT type INTEGER, - end of T_TERM. - types: - "!

- "! An object containing an array of autocompletion suggestions.

- begin of T_COMPLETIONS, - "! Array of autcomplete suggestion based on the provided prefix. - COMPLETIONS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_COMPLETIONS. - types: - "!

- "! An object contain retrieval type information.

- begin of T_RETRIEVAL_DETAILS, - "! 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`. - DOCUMENT_RETRIEVAL_STRATEGY type STRING, - end of T_RETRIEVAL_DETAILS. - types: - "!

- "! Response object returned when deleting an environment.

- begin of T_DELETE_ENVIRONMENT_RESPONSE, - "! The unique identifier for the environment. - ENVIRONMENT_ID type STRING, - "! Status of the environment. - STATUS type STRING, - end of T_DELETE_ENVIRONMENT_RESPONSE. - types: - "!

- "! The list of fetched fields.


- "!
- "! The fields are returned using a fully qualified name format, however, the format - "! differs slightly from that used by the query operations.
- "!
- "! * Fields which contain nested JSON objects are assigned a type of - "! "nested".
- "!
- "! * Fields which belong to a nested object are prefixed with `.properties` (for - "! example, `warnings.properties.severity` means that the `warnings` object has a - "! property called `severity`).
- "!
- "! * Fields returned from the News collection are prefixed with - "! `v{N}-fullnews-t3-{YEAR}.mappings` (for example, - "! `v5-fullnews-t3-2016.mappings.text.properties.author`). - begin of T_LST_COLLECTION_FIELDS_RESP, - "! An array containing information about each field in the collections. - FIELDS type STANDARD TABLE OF T_FIELD WITH NON-UNIQUE DEFAULT KEY, - end of T_LST_COLLECTION_FIELDS_RESP. - types: - "!

- "! Object containing collection update information.

- begin of T_UPDATE_COLLECTION_REQUEST, - "! The name of the collection. - NAME type STRING, - "! A description of the collection. - DESCRIPTION type STRING, - "! The ID of the configuration in which the collection is to be updated. - CONFIGURATION_ID type STRING, - end of T_UPDATE_COLLECTION_REQUEST. - types: - "!

- "! Object containing gateways array.

- begin of T_GATEWAY_LIST, - "! Array of configured gateway connections. - GATEWAYS type STANDARD TABLE OF T_GATEWAY WITH NON-UNIQUE DEFAULT KEY, - end of T_GATEWAY_LIST. - types: - "!

- "! Aggregation result data for the requested metric.

- begin of T_METRIC_TOKEN_AGGR_RESULT, - "! The content of the **natural_language_query** parameter used in the query that - "! this result represents. - KEY type STRING, - "! Number of matching results. - MATCHING_RESULTS type INTEGER, - "! The number of queries with associated events divided by the total number of - "! queries currently stored (queries and events are stored in the log for 30 - "! days). - EVENT_RATE type DOUBLE, - end of T_METRIC_TOKEN_AGGR_RESULT. - types: - "!

- "! An aggregation analyzing log information for queries and

- "! events. - begin of T_METRIC_TOKEN_AGGREGATION, - "! The event type associated with this metric result. This field, when present, - "! will always be `click`. - EVENT_TYPE type STRING, - "! Array of results for the metric token aggregation. - RESULTS type STANDARD TABLE OF T_METRIC_TOKEN_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_METRIC_TOKEN_AGGREGATION. - types: - "!

- "! Object that describes a long query.

- begin of T_COLL_QUERY_LARGE, - "! A cacheable query that excludes documents that don't mention the query - "! content. Filter searches are better for metadata-type searches and for - "! assessing the concepts in the data set. - FILTER type STRING, - "! A query search returns all documents in your data set with full enrichments and - "! full text, but with the most relevant documents listed first. Use a query - "! search when you want to find the most relevant search results. - QUERY type STRING, - "! A natural language query that returns relevant documents by utilizing training - "! data and natural language understanding. - NATURAL_LANGUAGE_QUERY type STRING, - "! A passages query that returns the most relevant passages from the results. - PASSAGES type BOOLEAN, - "! An aggregation search that returns an exact answer by combining query search - "! with filters. Useful for applications to build lists, tables, and time series. - "! For a full list of possible aggregations, see the Query reference. - AGGREGATION type STRING, - "! Number of results to return. - COUNT type INTEGER, - "! A comma-separated list of the portion of the document hierarchy to return. - RETURN type STRING, - "! The number of query results to skip at the beginning. For example, if the total - "! number of results that are returned is 10 and the offset is 8, it returns the - "! last two results. - OFFSET type INTEGER, - "! A comma-separated list of fields in the document to sort on. You can optionally - "! specify a sort direction by prefixing the field with `-` for descending or `+` - "! for ascending. Ascending is the default sort direction if no prefix is - "! specified. This parameter cannot be used in the same query as the **bias** - "! parameter. - SORT type STRING, - "! When true, a highlight field is returned for each result which contains the - "! fields which match the query with `<em></em>` tags around the - "! matching query terms. - HIGHLIGHT type BOOLEAN, - "! A comma-separated list of fields that passages are drawn from. If this parameter - "! not specified, then all top-level fields are included. - PASSAGES_FIELDS type STRING, - "! The maximum number of passages to return. The search returns fewer passages if - "! the requested total is not found. The default is `10`. The maximum is `100`. - PASSAGES_COUNT type INTEGER, - "! The approximate number of characters that any one passage will have. - PASSAGES_CHARACTERS type INTEGER, - "! When `true`, and used with a Watson Discovery News collection, duplicate results - "! (based on the contents of the **title** field) are removed. Duplicate - "! comparison is limited to the current query only; **offset** is not considered. - "! This parameter is currently Beta functionality. - DEDUPLICATE type BOOLEAN, - "! When specified, duplicate results based on the field specified are removed from - "! the returned results. Duplicate comparison is limited to the current query - "! only, **offset** is not considered. This parameter is currently Beta - "! functionality. - DEDUPLICATE_FIELD type STRING, - "! When `true`, results are returned based on their similarity to the document IDs - "! specified in the **similar.document_ids** parameter. - SIMILAR type BOOLEAN, - "! A comma-separated list of document IDs to find similar documents.
- "!
- "! **Tip:** Include the **natural_language_query** parameter to expand the scope of - "! the document similarity search with the natural language query. Other query - "! parameters, such as **filter** and **query**, are subsequently applied and - "! reduce the scope. - SIMILAR_DOCUMENT_IDS type STRING, - "! A comma-separated list of field names that are used as a basis for comparison to - "! identify similar documents. If not specified, the entire document is used for - "! comparison. - SIMILAR_FIELDS type STRING, - "! Field which the returned results will be biased against. The specified field - "! must be either a **date** or **number** format. When a **date** type field is - "! specified returned results are biased towards field values closer to the - "! current date. When a **number** type field is specified, returned results are - "! biased towards higher field values. This parameter cannot be used in the same - "! query as the **sort** parameter. - BIAS type STRING, - "! When `true` and the **natural_language_query** parameter is used, the - "! **natural_languge_query** parameter is spell checked. The most likely - "! correction is retunred in the **suggested_query** field of the response (if one - "! exists).
- "!
- "! **Important:** this parameter is only valid when using the Cloud Pak version of - "! Discovery. - SPELLING_SUGGESTIONS type BOOLEAN, - end of T_COLL_QUERY_LARGE. - types: - "!

- "! Object containing environment update information.

- begin of T_UPDATE_ENVIRONMENT_REQUEST, - "! Name that identifies the environment. - NAME type STRING, - "! Description of the environment. - DESCRIPTION type STRING, - "! Size that the environment should be increased to. Environment size cannot be - "! modified when using a Lite plan. Environment size can only increased and not - "! decreased. - SIZE type STRING, - end of T_UPDATE_ENVIRONMENT_REQUEST. - types: - "!

- "! Information returned when a configuration is deleted.

- begin of T_DEL_CONFIGURATION_RESPONSE, - "! The unique identifier for the configuration. - CONFIGURATION_ID type STRING, - "! Status of the configuration. A deleted configuration has the status deleted. - STATUS type STRING, - "! An array of notice messages, if any. - NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, - end of T_DEL_CONFIGURATION_RESPONSE. - types: - "!

- "! A response containing the documents and aggregations for the

- "! query. - begin of T_QUERY_RESPONSE, - "! The number of matching results for the query. - MATCHING_RESULTS type INTEGER, - "! Array of document results for the query. - RESULTS type STANDARD TABLE OF T_QUERY_RESULT WITH NON-UNIQUE DEFAULT KEY, - "! Array of aggregation results for the query. - AGGREGATIONS type STANDARD TABLE OF T_QUERY_AGGREGATION WITH NON-UNIQUE DEFAULT KEY, - "! Array of passage results for the query. - PASSAGES type STANDARD TABLE OF T_QUERY_PASSAGES WITH NON-UNIQUE DEFAULT KEY, - "! The number of duplicate results removed. - DUPLICATES_REMOVED type INTEGER, - "! The session token for this query. The session token can be used to add events - "! associated with this query to the query and event log.
- "!
- "! **Important:** Session tokens are case sensitive. - SESSION_TOKEN type STRING, - "! An object contain retrieval type information. - RETRIEVAL_DETAILS type T_RETRIEVAL_DETAILS, - "! The suggestions for a misspelled natural language query. - SUGGESTED_QUERY type STRING, - end of T_QUERY_RESPONSE. - types: - "! No documentation available. - begin of T_TIMESLICE, - "! The field where the aggregation is located in the document. - FIELD type STRING, - "! Interval of the aggregation. Valid date interval values are second/seconds - "! minute/minutes, hour/hours, day/days, week/weeks, month/months, and year/years. - "! - INTERVAL type STRING, - "! Used to indicate that anomaly detection should be performed. Anomaly detection - "! is used to locate unusual datapoints within a time series. - ANOMALY type BOOLEAN, - end of T_TIMESLICE. - types: - "!

- "! Training query to add.

- begin of T_NEW_TRAINING_QUERY, - "! The natural text query for the new training query. - NATURAL_LANGUAGE_QUERY type STRING, - "! The filter used on the collection before the **natural_language_query** is - "! applied. - FILTER type STRING, - "! Array of training examples. - EXAMPLES type STANDARD TABLE OF T_TRAINING_EXAMPLE WITH NON-UNIQUE DEFAULT KEY, - end of T_NEW_TRAINING_QUERY. - types: - "!

- "! Status information about a submitted document.

- begin of T_DOCUMENT_STATUS, - "! The unique identifier of the document. - DOCUMENT_ID type STRING, - "! The unique identifier for the configuration. - CONFIGURATION_ID type STRING, - "! Status of the document in the ingestion process. - STATUS type STRING, - "! Description of the document status. - STATUS_DESCRIPTION type STRING, - "! Name of the original source file (if available). - FILENAME type STRING, - "! The type of the original source file. - FILE_TYPE type STRING, - "! The SHA-1 hash of the original source file (formatted as a hexadecimal string). - SHA1 type STRING, - "! Array of notices produced by the document-ingestion process. - NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, - end of T_DOCUMENT_STATUS. - types: - "!

- "! Object that describes a long query.

- begin of T_FED_QUERY_LARGE, - "! A cacheable query that excludes documents that don't mention the query - "! content. Filter searches are better for metadata-type searches and for - "! assessing the concepts in the data set. - FILTER type STRING, - "! A query search returns all documents in your data set with full enrichments and - "! full text, but with the most relevant documents listed first. Use a query - "! search when you want to find the most relevant search results. - QUERY type STRING, - "! A natural language query that returns relevant documents by utilizing training - "! data and natural language understanding. - NATURAL_LANGUAGE_QUERY type STRING, - "! A passages query that returns the most relevant passages from the results. - PASSAGES type BOOLEAN, - "! An aggregation search that returns an exact answer by combining query search - "! with filters. Useful for applications to build lists, tables, and time series. - "! For a full list of possible aggregations, see the Query reference. - AGGREGATION type STRING, - "! Number of results to return. - COUNT type INTEGER, - "! A comma-separated list of the portion of the document hierarchy to return. - RETURN type STRING, - "! The number of query results to skip at the beginning. For example, if the total - "! number of results that are returned is 10 and the offset is 8, it returns the - "! last two results. - OFFSET type INTEGER, - "! A comma-separated list of fields in the document to sort on. You can optionally - "! specify a sort direction by prefixing the field with `-` for descending or `+` - "! for ascending. Ascending is the default sort direction if no prefix is - "! specified. This parameter cannot be used in the same query as the **bias** - "! parameter. - SORT type STRING, - "! When true, a highlight field is returned for each result which contains the - "! fields which match the query with `<em></em>` tags around the - "! matching query terms. - HIGHLIGHT type BOOLEAN, - "! A comma-separated list of fields that passages are drawn from. If this parameter - "! not specified, then all top-level fields are included. - PASSAGES_FIELDS type STRING, - "! The maximum number of passages to return. The search returns fewer passages if - "! the requested total is not found. The default is `10`. The maximum is `100`. - PASSAGES_COUNT type INTEGER, - "! The approximate number of characters that any one passage will have. - PASSAGES_CHARACTERS type INTEGER, - "! When `true`, and used with a Watson Discovery News collection, duplicate results - "! (based on the contents of the **title** field) are removed. Duplicate - "! comparison is limited to the current query only; **offset** is not considered. - "! This parameter is currently Beta functionality. - DEDUPLICATE type BOOLEAN, - "! When specified, duplicate results based on the field specified are removed from - "! the returned results. Duplicate comparison is limited to the current query - "! only, **offset** is not considered. This parameter is currently Beta - "! functionality. - DEDUPLICATE_FIELD type STRING, - "! When `true`, results are returned based on their similarity to the document IDs - "! specified in the **similar.document_ids** parameter. - SIMILAR type BOOLEAN, - "! A comma-separated list of document IDs to find similar documents.
- "!
- "! **Tip:** Include the **natural_language_query** parameter to expand the scope of - "! the document similarity search with the natural language query. Other query - "! parameters, such as **filter** and **query**, are subsequently applied and - "! reduce the scope. - SIMILAR_DOCUMENT_IDS type STRING, - "! A comma-separated list of field names that are used as a basis for comparison to - "! identify similar documents. If not specified, the entire document is used for - "! comparison. - SIMILAR_FIELDS type STRING, - "! Field which the returned results will be biased against. The specified field - "! must be either a **date** or **number** format. When a **date** type field is - "! specified returned results are biased towards field values closer to the - "! current date. When a **number** type field is specified, returned results are - "! biased towards higher field values. This parameter cannot be used in the same - "! query as the **sort** parameter. - BIAS type STRING, - "! A comma-separated list of collection IDs to be queried against. - COLLECTION_IDS type STRING, - end of T_FED_QUERY_LARGE. - types: - "!

- "! An error response object.

- begin of T_ERROR_RESPONSE, - "! The HTTP error status code. - CODE type INTEGER, - "! A message describing the error. - ERROR type STRING, - end of T_ERROR_RESPONSE. - types: - "!

- "! An expansion definition. Each object respresents one set of

- "! expandable strings. For example, you could have expansions for the word `hot` - "! in one object, and expansions for the word `cold` in another. - begin of T_EXPANSION, - "! A list of terms that will be expanded for this expansion. If specified, only the - "! items in this list are expanded. - INPUT_TERMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! A list of terms that this expansion will be expanded to. If specified without - "! **input_terms**, it also functions as the input term list. - EXPANDED_TERMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_EXPANSION. - types: - "!

- "! The query expansion definitions for the specified

- "! collection. - begin of T_EXPANSIONS, - "! An array of query expansion definitions.
- "!
- "! Each object in the **expansions** array represents a term or set of terms that - "! will be expanded into other terms. Each expansion object can be configured as - "! bidirectional or unidirectional. Bidirectional means that all terms are - "! expanded to all other terms in the object. Unidirectional means that a set list - "! of terms can be expanded into a second list of terms.
- "!
- "! To create a bi-directional expansion specify an **expanded_terms** array. When - "! found in a query, all items in the **expanded_terms** array are then expanded - "! to the other items in the same array.
- "!
- "! To create a uni-directional expansion, specify both an array of **input_terms** - "! and an array of **expanded_terms**. When items in the **input_terms** array are - "! present in a query, they are expanded using the items listed in the - "! **expanded_terms** array. - EXPANSIONS type STANDARD TABLE OF T_EXPANSION WITH NON-UNIQUE DEFAULT KEY, - end of T_EXPANSIONS. - types: - "!

- "! An object defining the event being created.

- begin of T_CREATE_EVENT_RESPONSE, - "! The event type that was created. - TYPE type STRING, - "! Query event data object. - DATA type T_EVENT_DATA, - end of T_CREATE_EVENT_RESPONSE. - types: - "!

- "! An array of document enrichment settings for the

- "! configuration. - T_ENRICHMENTS type STANDARD TABLE OF T_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY. - types: - "!

- "! The response generated from a call to a **metrics** method

- "! that evaluates tokens. - begin of T_METRIC_TOKEN_RESPONSE, - "! Array of metric token aggregations. - AGGREGATIONS type STANDARD TABLE OF T_METRIC_TOKEN_AGGREGATION WITH NON-UNIQUE DEFAULT KEY, - end of T_METRIC_TOKEN_RESPONSE. - types: - "!

- "! Object containing an array of training examples.

- begin of T_TRAINING_EXAMPLE_LIST, - "! Array of training examples. - EXAMPLES type STANDARD TABLE OF T_TRAINING_EXAMPLE WITH NON-UNIQUE DEFAULT KEY, - end of T_TRAINING_EXAMPLE_LIST. - types: - "!

- "! Information returned when a document is deleted.

- begin of T_DELETE_DOCUMENT_RESPONSE, - "! The unique identifier of the document. - DOCUMENT_ID type STRING, - "! Status of the document. A deleted document has the status deleted. - STATUS type STRING, - end of T_DELETE_DOCUMENT_RESPONSE. - types: - "! No documentation available. - begin of T_TOP_HITS, - "! Number of top hits returned by the aggregation. - SIZE type INTEGER, - "! No documentation available. - HITS type T_TOP_HITS_RESULTS, - end of T_TOP_HITS. - types: - "!

- "! Individual result object for a **logs** query. Each object

- "! represents either a query to a Discovery collection or an event that is - "! associated with a query. - begin of T_LOG_QUERY_RESPONSE_RESULT, - "! The environment ID that is associated with this log entry. - ENVIRONMENT_ID type STRING, - "! The **customer_id** label that was specified in the header of the query or event - "! API call that corresponds to this log entry. - CUSTOMER_ID type STRING, - "! 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. - DOCUMENT_TYPE type STRING, - "! The value of the **natural_language_query** query parameter that was used to - "! create these results. Only returned with logs of type **query**.
- "!
- "! **Note:** Other query parameters (such as **filter** or **deduplicate**) might - "! have been used with this query, but are not recorded. - NATURAL_LANGUAGE_QUERY type STRING, - "! Object containing result information that was returned by the query used to - "! create this log entry. Only returned with logs of type `query`. - DOCUMENT_RESULTS type T_LOG_QUERY_RESP_RESULT_DOCS, - "! Date that the log result was created. Returned in `YYYY-MM-DDThh:mm:ssZ` format. - "! - CREATED_TIMESTAMP type DATETIME, - "! Date specified by the user when recording an event. Returned in - "! `YYYY-MM-DDThh:mm:ssZ` format. Only returned with logs of type **event**. - CLIENT_TIMESTAMP type DATETIME, - "! Identifier that corresponds to the **natural_language_query** string used in the - "! original or associated query. All **event** and **query** log entries that have - "! the same original **natural_language_query** string also have them same - "! **query_id**. This field can be used to recall all **event** and **query** log - "! results that have the same original query (**event** logs do not contain the - "! original **natural_language_query** field). - QUERY_ID type STRING, - "! Unique identifier (within a 24-hour period) that identifies a single `query` log - "! and any `event` logs that were created for it.
- "!
- "! **Note:** If the exact same query is run at the exact same time on different - "! days, the **session_token** for those queries might be identical. However, the - "! **created_timestamp** differs.
- "!
- "! **Note:** Session tokens are case sensitive. To avoid matching on session tokens - "! that are identical except for case, use the exact match operator (`::`) when - "! you query for a specific session token. - SESSION_TOKEN type STRING, - "! The collection ID of the document associated with this event. Only returned with - "! logs of type `event`. - COLLECTION_ID type STRING, - "! The original display rank of the document associated with this event. Only - "! returned with logs of type `event`. - DISPLAY_RANK type INTEGER, - "! The document ID of the document associated with this event. Only returned with - "! logs of type `event`. - DOCUMENT_ID type STRING, - "! 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. - EVENT_TYPE type STRING, - "! The type of result that this **event** is associated with. Only returned with - "! logs of type `event`. - RESULT_TYPE type STRING, - end of T_LOG_QUERY_RESPONSE_RESULT. - types: - "!

- "! Object containing results that match the requested **logs**

- "! query. - begin of T_LOG_QUERY_RESPONSE, - "! Number of matching results. - MATCHING_RESULTS type INTEGER, - "! Array of log query response results. - RESULTS type STANDARD TABLE OF T_LOG_QUERY_RESPONSE_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_LOG_QUERY_RESPONSE. - types: - "!

- "! Defines operations that can be used to transform the final

- "! output JSON into a normalized form. Operations are executed in the order that - "! they appear in the array. - T_NORMALIZATIONS type STANDARD TABLE OF T_NORMALIZATION_OPERATION WITH NON-UNIQUE DEFAULT KEY. - types: - "!

- "! Training example to add.

- begin of T_TRAINING_EXAMPLE_PATCH, - "! The example to add. - CROSS_REFERENCE type STRING, - "! The relevance value for this example. - RELEVANCE type INTEGER, - end of T_TRAINING_EXAMPLE_PATCH. - types: - "!

- "! Response object containing an array of collection details.

- begin of T_LIST_COLLECTIONS_RESPONSE, - "! An array containing information about each collection in the environment. - COLLECTIONS type STANDARD TABLE OF T_COLLECTION WITH NON-UNIQUE DEFAULT KEY, - end of T_LIST_COLLECTIONS_RESPONSE. - types: - "! No documentation available. - begin of T_CALCULATION, - "! The field where the aggregation is located in the document. - FIELD type STRING, - "! Value of the aggregation. - VALUE type DOUBLE, - end of T_CALCULATION. - types: - "!

- "! Training information for a specific collection.

- begin of T_TRAINING_DATA_SET, - "! The environment id associated with this training data set. - ENVIRONMENT_ID type STRING, - "! The collection id associated with this training data set. - COLLECTION_ID type STRING, - "! Array of training queries. - QUERIES type STANDARD TABLE OF T_TRAINING_QUERY WITH NON-UNIQUE DEFAULT KEY, - end of T_TRAINING_DATA_SET. - types: - "!

- "! Array of font matching configurations.

- T_FONT_SETTINGS type STANDARD TABLE OF T_FONT_SETTING WITH NON-UNIQUE DEFAULT KEY. - types: - "!

- "! Object containing notice query results.

- begin of T_QUERY_NOTICES_RESPONSE, - "! The number of matching results. - MATCHING_RESULTS type INTEGER, - "! Array of document results that match the query. - RESULTS type STANDARD TABLE OF T_QUERY_NOTICES_RESULT WITH NON-UNIQUE DEFAULT KEY, - "! Array of aggregation results that match the query. - AGGREGATIONS type STANDARD TABLE OF T_QUERY_AGGREGATION WITH NON-UNIQUE DEFAULT KEY, - "! Array of passage results that match the query. - PASSAGES type STANDARD TABLE OF T_QUERY_PASSAGES WITH NON-UNIQUE DEFAULT KEY, - "! The number of duplicates removed from this notices query. - DUPLICATES_REMOVED type INTEGER, - end of T_QUERY_NOTICES_RESPONSE. - types: - "! No documentation available. - begin of T_HISTOGRAM, - "! The field where the aggregation is located in the document. - FIELD type STRING, - "! Interval of the aggregation. (For 'histogram' type). - INTERVAL type INTEGER, - end of T_HISTOGRAM. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_QUERY_AGGREGATION type string value '|', - T_AGGREGATION_RESULT type string value '|', - T_TRAINING_STATUS type string value '|', - T_TOKEN_DICT_STATUS_RESPONSE type string value '|', - T_NLU_ENRICHMENT_RELATIONS type string value '|', - T_NLU_ENRICHMENT_SENTIMENT type string value '|', - T_NL_ENRICHMENT_SEMANTIC_ROLES type string value '|', - T_NLU_ENRICHMENT_ENTITIES type string value '|', - T_NLU_ENRICHMENT_EMOTION type string value '|', - T_NLU_ENRICHMENT_CONCEPTS type string value '|', - T_NLU_ENRICHMENT_KEYWORDS type string value '|', - T_NLU_ENRICHMENT_FEATURES type string value '|', - T_NLU_ENRICHMENT_OPTIONS type string value '|', - T_TOKEN_DICT_RULE type string value '|TEXT|TOKENS|PART_OF_SPEECH|', - T_TOKEN_DICT type string value '|', - T_FILTER type string value '|', - T_SOURCE_OPTIONS_WEB_CRAWL type string value '|URL|', - T_CREDENTIAL_DETAILS type string value '|', - T_CREDENTIALS type string value '|', - T_CREDENTIALS_LIST type string value '|', - T_COLLECTION_USAGE type string value '|', - T_DISK_USAGE type string value '|', - T_ENVIRONMENT_DOCUMENTS type string value '|', - T_INDEX_CAPACITY type string value '|', - T_SEARCH_STATUS type string value '|', - T_ENVIRONMENT type string value '|', - T_LIST_ENVIRONMENTS_RESPONSE type string value '|', - T_GATEWAY_DELETE type string value '|', - T_TRAINING_EXAMPLE type string value '|', - T_TRAINING_QUERY type string value '|', - T_QUERY_PASSAGES type string value '|', - T_NORMALIZATION_OPERATION type string value '|', - T_FONT_SETTING type string value '|', - T_WORD_STYLE type string value '|', - T_WORD_HEADING_DETECTION type string value '|', - T_PDF_HEADING_DETECTION type string value '|', - T_PDF_SETTINGS type string value '|', - T_SOURCE_OPTIONS_FOLDER type string value '|OWNER_USER_ID|FOLDER_ID|', - T_SOURCE_OPTIONS_BUCKETS type string value '|NAME|', - T_SOURCE_SCHEDULE type string value '|', - T_SOURCE_OPTIONS_OBJECT type string value '|NAME|', - T_SOURCE_OPTIONS_SITE_COLL type string value '|SITE_COLLECTION_PATH1|', - T_SOURCE_OPTIONS type string value '|', - T_SOURCE type string value '|', - T_XPATH_PATTERNS type string value '|', - T_ENRICHMENT_OPTIONS type string value '|', - T_ENRICHMENT type string value '|DESTINATION_FIELD|SOURCE_FIELD|ENRICHMENT|', - T_SEGMENT_SETTINGS type string value '|', - T_WORD_SETTINGS type string value '|', - T_HTML_SETTINGS type string value '|', - T_CONVERSIONS type string value '|', - T_CONFIGURATION type string value '|NAME|', - T_LIST_CONFIGURATIONS_RESPONSE type string value '|', - T_SOURCE_STATUS type string value '|', - T_DELETE_CREDENTIALS type string value '|', - T_NOTICE type string value '|', - T_DOCUMENT_ACCEPTED type string value '|', - T_GATEWAY type string value '|', - T_METRIC_AGGREGATION_RESULT type string value '|', - T_METRIC_AGGREGATION type string value '|', - T_METRIC_RESPONSE type string value '|', - T_QUERY_RESULT_METADATA type string value '|SCORE|', - T_QUERY_NOTICES_RESULT type string value '|', - T_LOG_QRY_RESP_RSLT_DOCS_RSLT type string value '|', - T_LOG_QUERY_RESP_RESULT_DOCS type string value '|', - T_FIELD type string value '|', - T_EVENT_DATA type string value '|ENVIRONMENT_ID|SESSION_TOKEN|COLLECTION_ID|DOCUMENT_ID|', - T_CREATE_EVENT_OBJECT type string value '|TYPE|DATA|', - T_NESTED type string value '|', - T_QUERY_LARGE type string value '|', - T_GATEWAY_NAME type string value '|', - T_DOCUMENT_COUNTS type string value '|', - T_SDU_STATUS_CUSTOM_FIELDS type string value '|', - T_SDU_STATUS type string value '|', - T_COLLECTION_CRAWL_STATUS type string value '|', - T_COLLECTION_DISK_USAGE type string value '|', - T_COLLECTION type string value '|', - T_ELEMENTS_ENRICHMENT_OPTIONS type string value '|', - T_CREATE_ENVIRONMENT_REQUEST type string value '|NAME|', - T_CREATE_COLLECTION_REQUEST type string value '|NAME|', - T_INLINE_OBJECT type string value '|STOPWORD_FILE|', - T_QUERY_RESULT type string value '|', - T_TOP_HITS_RESULTS type string value '|', - T_DELETE_COLLECTION_RESPONSE type string value '|COLLECTION_ID|STATUS|', - T_TERM type string value '|', - T_COMPLETIONS type string value '|', - T_RETRIEVAL_DETAILS type string value '|', - T_DELETE_ENVIRONMENT_RESPONSE type string value '|ENVIRONMENT_ID|STATUS|', - T_LST_COLLECTION_FIELDS_RESP type string value '|', - T_UPDATE_COLLECTION_REQUEST type string value '|NAME|', - T_GATEWAY_LIST type string value '|', - T_METRIC_TOKEN_AGGR_RESULT type string value '|', - T_METRIC_TOKEN_AGGREGATION type string value '|', - T_COLL_QUERY_LARGE type string value '|', - T_UPDATE_ENVIRONMENT_REQUEST type string value '|', - T_DEL_CONFIGURATION_RESPONSE type string value '|CONFIGURATION_ID|STATUS|', - T_QUERY_RESPONSE type string value '|', - T_TIMESLICE type string value '|', - T_NEW_TRAINING_QUERY type string value '|', - T_DOCUMENT_STATUS type string value '|DOCUMENT_ID|STATUS|STATUS_DESCRIPTION|NOTICES|', - T_FED_QUERY_LARGE type string value '|COLLECTION_IDS|', - T_ERROR_RESPONSE type string value '|CODE|ERROR|', - T_EXPANSION type string value '|EXPANDED_TERMS|', - T_EXPANSIONS type string value '|EXPANSIONS|', - T_CREATE_EVENT_RESPONSE type string value '|', - T_METRIC_TOKEN_RESPONSE type string value '|', - T_TRAINING_EXAMPLE_LIST type string value '|', - T_DELETE_DOCUMENT_RESPONSE type string value '|', - T_TOP_HITS type string value '|', - T_LOG_QUERY_RESPONSE_RESULT type string value '|', - T_LOG_QUERY_RESPONSE type string value '|', - T_TRAINING_EXAMPLE_PATCH type string value '|', - T_LIST_COLLECTIONS_RESPONSE type string value '|', - T_CALCULATION type string value '|', - T_TRAINING_DATA_SET type string value '|', - T_QUERY_NOTICES_RESPONSE type string value '|', - T_HISTOGRAM type string value '|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - ENVIRONMENT_ID type string value 'environment_id', - NAME type string value 'name', - DESCRIPTION type string value 'description', - CREATED type string value 'created', - UPDATED type string value 'updated', - STATUS type string value 'status', - READ_ONLY type string value 'read_only', - SIZE type string value 'size', - REQUESTED_SIZE type string value 'requested_size', - INDEX_CAPACITY type string value 'index_capacity', - SEARCH_STATUS type string value 'search_status', - DOCUMENTS type string value 'documents', - DISK_USAGE type string value 'disk_usage', - COLLECTIONS type string value 'collections', - USED_BYTES type string value 'used_bytes', - MAXIMUM_ALLOWED_BYTES type string value 'maximum_allowed_bytes', - AVAILABLE type string value 'available', - MAXIMUM_ALLOWED type string value 'maximum_allowed', - ENVIRONMENTS type string value 'environments', - CONFIGURATION_ID type string value 'configuration_id', - LANGUAGE type string value 'language', - COLLECTION_ID type string value 'collection_id', - DOCUMENT_COUNTS type string value 'document_counts', - TRAINING_STATUS type string value 'training_status', - CRAWL_STATUS type string value 'crawl_status', - SMART_DOCUMENT_UNDERSTANDING type string value 'smart_document_understanding', - PROCESSING type string value 'processing', - FAILED type string value 'failed', - PENDING type string value 'pending', - CONVERSIONS type string value 'conversions', - ENRICHMENTS type string value 'enrichments', - ENRICHMENT type string value 'enrichment', - NORMALIZATIONS type string value 'normalizations', - NORMALIZATION type string value 'normalization', - SOURCE type string value 'source', - PDF type string value 'pdf', - WORD type string value 'word', - HTML type string value 'html', - SEGMENT type string value 'segment', - JSON_NORMALIZATIONS type string value 'json_normalizations', - IMAGE_TEXT_RECOGNITION type string value 'image_text_recognition', - HEADING type string value 'heading', - FONTS type string value 'fonts', - FONT_SETTING type string value 'font_setting', - STYLES type string value 'styles', - WORD_STYLE type string value 'word_style', - LEVEL type string value 'level', - NAMES type string value 'names', - EXCLUDE_TAGS_COMPLETELY type string value 'exclude_tags_completely', - EXCLUDE_TAGS_KEEP_CONTENT type string value 'exclude_tags_keep_content', - KEEP_CONTENT type string value 'keep_content', - EXCLUDE_CONTENT type string value 'exclude_content', - KEEP_TAG_ATTRIBUTES type string value 'keep_tag_attributes', - EXCLUDE_TAG_ATTRIBUTES type string value 'exclude_tag_attributes', - ENABLED type string value 'enabled', - SELECTOR_TAGS type string value 'selector_tags', - ANNOTATED_FIELDS type string value 'annotated_fields', - XPATHS type string value 'xpaths', - MIN_SIZE type string value 'min_size', - MAX_SIZE type string value 'max_size', - BOLD type string value 'bold', - ITALIC type string value 'italic', - DESTINATION_FIELD type string value 'destination_field', - SOURCE_FIELD type string value 'source_field', - OVERWRITE type string value 'overwrite', - IGNORE_DOWNSTREAM_ERRORS type string value 'ignore_downstream_errors', - OPTIONS type string value 'options', - FEATURES type string value 'features', - MODEL type string value 'model', - OPERATION type string value 'operation', - CONFIGURATIONS type string value 'configurations', - NOTICES type string value 'notices', - DOCUMENT_ID type string value 'document_id', - STATUS_DESCRIPTION type string value 'status_description', - FILENAME type string value 'filename', - FILE_TYPE type string value 'file_type', - SHA1 type string value 'sha1', - FIELDS type string value 'fields', - FIELD type string value 'field', - TYPE type string value 'type', - MATCHING_RESULTS type string value 'matching_results', - RESULTS type string value 'results', - AGGREGATIONS type string value 'aggregations', - PASSAGES type string value 'passages', - DUPLICATES_REMOVED type string value 'duplicates_removed', - SESSION_TOKEN type string value 'session_token', - RETRIEVAL_DETAILS type string value 'retrieval_details', - SUGGESTED_QUERY type string value 'suggested_query', - ID type string value 'id', - METADATA type string value 'metadata', - INNER type string value 'inner', - RESULT_METADATA type string value 'result_metadata', - SCORE type string value 'score', - CONFIDENCE type string value 'confidence', - CODE type string value 'code', - KEY type string value 'key', - INTERVAL type string value 'interval', - VALUE type string value 'value', - COUNT type string value 'count', - MATCH type string value 'match', - PATH type string value 'path', - ANOMALY type string value 'anomaly', - HITS type string value 'hits', - TOTAL_EXAMPLES type string value 'total_examples', - MINIMUM_QUERIES_ADDED type string value 'minimum_queries_added', - MINIMUM_EXAMPLES_ADDED type string value 'minimum_examples_added', - SUFFICIENT_LABEL_DIVERSITY type string value 'sufficient_label_diversity', - SUCCESSFULLY_TRAINED type string value 'successfully_trained', - DATA_UPDATED type string value 'data_updated', - QUERIES type string value 'queries', - QUERY_ID type string value 'query_id', - NATURAL_LANGUAGE_QUERY type string value 'natural_language_query', - FILTER type string value 'filter', - EXAMPLES type string value 'examples', - CROSS_REFERENCE type string value 'cross_reference', - RELEVANCE type string value 'relevance', - NOTICE_ID type string value 'notice_id', - SEVERITY type string value 'severity', - STEP type string value 'step', - ERROR type string value 'error', - PASSAGE_SCORE type string value 'passage_score', - PASSAGE_TEXT type string value 'passage_text', - START_OFFSET type string value 'start_offset', - END_OFFSET type string value 'end_offset', - KEYWORDS type string value 'keywords', - ENTITIES type string value 'entities', - SENTIMENT type string value 'sentiment', - EMOTION type string value 'emotion', - CATEGORIES type string value 'categories', - SEMANTIC_ROLES type string value 'semantic_roles', - RELATIONS type string value 'relations', - CONCEPTS type string value 'concepts', - LIMIT type string value 'limit', - MENTIONS type string value 'mentions', - MENTION_TYPES type string value 'mention_types', - SENTENCE_LOCATIONS type string value 'sentence_locations', - DOCUMENT type string value 'document', - TARGETS type string value 'targets', - TARGET type string value 'target', - EXPANSIONS type string value 'expansions', - INPUT_TERMS type string value 'input_terms', - EXPANDED_TERMS type string value 'expanded_terms', - DATA type string value 'data', - CLIENT_TIMESTAMP type string value 'client_timestamp', - DISPLAY_RANK type string value 'display_rank', - EVENT_TYPE type string value 'event_type', - KEY_AS_STRING type string value 'key_as_string', - EVENT_RATE type string value 'event_rate', - CUSTOMER_ID type string value 'customer_id', - DOCUMENT_TYPE type string value 'document_type', - DOCUMENT_RESULTS type string value 'document_results', - CREATED_TIMESTAMP type string value 'created_timestamp', - RESULT_TYPE type string value 'result_type', - POSITION type string value 'position', - CREDENTIALS type string value 'credentials', - CREDENTIAL_ID type string value 'credential_id', - SOURCE_TYPE type string value 'source_type', - CREDENTIAL_DETAILS type string value 'credential_details', - CREDENTIAL_TYPE type string value 'credential_type', - CLIENT_ID type string value 'client_id', - ENTERPRISE_ID type string value 'enterprise_id', - URL type string value 'url', - USERNAME type string value 'username', - ORGANIZATION_URL type string value 'organization_url', - SITE_COLLECTION_PATH type string value 'site_collection.path', - CLIENT_SECRET type string value 'client_secret', - PUBLIC_KEY_ID type string value 'public_key_id', - PRIVATE_KEY type string value 'private_key', - PASSPHRASE type string value 'passphrase', - PASSWORD type string value 'password', - GATEWAY_ID type string value 'gateway_id', - SOURCE_VERSION type string value 'source_version', - WEB_APPLICATION_URL type string value 'web_application_url', - DOMAIN type string value 'domain', - ENDPOINT type string value 'endpoint', - ACCESS_KEY_ID type string value 'access_key_id', - SECRET_ACCESS_KEY type string value 'secret_access_key', - NEXT_CRAWL type string value 'next_crawl', - SCHEDULE type string value 'schedule', - TIME_ZONE type string value 'time_zone', - FREQUENCY type string value 'frequency', - FOLDERS type string value 'folders', - OBJECTS type string value 'objects', - SITE_COLLECTIONS type string value 'site_collections', - URLS type string value 'urls', - BUCKETS type string value 'buckets', - CRAWL_ALL_BUCKETS type string value 'crawl_all_buckets', - OWNER_USER_ID type string value 'owner_user_id', - FOLDER_ID type string value 'folder_id', - SITE_COLLECTION_PATH1 type string value 'site_collection_path', - SCOPE type string value 'scope', - LAST_TRAINED type string value 'last_trained', - QUERY type string value 'query', - AGGREGATION type string value 'aggregation', - RETURN type string value 'return', - OFFSET type string value 'offset', - SORT type string value 'sort', - HIGHLIGHT type string value 'highlight', - PASSAGES_FIELDS type string value 'passages.fields', - PASSAGES_COUNT type string value 'passages.count', - PASSAGES_CHARACTERS type string value 'passages.characters', - DEDUPLICATE type string value 'deduplicate', - DEDUPLICATE_FIELD type string value 'deduplicate.field', - SIMILAR type string value 'similar', - SIMILAR_DOCUMENT_IDS type string value 'similar.document_ids', - SIMILAR_FIELDS type string value 'similar.fields', - BIAS type string value 'bias', - TOKENIZATION_RULES type string value 'tokenization_rules', - TEXT type string value 'text', - TOKENS type string value 'tokens', - READINGS type string value 'readings', - PART_OF_SPEECH type string value 'part_of_speech', - DOCUMENT_RETRIEVAL_STRATEGY type string value 'document_retrieval_strategy', - LIMIT_TO_STARTING_HOSTS type string value 'limit_to_starting_hosts', - CRAWL_SPEED type string value 'crawl_speed', - ALLOW_UNTRUSTED_CERTIFICATE type string value 'allow_untrusted_certificate', - MAXIMUM_HOPS type string value 'maximum_hops', - REQUEST_TIMEOUT type string value 'request_timeout', - OVERRIDE_ROBOTS_TXT type string value 'override_robots_txt', - BLACKLIST type string value 'blacklist', - GATEWAYS type string value 'gateways', - TOKEN type string value 'token', - TOKEN_ID type string value 'token_id', - TOTAL_ANNOTATED_PAGES type string value 'total_annotated_pages', - TOTAL_PAGES type string value 'total_pages', - TOTAL_DOCUMENTS type string value 'total_documents', - CUSTOM_FIELDS type string value 'custom_fields', - COMPLETIONS type string value 'completions', - COLLECTION_IDS type string value 'collection_ids', - SPELLING_SUGGESTIONS type string value 'spelling_suggestions', - DEFINED type string value 'defined', - SOURCE_CRAWL type string value 'source_crawl', - STOPWORD_FILE type string value 'stopword_file', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Create an environment

- "! Creates a new environment for private data. An environment must be created - "! before collections can be created.
- "!
- "! **Note**: You can create only one environment for private data per service - "! instance. An attempt to create another environment results in an error. - "! - "! @parameter I_BODY | - "! An object that defines an environment name and optional description. The fields - "! in this object are not approved for personal information and cannot be deleted - "! based on customer ID. - "! @parameter E_RESPONSE | - "! Service return value of type T_ENVIRONMENT - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_ENVIRONMENT - importing - !I_BODY type T_CREATE_ENVIRONMENT_REQUEST - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_ENVIRONMENT - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List environments

- "! List existing environments for the service instance. - "! - "! @parameter I_NAME | - "! Show only the environment with the given name. - "! @parameter E_RESPONSE | - "! Service return value of type T_LIST_ENVIRONMENTS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_ENVIRONMENTS - importing - !I_NAME type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LIST_ENVIRONMENTS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get environment info

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter E_RESPONSE | - "! Service return value of type T_ENVIRONMENT - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_ENVIRONMENT - importing - !I_ENVIRONMENT_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_ENVIRONMENT - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update an environment

- "! Updates an environment. The environment's **name** and **description** - "! parameters can be changed. You must specify a **name** for the environment. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_BODY | - "! An object that defines the environment's name and, optionally, description. - "! - "! @parameter E_RESPONSE | - "! Service return value of type T_ENVIRONMENT - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_ENVIRONMENT - importing - !I_ENVIRONMENT_ID type STRING - !I_BODY type T_UPDATE_ENVIRONMENT_REQUEST - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_ENVIRONMENT - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete environment

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter E_RESPONSE | - "! Service return value of type T_DELETE_ENVIRONMENT_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_ENVIRONMENT - importing - !I_ENVIRONMENT_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DELETE_ENVIRONMENT_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List fields across collections

- "! Gets a list of the unique fields (and their types) stored in the indexes of the - "! specified collections. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_IDS | - "! A comma-separated list of collection IDs to be queried against. - "! @parameter E_RESPONSE | - "! Service return value of type T_LST_COLLECTION_FIELDS_RESP - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_FIELDS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_IDS type TT_STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LST_COLLECTION_FIELDS_RESP - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Add configuration

- "! Creates a new configuration.
- "!
- "! If the input configuration contains the **configuration_id**, **created**, or - "! **updated** properties, then they are ignored and overridden by the system, and - "! an error is not returned so that the overridden fields do not need to be - "! removed when copying a configuration.
- "!
- "! The configuration can contain unrecognized JSON fields. Any such fields are - "! ignored and do not generate an error. This makes it easier to use newer - "! configuration files with older versions of the API and the service. It also - "! makes it possible for the tooling to add additional metadata and information to - "! the configuration. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CONFIGURATION | - "! Input an object that enables you to customize how your content is ingested and - "! what enrichments are added to your data.
- "!
- "! **name** is required and must be unique within the current **environment**. All - "! other properties are optional.
- "!
- "! If the input configuration contains the **configuration_id**, **created**, or - "! **updated** properties, then they will be ignored and overridden by the system - "! (an error is not returned so that the overridden fields do not need to be - "! removed when copying a configuration).
- "!
- "! The configuration can contain unrecognized JSON fields. Any such fields will be - "! ignored and will not generate an error. This makes it easier to use newer - "! configuration files with older versions of the API and the service. It also - "! makes it possible for the tooling to add additional metadata and information to - "! the configuration. - "! @parameter E_RESPONSE | - "! Service return value of type T_CONFIGURATION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_CONFIGURATION - importing - !I_ENVIRONMENT_ID type STRING - !I_CONFIGURATION type T_CONFIGURATION - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CONFIGURATION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List configurations

- "! Lists existing configurations for the service instance. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_NAME | - "! Find configurations with the given name. - "! @parameter E_RESPONSE | - "! Service return value of type T_LIST_CONFIGURATIONS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_CONFIGURATIONS - importing - !I_ENVIRONMENT_ID type STRING - !I_NAME type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LIST_CONFIGURATIONS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get configuration details

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CONFIGURATION_ID | - "! The ID of the configuration. - "! @parameter E_RESPONSE | - "! Service return value of type T_CONFIGURATION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_CONFIGURATION - importing - !I_ENVIRONMENT_ID type STRING - !I_CONFIGURATION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CONFIGURATION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update a configuration

- "! Replaces an existing configuration.
- "! * Completely replaces the original configuration.
- "! * The **configuration_id**, **updated**, and **created** fields are accepted - "! in the request, but they are ignored, and an error is not generated. It is also - "! acceptable for users to submit an updated configuration with none of the three - "! properties.
- "! * Documents are processed with a snapshot of the configuration as it was at - "! the time the document was submitted to be ingested. This means that already - "! submitted documents will not see any updates made to the configuration. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CONFIGURATION_ID | - "! The ID of the configuration. - "! @parameter I_CONFIGURATION | - "! Input an object that enables you to update and customize how your data is - "! ingested and what enrichments are added to your data. The **name** parameter - "! is required and must be unique within the current **environment**. All other - "! properties are optional, but if they are omitted the default values replace - "! the current value of each omitted property.
- "!
- "! If the input configuration contains the **configuration_id**, **created**, or - "! **updated** properties, they are ignored and overridden by the system, and an - "! error is not returned so that the overridden fields do not need to be removed - "! when updating a configuration.
- "!
- "! The configuration can contain unrecognized JSON fields. Any such fields are - "! ignored and do not generate an error. This makes it easier to use newer - "! configuration files with older versions of the API and the service. It also - "! makes it possible for the tooling to add additional metadata and information to - "! the configuration. - "! @parameter E_RESPONSE | - "! Service return value of type T_CONFIGURATION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_CONFIGURATION - importing - !I_ENVIRONMENT_ID type STRING - !I_CONFIGURATION_ID type STRING - !I_CONFIGURATION type T_CONFIGURATION - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CONFIGURATION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a configuration

- "! The deletion is performed unconditionally. A configuration deletion request - "! succeeds even if the configuration is referenced by a collection or document - "! ingestion. However, documents that have already been submitted for processing - "! continue to use the deleted configuration. Documents are always processed with - "! a snapshot of the configuration as it existed at the time the document was - "! submitted. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CONFIGURATION_ID | - "! The ID of the configuration. - "! @parameter E_RESPONSE | - "! Service return value of type T_DEL_CONFIGURATION_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_CONFIGURATION - importing - !I_ENVIRONMENT_ID type STRING - !I_CONFIGURATION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DEL_CONFIGURATION_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Create a collection

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_BODY | - "! Input an object that allows you to add a collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_COLLECTION - importing - !I_ENVIRONMENT_ID type STRING - !I_BODY type T_CREATE_COLLECTION_REQUEST - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List collections

- "! Lists existing collections for the service instance. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_NAME | - "! Find collections with the given name. - "! @parameter E_RESPONSE | - "! Service return value of type T_LIST_COLLECTIONS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_COLLECTIONS - importing - !I_ENVIRONMENT_ID type STRING - !I_NAME type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LIST_COLLECTIONS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get collection details

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_COLLECTION - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update a collection

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_BODY | - "! Input an object that allows you to update a collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_COLLECTION - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_BODY type T_UPDATE_COLLECTION_REQUEST - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a collection

- "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_DELETE_COLLECTION_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_COLLECTION - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DELETE_COLLECTION_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List collection fields

- "! Gets a list of the unique fields (and their types) stored in the index. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_LST_COLLECTION_FIELDS_RESP - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_COLLECTION_FIELDS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LST_COLLECTION_FIELDS_RESP - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Get the expansion list

- "! Returns the current expansion list for the specified collection. If an expansion - "! list is not specified, an object with empty expansion arrays is returned. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_EXPANSIONS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_EXPANSIONS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_EXPANSIONS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Create or update expansion list

- "! Create or replace the Expansion list for this collection. The maximum number of - "! expanded terms per collection is `500`.
- "! The current expansion list is replaced with the uploaded content. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_BODY | - "! An object that defines the expansion list. - "! @parameter E_RESPONSE | - "! Service return value of type T_EXPANSIONS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_EXPANSIONS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_BODY type T_EXPANSIONS - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_EXPANSIONS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete the expansion list

- "! Remove the expansion information for this collection. The expansion list must be - "! deleted to disable query expansion for a collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_EXPANSIONS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get tokenization dictionary status

- "! Returns the current status of the tokenization dictionary for the specified - "! collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_TOKEN_DICT_STATUS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_TOKENIZATION_DICT_STATUS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TOKEN_DICT_STATUS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Create tokenization dictionary

- "! Upload a custom tokenization dictionary to use with the specified collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_TOKENIZATION_DICTIONARY | - "! An object that represents the tokenization dictionary to be uploaded. - "! @parameter E_RESPONSE | - "! Service return value of type T_TOKEN_DICT_STATUS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_TOKENIZATION_DICTIONARY - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_TOKENIZATION_DICTIONARY type T_TOKEN_DICT optional - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TOKEN_DICT_STATUS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete tokenization dictionary

- "! Delete the tokenization dictionary from the collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_TOKENIZATION_DICTIONARY - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get stopword list status

- "! Returns the current status of the stopword list for the specified collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_TOKEN_DICT_STATUS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_STOPWORD_LIST_STATUS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TOKEN_DICT_STATUS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Create stopword list

- "! Upload a custom stopword list to use with the specified collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_STOPWORD_FILE | - "! The content of the stopword list to ingest. - "! @parameter I_STOPWORD_FILENAME | - "! The filename for stopwordFile. - "! @parameter E_RESPONSE | - "! Service return value of type T_TOKEN_DICT_STATUS_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_STOPWORD_LIST - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_STOPWORD_FILE type FILE - !I_STOPWORD_FILENAME type STRING - !I_STOPWORD_FILE_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TOKEN_DICT_STATUS_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a custom stopword list

- "! Delete a custom stopword list from the collection. After a custom stopword list - "! is deleted, the default list is used for the collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_STOPWORD_LIST - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Add a document

- "! Add a document to a collection with optional metadata.
- "!
- "! * The **version** query parameter is still required.
- "!
- "! * Returns immediately after the system has accepted the document for - "! processing.
- "!
- "! * The user must provide document content, metadata, or both. If the request is - "! missing both document content and metadata, it is rejected.
- "!
- "! * The user can set the **Content-Type** parameter on the **file** part to - "! indicate the media type of the document. If the **Content-Type** parameter is - "! missing or is one of the generic media types (for example, - "! `application/octet-stream`), then the service attempts to automatically detect - "! the document's media type.
- "!
- "! * The following field names are reserved and will be filtered out if present - "! after normalization: `id`, `score`, `highlight`, and any field with the prefix - "! of: `_`, `+`, or `-`
- "!
- "! * Fields with empty name values after normalization are filtered out before - "! indexing.
- "!
- "! * Fields containing the following characters after normalization are filtered - "! out before indexing: `#` and `,`
- "!
- "! **Note:** Documents can be added with a specific **document_id** by using the - "! **/v1/environments/{environment_id}/collections/{collection_id&# - "! 125;/documents** method. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_FILE | - "! The content of the document to ingest. The maximum supported file size when - "! adding a file to a collection is 50 megabytes, the maximum supported file size - "! when testing a configuration is 1 megabyte. Files larger than the supported - "! size are rejected. - "! @parameter I_FILENAME | - "! The filename for file. - "! @parameter I_FILE_CONTENT_TYPE | - "! The content type of file. - "! @parameter I_METADATA | - "! The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 - "! MB are rejected. Example: ``` {
- "! "Creator": "Johnny Appleseed",
- "! "Subject": "Apples"
- "! } ```. - "! @parameter E_RESPONSE | - "! Service return value of type T_DOCUMENT_ACCEPTED - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods ADD_DOCUMENT - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_FILE type FILE optional - !I_FILENAME type STRING optional - !I_FILE_CONTENT_TYPE type STRING optional - !I_METADATA type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DOCUMENT_ACCEPTED - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get document details

- "! Fetch status details about a submitted document. **Note:** this operation does - "! not return the document itself. Instead, it returns only the document's - "! processing status and any notices (warnings or errors) that were generated when - "! the document was ingested. Use the query API to retrieve the actual document - "! content. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_DOCUMENT_ID | - "! The ID of the document. - "! @parameter E_RESPONSE | - "! Service return value of type T_DOCUMENT_STATUS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_DOCUMENT_STATUS - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_DOCUMENT_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DOCUMENT_STATUS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update a document

- "! Replace an existing document or add a document with a specified **document_id**. - "! Starts ingesting a document with optional metadata.
- "!
- "! **Note:** When uploading a new document with this method it automatically - "! replaces any document stored with the same **document_id** if it exists. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_DOCUMENT_ID | - "! The ID of the document. - "! @parameter I_FILE | - "! The content of the document to ingest. The maximum supported file size when - "! adding a file to a collection is 50 megabytes, the maximum supported file size - "! when testing a configuration is 1 megabyte. Files larger than the supported - "! size are rejected. - "! @parameter I_FILENAME | - "! The filename for file. - "! @parameter I_FILE_CONTENT_TYPE | - "! The content type of file. - "! @parameter I_METADATA | - "! The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 - "! MB are rejected. Example: ``` {
- "! "Creator": "Johnny Appleseed",
- "! "Subject": "Apples"
- "! } ```. - "! @parameter E_RESPONSE | - "! Service return value of type T_DOCUMENT_ACCEPTED - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_DOCUMENT - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_DOCUMENT_ID type STRING - !I_FILE type FILE optional - !I_FILENAME type STRING optional - !I_FILE_CONTENT_TYPE type STRING optional - !I_METADATA type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DOCUMENT_ACCEPTED - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a document

- "! If the given document ID is invalid, or if the document is not found, then the a - "! success response is returned (HTTP status code `200`) with the status set to - "! 'deleted'. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_DOCUMENT_ID | - "! The ID of the document. - "! @parameter E_RESPONSE | - "! Service return value of type T_DELETE_DOCUMENT_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_DOCUMENT - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_DOCUMENT_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DELETE_DOCUMENT_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Query a collection

- "! By using this method, you can construct long queries. For details, see the - "! [Discovery - "! documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - "! pts#query-concepts). - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_LONG | - "! An object that represents the query to be submitted. - "! @parameter I_X_WATSON_LOGGING_OPT_OUT | - "! If `true`, queries are not stored in the Discovery **Logs** endpoint. - "! @parameter E_RESPONSE | - "! Service return value of type T_QUERY_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods QUERY - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_LONG type T_COLL_QUERY_LARGE optional - !I_X_WATSON_LOGGING_OPT_OUT type BOOLEAN default c_boolean_false - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_QUERY_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Query system notices

- "! Queries for notices (errors or warnings) that might have been generated by the - "! system. Notices are generated when ingesting documents and performing relevance - "! training. See the [Discovery - "! documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - "! pts#query-concepts) for more details on the query language. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_FILTER | - "! A cacheable query that excludes documents that don't mention the query - "! content. Filter searches are better for metadata-type searches and for - "! assessing the concepts in the data set. - "! @parameter I_QUERY | - "! A query search returns all documents in your data set with full enrichments and - "! full text, but with the most relevant documents listed first. - "! @parameter I_NATURAL_LANGUAGE_QUERY | - "! A natural language query that returns relevant documents by utilizing training - "! data and natural language understanding. - "! @parameter I_PASSAGES | - "! A passages query that returns the most relevant passages from the results. - "! @parameter I_AGGREGATION | - "! An aggregation search that returns an exact answer by combining query search - "! with filters. Useful for applications to build lists, tables, and time series. - "! For a full list of possible aggregations, see the Query reference. - "! @parameter I_COUNT | - "! Number of results to return. The maximum for the **count** and **offset** values - "! together in any one query is **10000**. - "! @parameter I_RETURN | - "! A comma-separated list of the portion of the document hierarchy to return. - "! @parameter I_OFFSET | - "! The number of query results to skip at the beginning. For example, if the total - "! number of results that are returned is 10 and the offset is 8, it returns the - "! last two results. The maximum for the **count** and **offset** values together - "! in any one query is **10000**. - "! @parameter I_SORT | - "! A comma-separated list of fields in the document to sort on. You can optionally - "! specify a sort direction by prefixing the field with `-` for descending or `+` - "! for ascending. Ascending is the default sort direction if no prefix is - "! specified. - "! @parameter I_HIGHLIGHT | - "! When true, a highlight field is returned for each result which contains the - "! fields which match the query with `<em></em>` tags around the - "! matching query terms. - "! @parameter I_PASSAGES_FIELDS | - "! A comma-separated list of fields that passages are drawn from. If this parameter - "! not specified, then all top-level fields are included. - "! @parameter I_PASSAGES_COUNT | - "! The maximum number of passages to return. The search returns fewer passages if - "! the requested total is not found. - "! @parameter I_PASSAGES_CHARACTERS | - "! The approximate number of characters that any one passage will have. - "! @parameter I_DEDUPLICATE_FIELD | - "! When specified, duplicate results based on the field specified are removed from - "! the returned results. Duplicate comparison is limited to the current query - "! only, **offset** is not considered. This parameter is currently Beta - "! functionality. - "! @parameter I_SIMILAR | - "! When `true`, results are returned based on their similarity to the document IDs - "! specified in the **similar.document_ids** parameter. - "! @parameter I_SIMILAR_DOCUMENT_IDS | - "! A comma-separated list of document IDs to find similar documents.
- "!
- "! **Tip:** Include the **natural_language_query** parameter to expand the scope of - "! the document similarity search with the natural language query. Other query - "! parameters, such as **filter** and **query**, are subsequently applied and - "! reduce the scope. - "! @parameter I_SIMILAR_FIELDS | - "! A comma-separated list of field names that are used as a basis for comparison to - "! identify similar documents. If not specified, the entire document is used for - "! comparison. - "! @parameter E_RESPONSE | - "! Service return value of type T_QUERY_NOTICES_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods QUERY_NOTICES - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_FILTER type STRING optional - !I_QUERY type STRING optional - !I_NATURAL_LANGUAGE_QUERY type STRING optional - !I_PASSAGES type BOOLEAN optional - !I_AGGREGATION type STRING optional - !I_COUNT type INTEGER optional - !I_RETURN type TT_STRING optional - !I_OFFSET type INTEGER optional - !I_SORT type TT_STRING optional - !I_HIGHLIGHT type BOOLEAN default c_boolean_false - !I_PASSAGES_FIELDS type TT_STRING optional - !I_PASSAGES_COUNT type INTEGER optional - !I_PASSAGES_CHARACTERS type INTEGER optional - !I_DEDUPLICATE_FIELD type STRING optional - !I_SIMILAR type BOOLEAN default c_boolean_false - !I_SIMILAR_DOCUMENT_IDS type TT_STRING optional - !I_SIMILAR_FIELDS type TT_STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_QUERY_NOTICES_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Query multiple collections

- "! By using this method, you can construct long queries that search multiple - "! collection. For details, see the [Discovery - "! documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - "! pts#query-concepts). - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_QUERY_LONG | - "! No documentation available. - "! @parameter I_X_WATSON_LOGGING_OPT_OUT | - "! If `true`, queries are not stored in the Discovery **Logs** endpoint. - "! @parameter E_RESPONSE | - "! Service return value of type T_QUERY_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods FEDERATED_QUERY - importing - !I_ENVIRONMENT_ID type STRING - !I_QUERY_LONG type T_FED_QUERY_LARGE - !I_X_WATSON_LOGGING_OPT_OUT type BOOLEAN default c_boolean_false - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_QUERY_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Query multiple collection system notices

- "! Queries for notices (errors or warnings) that might have been generated by the - "! system. Notices are generated when ingesting documents and performing relevance - "! training. See the [Discovery - "! documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-conce - "! pts#query-concepts) for more details on the query language. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_IDS | - "! A comma-separated list of collection IDs to be queried against. - "! @parameter I_FILTER | - "! A cacheable query that excludes documents that don't mention the query - "! content. Filter searches are better for metadata-type searches and for - "! assessing the concepts in the data set. - "! @parameter I_QUERY | - "! A query search returns all documents in your data set with full enrichments and - "! full text, but with the most relevant documents listed first. - "! @parameter I_NATURAL_LANGUAGE_QUERY | - "! A natural language query that returns relevant documents by utilizing training - "! data and natural language understanding. - "! @parameter I_AGGREGATION | - "! An aggregation search that returns an exact answer by combining query search - "! with filters. Useful for applications to build lists, tables, and time series. - "! For a full list of possible aggregations, see the Query reference. - "! @parameter I_COUNT | - "! Number of results to return. The maximum for the **count** and **offset** values - "! together in any one query is **10000**. - "! @parameter I_RETURN | - "! A comma-separated list of the portion of the document hierarchy to return. - "! @parameter I_OFFSET | - "! The number of query results to skip at the beginning. For example, if the total - "! number of results that are returned is 10 and the offset is 8, it returns the - "! last two results. The maximum for the **count** and **offset** values together - "! in any one query is **10000**. - "! @parameter I_SORT | - "! A comma-separated list of fields in the document to sort on. You can optionally - "! specify a sort direction by prefixing the field with `-` for descending or `+` - "! for ascending. Ascending is the default sort direction if no prefix is - "! specified. - "! @parameter I_HIGHLIGHT | - "! When true, a highlight field is returned for each result which contains the - "! fields which match the query with `<em></em>` tags around the - "! matching query terms. - "! @parameter I_DEDUPLICATE_FIELD | - "! When specified, duplicate results based on the field specified are removed from - "! the returned results. Duplicate comparison is limited to the current query - "! only, **offset** is not considered. This parameter is currently Beta - "! functionality. - "! @parameter I_SIMILAR | - "! When `true`, results are returned based on their similarity to the document IDs - "! specified in the **similar.document_ids** parameter. - "! @parameter I_SIMILAR_DOCUMENT_IDS | - "! A comma-separated list of document IDs to find similar documents.
- "!
- "! **Tip:** Include the **natural_language_query** parameter to expand the scope of - "! the document similarity search with the natural language query. Other query - "! parameters, such as **filter** and **query**, are subsequently applied and - "! reduce the scope. - "! @parameter I_SIMILAR_FIELDS | - "! A comma-separated list of field names that are used as a basis for comparison to - "! identify similar documents. If not specified, the entire document is used for - "! comparison. - "! @parameter E_RESPONSE | - "! Service return value of type T_QUERY_NOTICES_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods FEDERATED_QUERY_NOTICES - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_IDS type TT_STRING - !I_FILTER type STRING optional - !I_QUERY type STRING optional - !I_NATURAL_LANGUAGE_QUERY type STRING optional - !I_AGGREGATION type STRING optional - !I_COUNT type INTEGER optional - !I_RETURN type TT_STRING optional - !I_OFFSET type INTEGER optional - !I_SORT type TT_STRING optional - !I_HIGHLIGHT type BOOLEAN default c_boolean_false - !I_DEDUPLICATE_FIELD type STRING optional - !I_SIMILAR type BOOLEAN default c_boolean_false - !I_SIMILAR_DOCUMENT_IDS type TT_STRING optional - !I_SIMILAR_FIELDS type TT_STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_QUERY_NOTICES_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get Autocomplete Suggestions

- "! Returns completion query suggestions for the specified prefix. /n/n - "! **Important:** this method is only valid when using the Cloud Pak version of - "! Discovery. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_PREFIX | - "! The prefix to use for autocompletion. For example, the prefix `Ho` could - "! autocomplete to `Hot`, `Housing`, or `How do I upgrade`. Possible completions - "! are. - "! @parameter I_FIELD | - "! The field in the result documents that autocompletion suggestions are identified - "! from. - "! @parameter I_COUNT | - "! The number of autocompletion suggestions to return. - "! @parameter E_RESPONSE | - "! Service return value of type T_COMPLETIONS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_AUTOCOMPLETION - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_PREFIX type STRING - !I_FIELD type STRING optional - !I_COUNT type INTEGER optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COMPLETIONS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

List training data

- "! Lists the training data for the specified collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_DATA_SET - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_TRAINING_DATA - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_DATA_SET - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Add query to training data

- "! Adds a query to the training data for this collection. The query can contain a - "! filter and natural language query. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_BODY | - "! The body of the training data query that is to be added to the collection's - "! training data. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_QUERY - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods ADD_TRAINING_DATA - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_BODY type T_NEW_TRAINING_QUERY - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_QUERY - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete all training data

- "! Deletes all training data from a collection. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_ALL_TRAINING_DATA - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get details about a query

- "! Gets details for a specific training data query, including the query string and - "! all examples. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_QUERY - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_TRAINING_DATA - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_QUERY - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a training data query

- "! Removes the training data query and all associated examples from the training - "! data set. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_TRAINING_DATA - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List examples for a training data query

- "! List all examples for this training data query. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_EXAMPLE_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_TRAINING_EXAMPLES - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_EXAMPLE_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Add example to training data query

- "! Adds a example to this training data query. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @parameter I_BODY | - "! The body of the example that is to be added to the specified query. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_EXAMPLE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_TRAINING_EXAMPLE - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - !I_BODY type T_TRAINING_EXAMPLE - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_EXAMPLE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete example for training data query

- "! Deletes the example document with the given ID from the training data query. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @parameter I_EXAMPLE_ID | - "! The ID of the document as it is indexed. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_TRAINING_EXAMPLE - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - !I_EXAMPLE_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Change label or cross reference for example

- "! Changes the label or cross reference query for this training data example. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @parameter I_EXAMPLE_ID | - "! The ID of the document as it is indexed. - "! @parameter I_BODY | - "! The body of the example that is to be added to the specified query. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_EXAMPLE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_TRAINING_EXAMPLE - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - !I_EXAMPLE_ID type STRING - !I_BODY type T_TRAINING_EXAMPLE_PATCH - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_EXAMPLE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get details for training data example

- "! Gets the details for this training example. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_COLLECTION_ID | - "! The ID of the collection. - "! @parameter I_QUERY_ID | - "! The ID of the query used for training. - "! @parameter I_EXAMPLE_ID | - "! The ID of the document as it is indexed. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_EXAMPLE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_TRAINING_EXAMPLE - importing - !I_ENVIRONMENT_ID type STRING - !I_COLLECTION_ID type STRING - !I_QUERY_ID type STRING - !I_EXAMPLE_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_EXAMPLE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Delete labeled data

- "! Deletes all data associated with a specified customer ID. The method has no - "! effect if no data is associated with the customer ID.
- "!
- "! You associate a customer ID with data by passing the **X-Watson-Metadata** - "! header with a request that passes data. For more information about personal - "! data and customer IDs, see [Information - "! security](https://cloud.ibm.com/docs/discovery?topic=discovery-information-secu - "! rity#information-security). - "! - "! @parameter I_CUSTOMER_ID | - "! The customer ID for which all data is to be deleted. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_USER_DATA - importing - !I_CUSTOMER_ID type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Create event

- "! The **Events** API can be used to create log entries that are associated with - "! specific queries. For example, you can record which documents in the results - "! set were "clicked" by a user and when that click occurred. - "! - "! @parameter I_QUERY_EVENT | - "! An object that defines a query event to be added to the log. - "! @parameter E_RESPONSE | - "! Service return value of type T_CREATE_EVENT_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_EVENT - importing - !I_QUERY_EVENT type T_CREATE_EVENT_OBJECT - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CREATE_EVENT_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Search the query and event log

- "! Searches the query and event log to find query sessions that match the specified - "! criteria. Searching the **logs** endpoint uses the standard Discovery query - "! syntax for the parameters that are supported. - "! - "! @parameter I_FILTER | - "! A cacheable query that excludes documents that don't mention the query - "! content. Filter searches are better for metadata-type searches and for - "! assessing the concepts in the data set. - "! @parameter I_QUERY | - "! A query search returns all documents in your data set with full enrichments and - "! full text, but with the most relevant documents listed first. - "! @parameter I_COUNT | - "! Number of results to return. The maximum for the **count** and **offset** values - "! together in any one query is **10000**. - "! @parameter I_OFFSET | - "! The number of query results to skip at the beginning. For example, if the total - "! number of results that are returned is 10 and the offset is 8, it returns the - "! last two results. The maximum for the **count** and **offset** values together - "! in any one query is **10000**. - "! @parameter I_SORT | - "! A comma-separated list of fields in the document to sort on. You can optionally - "! specify a sort direction by prefixing the field with `-` for descending or `+` - "! for ascending. Ascending is the default sort direction if no prefix is - "! specified. - "! @parameter E_RESPONSE | - "! Service return value of type T_LOG_QUERY_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods QUERY_LOG - importing - !I_FILTER type STRING optional - !I_QUERY type STRING optional - !I_COUNT type INTEGER optional - !I_OFFSET type INTEGER optional - !I_SORT type TT_STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_LOG_QUERY_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Number of queries over time

- "! Total number of queries using the **natural_language_query** parameter over a - "! specific time window. - "! - "! @parameter I_START_TIME | - "! Metric is computed from data recorded after this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_END_TIME | - "! Metric is computed from data recorded before this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_RESULT_TYPE | - "! The type of result to consider when calculating the metric. - "! @parameter E_RESPONSE | - "! Service return value of type T_METRIC_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_METRICS_QUERY - importing - !I_START_TIME type DATETIME optional - !I_END_TIME type DATETIME optional - !I_RESULT_TYPE type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_METRIC_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Number of queries with an event over time

- "! Total number of queries using the **natural_language_query** parameter that have - "! a corresponding "click" event over a specified time window. This - "! metric requires having integrated event tracking in your application using the - "! **Events** API. - "! - "! @parameter I_START_TIME | - "! Metric is computed from data recorded after this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_END_TIME | - "! Metric is computed from data recorded before this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_RESULT_TYPE | - "! The type of result to consider when calculating the metric. - "! @parameter E_RESPONSE | - "! Service return value of type T_METRIC_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_METRICS_QUERY_EVENT - importing - !I_START_TIME type DATETIME optional - !I_END_TIME type DATETIME optional - !I_RESULT_TYPE type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_METRIC_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Number of queries with no search results over time

- "! Total number of queries using the **natural_language_query** parameter that have - "! no results returned over a specified time window. - "! - "! @parameter I_START_TIME | - "! Metric is computed from data recorded after this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_END_TIME | - "! Metric is computed from data recorded before this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_RESULT_TYPE | - "! The type of result to consider when calculating the metric. - "! @parameter E_RESPONSE | - "! Service return value of type T_METRIC_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_METRICS_QUERY_NO_RESULTS - importing - !I_START_TIME type DATETIME optional - !I_END_TIME type DATETIME optional - !I_RESULT_TYPE type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_METRIC_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Percentage of queries with an associated event

- "! The percentage of queries using the **natural_language_query** parameter that - "! have a corresponding "click" event over a specified time window. - "! This metric requires having integrated event tracking in your application using - "! the **Events** API. - "! - "! @parameter I_START_TIME | - "! Metric is computed from data recorded after this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_END_TIME | - "! Metric is computed from data recorded before this timestamp; must be in - "! `YYYY-MM-DDThh:mm:ssZ` format. - "! @parameter I_RESULT_TYPE | - "! The type of result to consider when calculating the metric. - "! @parameter E_RESPONSE | - "! Service return value of type T_METRIC_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_METRICS_EVENT_RATE - importing - !I_START_TIME type DATETIME optional - !I_END_TIME type DATETIME optional - !I_RESULT_TYPE type STRING optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_METRIC_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Most frequent query tokens with an event

- "! The most frequent query tokens parsed from the **natural_language_query** - "! parameter and their corresponding "click" event rate within the - "! recording period (queries and events are stored for 30 days). A query token is - "! an individual word or unigram within the query string. - "! - "! @parameter I_COUNT | - "! Number of results to return. The maximum for the **count** and **offset** values - "! together in any one query is **10000**. - "! @parameter E_RESPONSE | - "! Service return value of type T_METRIC_TOKEN_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_METRICS_QUERY_TOKEN_EVENT - importing - !I_COUNT type INTEGER optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_METRIC_TOKEN_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

List credentials

- "! List all the source credentials that have been created for this service - "! instance.
- "!
- "! **Note:** All credentials are sent over an encrypted connection and encrypted - "! at rest. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter E_RESPONSE | - "! Service return value of type T_CREDENTIALS_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_CREDENTIALS - importing - !I_ENVIRONMENT_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CREDENTIALS_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Create credentials

- "! Creates a set of credentials to connect to a remote source. Created credentials - "! are used in a configuration to associate a collection with the remote - "! source.
- "!
- "! **Note:** All credentials are sent over an encrypted connection and encrypted at - "! rest. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CREDENTIALS_PARAMETER | - "! An object that defines an individual set of source credentials. - "! @parameter E_RESPONSE | - "! Service return value of type T_CREDENTIALS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_CREDENTIALS - importing - !I_ENVIRONMENT_ID type STRING - !I_CREDENTIALS_PARAMETER type T_CREDENTIALS - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CREDENTIALS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

View Credentials

- "! Returns details about the specified credentials.
- "!
- "! **Note:** Secure credential information such as a password or SSH key is never - "! returned and must be obtained from the source system. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CREDENTIAL_ID | - "! The unique identifier for a set of source credentials. - "! @parameter E_RESPONSE | - "! Service return value of type T_CREDENTIALS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_CREDENTIALS - importing - !I_ENVIRONMENT_ID type STRING - !I_CREDENTIAL_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CREDENTIALS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update credentials

- "! Updates an existing set of source credentials.
- "!
- "! **Note:** All credentials are sent over an encrypted connection and encrypted at - "! rest. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CREDENTIAL_ID | - "! The unique identifier for a set of source credentials. - "! @parameter I_CREDENTIALS_PARAMETER | - "! An object that defines an individual set of source credentials. - "! @parameter E_RESPONSE | - "! Service return value of type T_CREDENTIALS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_CREDENTIALS - importing - !I_ENVIRONMENT_ID type STRING - !I_CREDENTIAL_ID type STRING - !I_CREDENTIALS_PARAMETER type T_CREDENTIALS - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CREDENTIALS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete credentials

- "! Deletes a set of stored credentials from your Discovery instance. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_CREDENTIAL_ID | - "! The unique identifier for a set of source credentials. - "! @parameter E_RESPONSE | - "! Service return value of type T_DELETE_CREDENTIALS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_CREDENTIALS - importing - !I_ENVIRONMENT_ID type STRING - !I_CREDENTIAL_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_DELETE_CREDENTIALS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

List Gateways

- "! List the currently configured gateways. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter E_RESPONSE | - "! Service return value of type T_GATEWAY_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_GATEWAYS - importing - !I_ENVIRONMENT_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_GATEWAY_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Create Gateway

- "! Create a gateway configuration to use with a remotely installed gateway. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_GATEWAY_NAME | - "! The name of the gateway to created. - "! @parameter E_RESPONSE | - "! Service return value of type T_GATEWAY - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_GATEWAY - importing - !I_ENVIRONMENT_ID type STRING - !I_GATEWAY_NAME type T_GATEWAY_NAME optional - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_GATEWAY - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List Gateway Details

- "! List information about the specified gateway. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_GATEWAY_ID | - "! The requested gateway ID. - "! @parameter E_RESPONSE | - "! Service return value of type T_GATEWAY - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_GATEWAY - importing - !I_ENVIRONMENT_ID type STRING - !I_GATEWAY_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_GATEWAY - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete Gateway

- "! Delete the specified gateway configuration. - "! - "! @parameter I_ENVIRONMENT_ID | - "! The ID of the environment. - "! @parameter I_GATEWAY_ID | - "! The requested gateway ID. - "! @parameter E_RESPONSE | - "! Service return value of type T_GATEWAY_DELETE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_GATEWAY - importing - !I_ENVIRONMENT_ID type STRING - !I_GATEWAY_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_GATEWAY_DELETE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_DISCOVERY_V1 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Discovery'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_DISCOVERY_V1->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.discovery.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144431'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_ENVIRONMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_BODY TYPE T_CREATE_ENVIRONMENT_REQUEST -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_ENVIRONMENT -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_ENVIRONMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_ENVIRONMENTS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_NAME TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LIST_ENVIRONMENTS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_ENVIRONMENTS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_NAME is supplied. - lv_queryparam = escape( val = i_NAME format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `name` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_ENVIRONMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_ENVIRONMENT -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_ENVIRONMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->UPDATE_ENVIRONMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_BODY TYPE T_UPDATE_ENVIRONMENT_REQUEST -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_ENVIRONMENT -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_ENVIRONMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP PUT request - lo_response = HTTP_PUT( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_ENVIRONMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DELETE_ENVIRONMENT_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_ENVIRONMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_FIELDS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_IDS TYPE TT_STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LST_COLLECTION_FIELDS_RESP -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_FIELDS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/fields'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - data: - lv_item_COLLECTION_IDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_COLLECTION_IDS into lv_item_COLLECTION_IDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_COLLECTION_IDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `collection_ids` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_CONFIGURATION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CONFIGURATION TYPE T_CONFIGURATION -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CONFIGURATION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_CONFIGURATION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/configurations'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_CONFIGURATION ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_CONFIGURATION i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'configuration' i_value = i_CONFIGURATION ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_CONFIGURATION to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_CONFIGURATIONS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_NAME TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LIST_CONFIGURATIONS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_CONFIGURATIONS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/configurations'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_NAME is supplied. - lv_queryparam = escape( val = i_NAME format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `name` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_CONFIGURATION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CONFIGURATION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CONFIGURATION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_CONFIGURATION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/configurations/{configuration_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{configuration_id}` in ls_request_prop-url-path with i_CONFIGURATION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->UPDATE_CONFIGURATION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CONFIGURATION_ID TYPE STRING -* | [--->] I_CONFIGURATION TYPE T_CONFIGURATION -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CONFIGURATION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_CONFIGURATION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/configurations/{configuration_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{configuration_id}` in ls_request_prop-url-path with i_CONFIGURATION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_CONFIGURATION ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_CONFIGURATION i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'configuration' i_value = i_CONFIGURATION ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_CONFIGURATION to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP PUT request - lo_response = HTTP_PUT( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_CONFIGURATION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CONFIGURATION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DEL_CONFIGURATION_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_CONFIGURATION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/configurations/{configuration_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{configuration_id}` in ls_request_prop-url-path with i_CONFIGURATION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_BODY TYPE T_CREATE_COLLECTION_REQUEST -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_COLLECTIONS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_NAME TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LIST_COLLECTIONS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_COLLECTIONS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_NAME is supplied. - lv_queryparam = escape( val = i_NAME format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `name` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->UPDATE_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_BODY TYPE T_UPDATE_COLLECTION_REQUEST -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP PUT request - lo_response = HTTP_PUT( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DELETE_COLLECTION_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_COLLECTION_FIELDS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LST_COLLECTION_FIELDS_RESP -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_COLLECTION_FIELDS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/fields'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_EXPANSIONS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_EXPANSIONS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_EXPANSIONS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/expansions'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_EXPANSIONS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_BODY TYPE T_EXPANSIONS -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_EXPANSIONS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_EXPANSIONS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/expansions'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_EXPANSIONS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_EXPANSIONS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/expansions'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_TOKENIZATION_DICT_STATUS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TOKEN_DICT_STATUS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_TOKENIZATION_DICT_STATUS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_TOKENIZATION_DICTIONARY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_TOKENIZATION_DICTIONARY TYPE T_TOKEN_DICT(optional) -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TOKEN_DICT_STATUS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_TOKENIZATION_DICTIONARY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - if not i_TOKENIZATION_DICTIONARY is initial. - lv_datatype = get_datatype( i_TOKENIZATION_DICTIONARY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_TOKENIZATION_DICTIONARY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'tokenization_dictionary' i_value = i_TOKENIZATION_DICTIONARY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_TOKENIZATION_DICTIONARY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_TOKENIZATION_DICTIONARY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_TOKENIZATION_DICTIONARY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_STOPWORD_LIST_STATUS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TOKEN_DICT_STATUS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_STOPWORD_LIST_STATUS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_STOPWORD_LIST -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_STOPWORD_FILE TYPE FILE -* | [--->] I_STOPWORD_FILENAME TYPE STRING -* | [--->] I_STOPWORD_FILE_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TOKEN_DICT_STATUS_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_STOPWORD_LIST. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_STOPWORD_FILE is initial. - if not I_stopword_filename is initial. - lv_value = `form-data; name="stopword_file"; filename="` && I_stopword_filename && `"` ##NO_TEXT. - else. - lv_extension = get_file_extension( I_STOPWORD_FILE_CT ). - lv_value = `form-data; name="stopword_file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - endif. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_STOPWORD_FILE_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_STOPWORD_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_STOPWORD_LIST -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_STOPWORD_LIST. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->ADD_DOCUMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_FILE TYPE FILE(optional) -* | [--->] I_FILENAME TYPE STRING(optional) -* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_METADATA TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DOCUMENT_ACCEPTED -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method ADD_DOCUMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/documents'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_METADATA is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_METADATA. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - - - if not i_FILE is initial. - if not I_filename is initial. - lv_value = `form-data; name="file"; filename="` && I_filename && `"` ##NO_TEXT. - else. - lv_extension = get_file_extension( I_file_content_type ). - lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - endif. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_DOCUMENT_STATUS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_DOCUMENT_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DOCUMENT_STATUS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_DOCUMENT_STATUS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->UPDATE_DOCUMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_DOCUMENT_ID TYPE STRING -* | [--->] I_FILE TYPE FILE(optional) -* | [--->] I_FILENAME TYPE STRING(optional) -* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_METADATA TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DOCUMENT_ACCEPTED -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_DOCUMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_METADATA is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_METADATA. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - - - if not i_FILE is initial. - if not I_filename is initial. - lv_value = `form-data; name="file"; filename="` && I_filename && `"` ##NO_TEXT. - else. - lv_extension = get_file_extension( I_file_content_type ). - lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - endif. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_file_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_DOCUMENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_DOCUMENT_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DELETE_DOCUMENT_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_DOCUMENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->QUERY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_LONG TYPE T_COLL_QUERY_LARGE(optional) -* | [--->] I_X_WATSON_LOGGING_OPT_OUT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_QUERY_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method QUERY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/query'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_X_WATSON_LOGGING_OPT_OUT is supplied. - lv_headerparam = I_X_WATSON_LOGGING_OPT_OUT. - add_header_parameter( - exporting - i_parameter = 'X-Watson-Logging-Opt-Out' - i_value = lv_headerparam - i_is_boolean = c_boolean_true - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - if not i_QUERY_LONG is initial. - lv_datatype = get_datatype( i_QUERY_LONG ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_QUERY_LONG i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'query_long' i_value = i_QUERY_LONG ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_QUERY_LONG to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->QUERY_NOTICES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_FILTER TYPE STRING(optional) -* | [--->] I_QUERY TYPE STRING(optional) -* | [--->] I_NATURAL_LANGUAGE_QUERY TYPE STRING(optional) -* | [--->] I_PASSAGES TYPE BOOLEAN(optional) -* | [--->] I_AGGREGATION TYPE STRING(optional) -* | [--->] I_COUNT TYPE INTEGER(optional) -* | [--->] I_RETURN TYPE TT_STRING(optional) -* | [--->] I_OFFSET TYPE INTEGER(optional) -* | [--->] I_SORT TYPE TT_STRING(optional) -* | [--->] I_HIGHLIGHT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_PASSAGES_FIELDS TYPE TT_STRING(optional) -* | [--->] I_PASSAGES_COUNT TYPE INTEGER(optional) -* | [--->] I_PASSAGES_CHARACTERS TYPE INTEGER(optional) -* | [--->] I_DEDUPLICATE_FIELD TYPE STRING(optional) -* | [--->] I_SIMILAR TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_SIMILAR_DOCUMENT_IDS TYPE TT_STRING(optional) -* | [--->] I_SIMILAR_FIELDS TYPE TT_STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_QUERY_NOTICES_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method QUERY_NOTICES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/notices'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_FILTER is supplied. - lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `filter` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_QUERY is supplied. - lv_queryparam = escape( val = i_QUERY format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `query` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_NATURAL_LANGUAGE_QUERY is supplied. - lv_queryparam = escape( val = i_NATURAL_LANGUAGE_QUERY format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `natural_language_query` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_PASSAGES is supplied. - lv_queryparam = i_PASSAGES. - add_query_parameter( - exporting - i_parameter = `passages` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_AGGREGATION is supplied. - lv_queryparam = escape( val = i_AGGREGATION format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `aggregation` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_COUNT is supplied. - lv_queryparam = i_COUNT. - add_query_parameter( - exporting - i_parameter = `count` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_RETURN is supplied. - data: - lv_item_RETURN type STRING. - clear: lv_queryparam, lv_sep. - loop at i_RETURN into lv_item_RETURN. - lv_queryparam = lv_queryparam && lv_sep && lv_item_RETURN. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `return` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_OFFSET is supplied. - lv_queryparam = i_OFFSET. - add_query_parameter( - exporting - i_parameter = `offset` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SORT is supplied. - data: - lv_item_SORT type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SORT into lv_item_SORT. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SORT. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `sort` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_HIGHLIGHT is supplied. - lv_queryparam = i_HIGHLIGHT. - add_query_parameter( - exporting - i_parameter = `highlight` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_PASSAGES_FIELDS is supplied. - data: - lv_item_PASSAGES_FIELDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_PASSAGES_FIELDS into lv_item_PASSAGES_FIELDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_PASSAGES_FIELDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `passages.fields` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_PASSAGES_COUNT is supplied. - lv_queryparam = i_PASSAGES_COUNT. - add_query_parameter( - exporting - i_parameter = `passages.count` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_PASSAGES_CHARACTERS is supplied. - lv_queryparam = i_PASSAGES_CHARACTERS. - add_query_parameter( - exporting - i_parameter = `passages.characters` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_DEDUPLICATE_FIELD is supplied. - lv_queryparam = escape( val = i_DEDUPLICATE_FIELD format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `deduplicate.field` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SIMILAR is supplied. - lv_queryparam = i_SIMILAR. - add_query_parameter( - exporting - i_parameter = `similar` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SIMILAR_DOCUMENT_IDS is supplied. - data: - lv_item_SIMILAR_DOCUMENT_IDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SIMILAR_DOCUMENT_IDS into lv_item_SIMILAR_DOCUMENT_IDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SIMILAR_DOCUMENT_IDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `similar.document_ids` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SIMILAR_FIELDS is supplied. - data: - lv_item_SIMILAR_FIELDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SIMILAR_FIELDS into lv_item_SIMILAR_FIELDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SIMILAR_FIELDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `similar.fields` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->FEDERATED_QUERY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_QUERY_LONG TYPE T_FED_QUERY_LARGE -* | [--->] I_X_WATSON_LOGGING_OPT_OUT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_QUERY_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method FEDERATED_QUERY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/query'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_X_WATSON_LOGGING_OPT_OUT is supplied. - lv_headerparam = I_X_WATSON_LOGGING_OPT_OUT. - add_header_parameter( - exporting - i_parameter = 'X-Watson-Logging-Opt-Out' - i_value = lv_headerparam - i_is_boolean = c_boolean_true - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_QUERY_LONG ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_QUERY_LONG i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'query_long' i_value = i_QUERY_LONG ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_QUERY_LONG to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->FEDERATED_QUERY_NOTICES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_IDS TYPE TT_STRING -* | [--->] I_FILTER TYPE STRING(optional) -* | [--->] I_QUERY TYPE STRING(optional) -* | [--->] I_NATURAL_LANGUAGE_QUERY TYPE STRING(optional) -* | [--->] I_AGGREGATION TYPE STRING(optional) -* | [--->] I_COUNT TYPE INTEGER(optional) -* | [--->] I_RETURN TYPE TT_STRING(optional) -* | [--->] I_OFFSET TYPE INTEGER(optional) -* | [--->] I_SORT TYPE TT_STRING(optional) -* | [--->] I_HIGHLIGHT TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_DEDUPLICATE_FIELD TYPE STRING(optional) -* | [--->] I_SIMILAR TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_SIMILAR_DOCUMENT_IDS TYPE TT_STRING(optional) -* | [--->] I_SIMILAR_FIELDS TYPE TT_STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_QUERY_NOTICES_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method FEDERATED_QUERY_NOTICES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/notices'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - data: - lv_item_COLLECTION_IDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_COLLECTION_IDS into lv_item_COLLECTION_IDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_COLLECTION_IDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `collection_ids` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - if i_FILTER is supplied. - lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `filter` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_QUERY is supplied. - lv_queryparam = escape( val = i_QUERY format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `query` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_NATURAL_LANGUAGE_QUERY is supplied. - lv_queryparam = escape( val = i_NATURAL_LANGUAGE_QUERY format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `natural_language_query` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_AGGREGATION is supplied. - lv_queryparam = escape( val = i_AGGREGATION format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `aggregation` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_COUNT is supplied. - lv_queryparam = i_COUNT. - add_query_parameter( - exporting - i_parameter = `count` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_RETURN is supplied. - data: - lv_item_RETURN type STRING. - clear: lv_queryparam, lv_sep. - loop at i_RETURN into lv_item_RETURN. - lv_queryparam = lv_queryparam && lv_sep && lv_item_RETURN. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `return` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_OFFSET is supplied. - lv_queryparam = i_OFFSET. - add_query_parameter( - exporting - i_parameter = `offset` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SORT is supplied. - data: - lv_item_SORT type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SORT into lv_item_SORT. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SORT. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `sort` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_HIGHLIGHT is supplied. - lv_queryparam = i_HIGHLIGHT. - add_query_parameter( - exporting - i_parameter = `highlight` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_DEDUPLICATE_FIELD is supplied. - lv_queryparam = escape( val = i_DEDUPLICATE_FIELD format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `deduplicate.field` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SIMILAR is supplied. - lv_queryparam = i_SIMILAR. - add_query_parameter( - exporting - i_parameter = `similar` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SIMILAR_DOCUMENT_IDS is supplied. - data: - lv_item_SIMILAR_DOCUMENT_IDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SIMILAR_DOCUMENT_IDS into lv_item_SIMILAR_DOCUMENT_IDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SIMILAR_DOCUMENT_IDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `similar.document_ids` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SIMILAR_FIELDS is supplied. - data: - lv_item_SIMILAR_FIELDS type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SIMILAR_FIELDS into lv_item_SIMILAR_FIELDS. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SIMILAR_FIELDS. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `similar.fields` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_AUTOCOMPLETION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_PREFIX TYPE STRING -* | [--->] I_FIELD TYPE STRING(optional) -* | [--->] I_COUNT TYPE INTEGER(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COMPLETIONS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_AUTOCOMPLETION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/autocompletion'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_PREFIX format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `prefix` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - if i_FIELD is supplied. - lv_queryparam = escape( val = i_FIELD format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `field` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_COUNT is supplied. - lv_queryparam = i_COUNT. - add_query_parameter( - exporting - i_parameter = `count` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_TRAINING_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_DATA_SET -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_TRAINING_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->ADD_TRAINING_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_BODY TYPE T_NEW_TRAINING_QUERY -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_QUERY -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method ADD_TRAINING_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_ALL_TRAINING_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_ALL_TRAINING_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_TRAINING_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_QUERY -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_TRAINING_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_TRAINING_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_TRAINING_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_TRAINING_EXAMPLES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_EXAMPLE_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_TRAINING_EXAMPLES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_TRAINING_EXAMPLE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [--->] I_BODY TYPE T_TRAINING_EXAMPLE -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_EXAMPLE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_TRAINING_EXAMPLE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_TRAINING_EXAMPLE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [--->] I_EXAMPLE_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_TRAINING_EXAMPLE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - replace all occurrences of `{example_id}` in ls_request_prop-url-path with i_EXAMPLE_ID ignoring case. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->UPDATE_TRAINING_EXAMPLE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [--->] I_EXAMPLE_ID TYPE STRING -* | [--->] I_BODY TYPE T_TRAINING_EXAMPLE_PATCH -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_EXAMPLE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_TRAINING_EXAMPLE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - replace all occurrences of `{example_id}` in ls_request_prop-url-path with i_EXAMPLE_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP PUT request - lo_response = HTTP_PUT( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_TRAINING_EXAMPLE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_QUERY_ID TYPE STRING -* | [--->] I_EXAMPLE_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_EXAMPLE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_TRAINING_EXAMPLE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. - replace all occurrences of `{example_id}` in ls_request_prop-url-path with i_EXAMPLE_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_USER_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CUSTOMER_ID TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_USER_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/user_data'. - - " standard headers - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_CUSTOMER_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `customer_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_EVENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_QUERY_EVENT TYPE T_CREATE_EVENT_OBJECT -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CREATE_EVENT_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_EVENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/events'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_QUERY_EVENT ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_QUERY_EVENT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'query_event' i_value = i_QUERY_EVENT ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_QUERY_EVENT to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->QUERY_LOG -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_FILTER TYPE STRING(optional) -* | [--->] I_QUERY TYPE STRING(optional) -* | [--->] I_COUNT TYPE INTEGER(optional) -* | [--->] I_OFFSET TYPE INTEGER(optional) -* | [--->] I_SORT TYPE TT_STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_LOG_QUERY_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method QUERY_LOG. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/logs'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_FILTER is supplied. - lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `filter` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_QUERY is supplied. - lv_queryparam = escape( val = i_QUERY format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `query` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_COUNT is supplied. - lv_queryparam = i_COUNT. - add_query_parameter( - exporting - i_parameter = `count` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_OFFSET is supplied. - lv_queryparam = i_OFFSET. - add_query_parameter( - exporting - i_parameter = `offset` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_SORT is supplied. - data: - lv_item_SORT type STRING. - clear: lv_queryparam, lv_sep. - loop at i_SORT into lv_item_SORT. - lv_queryparam = lv_queryparam && lv_sep && lv_item_SORT. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `sort` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_METRICS_QUERY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_START_TIME TYPE DATETIME(optional) -* | [--->] I_END_TIME TYPE DATETIME(optional) -* | [--->] I_RESULT_TYPE TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_METRIC_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_METRICS_QUERY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/metrics/number_of_queries'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_START_TIME is supplied. - lv_queryparam = i_START_TIME. - add_query_parameter( - exporting - i_parameter = `start_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_END_TIME is supplied. - lv_queryparam = i_END_TIME. - add_query_parameter( - exporting - i_parameter = `end_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_RESULT_TYPE is supplied. - lv_queryparam = escape( val = i_RESULT_TYPE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `result_type` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_METRICS_QUERY_EVENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_START_TIME TYPE DATETIME(optional) -* | [--->] I_END_TIME TYPE DATETIME(optional) -* | [--->] I_RESULT_TYPE TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_METRIC_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_METRICS_QUERY_EVENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/metrics/number_of_queries_with_event'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_START_TIME is supplied. - lv_queryparam = i_START_TIME. - add_query_parameter( - exporting - i_parameter = `start_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_END_TIME is supplied. - lv_queryparam = i_END_TIME. - add_query_parameter( - exporting - i_parameter = `end_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_RESULT_TYPE is supplied. - lv_queryparam = escape( val = i_RESULT_TYPE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `result_type` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_METRICS_QUERY_NO_RESULTS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_START_TIME TYPE DATETIME(optional) -* | [--->] I_END_TIME TYPE DATETIME(optional) -* | [--->] I_RESULT_TYPE TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_METRIC_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_METRICS_QUERY_NO_RESULTS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/metrics/number_of_queries_with_no_search_results'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_START_TIME is supplied. - lv_queryparam = i_START_TIME. - add_query_parameter( - exporting - i_parameter = `start_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_END_TIME is supplied. - lv_queryparam = i_END_TIME. - add_query_parameter( - exporting - i_parameter = `end_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_RESULT_TYPE is supplied. - lv_queryparam = escape( val = i_RESULT_TYPE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `result_type` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_METRICS_EVENT_RATE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_START_TIME TYPE DATETIME(optional) -* | [--->] I_END_TIME TYPE DATETIME(optional) -* | [--->] I_RESULT_TYPE TYPE STRING(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_METRIC_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_METRICS_EVENT_RATE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/metrics/event_rate'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_START_TIME is supplied. - lv_queryparam = i_START_TIME. - add_query_parameter( - exporting - i_parameter = `start_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_END_TIME is supplied. - lv_queryparam = i_END_TIME. - add_query_parameter( - exporting - i_parameter = `end_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_RESULT_TYPE is supplied. - lv_queryparam = escape( val = i_RESULT_TYPE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `result_type` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_METRICS_QUERY_TOKEN_EVENT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COUNT TYPE INTEGER(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_METRIC_TOKEN_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_METRICS_QUERY_TOKEN_EVENT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/metrics/top_query_tokens_with_event_rate'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_COUNT is supplied. - lv_queryparam = i_COUNT. - add_query_parameter( - exporting - i_parameter = `count` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_CREDENTIALS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CREDENTIALS_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_CREDENTIALS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/credentials'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_CREDENTIALS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CREDENTIALS_PARAMETER TYPE T_CREDENTIALS -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CREDENTIALS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_CREDENTIALS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/credentials'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_CREDENTIALS_PARAMETER ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_CREDENTIALS_PARAMETER i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'credentials_parameter' i_value = i_CREDENTIALS_PARAMETER ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_CREDENTIALS_PARAMETER to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_CREDENTIALS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CREDENTIAL_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CREDENTIALS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_CREDENTIALS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/credentials/{credential_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{credential_id}` in ls_request_prop-url-path with i_CREDENTIAL_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->UPDATE_CREDENTIALS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CREDENTIAL_ID TYPE STRING -* | [--->] I_CREDENTIALS_PARAMETER TYPE T_CREDENTIALS -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CREDENTIALS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_CREDENTIALS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/credentials/{credential_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{credential_id}` in ls_request_prop-url-path with i_CREDENTIAL_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_CREDENTIALS_PARAMETER ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_CREDENTIALS_PARAMETER i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'credentials_parameter' i_value = i_CREDENTIALS_PARAMETER ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_CREDENTIALS_PARAMETER to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP PUT request - lo_response = HTTP_PUT( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_CREDENTIALS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_CREDENTIAL_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_DELETE_CREDENTIALS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_CREDENTIALS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/credentials/{credential_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{credential_id}` in ls_request_prop-url-path with i_CREDENTIAL_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->LIST_GATEWAYS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_GATEWAY_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_GATEWAYS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/gateways'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->CREATE_GATEWAY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_GATEWAY_NAME TYPE T_GATEWAY_NAME(optional) -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_GATEWAY -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_GATEWAY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/gateways'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - if not i_GATEWAY_NAME is initial. - lv_datatype = get_datatype( i_GATEWAY_NAME ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_GATEWAY_NAME i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'gateway_name' i_value = i_GATEWAY_NAME ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_GATEWAY_NAME to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->GET_GATEWAY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_GATEWAY_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_GATEWAY -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_GATEWAY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/gateways/{gateway_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{gateway_id}` in ls_request_prop-url-path with i_GATEWAY_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_DISCOVERY_V1->DELETE_GATEWAY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_ENVIRONMENT_ID TYPE STRING -* | [--->] I_GATEWAY_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_GATEWAY_DELETE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_GATEWAY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/environments/{environment_id}/gateways/{gateway_id}'. - replace all occurrences of `{environment_id}` in ls_request_prop-url-path with i_ENVIRONMENT_ID ignoring case. - replace all occurrences of `{gateway_id}` in ls_request_prop-url-path with i_GATEWAY_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_discovery_v1.clas.xml b/src/zcl_ibmc_discovery_v1.clas.xml deleted file mode 100644 index fe06a48..0000000 --- a/src/zcl_ibmc_discovery_v1.clas.xml +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - ZCL_IBMC_DISCOVERY_V1 - E - Discovery - 1 - X - X - X - - - - ZCL_IBMC_DISCOVERY_V1 - ADD_DOCUMENT - E - Add a document - - - ZCL_IBMC_DISCOVERY_V1 - ADD_TRAINING_DATA - E - Add query to training data - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_COLLECTION - E - Create a collection - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_CONFIGURATION - E - Add configuration - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_CREDENTIALS - E - Create credentials - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_ENVIRONMENT - E - Create an environment - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_EVENT - E - Create event - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_EXPANSIONS - E - Create or update expansion list - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_GATEWAY - E - Create Gateway - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_STOPWORD_LIST - E - Create stopword list - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_TOKENIZATION_DICTIONARY - E - Create tokenization dictionary - - - ZCL_IBMC_DISCOVERY_V1 - CREATE_TRAINING_EXAMPLE - E - Add example to training data query - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_ALL_TRAINING_DATA - E - Delete all training data - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_COLLECTION - E - Delete a collection - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_CONFIGURATION - E - Delete a configuration - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_CREDENTIALS - E - Delete credentials - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_DOCUMENT - E - Delete a document - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_ENVIRONMENT - E - Delete environment - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_EXPANSIONS - E - Delete the expansion list - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_GATEWAY - E - Delete Gateway - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_STOPWORD_LIST - E - Delete a custom stopword list - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_TOKENIZATION_DICTIONARY - E - Delete tokenization dictionary - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_TRAINING_DATA - E - Delete a training data query - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_TRAINING_EXAMPLE - E - Delete example for training data query - - - ZCL_IBMC_DISCOVERY_V1 - DELETE_USER_DATA - E - Delete labeled data - - - ZCL_IBMC_DISCOVERY_V1 - FEDERATED_QUERY - E - Query multiple collections - - - ZCL_IBMC_DISCOVERY_V1 - FEDERATED_QUERY_NOTICES - E - Query multiple collection system notices - - - ZCL_IBMC_DISCOVERY_V1 - GET_AUTOCOMPLETION - E - Get Autocomplete Suggestions - - - ZCL_IBMC_DISCOVERY_V1 - GET_COLLECTION - E - Get collection details - - - ZCL_IBMC_DISCOVERY_V1 - GET_CONFIGURATION - E - Get configuration details - - - ZCL_IBMC_DISCOVERY_V1 - GET_CREDENTIALS - E - View Credentials - - - ZCL_IBMC_DISCOVERY_V1 - GET_DOCUMENT_STATUS - E - Get document details - - - ZCL_IBMC_DISCOVERY_V1 - GET_ENVIRONMENT - E - Get environment info - - - ZCL_IBMC_DISCOVERY_V1 - GET_GATEWAY - E - List Gateway Details - - - ZCL_IBMC_DISCOVERY_V1 - GET_METRICS_EVENT_RATE - E - Percentage of queries with an associated event - - - ZCL_IBMC_DISCOVERY_V1 - GET_METRICS_QUERY - E - Number of queries over time - - - ZCL_IBMC_DISCOVERY_V1 - GET_METRICS_QUERY_EVENT - E - Number of queries with an event over time - - - ZCL_IBMC_DISCOVERY_V1 - GET_METRICS_QUERY_NO_RESULTS - E - Number of queries with no search results over time - - - ZCL_IBMC_DISCOVERY_V1 - GET_METRICS_QUERY_TOKEN_EVENT - E - Most frequent query tokens with an event - - - ZCL_IBMC_DISCOVERY_V1 - GET_STOPWORD_LIST_STATUS - E - Get stopword list status - - - ZCL_IBMC_DISCOVERY_V1 - GET_TOKENIZATION_DICT_STATUS - E - Get tokenization dictionary status - - - ZCL_IBMC_DISCOVERY_V1 - GET_TRAINING_DATA - E - Get details about a query - - - ZCL_IBMC_DISCOVERY_V1 - GET_TRAINING_EXAMPLE - E - Get details for training data example - - - ZCL_IBMC_DISCOVERY_V1 - LIST_COLLECTIONS - E - List collections - - - ZCL_IBMC_DISCOVERY_V1 - LIST_COLLECTION_FIELDS - E - List collection fields - - - ZCL_IBMC_DISCOVERY_V1 - LIST_CONFIGURATIONS - E - List configurations - - - ZCL_IBMC_DISCOVERY_V1 - LIST_CREDENTIALS - E - List credentials - - - ZCL_IBMC_DISCOVERY_V1 - LIST_ENVIRONMENTS - E - List environments - - - ZCL_IBMC_DISCOVERY_V1 - LIST_EXPANSIONS - E - Get the expansion list - - - ZCL_IBMC_DISCOVERY_V1 - LIST_FIELDS - E - List fields across collections - - - ZCL_IBMC_DISCOVERY_V1 - LIST_GATEWAYS - E - List Gateways - - - ZCL_IBMC_DISCOVERY_V1 - LIST_TRAINING_DATA - E - List training data - - - ZCL_IBMC_DISCOVERY_V1 - LIST_TRAINING_EXAMPLES - E - List examples for a training data query - - - ZCL_IBMC_DISCOVERY_V1 - QUERY - E - Query a collection - - - ZCL_IBMC_DISCOVERY_V1 - QUERY_LOG - E - Search the query and event log - - - ZCL_IBMC_DISCOVERY_V1 - QUERY_NOTICES - E - Query system notices - - - ZCL_IBMC_DISCOVERY_V1 - UPDATE_COLLECTION - E - Update a collection - - - ZCL_IBMC_DISCOVERY_V1 - UPDATE_CONFIGURATION - E - Update a configuration - - - ZCL_IBMC_DISCOVERY_V1 - UPDATE_CREDENTIALS - E - Update credentials - - - ZCL_IBMC_DISCOVERY_V1 - UPDATE_DOCUMENT - E - Update a document - - - ZCL_IBMC_DISCOVERY_V1 - UPDATE_ENVIRONMENT - E - Update an environment - - - ZCL_IBMC_DISCOVERY_V1 - UPDATE_TRAINING_EXAMPLE - E - Change label or cross reference for example - - - - - diff --git a/src/zcl_ibmc_discovery_v2.clas.abap b/src/zcl_ibmc_discovery_v2.clas.abap new file mode 100644 index 0000000..34dcd9a --- /dev/null +++ b/src/zcl_ibmc_discovery_v2.clas.abap @@ -0,0 +1,7563 @@ +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +"!

Discovery v2

+"! IBM Watson® Discovery is a cognitive search and content analytics engine +"! that you can add to applications to identify patterns, trends and actionable +"! insights to drive better decision-making. Securely unify structured and +"! unstructured data with pre-enriched content, and use a simplified query +"! language to eliminate the need for manual filtering of results.
+class ZCL_IBMC_DISCOVERY_V2 DEFINITION + public + inheriting from ZCL_IBMC_SERVICE_EXT + create public . + +public section. + types: + "!

+ "! A macro-average computes metric independently for each class

+ "! and then takes the average. Class refers to the classification label that is + "! specified in the **answer_field**. + begin of T_MDL_EVALUATION_MACRO_AVERAGE, + "! A metric that measures how many of the overall documents are classified + "! correctly. + PRECISION type DOUBLE, + "! A metric that measures how often documents that should be classified into + "! certain classes are classified into those classes. + RECALL type DOUBLE, + "! A metric that measures whether the optimal balance between precision and recall + "! is reached. The F1 score can be interpreted as a weighted average of the + "! precision and recall values. An F1 score reaches its best value at 1 and worst + "! value at 0. + F1 type DOUBLE, + end of T_MDL_EVALUATION_MACRO_AVERAGE. + types: + "!

+ "! An object that measures the metrics from a training run for

+ "! each classification label separately. + begin of T_PER_CLASS_MODEL_EVALUATION, + "! Class name. Each class name is derived from a value in the **answer_field**. + NAME type STRING, + "! A metric that measures how many of the overall documents are classified + "! correctly. + PRECISION type DOUBLE, + "! A metric that measures how often documents that should be classified into + "! certain classes are classified into those classes. + RECALL type DOUBLE, + "! A metric that measures whether the optimal balance between precision and recall + "! is reached. The F1 score can be interpreted as a weighted average of the + "! precision and recall values. An F1 score reaches its best value at 1 and worst + "! value at 0. + F1 type DOUBLE, + end of T_PER_CLASS_MODEL_EVALUATION. + types: + "!

+ "! A micro-average aggregates the contributions of all classes

+ "! to compute the average metric. Classes refers to the classification labels that + "! are specified in the **answer_field**. + begin of T_MDL_EVALUATION_MICRO_AVERAGE, + "! A metric that measures how many of the overall documents are classified + "! correctly. + PRECISION type DOUBLE, + "! A metric that measures how often documents that should be classified into + "! certain classes are classified into those classes. + RECALL type DOUBLE, + "! A metric that measures whether the optimal balance between precision and recall + "! is reached. The F1 score can be interpreted as a weighted average of the + "! precision and recall values. An F1 score reaches its best value at 1 and worst + "! value at 0. + F1 type DOUBLE, + end of T_MDL_EVALUATION_MICRO_AVERAGE. + types: + "!

+ "! An object that contains information about a trained document

+ "! classifier model. + begin of T_CLASSIFIER_MODEL_EVALUATION, + "! A micro-average aggregates the contributions of all classes to compute the + "! average metric. Classes refers to the classification labels that are specified + "! in the **answer_field**. + MICRO_AVERAGE type T_MDL_EVALUATION_MICRO_AVERAGE, + "! A macro-average computes metric independently for each class and then takes the + "! average. Class refers to the classification label that is specified in the + "! **answer_field**. + MACRO_AVERAGE type T_MDL_EVALUATION_MACRO_AVERAGE, + "! An array of evaluation metrics, one set of metrics for each class, where class + "! refers to the classification label that is specified in the **answer_field**. + PER_CLASS type STANDARD TABLE OF T_PER_CLASS_MODEL_EVALUATION WITH NON-UNIQUE DEFAULT KEY, + end of T_CLASSIFIER_MODEL_EVALUATION. + types: + "!

+ "! Information about a document classifier model.

+ begin of T_DOCUMENT_CLASSIFIER_MODEL, + "! A unique identifier of the document classifier model. + MODEL_ID type STRING, + "! A human-readable name of the document classifier model. + NAME type STRING, + "! A description of the document classifier model. + DESCRIPTION type STRING, + "! The date that the document classifier model was created. + CREATED type DATETIME, + "! The date that the document classifier model was last updated. + UPDATED type DATETIME, + "! Name of the CSV file that contains the training data that is used to train the + "! document classifier model. + TRAINING_DATA_FILE type STRING, + "! Name of the CSV file that contains data that is used to test the document + "! classifier model. If no test data is provided, a subset of the training data is + "! used for testing purposes. + TEST_DATA_FILE type STRING, + "! The status of the training run. + STATUS type STRING, + "! An object that contains information about a trained document classifier model. + EVALUATION type T_CLASSIFIER_MODEL_EVALUATION, + "! A unique identifier of the enrichment that is generated by this document + "! classifier model. + ENRICHMENT_ID type STRING, + "! The date that the document classifier model was deployed. + DEPLOYED_AT type DATETIME, + end of T_DOCUMENT_CLASSIFIER_MODEL. + types: + "!

+ "! Relevancy training status information for this project.

+ begin of T_PRJCT_LST_DTLS_RLVNCY_TRNNG1, + "! When the training data was updated. + DATA_UPDATED type STRING, + "! The total number of examples. + TOTAL_EXAMPLES type INTEGER, + "! When `true`, sufficient label diversity is present to allow training for this + "! project. + SUFFICIENT_LABEL_DIVERSITY type BOOLEAN, + "! When `true`, the relevancy training is in processing. + PROCESSING type BOOLEAN, + "! When `true`, the minimum number of examples required to train has been met. + MINIMUM_EXAMPLES_ADDED type BOOLEAN, + "! The time that the most recent successful training occurred. + SUCCESSFULLY_TRAINED type STRING, + "! When `true`, relevancy training is available when querying collections in the + "! project. + AVAILABLE type BOOLEAN, + "! The number of notices generated during the relevancy training. + NOTICES type INTEGER, + "! When `true`, the minimum number of queries required to train has been met. + MINIMUM_QUERIES_ADDED type BOOLEAN, + end of T_PRJCT_LST_DTLS_RLVNCY_TRNNG1. + types: + "!

+ "! Details about a specific project.

+ begin of T_PROJECT_LIST_DETAILS, + "! The unique identifier of this project. + PROJECT_ID type STRING, + "! The human readable name of this project. + NAME type STRING, + "! 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. + TYPE type STRING, + "! Relevancy training status information for this project. + RELEVANCY_TRAINING_STATUS type T_PRJCT_LST_DTLS_RLVNCY_TRNNG1, + "! The number of collections configured in this project. + COLLECTION_COUNT type INTEGER, + end of T_PROJECT_LIST_DETAILS. + types: + "!

+ "! A list of projects in this instance.

+ begin of T_LIST_PROJECTS_RESPONSE, + "! An array of project details. + PROJECTS type STANDARD TABLE OF T_PROJECT_LIST_DETAILS WITH NON-UNIQUE DEFAULT KEY, + end of T_LIST_PROJECTS_RESPONSE. + types: + "!

+ "! Result for the `pair` aggregation.

+ begin of T_QUERY_PAIR_AGGR_RESULT, + "! Array of subaggregations of type `term`, `group_by`, `histogram`, or + "! `timeslice`. Each element of the matrix that is returned contains a + "! **relevancy** value that is calculated from the combination of each value from + "! the first and second aggregations. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_PAIR_AGGR_RESULT. + types: + "!

+ "! Calculates relevancy values using combinations of document

+ "! sets from results of the specified pair of aggregations. + begin of T_QUERY_AGGR_QUERY_PAIR_AGGR, + "! Specifies that the aggregation type is `pair`. + TYPE type STRING, + "! Specifies the first aggregation in the pair. The aggregation must be a `term`, + "! `group_by`, `histogram`, or `timeslice` aggregation type. + FIRST type STRING, + "! Specifies the second aggregation in the pair. The aggregation must be a `term`, + "! `group_by`, `histogram`, or `timeslice` aggregation type. + SECOND type STRING, + "! Indicates whether to include estimated matching result information. + SHW_ESTIMATED_MATCHING_RESULTS type BOOLEAN, + "! Indicates whether to include total matching documents information. + SHOW_TOTAL_MATCHING_DOCUMENTS type BOOLEAN, + "! An array of aggregations. + RESULTS type STANDARD TABLE OF T_QUERY_PAIR_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_AGGR_QUERY_PAIR_AGGR. + types: + "!

+ "! Configuration for table retrieval.

+ begin of T_QUERY_LARGE_TABLE_RESULTS, + "! Whether to enable table retrieval. + ENABLED type BOOLEAN, + "! Maximum number of tables to return. + COUNT type INTEGER, + end of T_QUERY_LARGE_TABLE_RESULTS. + types: + "!

+ "! Result information for a curated query.

+ begin of T_CURATION_RESULT, + "! The document ID of the curated result. + DOCUMENT_ID type STRING, + "! The collection ID of the curated result. + COLLECTION_ID type STRING, + "! Text to return in the `passage_text` field when this curated document is + "! returned for the specified natural language query. If **passages.per_document** + "! is `true`, the text snippet that you specify is returned as the top passage + "! instead of the original passage that is chosen by search. Only one text snippet + "! can be specified per document. If **passages.max_per_document** is greater than + "! `1`, the snippet is returned first, followed by the passages that are chosen by + "! search. + SNIPPET type STRING, + end of T_CURATION_RESULT. + types: + "!

+ "! Object that contains an array of curated results.

+ begin of T_CURATED_RESULTS, + "! Array of curated results. + CURATED_RESULTS type STANDARD TABLE OF T_CURATION_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_CURATED_RESULTS. + types: + "!

+ "! The numeric location of the identified element in the

+ "! document, represented with two integers labeled `begin` and `end`. + begin of T_TABLE_ELEMENT_LOCATION, + "! The element's `begin` index. + BEGIN type LONG, + "! The element's `end` index. + END type LONG, + end of T_TABLE_ELEMENT_LOCATION. + types: + "!

+ "! Object that contains example response details for a training

+ "! query. + begin of T_TRAINING_EXAMPLE, + "! The document ID associated with this training example. + DOCUMENT_ID type STRING, + "! The collection ID associated with this training example. + COLLECTION_ID type STRING, + "! The relevance of the training example. + RELEVANCE type INTEGER, + "! The date and time the example was created. + CREATED type DATETIME, + "! The date and time the example was updated. + UPDATED type DATETIME, + end of T_TRAINING_EXAMPLE. + types: + "!

+ "! Object that contains training query details.

+ begin of T_TRAINING_QUERY, + "! The query ID associated with the training query. + QUERY_ID type STRING, + "! The natural text query that is used as the training query. + NATURAL_LANGUAGE_QUERY type STRING, + "! The filter used on the collection before the **natural_language_query** is + "! applied. + FILTER type STRING, + "! The date and time the query was created. + CREATED type DATETIME, + "! The date and time the query was updated. + UPDATED type DATETIME, + "! Array of training examples. + EXAMPLES type STANDARD TABLE OF T_TRAINING_EXAMPLE WITH NON-UNIQUE DEFAULT KEY, + end of T_TRAINING_QUERY. + types: + "!

+ "! A value in a key-value pair.

+ begin of T_TABLE_CELL_VALUES, + "! The unique ID of the value in the table. + CELL_ID type STRING, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + "! The text content of the table cell without HTML markup. + TEXT type STRING, + end of T_TABLE_CELL_VALUES. + types: + "!

+ "! A key in a key-value pair.

+ begin of T_TABLE_CELL_KEY, + "! The unique ID of the key in the table. + CELL_ID type STRING, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + "! The text content of the table cell without HTML markup. + TEXT type STRING, + end of T_TABLE_CELL_KEY. + types: + "!

+ "! Key-value pairs detected across cell boundaries.

+ begin of T_TABLE_KEY_VALUE_PAIRS, + "! A key in a key-value pair. + KEY type T_TABLE_CELL_KEY, + "! A list of values in a key-value pair. + VALUE type STANDARD TABLE OF T_TABLE_CELL_VALUES WITH NON-UNIQUE DEFAULT KEY, + end of T_TABLE_KEY_VALUE_PAIRS. + types: + "!

+ "! Aggregation results. For more information about supported

+ "! aggregation types, see the [product + "! documentation](/docs/discovery-data?topic=discovery-data-query-aggregations). + T_QUERY_SUB_AGGREGATION type JSONOBJECT. + types: + "!

+ "! Curation status information.

+ begin of T_CURATION_STATUS, + "! The curation ID of the curation. + CURATION_ID type STRING, + "! The current status of the specified curation. + STATUS type STRING, + end of T_CURATION_STATUS. + types: + "!

+ "! A query response that contains the matching documents for

+ "! the preceding aggregations. + begin of T_QUERY_TOP_HITS_AGGR_RESULT, + "! Number of matching results. + MATCHING_RESULTS type INTEGER, + "! An array of the document results in an ordered list. + HITS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TOP_HITS_AGGR_RESULT. + types: + "!

+ "! Curated query and responses.

+ begin of T_CURATION, + "! The curation ID of this curation. + CURATION_ID type STRING, + "! The curated natural language query. + NATURAL_LANGUAGE_QUERY type STRING, + "! Array of curated results. + CURATED_RESULTS type STANDARD TABLE OF T_CURATION_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_CURATION. + types: + "!

+ "! Title label.

+ begin of T_CMPNNT_STTNGS_FLDS_SHWN_TTL, + "! Use a specific field as the title. + FIELD type STRING, + end of T_CMPNNT_STTNGS_FLDS_SHWN_TTL. + types: + "!

+ "! Display settings for aggregations.

+ begin of T_COMPONENT_SETTINGS_AGGR, + "! Identifier used to map aggregation settings to aggregation configuration. + NAME type STRING, + "! User-friendly alias for the aggregation. + LABEL type STRING, + "! Whether users is allowed to select more than one of the aggregation terms. + MULTIPLE_SELECTIONS_ALLOWED type BOOLEAN, + "! Type of visualization to use when rendering the aggregation. + VISUALIZATION_TYPE type STRING, + end of T_COMPONENT_SETTINGS_AGGR. + types: + "!

+ "! Body label.

+ begin of T_CMPNNT_STTNGS_FLDS_SHWN_BODY, + "! Use the whole passage as the body. + USE_PASSAGE type BOOLEAN, + "! Use a specific field as the title. + FIELD type STRING, + end of T_CMPNNT_STTNGS_FLDS_SHWN_BODY. + types: + "!

+ "! Fields shown in the results section of the UI.

+ begin of T_CMPNNT_SETTINGS_FIELDS_SHOWN, + "! Body label. + BODY type T_CMPNNT_STTNGS_FLDS_SHWN_BODY, + "! Title label. + TITLE type T_CMPNNT_STTNGS_FLDS_SHWN_TTL, + end of T_CMPNNT_SETTINGS_FIELDS_SHOWN. + types: + "!

+ "! The default component settings for this project.

+ begin of T_COMPONENT_SETTINGS_RESPONSE, + "! Fields shown in the results section of the UI. + FIELDS_SHOWN type T_CMPNNT_SETTINGS_FIELDS_SHOWN, + "! Whether or not autocomplete is enabled. + AUTOCOMPLETE type BOOLEAN, + "! Whether or not structured search is enabled. + STRUCTURED_SEARCH type BOOLEAN, + "! Number or results shown per page. + RESULTS_PER_PAGE type INTEGER, + "! a list of component setting aggregations. + AGGREGATIONS type STANDARD TABLE OF T_COMPONENT_SETTINGS_AGGR WITH NON-UNIQUE DEFAULT KEY, + end of T_COMPONENT_SETTINGS_RESPONSE. + types: + "!

+ "! Object that contains suggested refinement settings.


+ "!
+ "! **Note**: The `suggested_refinements` parameter that identified dynamic facets + "! from the data is deprecated. + begin of T_DFLT_QRY_PRMS_SGGSTD_RFNMNTS, + "! When `true`, suggested refinements for the query are returned by default. + ENABLED type BOOLEAN, + "! The number of suggested refinements to return by default. + COUNT type INTEGER, + end of T_DFLT_QRY_PRMS_SGGSTD_RFNMNTS. + types: + "!

+ "! Default project query settings for table results.

+ begin of T_DFLT_QRY_PARAMS_TAB_RESULTS, + "! When `true`, a table results for the query are returned by default. + ENABLED type BOOLEAN, + "! The number of table results to return by default. + COUNT type INTEGER, + "! The number of table results to include in each result document. + PER_DOCUMENT type INTEGER, + end of T_DFLT_QRY_PARAMS_TAB_RESULTS. + types: + "!

+ "! Default settings configuration for passage search options.

+ begin of T_DFLT_QUERY_PARAMS_PASSAGES, + "! When `true`, a passage search is performed by default. + ENABLED type BOOLEAN, + "! The number of passages to return. + COUNT type INTEGER, + "! An array of field names to perform the passage search on. + FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! The approximate number of characters that each returned passage will contain. + CHARACTERS type INTEGER, + "! When `true` the number of passages that can be returned from a single document + "! is restricted to the *max_per_document* value. + PER_DOCUMENT type BOOLEAN, + "! The default maximum number of passages that can be taken from a single document + "! as the result of a passage query. + MAX_PER_DOCUMENT type INTEGER, + end of T_DFLT_QUERY_PARAMS_PASSAGES. + types: + "!

+ "! Default query parameters for this project.

+ begin of T_DEFAULT_QUERY_PARAMS, + "! An array of collection identifiers to query. If empty or omitted all collections + "! in the project are queried. + COLLECTION_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! Default settings configuration for passage search options. + PASSAGES type T_DFLT_QUERY_PARAMS_PASSAGES, + "! Default project query settings for table results. + TABLE_RESULTS type T_DFLT_QRY_PARAMS_TAB_RESULTS, + "! A string representing the default aggregation query for the project. + AGGREGATION type STRING, + "! Object that contains suggested refinement settings.
+ "!
+ "! **Note**: The `suggested_refinements` parameter that identified dynamic facets + "! from the data is deprecated. + SUGGESTED_REFINEMENTS type T_DFLT_QRY_PRMS_SGGSTD_RFNMNTS, + "! When `true`, a spelling suggestions for the query are returned by default. + SPELLING_SUGGESTIONS type BOOLEAN, + "! When `true`, highlights for the query are returned by default. + HIGHLIGHT type BOOLEAN, + "! The number of document results returned by default. + COUNT type INTEGER, + "! A comma separated list of document fields to sort results by default. + SORT type STRING, + "! An array of field names to return in document results if present by default. + RETURN type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_DEFAULT_QUERY_PARAMS. + types: + "!

+ "! Detailed information about the specified project.

+ begin of T_PROJECT_DETAILS, + "! The unique identifier of this project. + PROJECT_ID type STRING, + "! The human readable name of this project. + NAME type STRING, + "! 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. + TYPE type STRING, + "! Relevancy training status information for this project. + RELEVANCY_TRAINING_STATUS type T_PRJCT_LST_DTLS_RLVNCY_TRNNG1, + "! The number of collections configured in this project. + COLLECTION_COUNT type INTEGER, + "! Default query parameters for this project. + DEFAULT_QUERY_PARAMETERS type T_DEFAULT_QUERY_PARAMS, + end of T_PROJECT_DETAILS. + types: + "!

+ "! Information returned after an uploaded document is accepted.

+ begin of T_DOCUMENT_ACCEPTED, + "! The unique identifier of the ingested document. + DOCUMENT_ID type STRING, + "! 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 type STRING, + end of T_DOCUMENT_ACCEPTED. + types: + "!

+ "! Result for the `trend` aggregation.

+ begin of T_QUERY_TREND_AGGR_RESULT, + "! Array of subaggregations of type `term` or `group_by` and `timeslice`. Each + "! element of the matrix that is returned contains a **trend_indicator** that is + "! calculated from the combination of each aggregation value and segment of time. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TREND_AGGR_RESULT. + types: + "!

+ "! Detects sharp and unexpected changes in the frequency of a

+ "! facet or facet value over time based on the past history of frequency changes + "! of the facet value. + begin of T_QUERY_TREND_AGGREGATION, + "! Specifies that the aggregation type is `trend`. + TYPE type STRING, + "! Specifies the `term` or `group_by` aggregation for the facet that you want to + "! analyze. + FACET type STRING, + "! Specifies the `timeslice` aggregation that defines the time segments. + TIME_SEGMENTS type STRING, + "! Indicates whether to include estimated matching result information. + SHW_ESTIMATED_MATCHING_RESULTS type BOOLEAN, + "! Indicates whether to include total matching documents information. + SHOW_TOTAL_MATCHING_DOCUMENTS type BOOLEAN, + "! An array of aggregations. + RESULTS type STANDARD TABLE OF T_QUERY_TREND_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TREND_AGGREGATION. + types: + "!

+ "! Object that contains a potential answer to the specified

+ "! query. + begin of T_RESULT_PASSAGE_ANSWER, + "! Answer text for the specified query as identified by Discovery. + ANSWER_TEXT type STRING, + "! The position of the first character of the extracted answer in the originating + "! field. + START_OFFSET type INTEGER, + "! The position after the last character of the extracted answer in the originating + "! field. + END_OFFSET type INTEGER, + "! An estimate of the probability that the answer is relevant. + CONFIDENCE type DOUBLE, + end of T_RESULT_PASSAGE_ANSWER. + types: + "!

+ "! A passage query response.

+ begin of T_QUERY_RESPONSE_PASSAGE, + "! The content of the extracted passage. + PASSAGE_TEXT type STRING, + "! The confidence score of the passage's analysis. A higher score indicates + "! greater confidence. The score is used to rank the passages from all documents + "! and is returned only if **passages.per_document** is `false`. + PASSAGE_SCORE type DOUBLE, + "! The unique identifier of the ingested document. + DOCUMENT_ID type STRING, + "! The unique identifier of the collection. + COLLECTION_ID type STRING, + "! The position of the first character of the extracted passage in the originating + "! field. + START_OFFSET type INTEGER, + "! The position after the last character of the extracted passage in the + "! originating field. + END_OFFSET type INTEGER, + "! The label of the field from which the passage has been extracted. + FIELD type STRING, + "! An array of extracted answers to the specified query. Returned for natural + "! language queries when **passages.per_document** is `false`. + ANSWERS type STANDARD TABLE OF T_RESULT_PASSAGE_ANSWER WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_RESPONSE_PASSAGE. + types: + "!

+ "! An object that contains configuration settings for a

+ "! document classifier model training run. + begin of T_DOC_CLASSIFIER_MODEL_TRAIN, + "! The name of the document classifier model. + NAME type STRING, + "! A description of the document classifier model. + DESCRIPTION type STRING, + "! A tuning parameter in an optimization algorithm that determines the step size at + "! each iteration of the training process. It influences how much of any newly + "! acquired information overrides the existing information, and therefore is said + "! to represent the speed at which a machine learning model learns. The default + "! value is `0.1`. + LEARNING_RATE type DOUBLE, + "! Avoids overfitting by shrinking the coefficient of less important features to + "! zero, which removes some features altogether. You can specify many values for + "! hyper-parameter optimization. The default value is `[0.000001]`. + L1_REGULARIZATION_STRENGTHS type STANDARD TABLE OF DOUBLE WITH NON-UNIQUE DEFAULT KEY, + "! A method you can apply to avoid overfitting your model on the training data. You + "! can specify many values for hyper-parameter optimization. The default value is + "! `[0.000001]`. + L2_REGULARIZATION_STRENGTHS type STANDARD TABLE OF DOUBLE WITH NON-UNIQUE DEFAULT KEY, + "! Maximum number of training steps to complete. This setting is useful if you need + "! the training process to finish in a specific time frame to fit into an + "! automated process. The default value is ten million. + TRAINING_MAX_STEPS type INTEGER, + "! Stops the training run early if the improvement ratio is not met by the time the + "! process reaches a certain point. The default value is `0.00001`. + IMPROVEMENT_RATIO type DOUBLE, + end of T_DOC_CLASSIFIER_MODEL_TRAIN. + types: + "!

+ "! Calculates relevancy values using combinations of document

+ "! sets from results of the specified pair of aggregations. + begin of T_QUERY_PAIR_AGGREGATION, + "! Specifies that the aggregation type is `pair`. + TYPE type STRING, + "! Specifies the first aggregation in the pair. The aggregation must be a `term`, + "! `group_by`, `histogram`, or `timeslice` aggregation type. + FIRST type STRING, + "! Specifies the second aggregation in the pair. The aggregation must be a `term`, + "! `group_by`, `histogram`, or `timeslice` aggregation type. + SECOND type STRING, + "! Indicates whether to include estimated matching result information. + SHW_ESTIMATED_MATCHING_RESULTS type BOOLEAN, + "! Indicates whether to include total matching documents information. + SHOW_TOTAL_MATCHING_DOCUMENTS type BOOLEAN, + "! An array of aggregations. + RESULTS type STANDARD TABLE OF T_QUERY_PAIR_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_PAIR_AGGREGATION. + types: + "!

+ "! Returns a scalar calculation across all documents for the

+ "! field specified. Possible calculations include min, max, sum, average, and + "! unique_count. + begin of T_QUERY_CALCULATION_AGGR, + "! Specifies the calculation type, such as 'average`, `max`, `min`, `sum`, or + "! `unique_count`. + TYPE type STRING, + "! The field to perform the calculation on. + FIELD type STRING, + "! The value of the calculation. + VALUE type DOUBLE, + end of T_QUERY_CALCULATION_AGGR. + types: + "!

+ "! An object that describes the Smart Document Understanding

+ "! model for a collection. + begin of T_CLLCTN_DTLS_SMRT_DOC_UNDRST1, + "! When `true`, smart document understanding conversion is enabled for the + "! collection. + ENABLED type BOOLEAN, + "! 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). + MODEL type STRING, + end of T_CLLCTN_DTLS_SMRT_DOC_UNDRST1. + types: + "!

+ "! An object describing an enrichment for a collection.

+ begin of T_COLLECTION_ENRICHMENT, + "! The unique identifier of this enrichment. For more information about how to + "! determine the ID of an enrichment, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-manage-enrichments#enr + "! ichments-ids). + ENRICHMENT_ID type STRING, + "! An array of field names that the enrichment is applied to.
+ "!
+ "! If you apply an enrichment to a field from a JSON file, the data is converted to + "! an array automatically, even if the field contains a single value. + FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_COLLECTION_ENRICHMENT. + types: + "!

+ "! A collection for storing documents.

+ begin of T_COLLECTION_DETAILS, + "! The unique identifier of the collection. + COLLECTION_ID type STRING, + "! The name of the collection. + NAME type STRING, + "! A description of the collection. + DESCRIPTION type STRING, + "! The date that the collection was created. + CREATED type DATETIME, + "! The language of the collection. For a list of supported languages, see the + "! [product + "! documentation](/docs/discovery-data?topic=discovery-data-language-support). + LANGUAGE type STRING, + "! An array of enrichments that are applied to this collection. To get a list of + "! enrichments that are available for a project, use the [List + "! enrichments](#listenrichments) method.
+ "!
+ "! If no enrichments are specified when the collection is created, the default + "! enrichments for the project type are applied. For more information about + "! project default settings, see the [product + "! documentation](/docs/discovery-data?topic=discovery-data-project-defaults). + ENRICHMENTS type STANDARD TABLE OF T_COLLECTION_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY, + "! An object that describes the Smart Document Understanding model for a + "! collection. + SMART_DOCUMENT_UNDERSTANDING type T_CLLCTN_DTLS_SMRT_DOC_UNDRST1, + end of T_COLLECTION_DETAILS. + types: + "!

+ "! An object with details for creating federated document

+ "! classifier models. + begin of T_CLASSIFIER_FEDERATED_MODEL, + "! Name of the field that contains the values from which multiple classifier models + "! are defined. For example, you can specify a field that lists product lines to + "! create a separate model per product line. + FIELD type STRING, + end of T_CLASSIFIER_FEDERATED_MODEL. + types: + "!

+ "! An object that describes enrichments that are applied to the

+ "! training and test data that is used by the document classifier. + begin of T_DOC_CLASSIFIER_ENRICHMENT, + "! A unique identifier of the enrichment. + ENRICHMENT_ID type STRING, + "! An array of field names where the enrichment is applied. + FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_DOC_CLASSIFIER_ENRICHMENT. + types: + "!

+ "! Information about a document classifier.

+ begin of T_DOCUMENT_CLASSIFIER, + "! A unique identifier of the document classifier. + CLASSIFIER_ID type STRING, + "! A human-readable name of the document classifier. + NAME type STRING, + "! A description of the document classifier. + DESCRIPTION type STRING, + "! The date that the document classifier was created. + CREATED type DATETIME, + "! The language of the training data that is associated with the document + "! classifier. Language is specified by using the ISO 639-1 language code, such as + "! `en` for English or `ja` for Japanese. + LANGUAGE type STRING, + "! An array of enrichments to apply to the data that is used to train and test the + "! document classifier. The output from the enrichments is used as features by the + "! classifier to classify the document content both during training and at run + "! time. + ENRICHMENTS type STANDARD TABLE OF T_DOC_CLASSIFIER_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY, + "! An array of fields that are used to train the document classifier. The same set + "! of fields must exist in the training data, the test data, and the documents + "! where the resulting document classifier enrichment is applied at run time. + RECOGNIZED_FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! The name of the field from the training and test data that contains the + "! classification labels. + ANSWER_FIELD type STRING, + "! Name of the CSV file with training data that is used to train the document + "! classifier. + TRAINING_DATA_FILE type STRING, + "! Name of the CSV file with data that is used to test the document classifier. If + "! no test data is provided, a subset of the training data is used for testing + "! purposes. + TEST_DATA_FILE type STRING, + "! An object with details for creating federated document classifier models. + FEDERATED_CLASSIFICATION type T_CLASSIFIER_FEDERATED_MODEL, + end of T_DOCUMENT_CLASSIFIER. + types: + "!

+ "! An object that contains a list of document classifier

+ "! definitions. + begin of T_DOCUMENT_CLASSIFIERS, + "! An array of document classifier definitions. + CLASSIFIERS type STANDARD TABLE OF T_DOCUMENT_CLASSIFIER WITH NON-UNIQUE DEFAULT KEY, + end of T_DOCUMENT_CLASSIFIERS. + types: + "!

+ "! Top value result for the `term` aggregation.

+ begin of T_QUERY_TERM_AGGR_RESULT, + "! Value of the field with a nonzero frequency in the document set. + KEY type STRING, + "! Number of documents that contain the 'key'. + MATCHING_RESULTS type INTEGER, + "! The relevancy score for this result. Returned only if `relevancy:true` is + "! specified in the request. + RELEVANCY type DOUBLE, + "! Number of documents in the collection that contain the term in the specified + "! field. Returned only when `relevancy:true` is specified in the request. + TOTAL_MATCHING_DOCUMENTS type INTEGER, + "! Number of documents that are estimated to match the query and also meet the + "! condition. Returned only when `relevancy:true` is specified in the request. + ESTIMATED_MATCHING_RESULTS type DOUBLE, + "! An array of subaggregations. Returned only when this aggregation is combined + "! with other aggregations in the request or is returned as a subaggregation. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TERM_AGGR_RESULT. + types: + "!

+ "! An array of values, each being the `id` value of a column

+ "! header that is applicable to the current cell. + begin of T_TABLE_COLUMN_HEADER_IDS, + "! The `id` value of a column header. + ID type STRING, + end of T_TABLE_COLUMN_HEADER_IDS. + types: + "!

+ "! A list of values in a key-value pair.

+ T_TABLE_CELL_VALUE type STANDARD TABLE OF T_TABLE_CELL_VALUES WITH NON-UNIQUE DEFAULT KEY. + types: + "!

+ "! A timeslice interval segment.

+ begin of T_QUERY_TIMESLICE_AGGR_RESULT, + "! String date value of the upper bound for the timeslice interval in ISO-8601 + "! format. + KEY_AS_STRING type STRING, + "! Numeric date value of the upper bound for the timeslice interval in UNIX + "! milliseconds since epoch. + KEY type LONG, + "! Number of documents with the specified key as the upper bound. + MATCHING_RESULTS type LONG, + "! An array of subaggregations. Returned only when this aggregation is returned as + "! a subaggregation. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TIMESLICE_AGGR_RESULT. + types: + "!

+ "! A specialized histogram aggregation that uses dates to

+ "! create interval segments. + begin of T_QRY_AGGR_QRY_TIMESLICE_AGGR, + "! Specifies that the aggregation type is `timeslice`. + TYPE type STRING, + "! The date field name used to create the timeslice. + FIELD type STRING, + "! The date interval value. Valid values are seconds, minutes, hours, days, weeks, + "! and years. + INTERVAL type STRING, + "! Identifier that can optionally be specified in the query request of this + "! aggregation. + NAME type STRING, + "! Array of aggregation results. + RESULTS type STANDARD TABLE OF T_QUERY_TIMESLICE_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QRY_AGGR_QRY_TIMESLICE_AGGR. + types: + "!

+ "! Object that contains field details.

+ begin of T_FIELD, + "! The name of the field. + FIELD type STRING, + "! The type of the field. + TYPE type STRING, + "! The collection Id of the collection where the field was found. + COLLECTION_ID type STRING, + end of T_FIELD. + types: + "!

+ "! Finds results from documents that are similar to documents

+ "! of interest. Use this parameter to add a *More like these* function to your + "! search. You can include this parameter with or without a **query**, **filter** + "! or **natural_language_query** parameter. + begin of T_QUERY_LARGE_SIMILAR, + "! When `true`, includes documents in the query results that are similar to + "! documents you specify. + ENABLED type BOOLEAN, + "! The list of documents of interest. Required if **enabled** is `true`. + DOCUMENT_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! Looks for similarities in the specified subset of fields in the documents. If + "! not specified, all of the document fields are used. + FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_LARGE_SIMILAR. + types: + "!

+ "! Histogram numeric interval result.

+ begin of T_QUERY_HISTOGRAM_AGGR_RESULT, + "! The value of the upper bound for the numeric segment. + KEY type LONG, + "! Number of documents with the specified key as the upper bound. + MATCHING_RESULTS type INTEGER, + "! An array of subaggregations. Returned only when this aggregation is returned as + "! a subaggregation. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_HISTOGRAM_AGGR_RESULT. + types: + "!

+ "! Numeric interval segments to categorize documents by using

+ "! field values from a single numeric field to describe the category. + begin of T_QUERY_HISTOGRAM_AGGREGATION, + "! Specifies that the aggregation type is `histogram`. + TYPE type STRING, + "! The numeric field name used to create the histogram. + FIELD type STRING, + "! The size of the sections that the results are split into. + INTERVAL type INTEGER, + "! Identifier that can optionally be specified in the query request of this + "! aggregation. + NAME type STRING, + "! Array of numeric intervals. + RESULTS type STANDARD TABLE OF T_QUERY_HISTOGRAM_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_HISTOGRAM_AGGREGATION. + types: + "!

+ "! An array of values, each being the `id` value of a row

+ "! header that is applicable to this body cell. + begin of T_TABLE_ROW_HEADER_IDS, + "! The `id` values of a row header. + ID type STRING, + end of T_TABLE_ROW_HEADER_IDS. + types: + "!

+ "! Relevancy training status information for this project.

+ begin of T_PROJECT_REL_TRAIN_STATUS, + "! When the training data was updated. + DATA_UPDATED type STRING, + "! The total number of examples. + TOTAL_EXAMPLES type INTEGER, + "! When `true`, sufficient label diversity is present to allow training for this + "! project. + SUFFICIENT_LABEL_DIVERSITY type BOOLEAN, + "! When `true`, the relevancy training is in processing. + PROCESSING type BOOLEAN, + "! When `true`, the minimum number of examples required to train has been met. + MINIMUM_EXAMPLES_ADDED type BOOLEAN, + "! The time that the most recent successful training occurred. + SUCCESSFULLY_TRAINED type STRING, + "! When `true`, relevancy training is available when querying collections in the + "! project. + AVAILABLE type BOOLEAN, + "! The number of notices generated during the relevancy training. + NOTICES type INTEGER, + "! When `true`, the minimum number of queries required to train has been met. + MINIMUM_QUERIES_ADDED type BOOLEAN, + end of T_PROJECT_REL_TRAIN_STATUS. + types: + "!

+ "! An object that defines how to aggregate query results.

+ T_QUERY_AGGREGATION type JSONOBJECT. + types: + "!

+ "! Numeric interval segments to categorize documents by using

+ "! field values from a single numeric field to describe the category. + begin of T_QRY_AGGR_QRY_HISTOGRAM_AGGR, + "! Specifies that the aggregation type is `histogram`. + TYPE type STRING, + "! The numeric field name used to create the histogram. + FIELD type STRING, + "! The size of the sections that the results are split into. + INTERVAL type INTEGER, + "! Identifier that can optionally be specified in the query request of this + "! aggregation. + NAME type STRING, + "! Array of numeric intervals. + RESULTS type STANDARD TABLE OF T_QUERY_HISTOGRAM_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QRY_AGGR_QRY_HISTOGRAM_AGGR. + types: + "!

+ "! Result of the document analysis.

+ begin of T_ANALYZED_RESULT, + "! Metadata that was specified with the request. + METADATA type JSONOBJECT, + end of T_ANALYZED_RESULT. + types: + "!

+ "! Configuration for passage retrieval.

+ begin of T_QUERY_LARGE_PASSAGES, + "! A passages query that returns the most relevant passages from the results. + ENABLED type BOOLEAN, + "! If `true`, ranks the documents by document quality, and then returns the + "! highest-ranked passages per document in a `document_passages` field for each + "! document entry in the results list of the response.
+ "!
+ "! If `false`, ranks the passages from all of the documents by passage quality + "! regardless of the document quality and returns them in a separate `passages` + "! field in the response. + PER_DOCUMENT type BOOLEAN, + "! Maximum number of passages to return per document in the result. Ignored if + "! **passages.per_document** is `false`. + MAX_PER_DOCUMENT type INTEGER, + "! A list of fields to extract passages from. By default, passages are extracted + "! from the `text` and `title` fields only. If you add this parameter and specify + "! an empty list (`[]`) as its value, then the service searches all root-level + "! fields for suitable passages. + FIELDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! The maximum number of passages to return. Ignored if **passages.per_document** + "! is `true`. + COUNT type INTEGER, + "! The approximate number of characters that any one passage will have. + CHARACTERS type INTEGER, + "! When true, `answer` objects are returned as part of each passage in the query + "! results. The primary difference between an `answer` and a `passage` is that the + "! length of a passage is defined by the query, where the length of an `answer` is + "! calculated by Discovery based on how much text is needed to answer the + "! question.
+ "!
+ "! This parameter is ignored if passages are not enabled for the query, or no + "! **natural_language_query** is specified.
+ "!
+ "! If the **find_answers** parameter is set to `true` and **per_document** + "! parameter is also set to `true`, then the document search results and the + "! passage search results within each document are reordered using the answer + "! confidences. The goal of this reordering is to place the best answer as the + "! first answer of the first passage of the first document. Similarly, if the + "! **find_answers** parameter is set to `true` and **per_document** parameter is + "! set to `false`, then the passage search results are reordered in decreasing + "! order of the highest confidence answer for each document and passage.
+ "!
+ "! The **find_answers** parameter is available only on managed instances of + "! Discovery. + FIND_ANSWERS type BOOLEAN, + "! The number of `answer` objects to return per passage if the **find_answers** + "! parmeter is specified as `true`. + MAX_ANSWERS_PER_PASSAGE type INTEGER, + end of T_QUERY_LARGE_PASSAGES. + types: + "!

+ "! Configuration for suggested refinements.


+ "!
+ "! **Note**: The **suggested_refinements** parameter that identified dynamic facets + "! from the data is deprecated. + begin of T_QRY_LRG_SGGSTD_REFINEMENTS, + "! Whether to perform suggested refinements. + ENABLED type BOOLEAN, + "! Maximum number of suggested refinements texts to be returned. The maximum is + "! `100`. + COUNT type INTEGER, + end of T_QRY_LRG_SGGSTD_REFINEMENTS. + types: + "!

+ "! Object that describes a long query.

+ begin of T_QUERY_LARGE, + "! A comma-separated list of collection IDs to be queried against. + COLLECTION_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! Searches for documents that match the Discovery Query Language criteria that is + "! specified as input. Filter calls are cached and are faster than query calls + "! because the results are not ordered by relevance. When used with the + "! **aggregation**, **query**, or **natural_language_query** parameters, the + "! **filter** parameter runs first. This parameter is useful for limiting results + "! to those that contain specific metadata values. + FILTER type STRING, + "! A query search that is written in the Discovery Query Language and returns all + "! matching documents in your data set with full enrichments and full text, and + "! with the most relevant documents listed first. Use a query search when you want + "! to find the most relevant search results. + QUERY type STRING, + "! A natural language query that returns relevant documents by using training data + "! and natural language understanding. + NATURAL_LANGUAGE_QUERY type STRING, + "! An aggregation search that returns an exact answer by combining query search + "! with filters. Useful for applications to build lists, tables, and time series. + "! For more information about the supported types of aggregations, see the + "! [Discovery + "! documentation](/docs/discovery-data?topic=discovery-data-query-aggregations). + AGGREGATION type STRING, + "! Number of results to return. + COUNT type INTEGER, + "! A list of the fields in the document hierarchy to return. You can specify both + "! root-level (`text`) and nested (`extracted_metadata.filename`) fields. If this + "! parameter is an empty list, then all fields are returned. + RETURN type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! The number of query results to skip at the beginning. For example, if the total + "! number of results that are returned is 10 and the offset is 8, it returns the + "! last two results. + OFFSET type INTEGER, + "! A comma-separated list of fields in the document to sort on. You can optionally + "! specify a sort direction by prefixing the field with `-` for descending or `+` + "! for ascending. Ascending is the default sort direction if no prefix is + "! specified. + SORT type STRING, + "! When `true`, a highlight field is returned for each result that contains fields + "! that match the query. The matching query terms are emphasized with surrounding + "! `<em></em>` tags. This parameter is ignored if **passages.enabled** + "! and **passages.per_document** are `true`, in which case passages are returned + "! for each document instead of highlights. + HIGHLIGHT type BOOLEAN, + "! When `true` and the **natural_language_query** parameter is used, the + "! **natural_language_query** parameter is spell checked. The most likely + "! correction is returned in the **suggested_query** field of the response (if one + "! exists). + SPELLING_SUGGESTIONS type BOOLEAN, + "! Configuration for table retrieval. + TABLE_RESULTS type T_QUERY_LARGE_TABLE_RESULTS, + "! Configuration for suggested refinements.
+ "!
+ "! **Note**: The **suggested_refinements** parameter that identified dynamic facets + "! from the data is deprecated. + SUGGESTED_REFINEMENTS type T_QRY_LRG_SGGSTD_REFINEMENTS, + "! Configuration for passage retrieval. + PASSAGES type T_QUERY_LARGE_PASSAGES, + "! Finds results from documents that are similar to documents of interest. Use this + "! parameter to add a *More like these* function to your search. You can include + "! this parameter with or without a **query**, **filter** or + "! **natural_language_query** parameter. + SIMILAR type T_QUERY_LARGE_SIMILAR, + end of T_QUERY_LARGE. + types: + "!

+ "! 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. + begin of T_ENRICHMENT_OPTIONS, + "! An array of supported languages for this enrichment. When creating an + "! enrichment, only specify a language that is used by the model or in the + "! dictionary. Required when **type** is `dictionary`. Optional when **type** is + "! `rule_based`. Not valid when creating any other type of enrichment. + LANGUAGES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! The name of the entity type. This value is used as the field name in the index. + "! Required when **type** is `dictionary` or `regular_expression`. Not valid when + "! creating any other type of enrichment. + ENTITY_TYPE type STRING, + "! The regular expression to apply for this enrichment. Required when **type** is + "! `regular_expression`. Not valid when creating any other type of enrichment. + REGULAR_EXPRESSION type STRING, + "! The name of the result document field that this enrichment creates. Required + "! when **type** is `rule_based` or `classifier`. Not valid when creating any + "! other type of enrichment. + RESULT_FIELD type STRING, + "! A unique identifier of the document classifier. Required when **type** is + "! `classifier`. Not valid when creating any other type of enrichment. + CLASSIFIER_ID type STRING, + "! A unique identifier of the document classifier model. Required when **type** is + "! `classifier`. Not valid when creating any other type of enrichment. + MODEL_ID type STRING, + "! Specifies a threshold. Only classes with evaluation confidence scores that are + "! higher than the specified threshold are included in the output. Optional when + "! **type** is `classifier`. Not valid when creating any other type of enrichment. + "! + CONFIDENCE_THRESHOLD type DOUBLE, + "! Evaluates only the classes that fall in the top set of results when ranked by + "! confidence. For example, if set to `5`, then the top five classes for each + "! document are evaluated. If set to 0, the **confidence_threshold** is used to + "! determine the predicted classes. Optional when **type** is `classifier`. Not + "! valid when creating any other type of enrichment. + TOP_K type INTEGER, + end of T_ENRICHMENT_OPTIONS. + types: + "!

+ "! Information about a specific enrichment.

+ begin of T_ENRICHMENT, + "! The unique identifier of this enrichment. + ENRICHMENT_ID type STRING, + "! The human readable name for this enrichment. + NAME type STRING, + "! The description of this enrichment. + DESCRIPTION type STRING, + "! The type of this enrichment. + TYPE 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 type T_ENRICHMENT_OPTIONS, + end of T_ENRICHMENT. + types: + "!

+ "! Result group for the `group_by` aggregation.

+ begin of T_QUERY_GROUP_BY_AGGR_RESULT, + "! The condition that is met by the documents in this group. For example, + "! `YEARTXT<2000`. + KEY type STRING, + "! Number of documents that meet the query and condition. + MATCHING_RESULTS type INTEGER, + "! The relevancy for this group. Returned only if `relevancy:true` is specified in + "! the request. + RELEVANCY type DOUBLE, + "! Number of documents that meet the condition in the whole set of documents in + "! this collection. Returned only when `relevancy:true` is specified in the + "! request. + TOTAL_MATCHING_DOCUMENTS type INTEGER, + "! The number of documents that are estimated to match the query and condition. + "! Returned only when `relevancy:true` is specified in the request. + ESTIMATED_MATCHING_RESULTS type DOUBLE, + "! An array of subaggregations. Returned only when this aggregation is returned as + "! a subaggregation. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_GROUP_BY_AGGR_RESULT. + types: + "!

+ "! Separates document results into groups that meet the

+ "! conditions you specify. + begin of T_QRY_AGGR_QUERY_GROUP_BY_AGGR, + "! Specifies that the aggregation type is `group_by`. + TYPE type STRING, + "! An array of results. + RESULTS type STANDARD TABLE OF T_QUERY_GROUP_BY_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QRY_AGGR_QUERY_GROUP_BY_AGGR. + types: + "!

+ "! A collection for storing documents.

+ begin of T_COLLECTION, + "! The unique identifier of the collection. + COLLECTION_ID type STRING, + "! The name of the collection. + NAME type STRING, + end of T_COLLECTION. + types: + "!

+ "! An object that contains a list of document classifier model

+ "! definitions. + begin of T_DOCUMENT_CLASSIFIER_MODELS, + "! An array of document classifier model definitions. + MODELS type STANDARD TABLE OF T_DOCUMENT_CLASSIFIER_MODEL WITH NON-UNIQUE DEFAULT KEY, + end of T_DOCUMENT_CLASSIFIER_MODELS. + types: + "!

+ "! If you provide customization input, the normalized version

+ "! of the row header texts according to the customization; otherwise, the same + "! value as `row_header_texts`. + begin of T_TAB_ROW_HEADER_TEXTS_NORM, + "! The normalized version of a row header text. + TEXT_NORMALIZED type STRING, + end of T_TAB_ROW_HEADER_TEXTS_NORM. + types: + "!

+ "! List of document attributes.

+ begin of T_DOCUMENT_ATTRIBUTE, + "! The type of attribute. + TYPE type STRING, + "! The text associated with the attribute. + TEXT type STRING, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + end of T_DOCUMENT_ATTRIBUTE. + types: + "!

+ "! An array of values, each being the `text` value of a row

+ "! header that is applicable to this body cell. + begin of T_TABLE_ROW_HEADER_TEXTS, + "! The `text` value of a row header. + TEXT type STRING, + end of T_TABLE_ROW_HEADER_TEXTS. + types: + "!

+ "! An array of values, each being the `text` value of a column

+ "! header that is applicable to the current cell. + begin of T_TABLE_COLUMN_HEADER_TEXTS, + "! The `text` value of a column header. + TEXT type STRING, + end of T_TABLE_COLUMN_HEADER_TEXTS. + types: + "!

+ "! If you provide customization input, the normalized version

+ "! of the column header texts according to the customization; otherwise, the same + "! value as `column_header_texts`. + begin of T_TAB_COLUMN_HEADER_TEXTS_NORM, + "! The normalized version of a column header text. + TEXT_NORMALIZED type STRING, + end of T_TAB_COLUMN_HEADER_TEXTS_NORM. + types: + "!

+ "! Cells that are not table header, column header, or row

+ "! header cells. + begin of T_TABLE_BODY_CELLS, + "! The unique ID of the cell in the current table. + CELL_ID type STRING, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + "! The textual contents of this cell from the input document without associated + "! markup content. + TEXT type STRING, + "! The `begin` index of this cell's `row` location in the current table. + ROW_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `row` location in the current table. + ROW_INDEX_END type LONG, + "! The `begin` index of this cell's `column` location in the current table. + COLUMN_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `column` location in the current table. + COLUMN_INDEX_END type LONG, + "! A list of table row header ids. + ROW_HEADER_IDS type STANDARD TABLE OF T_TABLE_ROW_HEADER_IDS WITH NON-UNIQUE DEFAULT KEY, + "! A list of table row header texts. + ROW_HEADER_TEXTS type STANDARD TABLE OF T_TABLE_ROW_HEADER_TEXTS WITH NON-UNIQUE DEFAULT KEY, + "! A list of table row header texts normalized. + ROW_HEADER_TEXTS_NORMALIZED type STANDARD TABLE OF T_TAB_ROW_HEADER_TEXTS_NORM WITH NON-UNIQUE DEFAULT KEY, + "! A list of table column header ids. + COLUMN_HEADER_IDS type STANDARD TABLE OF T_TABLE_COLUMN_HEADER_IDS WITH NON-UNIQUE DEFAULT KEY, + "! A list of table column header texts. + COLUMN_HEADER_TEXTS type STANDARD TABLE OF T_TABLE_COLUMN_HEADER_TEXTS WITH NON-UNIQUE DEFAULT KEY, + "! A list of table column header texts normalized. + COLUMN_HEADER_TEXTS_NORMALIZED type STANDARD TABLE OF T_TAB_COLUMN_HEADER_TEXTS_NORM WITH NON-UNIQUE DEFAULT KEY, + "! A list of document attributes. + ATTRIBUTES type STANDARD TABLE OF T_DOCUMENT_ATTRIBUTE WITH NON-UNIQUE DEFAULT KEY, + end of T_TABLE_BODY_CELLS. + types: + "!

+ "! Text and associated location within a table.

+ begin of T_TABLE_TEXT_LOCATION, + "! The text retrieved. + TEXT type STRING, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + end of T_TABLE_TEXT_LOCATION. + types: + "!

+ "! Returns the top documents ranked by the score of the query.

+ begin of T_QUERY_TOP_HITS_AGGREGATION, + "! Specifies that the aggregation type is `top_hits`. + TYPE type STRING, + "! The number of documents to return. + SIZE type INTEGER, + "! Identifier specified in the query request of this aggregation. + NAME type STRING, + "! A query response that contains the matching documents for the preceding + "! aggregations. + HITS type T_QUERY_TOP_HITS_AGGR_RESULT, + end of T_QUERY_TOP_HITS_AGGREGATION. + types: + "!

+ "! Information about the child documents that are generated

+ "! from a single document during ingestion or other processing. + begin of T_DOCUMENT_DETAILS_CHILDREN, + "! Indicates whether the child documents have any notices. The value is `false` if + "! the document does not have child documents. + HAVE_NOTICES type BOOLEAN, + "! Number of child documents. The value is `0` when processing of the document + "! doesn't generate any child documents. + COUNT type INTEGER, + end of T_DOCUMENT_DETAILS_CHILDREN. + types: + "!

+ "! A notice produced for the collection.

+ begin of T_NOTICE, + "! Identifies the notice. Many notices might have the same ID. This field exists so + "! that user applications can programmatically identify a notice and take + "! automatic corrective action. Typical notice IDs include:
+ "!
+ "! `index_failed`, `index_failed_too_many_requests`, + "! `index_failed_incompatible_field`, `index_failed_cluster_unavailable`, + "! `ingestion_timeout`, `ingestion_error`, `bad_request`, `internal_error`, + "! `missing_model`, `unsupported_model`, + "! `smart_document_understanding_failed_incompatible_field`, + "! `smart_document_understanding_failed_internal_error`, + "! `smart_document_understanding_failed_internal_error`, + "! `smart_document_understanding_failed_warning`, + "! `smart_document_understanding_page_error`, + "! `smart_document_understanding_page_warning`. **Note:** This is not a complete + "! list. Other values might be returned. + NOTICE_ID type STRING, + "! The creation date of the collection in the format + "! yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. + CREATED type DATETIME, + "! Unique identifier of the document. + DOCUMENT_ID type STRING, + "! Unique identifier of the collection. + COLLECTION_ID type STRING, + "! Unique identifier of the query used for relevance training. + QUERY_ID type STRING, + "! Severity level of the notice. + SEVERITY type STRING, + "! Ingestion or training step in which the notice occurred. + STEP type STRING, + "! The description of the notice. + DESCRIPTION type STRING, + end of T_NOTICE. + types: + "!

+ "! Information about a document.

+ begin of T_DOCUMENT_DETAILS, + "! The unique identifier of the document. + DOCUMENT_ID type STRING, + "! Date and time that the document is added to the collection. For a child + "! document, the date and time when the process that generates the child document + "! runs. The date-time format is + "! `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. + CREATED type DATETIME, + "! Date and time that the document is finished being processed and is indexed. This + "! date changes whenever the document is reprocessed, including for enrichment + "! changes. The date-time format is + "! `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. + UPDATED type DATETIME, + "! 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. + STATUS type 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. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, + "! Information about the child documents that are generated from a single document + "! during ingestion or other processing. + CHILDREN type T_DOCUMENT_DETAILS_CHILDREN, + "! Name of the original source file (if available). + FILENAME type STRING, + "! The type of the original source file, such as `csv`, `excel`, `html`, `json`, + "! `pdf`, `text`, `word`, and so on. + FILE_TYPE type STRING, + "! The SHA-256 hash of the original source file. The hash is formatted as a + "! hexadecimal string. + SHA256 type STRING, + end of T_DOCUMENT_DETAILS. + types: + "!

+ "! A restriction that alters the document set that is used by

+ "! the aggregations that it precedes. Subsequent aggregations are applied to + "! nested documents from the specified field. + begin of T_QUERY_AGGR_QUERY_NESTED_AGGR, + "! Specifies that the aggregation type is `nested`. + TYPE type STRING, + "! The path to the document field to scope subsequent aggregations to. + PATH type STRING, + "! Number of nested documents found in the specified field. + MATCHING_RESULTS type LONG, + "! An array of subaggregations. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_AGGR_QUERY_NESTED_AGGR. + types: + "!

+ "! An object that contains an array of autocompletion

+ "! suggestions. + begin of T_COMPLETIONS, + "! Array of autocomplete suggestion based on the provided prefix. + COMPLETIONS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_COMPLETIONS. + types: + "!

+ "! An object that contains a new name and description for an

+ "! enrichment. + begin of T_UPDATE_ENRICHMENT, + "! A new name for the enrichment. + NAME type STRING, + "! A new description for the enrichment. + DESCRIPTION type STRING, + end of T_UPDATE_ENRICHMENT. + types: + "!

+ "! A suggested additional query term or terms user to filter

+ "! results. **Note**: The `suggested_refinements` parameter is deprecated. + begin of T_QUERY_SUGGESTED_REFINEMENT, + "! The text used to filter. + TEXT type STRING, + end of T_QUERY_SUGGESTED_REFINEMENT. + types: + "!

+ "! The contents of the current table's header.

+ begin of T_TABLE_HEADERS, + "! The unique ID of the cell in the current table. + CELL_ID type STRING, + "! The location of the table header cell in the current table as defined by its + "! `begin` and `end` offsets, respectfully, in the input document. + LOCATION type JSONOBJECT, + "! The textual contents of the cell from the input document without associated + "! markup content. + TEXT type STRING, + "! The `begin` index of this cell's `row` location in the current table. + ROW_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `row` location in the current table. + ROW_INDEX_END type LONG, + "! The `begin` index of this cell's `column` location in the current table. + COLUMN_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `column` location in the current table. + COLUMN_INDEX_END type LONG, + end of T_TABLE_HEADERS. + types: + "!

+ "! An object contain retrieval type information.

+ begin of T_RETRIEVAL_DETAILS, + "! 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`. + DOCUMENT_RETRIEVAL_STRATEGY type STRING, + end of T_RETRIEVAL_DETAILS. + types: + "!

+ "! Information about a specific enrichment.

+ begin of T_CREATE_ENRICHMENT, + "! The human readable name for this enrichment. + NAME type STRING, + "! The description of this enrichment. + DESCRIPTION type STRING, + "! 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. + TYPE 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 type T_ENRICHMENT_OPTIONS, + end of T_CREATE_ENRICHMENT. + types: + "!

+ "! The list of fetched fields.


+ "!
+ "! The fields are returned using a fully qualified name format, however, the format + "! differs slightly from that used by the query operations.
+ "!
+ "! * Fields which contain nested objects are assigned a type of + "! "nested".
+ "!
+ "! * Fields which belong to a nested object are prefixed with `.properties` (for + "! example, `warnings.properties.severity` means that the `warnings` object has a + "! property called `severity`). + begin of T_LIST_FIELDS_RESPONSE, + "! An array that contains information about each field in the collections. + FIELDS type STANDARD TABLE OF T_FIELD WITH NON-UNIQUE DEFAULT KEY, + end of T_LIST_FIELDS_RESPONSE. + types: + "!

+ "! Returns the top documents ranked by the score of the query.

+ begin of T_QRY_AGGR_QUERY_TOP_HITS_AGGR, + "! Specifies that the aggregation type is `top_hits`. + TYPE type STRING, + "! The number of documents to return. + SIZE type INTEGER, + "! Identifier specified in the query request of this aggregation. + NAME type STRING, + "! A query response that contains the matching documents for the preceding + "! aggregations. + HITS type T_QUERY_TOP_HITS_AGGR_RESULT, + end of T_QRY_AGGR_QUERY_TOP_HITS_AGGR. + types: + "!

+ "! A passage query result.

+ begin of T_QUERY_RESULT_PASSAGE, + "! The content of the extracted passage. + PASSAGE_TEXT type STRING, + "! The position of the first character of the extracted passage in the originating + "! field. + START_OFFSET type INTEGER, + "! The position after the last character of the extracted passage in the + "! originating field. + END_OFFSET type INTEGER, + "! The label of the field from which the passage has been extracted. + FIELD type STRING, + "! An arry of extracted answers to the specified query. Returned for natural + "! language queries when **passages.per_document** is `true`. + ANSWERS type STANDARD TABLE OF T_RESULT_PASSAGE_ANSWER WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_RESULT_PASSAGE. + types: + "!

+ "! List of words to filter out of text that is submitted in

+ "! queries. + begin of T_STOP_WORD_LIST, + "! List of stop words. + STOPWORDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_STOP_WORD_LIST. + types: + "!

+ "! Object specifying the training queries contained in the

+ "! identified training set. + begin of T_TRAINING_QUERY_SET, + "! Array of training queries. At least 50 queries are required for training to + "! begin. A maximum of 10,000 queries are returned. + QUERIES type STANDARD TABLE OF T_TRAINING_QUERY WITH NON-UNIQUE DEFAULT KEY, + end of T_TRAINING_QUERY_SET. + types: + "!

+ "! Metadata of a query result.

+ begin of T_QUERY_RESULT_METADATA, + "! The document retrieval source that produced this search result. + DOCUMENT_RETRIEVAL_SOURCE type STRING, + "! The collection id associated with this training data set. + COLLECTION_ID type STRING, + "! The confidence score for the given result. Calculated based on how relevant the + "! result is estimated to be. The score can range from `0.0` to `1.0`. The higher + "! the number, the more relevant the document. The `confidence` value for a result + "! was calculated using the model specified in the `document_retrieval_strategy` + "! field of the result set. This field is returned only if the + "! **natural_language_query** parameter is specified in the query. + CONFIDENCE type DOUBLE, + end of T_QUERY_RESULT_METADATA. + types: + "!

+ "! Result document for the specified query.

+ begin of T_QUERY_RESULT, + "! The unique identifier of the document. + DOCUMENT_ID type STRING, + "! Metadata of the document. + METADATA type JSONOBJECT, + "! Metadata of a query result. + RESULT_METADATA type T_QUERY_RESULT_METADATA, + "! Passages from the document that best matches the query. Returned if + "! **passages.per_document** is `true`. + DOCUMENT_PASSAGES type STANDARD TABLE OF T_QUERY_RESULT_PASSAGE WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_RESULT. + types: + "!

+ "! Column-level cells, each applicable as a header to other

+ "! cells in the same column as itself, of the current table. + begin of T_TABLE_COLUMN_HEADERS, + "! The unique ID of the cell in the current table. + CELL_ID type STRING, + "! The location of the column header cell in the current table as defined by its + "! `begin` and `end` offsets, respectfully, in the input document. + LOCATION type JSONOBJECT, + "! The textual contents of this cell from the input document without associated + "! markup content. + TEXT type STRING, + "! If you provide customization input, the normalized version of the cell text + "! according to the customization; otherwise, the same value as `text`. + TEXT_NORMALIZED type STRING, + "! The `begin` index of this cell's `row` location in the current table. + ROW_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `row` location in the current table. + ROW_INDEX_END type LONG, + "! The `begin` index of this cell's `column` location in the current table. + COLUMN_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `column` location in the current table. + COLUMN_INDEX_END type LONG, + end of T_TABLE_COLUMN_HEADERS. + types: + "!

+ "! Row-level cells, each applicable as a header to other cells

+ "! in the same row as itself, of the current table. + begin of T_TABLE_ROW_HEADERS, + "! The unique ID of the cell in the current table. + CELL_ID type STRING, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + "! The textual contents of this cell from the input document without associated + "! markup content. + TEXT type STRING, + "! If you provide customization input, the normalized version of the cell text + "! according to the customization; otherwise, the same value as `text`. + TEXT_NORMALIZED type STRING, + "! The `begin` index of this cell's `row` location in the current table. + ROW_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `row` location in the current table. + ROW_INDEX_END type LONG, + "! The `begin` index of this cell's `column` location in the current table. + COLUMN_INDEX_BEGIN type LONG, + "! The `end` index of this cell's `column` location in the current table. + COLUMN_INDEX_END type LONG, + end of T_TABLE_ROW_HEADERS. + types: + "!

+ "! Full table object retrieved from Table Understanding

+ "! Enrichment. + begin of T_TABLE_RESULT_TABLE, + "! The numeric location of the identified element in the document, represented with + "! two integers labeled `begin` and `end`. + LOCATION type T_TABLE_ELEMENT_LOCATION, + "! The textual contents of the current table from the input document without + "! associated markup content. + TEXT type STRING, + "! Text and associated location within a table. + SECTION_TITLE type T_TABLE_TEXT_LOCATION, + "! Text and associated location within a table. + TITLE type T_TABLE_TEXT_LOCATION, + "! An array of table-level cells that apply as headers to all the other cells in + "! the current table. + TABLE_HEADERS type STANDARD TABLE OF T_TABLE_HEADERS WITH NON-UNIQUE DEFAULT KEY, + "! An array of row-level cells, each applicable as a header to other cells in the + "! same row as itself, of the current table. + ROW_HEADERS type STANDARD TABLE OF T_TABLE_ROW_HEADERS WITH NON-UNIQUE DEFAULT KEY, + "! An array of column-level cells, each applicable as a header to other cells in + "! the same column as itself, of the current table. + COLUMN_HEADERS type STANDARD TABLE OF T_TABLE_COLUMN_HEADERS WITH NON-UNIQUE DEFAULT KEY, + "! An array of key-value pairs identified in the current table. + KEY_VALUE_PAIRS type STANDARD TABLE OF T_TABLE_KEY_VALUE_PAIRS WITH NON-UNIQUE DEFAULT KEY, + "! An array of cells that are neither table header nor column header nor row header + "! cells, of the current table with corresponding row and column header + "! associations. + BODY_CELLS type STANDARD TABLE OF T_TABLE_BODY_CELLS WITH NON-UNIQUE DEFAULT KEY, + "! An array of lists of textual entries across the document related to the current + "! table being parsed. + CONTEXTS type STANDARD TABLE OF T_TABLE_TEXT_LOCATION WITH NON-UNIQUE DEFAULT KEY, + end of T_TABLE_RESULT_TABLE. + types: + "!

+ "! A tables whose content or context match a search query.

+ begin of T_QUERY_TABLE_RESULT, + "! The identifier for the retrieved table. + TABLE_ID type STRING, + "! The identifier of the document the table was retrieved from. + SOURCE_DOCUMENT_ID type STRING, + "! The identifier of the collection the table was retrieved from. + COLLECTION_ID type STRING, + "! HTML snippet of the table info. + TABLE_HTML type STRING, + "! The offset of the table html snippet in the original document html. + TABLE_HTML_OFFSET type INTEGER, + "! Full table object retrieved from Table Understanding Enrichment. + TABLE type T_TABLE_RESULT_TABLE, + end of T_QUERY_TABLE_RESULT. + types: + "!

+ "! A response that contains the documents and aggregations for

+ "! the query. + begin of T_QUERY_RESPONSE, + "! The number of matching results for the query. Results that match due to a + "! curation only are not counted in the total. + MATCHING_RESULTS type INTEGER, + "! Array of document results for the query. + RESULTS type STANDARD TABLE OF T_QUERY_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! Array of aggregations for the query. + AGGREGATIONS type STANDARD TABLE OF T_QUERY_AGGREGATION WITH NON-UNIQUE DEFAULT KEY, + "! An object contain retrieval type information. + RETRIEVAL_DETAILS type T_RETRIEVAL_DETAILS, + "! Suggested correction to the submitted **natural_language_query** value. + SUGGESTED_QUERY type STRING, + "! Array of suggested refinements. **Note**: The `suggested_refinements` parameter + "! that identified dynamic facets from the data is deprecated. + SUGGESTED_REFINEMENTS type STANDARD TABLE OF T_QUERY_SUGGESTED_REFINEMENT WITH NON-UNIQUE DEFAULT KEY, + "! Array of table results. + TABLE_RESULTS type STANDARD TABLE OF T_QUERY_TABLE_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! Passages that best match the query from across all of the collections in the + "! project. Returned if **passages.per_document** is `false`. + PASSAGES type STANDARD TABLE OF T_QUERY_RESPONSE_PASSAGE WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_RESPONSE. + types: + "!

+ "! An object that contains the converted document and any

+ "! identified enrichments. Root-level fields from the original file are returned + "! also. + begin of T_ANALYZED_DOCUMENT, + "! Array of notices that are triggered when the files are processed. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, + "! Result of the document analysis. + RESULT type T_ANALYZED_RESULT, + end of T_ANALYZED_DOCUMENT. + types: + "!

+ "! A specialized histogram aggregation that uses dates to

+ "! create interval segments. + begin of T_QUERY_TIMESLICE_AGGREGATION, + "! Specifies that the aggregation type is `timeslice`. + TYPE type STRING, + "! The date field name used to create the timeslice. + FIELD type STRING, + "! The date interval value. Valid values are seconds, minutes, hours, days, weeks, + "! and years. + INTERVAL type STRING, + "! Identifier that can optionally be specified in the query request of this + "! aggregation. + NAME type STRING, + "! Array of aggregation results. + RESULTS type STANDARD TABLE OF T_QUERY_TIMESLICE_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TIMESLICE_AGGREGATION. + types: + "!

+ "! Error response information.

+ begin of T_ERROR_RESPONSE, + "! The HTTP error status code. + CODE type INTEGER, + "! A message describing the error. + ERROR type STRING, + end of T_ERROR_RESPONSE. + types: + "!

+ "! An expansion definition. Each object respresents one set of

+ "! expandable strings. For example, you could have expansions for the word `hot` + "! in one object, and expansions for the word `cold` in another. Follow these + "! guidelines when you add terms:
+ "!
+ "! * Specify the terms in lowercase. Lowercase terms expand to uppercase.
+ "!
+ "! * Multiword terms are supported only in bidirectional expansions.
+ "!
+ "! * Do not specify a term that is specified in the stop words list for the + "! collection. + begin of T_EXPANSION, + "! A list of terms that will be expanded for this expansion. If specified, only the + "! items in this list are expanded. + INPUT_TERMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! A list of terms that this expansion will be expanded to. If specified without + "! **input_terms**, the list also functions as the input term list. + EXPANDED_TERMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + end of T_EXPANSION. + types: + "!

+ "! The query expansion definitions for the specified

+ "! collection. + begin of T_EXPANSIONS, + "! An array of query expansion definitions.
+ "!
+ "! Each object in the **expansions** array represents a term or set of terms that + "! will be expanded into other terms. Each expansion object can be configured as + "! `bidirectional` or `unidirectional`.
+ "!
+ "! * **Bidirectional**: Each entry in the `expanded_terms` list expands to include + "! all expanded terms. For example, a query for `ibm` expands to `ibm OR + "! international business machines OR big blue`.
+ "!
+ "! * **Unidirectional**: The terms in `input_terms` in the query are replaced by + "! the terms in `expanded_terms`. For example, a query for the often misused term + "! `on premise` is converted to `on premises OR on-premises` and does not contain + "! the original term. If you want an input term to be included in the query, then + "! repeat the input term in the expanded terms list. + EXPANSIONS type STANDARD TABLE OF T_EXPANSION WITH NON-UNIQUE DEFAULT KEY, + end of T_EXPANSIONS. + types: + "!

+ "! An object that contains a new name or description for a

+ "! document classifier model. + begin of T_UPD_DOC_CLASSIFIER_MODEL, + "! A new name for the enrichment. + NAME type STRING, + "! A new description for the enrichment. + DESCRIPTION type STRING, + end of T_UPD_DOC_CLASSIFIER_MODEL. + types: + "!

+ "! An object that contains an array of enrichment definitions.

+ begin of T_ENRICHMENTS, + "! An array of enrichment definitions. + ENRICHMENTS type STANDARD TABLE OF T_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY, + end of T_ENRICHMENTS. + types: + "!

+ "! Information returned when a document is deleted.

+ begin of T_DELETE_DOCUMENT_RESPONSE, + "! The unique identifier of the document. + DOCUMENT_ID type STRING, + "! Status of the document. A deleted document has the status deleted. + STATUS type STRING, + end of T_DELETE_DOCUMENT_RESPONSE. + types: + "!

+ "! Detects sharp and unexpected changes in the frequency of a

+ "! facet or facet value over time based on the past history of frequency changes + "! of the facet value. + begin of T_QUERY_AGGR_QUERY_TREND_AGGR, + "! Specifies that the aggregation type is `trend`. + TYPE type STRING, + "! Specifies the `term` or `group_by` aggregation for the facet that you want to + "! analyze. + FACET type STRING, + "! Specifies the `timeslice` aggregation that defines the time segments. + TIME_SEGMENTS type STRING, + "! Indicates whether to include estimated matching result information. + SHW_ESTIMATED_MATCHING_RESULTS type BOOLEAN, + "! Indicates whether to include total matching documents information. + SHOW_TOTAL_MATCHING_DOCUMENTS type BOOLEAN, + "! An array of aggregations. + RESULTS type STANDARD TABLE OF T_QUERY_TREND_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_AGGR_QUERY_TREND_AGGR. + types: + "!

+ "! A modifier that narrows the document set of the

+ "! subaggregations it precedes. + begin of T_QUERY_AGGR_QUERY_FILTER_AGGR, + "! Specifies that the aggregation type is `filter`. + TYPE type STRING, + "! The filter that is written in Discovery Query Language syntax and is applied to + "! the documents before subaggregations are run. + MATCH type STRING, + "! Number of documents that match the filter. + MATCHING_RESULTS type LONG, + "! An array of subaggregations. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_AGGR_QUERY_FILTER_AGGR. + types: + "!

+ "! An object that contains a new name or description for a

+ "! document classifier, updated training data, or new or updated test data. + begin of T_UPDATE_DOCUMENT_CLASSIFIER, + "! A new name for the classifier. + NAME type STRING, + "! A new description for the classifier. + DESCRIPTION type STRING, + end of T_UPDATE_DOCUMENT_CLASSIFIER. + types: + "!

+ "! Array of queries with curated responses for the specified

+ "! project. + begin of T_CURATIONS, + "! The project ID of the project that contains these curations. + PROJECT_ID type STRING, + "! Array of curated queries and responses. + CURATIONS type STANDARD TABLE OF T_CURATION WITH NON-UNIQUE DEFAULT KEY, + end of T_CURATIONS. + types: + "!

+ "! Detailed information about the specified project.

+ begin of T_PROJECT_CREATION, + "! The human readable name of this project. + NAME type STRING, + "! 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. + TYPE type STRING, + "! Default query parameters for this project. + DEFAULT_QUERY_PARAMETERS type T_DEFAULT_QUERY_PARAMS, + end of T_PROJECT_CREATION. + types: + "!

+ "! Returns results from the field that is specified.

+ begin of T_QUERY_TERM_AGGREGATION, + "! Specifies that the aggregation type is `term`. + TYPE type STRING, + "! The field in the document where the values come from. + FIELD type STRING, + "! The number of results returned. Not returned if `relevancy:true` is specified in + "! the request. + COUNT type INTEGER, + "! Identifier specified in the query request of this aggregation. Not returned if + "! `relevancy:true` is specified in the request. + NAME type STRING, + "! An array of results. + RESULTS type STANDARD TABLE OF T_QUERY_TERM_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TERM_AGGREGATION. + types: + "!

+ "! A restriction that alters the document set that is used by

+ "! the aggregations that it precedes. Subsequent aggregations are applied to + "! nested documents from the specified field. + begin of T_QUERY_NESTED_AGGREGATION, + "! Specifies that the aggregation type is `nested`. + TYPE type STRING, + "! The path to the document field to scope subsequent aggregations to. + PATH type STRING, + "! Number of nested documents found in the specified field. + MATCHING_RESULTS type LONG, + "! An array of subaggregations. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_NESTED_AGGREGATION. + types: + "!

+ "! Object that contains a new name for the specified project.

+ begin of T_PROJECT_NAME, + "! The new name to give this project. + NAME type STRING, + end of T_PROJECT_NAME. + types: + "!

+ "! Response object that contains an array of documents.

+ begin of T_LIST_DOCUMENTS_RESPONSE, + "! The number of matching results for the document query. + MATCHING_RESULTS type INTEGER, + "! An array that lists the documents in a collection. Only the document ID of each + "! document is returned in the list. You can use the [Get document](#getdocument) + "! method to get more information about an individual document. + DOCUMENTS type STANDARD TABLE OF T_DOCUMENT_DETAILS WITH NON-UNIQUE DEFAULT KEY, + end of T_LIST_DOCUMENTS_RESPONSE. + types: + "!

+ "! Result for the `topic` aggregation.

+ begin of T_QUERY_TOPIC_AGGR_RESULT, + "! Array of subaggregations of type `term` or `group_by` and `timeslice`. Each + "! element of the matrix that is returned contains a **topic_indicator** that is + "! calculated from the combination of each aggregation value and segment of time. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TOPIC_AGGR_RESULT. + types: + "!

+ "! Detects how much the frequency of a given facet value

+ "! deviates from the expected average for the given time period. This aggregation + "! type does not use data from previous time periods. It calculates an index by + "! using the averages of frequency counts of other facet values for the given time + "! period. + begin of T_QUERY_AGGR_QUERY_TOPIC_AGGR, + "! Specifies that the aggregation type is `topic`. + TYPE type STRING, + "! Specifies the `term` or `group_by` aggregation for the facet that you want to + "! analyze. + FACET type STRING, + "! Specifies the `timeslice` aggregation that defines the time segments. + TIME_SEGMENTS type STRING, + "! Indicates whether to include estimated matching result information. + SHW_ESTIMATED_MATCHING_RESULTS type BOOLEAN, + "! Indicates whether to include total matching documents information. + SHOW_TOTAL_MATCHING_DOCUMENTS type BOOLEAN, + "! An array of aggregations. + RESULTS type STANDARD TABLE OF T_QUERY_TOPIC_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_AGGR_QUERY_TOPIC_AGGR. + types: + "!

+ "! Details about a specific project.

+ begin of T_PROJECT_CREATION_DETAILS, + "! The human readable name of this project. + NAME type STRING, + "! 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. + TYPE type STRING, + end of T_PROJECT_CREATION_DETAILS. + types: + "!

+ "! Separates document results into groups that meet the

+ "! conditions you specify. + begin of T_QUERY_GROUP_BY_AGGREGATION, + "! Specifies that the aggregation type is `group_by`. + TYPE type STRING, + "! An array of results. + RESULTS type STANDARD TABLE OF T_QUERY_GROUP_BY_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_GROUP_BY_AGGREGATION. + types: + "!

+ "! An object that manages the settings and data that is

+ "! required to train a document classification model. + begin of T_CREATE_DOCUMENT_CLASSIFIER, + "! A human-readable name of the document classifier. + NAME type STRING, + "! A description of the document classifier. + DESCRIPTION type STRING, + "! The language of the training data that is associated with the document + "! classifier. Language is specified by using the ISO 639-1 language code, such as + "! `en` for English or `ja` for Japanese. + LANGUAGE type STRING, + "! The name of the field from the training and test data that contains the + "! classification labels. + ANSWER_FIELD type STRING, + "! An array of enrichments to apply to the data that is used to train and test the + "! document classifier. The output from the enrichments is used as features by the + "! classifier to classify the document content both during training and at run + "! time. + ENRICHMENTS type STANDARD TABLE OF T_DOC_CLASSIFIER_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY, + "! An object with details for creating federated document classifier models. + FEDERATED_CLASSIFICATION type T_CLASSIFIER_FEDERATED_MODEL, + end of T_CREATE_DOCUMENT_CLASSIFIER. + types: + "!

+ "! Returns results from the field that is specified.

+ begin of T_QUERY_AGGR_QUERY_TERM_AGGR, + "! Specifies that the aggregation type is `term`. + TYPE type STRING, + "! The field in the document where the values come from. + FIELD type STRING, + "! The number of results returned. Not returned if `relevancy:true` is specified in + "! the request. + COUNT type INTEGER, + "! Identifier specified in the query request of this aggregation. Not returned if + "! `relevancy:true` is specified in the request. + NAME type STRING, + "! An array of results. + RESULTS type STANDARD TABLE OF T_QUERY_TERM_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_AGGR_QUERY_TERM_AGGR. + types: + "!

+ "! Detects how much the frequency of a given facet value

+ "! deviates from the expected average for the given time period. This aggregation + "! type does not use data from previous time periods. It calculates an index by + "! using the averages of frequency counts of other facet values for the given time + "! period. + begin of T_QUERY_TOPIC_AGGREGATION, + "! Specifies that the aggregation type is `topic`. + TYPE type STRING, + "! Specifies the `term` or `group_by` aggregation for the facet that you want to + "! analyze. + FACET type STRING, + "! Specifies the `timeslice` aggregation that defines the time segments. + TIME_SEGMENTS type STRING, + "! Indicates whether to include estimated matching result information. + SHW_ESTIMATED_MATCHING_RESULTS type BOOLEAN, + "! Indicates whether to include total matching documents information. + SHOW_TOTAL_MATCHING_DOCUMENTS type BOOLEAN, + "! An array of aggregations. + RESULTS type STANDARD TABLE OF T_QUERY_TOPIC_AGGR_RESULT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_TOPIC_AGGREGATION. + types: + "!

+ "! Response object that contains an array of collection

+ "! details. + begin of T_LIST_COLLECTIONS_RESPONSE, + "! An array that contains information about each collection in the project. + COLLECTIONS type STANDARD TABLE OF T_COLLECTION WITH NON-UNIQUE DEFAULT KEY, + end of T_LIST_COLLECTIONS_RESPONSE. + types: + "!

+ "! A modifier that narrows the document set of the

+ "! subaggregations it precedes. + begin of T_QUERY_FILTER_AGGREGATION, + "! Specifies that the aggregation type is `filter`. + TYPE type STRING, + "! The filter that is written in Discovery Query Language syntax and is applied to + "! the documents before subaggregations are run. + MATCH type STRING, + "! Number of documents that match the filter. + MATCHING_RESULTS type LONG, + "! An array of subaggregations. + AGGREGATIONS type STANDARD TABLE OF JSONOBJECT WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_FILTER_AGGREGATION. + types: + "!

+ "! An object that represents the collection to be updated.

+ begin of T_UPDATE_COLLECTION, + "! The new name of the collection. + NAME type STRING, + "! The new description of the collection. + DESCRIPTION type STRING, + "! An array of enrichments that are applied to this collection. + ENRICHMENTS type STANDARD TABLE OF T_COLLECTION_ENRICHMENT WITH NON-UNIQUE DEFAULT KEY, + end of T_UPDATE_COLLECTION. + types: + "!

+ "! Object that contains notice query results.

+ begin of T_QUERY_NOTICES_RESPONSE, + "! The number of matching results. + MATCHING_RESULTS type INTEGER, + "! Array of document results that match the query. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, + end of T_QUERY_NOTICES_RESPONSE. + types: + "!

+ "! Returns a scalar calculation across all documents for the

+ "! field specified. Possible calculations include min, max, sum, average, and + "! unique_count. + begin of T_QRY_AGGR_QRY_CLCLTN_AGGR, + "! Specifies the calculation type, such as 'average`, `max`, `min`, `sum`, or + "! `unique_count`. + TYPE type STRING, + "! The field to perform the calculation on. + FIELD type STRING, + "! The value of the calculation. + VALUE type DOUBLE, + end of T_QRY_AGGR_QRY_CLCLTN_AGGR. + +constants: + "!

List of required fields per type.

+ begin of C_REQUIRED_FIELDS, + T_MDL_EVALUATION_MACRO_AVERAGE type string value '|PRECISION|RECALL|F1|', + T_PER_CLASS_MODEL_EVALUATION type string value '|NAME|PRECISION|RECALL|F1|', + T_MDL_EVALUATION_MICRO_AVERAGE type string value '|PRECISION|RECALL|F1|', + T_CLASSIFIER_MODEL_EVALUATION type string value '|MICRO_AVERAGE|MACRO_AVERAGE|PER_CLASS|', + T_DOCUMENT_CLASSIFIER_MODEL type string value '|NAME|', + T_PRJCT_LST_DTLS_RLVNCY_TRNNG1 type string value '|', + T_PROJECT_LIST_DETAILS type string value '|', + T_LIST_PROJECTS_RESPONSE type string value '|', + T_QUERY_PAIR_AGGR_RESULT type string value '|', + T_QUERY_AGGR_QUERY_PAIR_AGGR type string value '|', + T_QUERY_LARGE_TABLE_RESULTS type string value '|', + T_CURATION_RESULT type string value '|', + T_CURATED_RESULTS type string value '|', + T_TABLE_ELEMENT_LOCATION type string value '|BEGIN|END|', + T_TRAINING_EXAMPLE type string value '|DOCUMENT_ID|COLLECTION_ID|RELEVANCE|', + T_TRAINING_QUERY type string value '|NATURAL_LANGUAGE_QUERY|EXAMPLES|', + T_TABLE_CELL_VALUES type string value '|', + T_TABLE_CELL_KEY type string value '|', + T_TABLE_KEY_VALUE_PAIRS type string value '|', + T_CURATION_STATUS type string value '|', + T_QUERY_TOP_HITS_AGGR_RESULT type string value '|MATCHING_RESULTS|', + T_CURATION type string value '|', + T_CMPNNT_STTNGS_FLDS_SHWN_TTL type string value '|', + T_COMPONENT_SETTINGS_AGGR type string value '|', + T_CMPNNT_STTNGS_FLDS_SHWN_BODY type string value '|', + T_CMPNNT_SETTINGS_FIELDS_SHOWN type string value '|', + T_COMPONENT_SETTINGS_RESPONSE type string value '|', + T_DFLT_QRY_PRMS_SGGSTD_RFNMNTS type string value '|', + T_DFLT_QRY_PARAMS_TAB_RESULTS type string value '|', + T_DFLT_QUERY_PARAMS_PASSAGES type string value '|', + T_DEFAULT_QUERY_PARAMS type string value '|', + T_PROJECT_DETAILS type string value '|', + T_DOCUMENT_ACCEPTED type string value '|', + T_QUERY_TREND_AGGR_RESULT type string value '|', + T_QUERY_TREND_AGGREGATION type string value '|', + T_RESULT_PASSAGE_ANSWER type string value '|', + T_QUERY_RESPONSE_PASSAGE type string value '|', + T_DOC_CLASSIFIER_MODEL_TRAIN type string value '|NAME|', + T_QUERY_PAIR_AGGREGATION type string value '|', + T_QUERY_CALCULATION_AGGR type string value '|FIELD|', + T_CLLCTN_DTLS_SMRT_DOC_UNDRST1 type string value '|', + T_COLLECTION_ENRICHMENT type string value '|', + T_COLLECTION_DETAILS type string value '|NAME|', + T_CLASSIFIER_FEDERATED_MODEL type string value '|FIELD|', + T_DOC_CLASSIFIER_ENRICHMENT type string value '|ENRICHMENT_ID|FIELDS|', + T_DOCUMENT_CLASSIFIER type string value '|NAME|', + T_DOCUMENT_CLASSIFIERS type string value '|', + T_QUERY_TERM_AGGR_RESULT type string value '|KEY|MATCHING_RESULTS|', + T_TABLE_COLUMN_HEADER_IDS type string value '|', + T_QUERY_TIMESLICE_AGGR_RESULT type string value '|KEY_AS_STRING|KEY|MATCHING_RESULTS|', + T_QRY_AGGR_QRY_TIMESLICE_AGGR type string value '|FIELD|INTERVAL|', + T_FIELD type string value '|', + T_QUERY_LARGE_SIMILAR type string value '|', + T_QUERY_HISTOGRAM_AGGR_RESULT type string value '|KEY|MATCHING_RESULTS|', + T_QUERY_HISTOGRAM_AGGREGATION type string value '|FIELD|INTERVAL|', + T_TABLE_ROW_HEADER_IDS type string value '|', + T_PROJECT_REL_TRAIN_STATUS type string value '|', + T_QRY_AGGR_QRY_HISTOGRAM_AGGR type string value '|FIELD|INTERVAL|', + T_ANALYZED_RESULT type string value '|', + T_QUERY_LARGE_PASSAGES type string value '|', + T_QRY_LRG_SGGSTD_REFINEMENTS type string value '|', + T_QUERY_LARGE type string value '|', + T_ENRICHMENT_OPTIONS type string value '|', + T_ENRICHMENT type string value '|', + T_QUERY_GROUP_BY_AGGR_RESULT type string value '|KEY|MATCHING_RESULTS|', + T_QRY_AGGR_QUERY_GROUP_BY_AGGR type string value '|', + T_COLLECTION type string value '|', + T_DOCUMENT_CLASSIFIER_MODELS type string value '|', + T_TAB_ROW_HEADER_TEXTS_NORM type string value '|', + T_DOCUMENT_ATTRIBUTE type string value '|', + T_TABLE_ROW_HEADER_TEXTS type string value '|', + T_TABLE_COLUMN_HEADER_TEXTS type string value '|', + T_TAB_COLUMN_HEADER_TEXTS_NORM type string value '|', + T_TABLE_BODY_CELLS type string value '|', + T_TABLE_TEXT_LOCATION type string value '|', + T_QUERY_TOP_HITS_AGGREGATION type string value '|SIZE|', + T_DOCUMENT_DETAILS_CHILDREN type string value '|', + T_NOTICE type string value '|', + T_DOCUMENT_DETAILS type string value '|', + T_QUERY_AGGR_QUERY_NESTED_AGGR type string value '|PATH|MATCHING_RESULTS|', + T_COMPLETIONS type string value '|', + T_UPDATE_ENRICHMENT type string value '|NAME|', + T_QUERY_SUGGESTED_REFINEMENT type string value '|', + T_TABLE_HEADERS type string value '|', + T_RETRIEVAL_DETAILS type string value '|', + T_CREATE_ENRICHMENT type string value '|', + T_LIST_FIELDS_RESPONSE type string value '|', + T_QRY_AGGR_QUERY_TOP_HITS_AGGR type string value '|SIZE|', + T_QUERY_RESULT_PASSAGE type string value '|', + T_STOP_WORD_LIST type string value '|STOPWORDS|', + T_TRAINING_QUERY_SET type string value '|', + T_QUERY_RESULT_METADATA type string value '|COLLECTION_ID|', + T_QUERY_RESULT type string value '|DOCUMENT_ID|RESULT_METADATA|', + T_TABLE_COLUMN_HEADERS type string value '|', + T_TABLE_ROW_HEADERS type string value '|', + T_TABLE_RESULT_TABLE type string value '|', + T_QUERY_TABLE_RESULT type string value '|', + T_QUERY_RESPONSE type string value '|', + T_ANALYZED_DOCUMENT type string value '|', + T_QUERY_TIMESLICE_AGGREGATION type string value '|FIELD|INTERVAL|', + T_ERROR_RESPONSE type string value '|CODE|ERROR|', + T_EXPANSION type string value '|EXPANDED_TERMS|', + T_EXPANSIONS type string value '|EXPANSIONS|', + T_UPD_DOC_CLASSIFIER_MODEL type string value '|', + T_ENRICHMENTS type string value '|', + T_DELETE_DOCUMENT_RESPONSE type string value '|', + T_QUERY_AGGR_QUERY_TREND_AGGR type string value '|', + T_QUERY_AGGR_QUERY_FILTER_AGGR type string value '|MATCH|MATCHING_RESULTS|', + T_UPDATE_DOCUMENT_CLASSIFIER type string value '|', + T_CURATIONS type string value '|', + T_PROJECT_CREATION type string value '|NAME|TYPE|', + T_QUERY_TERM_AGGREGATION type string value '|', + T_QUERY_NESTED_AGGREGATION type string value '|PATH|MATCHING_RESULTS|', + T_PROJECT_NAME type string value '|', + T_LIST_DOCUMENTS_RESPONSE type string value '|', + T_QUERY_TOPIC_AGGR_RESULT type string value '|', + T_QUERY_AGGR_QUERY_TOPIC_AGGR type string value '|', + T_PROJECT_CREATION_DETAILS type string value '|NAME|TYPE|', + T_QUERY_GROUP_BY_AGGREGATION type string value '|', + T_CREATE_DOCUMENT_CLASSIFIER type string value '|NAME|LANGUAGE|ANSWER_FIELD|', + T_QUERY_AGGR_QUERY_TERM_AGGR type string value '|', + T_QUERY_TOPIC_AGGREGATION type string value '|', + T_LIST_COLLECTIONS_RESPONSE type string value '|', + T_QUERY_FILTER_AGGREGATION type string value '|MATCH|MATCHING_RESULTS|', + T_UPDATE_COLLECTION type string value '|', + T_QUERY_NOTICES_RESPONSE type string value '|', + T_QRY_AGGR_QRY_CLCLTN_AGGR type string value '|FIELD|', + __DUMMY type string value SPACE, + end of C_REQUIRED_FIELDS . + +constants: + "!

Map ABAP identifiers to service identifiers.

+ begin of C_ABAPNAME_DICTIONARY, + COLLECTIONS type string value 'collections', + MATCHING_RESULTS type string value 'matching_results', + DOCUMENTS type string value 'documents', + BEGIN type string value 'begin', + END type string value 'end', + RESULTS type string value 'results', + AGGREGATIONS type string value 'aggregations', + RETRIEVAL_DETAILS type string value 'retrieval_details', + SUGGESTED_QUERY type string value 'suggested_query', + SUGGESTED_REFINEMENTS type string value 'suggested_refinements', + TABLE_RESULTS type string value 'table_results', + PASSAGES type string value 'passages', + DOCUMENT_ID type string value 'document_id', + METADATA type string value 'metadata', + INNER type string value 'inner', + RESULT_METADATA type string value 'result_metadata', + DOCUMENT_PASSAGES type string value 'document_passages', + DOCUMENT_RETRIEVAL_SOURCE type string value 'document_retrieval_source', + COLLECTION_ID type string value 'collection_id', + CONFIDENCE type string value 'confidence', + PASSAGE_TEXT type string value 'passage_text', + START_OFFSET type string value 'start_offset', + END_OFFSET type string value 'end_offset', + FIELD type string value 'field', + ANSWERS type string value 'answers', + PASSAGE_SCORE type string value 'passage_score', + TABLE_ID type string value 'table_id', + SOURCE_DOCUMENT_ID type string value 'source_document_id', + TABLE_HTML type string value 'table_html', + TABLE_HTML_OFFSET type string value 'table_html_offset', + TABLE type string value 'table', + TEXT type string value 'text', + TYPE type string value 'type', + COUNT type string value 'count', + NAME type string value 'name', + KEY type string value 'key', + RELEVANCY type string value 'relevancy', + TOTAL_MATCHING_DOCUMENTS type string value 'total_matching_documents', + ESTIMATED_MATCHING_RESULTS type string value 'estimated_matching_results', + INTERVAL type string value 'interval', + KEY_AS_STRING type string value 'key_as_string', + PATH type string value 'path', + MATCH type string value 'match', + VALUE type string value 'value', + SIZE type string value 'size', + HITS type string value 'hits', + FIRST type string value 'first', + SECOND type string value 'second', + SHW_ESTIMATED_MATCHING_RESULTS type string value 'show_estimated_matching_results', + SHOW_TOTAL_MATCHING_DOCUMENTS type string value 'show_total_matching_documents', + FACET type string value 'facet', + TIME_SEGMENTS type string value 'time_segments', + CELL_ID type string value 'cell_id', + LOCATION type string value 'location', + ROW_INDEX_BEGIN type string value 'row_index_begin', + ROW_INDEX_END type string value 'row_index_end', + COLUMN_INDEX_BEGIN type string value 'column_index_begin', + COLUMN_INDEX_END type string value 'column_index_end', + TEXT_NORMALIZED type string value 'text_normalized', + ROW_HEADER_IDS type string value 'row_header_ids', + ROW_HEADER_TEXTS type string value 'row_header_texts', + ROW_HEADER_TEXTS_NORMALIZED type string value 'row_header_texts_normalized', + COLUMN_HEADER_IDS type string value 'column_header_ids', + COLUMN_HEADER_TEXTS type string value 'column_header_texts', + COLUMN_HEADER_TEXTS_NORMALIZED type string value 'column_header_texts_normalized', + ATTRIBUTES type string value 'attributes', + ID type string value 'id', + SECTION_TITLE type string value 'section_title', + TITLE type string value 'title', + TABLE_HEADERS type string value 'table_headers', + ROW_HEADERS type string value 'row_headers', + COLUMN_HEADERS type string value 'column_headers', + KEY_VALUE_PAIRS type string value 'key_value_pairs', + BODY_CELLS type string value 'body_cells', + CONTEXTS type string value 'contexts', + CODE type string value 'code', + ERROR type string value 'error', + COLLECTION_IDS type string value 'collection_ids', + FILTER type string value 'filter', + QUERY type string value 'query', + NATURAL_LANGUAGE_QUERY type string value 'natural_language_query', + AGGREGATION type string value 'aggregation', + RETURN type string value 'return', + RETURN_FIELD type string value 'return_field', + OFFSET type string value 'offset', + SORT type string value 'sort', + HIGHLIGHT type string value 'highlight', + SPELLING_SUGGESTIONS type string value 'spelling_suggestions', + SIMILAR type string value 'similar', + DOCUMENT_RETRIEVAL_STRATEGY type string value 'document_retrieval_strategy', + COMPLETIONS type string value 'completions', + FIELDS_SHOWN type string value 'fields_shown', + AUTOCOMPLETE type string value 'autocomplete', + STRUCTURED_SEARCH type string value 'structured_search', + RESULTS_PER_PAGE type string value 'results_per_page', + BODY type string value 'body', + USE_PASSAGE type string value 'use_passage', + LABEL type string value 'label', + MULTIPLE_SELECTIONS_ALLOWED type string value 'multiple_selections_allowed', + VISUALIZATION_TYPE type string value 'visualization_type', + STATUS type string value 'status', + QUERY_ID type string value 'query_id', + CREATED type string value 'created', + UPDATED type string value 'updated', + EXAMPLES type string value 'examples', + RELEVANCE type string value 'relevance', + QUERIES type string value 'queries', + FIELDS type string value 'fields', + NOTICES type string value 'notices', + NOTICE_ID type string value 'notice_id', + SEVERITY type string value 'severity', + STEP type string value 'step', + DESCRIPTION type string value 'description', + PROJECT_ID type string value 'project_id', + CURATIONS type string value 'curations', + CURATION_ID type string value 'curation_id', + CURATED_RESULTS type string value 'curated_results', + SNIPPET type string value 'snippet', + LANGUAGE type string value 'language', + ENRICHMENTS type string value 'enrichments', + SMART_DOCUMENT_UNDERSTANDING type string value 'smart_document_understanding', + CHILDREN type string value 'children', + FILENAME type string value 'filename', + FILE_TYPE type string value 'file_type', + SHA256 type string value 'sha256', + ENRICHMENT_ID type string value 'enrichment_id', + PROJECTS type string value 'projects', + RELEVANCY_TRAINING_STATUS type string value 'relevancy_training_status', + COLLECTION_COUNT type string value 'collection_count', + DEFAULT_QUERY_PARAMETERS type string value 'default_query_parameters', + DATA_UPDATED type string value 'data_updated', + TOTAL_EXAMPLES type string value 'total_examples', + SUFFICIENT_LABEL_DIVERSITY type string value 'sufficient_label_diversity', + PROCESSING type string value 'processing', + MINIMUM_EXAMPLES_ADDED type string value 'minimum_examples_added', + SUCCESSFULLY_TRAINED type string value 'successfully_trained', + AVAILABLE type string value 'available', + MINIMUM_QUERIES_ADDED type string value 'minimum_queries_added', + OPTIONS type string value 'options', + LANGUAGES type string value 'languages', + ENTITY_TYPE type string value 'entity_type', + REGULAR_EXPRESSION type string value 'regular_expression', + RESULT_FIELD type string value 'result_field', + CLASSIFIER_ID type string value 'classifier_id', + MODEL_ID type string value 'model_id', + CONFIDENCE_THRESHOLD type string value 'confidence_threshold', + TOP_K type string value 'top_k', + RESULT type string value 'result', + ANSWER_TEXT type string value 'answer_text', + CLASSIFIERS type string value 'classifiers', + RECOGNIZED_FIELDS type string value 'recognized_fields', + ANSWER_FIELD type string value 'answer_field', + TRAINING_DATA_FILE type string value 'training_data_file', + TEST_DATA_FILE type string value 'test_data_file', + FEDERATED_CLASSIFICATION type string value 'federated_classification', + MODELS type string value 'models', + EVALUATION type string value 'evaluation', + DEPLOYED_AT type string value 'deployed_at', + MICRO_AVERAGE type string value 'micro_average', + MACRO_AVERAGE type string value 'macro_average', + PER_CLASS type string value 'per_class', + PRECISION type string value 'precision', + RECALL type string value 'recall', + F1 type string value 'f1', + LEARNING_RATE type string value 'learning_rate', + L1_REGULARIZATION_STRENGTHS type string value 'l1_regularization_strengths', + L2_REGULARIZATION_STRENGTHS type string value 'l2_regularization_strengths', + TRAINING_MAX_STEPS type string value 'training_max_steps', + IMPROVEMENT_RATIO type string value 'improvement_ratio', + STOPWORDS type string value 'stopwords', + EXPANSIONS type string value 'expansions', + INPUT_TERMS type string value 'input_terms', + EXPANDED_TERMS type string value 'expanded_terms', + HAVE_NOTICES type string value 'have_notices', + ENABLED type string value 'enabled', + CHARACTERS type string value 'characters', + PER_DOCUMENT type string value 'per_document', + MAX_PER_DOCUMENT type string value 'max_per_document', + FIND_ANSWERS type string value 'find_answers', + MAX_ANSWERS_PER_PASSAGE type string value 'max_answers_per_passage', + DOCUMENT_IDS type string value 'document_ids', + MODEL type string value 'model', + end of C_ABAPNAME_DICTIONARY . + + + methods GET_APPNAME + redefinition . + methods GET_REQUEST_PROP + redefinition . + methods GET_SDK_VERSION_DATE + redefinition . + + + "!

List projects

+ "! Lists existing projects for this instance. + "! + "! @parameter E_RESPONSE | + "! Service return value of type T_LIST_PROJECTS_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_PROJECTS + importing + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_LIST_PROJECTS_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create a project

+ "! Create a new project for this instance + "! + "! @parameter I_PROJECTCREATION | + "! An object that represents the project to be created. + "! @parameter E_RESPONSE | + "! Service return value of type T_PROJECT_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_PROJECT + importing + !I_PROJECTCREATION type T_PROJECT_CREATION + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_PROJECT_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get project

+ "! Get details on the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter E_RESPONSE | + "! Service return value of type T_PROJECT_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_PROJECT + importing + !I_PROJECT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_PROJECT_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update a project

+ "! Update the specified project's name. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_PROJECTNAME | + "! An object that represents the new name of the project. + "! @parameter E_RESPONSE | + "! Service return value of type T_PROJECT_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_PROJECT + importing + !I_PROJECT_ID type STRING + !I_PROJECTNAME type T_PROJECT_NAME optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_PROJECT_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a project

+ "! Deletes the specified project.
+ "!
+ "! **Important:** Deleting a project deletes everything that is part of the + "! specified project, including all collections. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_PROJECT + importing + !I_PROJECT_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

List fields

+ "! Gets a list of the unique fields (and their types) stored in the specified + "! collections. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_IDS | + "! Comma separated list of the collection IDs. If this parameter is not specified, + "! all collections in the project are used. + "! @parameter E_RESPONSE | + "! Service return value of type T_LIST_FIELDS_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_FIELDS + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_IDS type TT_STRING optional + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_LIST_FIELDS_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List collections

+ "! Lists existing collections for the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter E_RESPONSE | + "! Service return value of type T_LIST_COLLECTIONS_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_COLLECTIONS + importing + !I_PROJECT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_LIST_COLLECTIONS_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create a collection

+ "! Create a new collection in the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTIONDETAILS | + "! An object that represents the collection to be created. + "! @parameter E_RESPONSE | + "! Service return value of type T_COLLECTION_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_COLLECTION + importing + !I_PROJECT_ID type STRING + !I_COLLECTIONDETAILS type T_COLLECTION_DETAILS + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_COLLECTION_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get collection

+ "! Get details about the specified collection. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter E_RESPONSE | + "! Service return value of type T_COLLECTION_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_COLLECTION + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_COLLECTION_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update a collection

+ "! Updates the specified collection's name, description, and enrichments. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_UPDATECOLLECTION | + "! An object that represents the collection to be updated. + "! @parameter E_RESPONSE | + "! Service return value of type T_COLLECTION_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_COLLECTION + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_UPDATECOLLECTION type T_UPDATE_COLLECTION + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_COLLECTION_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a collection

+ "! Deletes the specified collection from the project. All documents stored in the + "! specified collection and not shared is also deleted. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_COLLECTION + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List documents

+ "! Lists the documents in the specified collection. The list includes only the + "! document ID of each document and returns information for up to 10,000 + "! documents.
+ "!
+ "! **Note**: This method is available only from Cloud Pak for Data version 4.0.9 + "! and later installed instances and from Plus and Enterprise plan IBM + "! Cloud-managed instances. It is not currently available from Premium plan + "! instances. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_COUNT | + "! The maximum number of documents to return. Up to 1,000 documents are returned by + "! default. The maximum number allowed is 10,000. + "! @parameter I_STATUS | + "! Filters the documents to include only documents with the specified ingestion + "! status. The options include:
+ "!
+ "! * `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.
+ "!
+ "! You can specify one status value or add a comma-separated list of more than one + "! status value. For example, `available,failed`. + "! @parameter I_HAS_NOTICES | + "! If set to `true`, only documents that have notices, meaning documents for which + "! warnings or errors were generated during the ingestion, are returned. If set to + "! `false`, only documents that don't have notices are returned. If + "! unspecified, no filter based on notices is applied.
+ "!
+ "! Notice details are not available in the result, but you can use the [Query + "! collection notices](#querycollectionnotices) method to find details by adding + "! the parameter `query=notices.document_id:{document-id}`. + "! @parameter I_IS_PARENT | + "! If set to `true`, only parent documents, meaning documents that were split + "! during the ingestion process and resulted in two or more child documents, are + "! returned. If set to `false`, only child documents are returned. If unspecified, + "! no filter based on the parent or child relationship is applied.
+ "!
+ "! CSV files, for example, are split into separate documents per line and JSON + "! files are split into separate documents per object. + "! @parameter I_PARENT_DOCUMENT_ID | + "! Filters the documents to include only child documents that were generated when + "! the specified parent document was processed. + "! @parameter I_SHA256 | + "! Filters the documents to include only documents with the specified SHA-256 hash. + "! Format the hash as a hexadecimal string. + "! @parameter E_RESPONSE | + "! Service return value of type T_LIST_DOCUMENTS_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_DOCUMENTS + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_COUNT type INTEGER default 1000 + !I_STATUS type STRING optional + !I_HAS_NOTICES type BOOLEAN optional + !I_IS_PARENT type BOOLEAN optional + !I_PARENT_DOCUMENT_ID type STRING optional + !I_SHA256 type STRING optional + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_LIST_DOCUMENTS_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Add a document

+ "! Add a document to a collection with optional metadata.
+ "!
+ "! Returns immediately after the system has accepted the document for + "! processing.
+ "!
+ "! Use this method to upload a file to the collection. You cannot use this method + "! to crawl an external data source.
+ "!
+ "! * For a list of supported file types, see the [product + "! documentation](/docs/discovery-data?topic=discovery-data-collections#supportedf + "! iletypes).
+ "!
+ "! * You must provide document content, metadata, or both. If the request is + "! missing both document content and metadata, it is rejected.
+ "!
+ "! * You can set the **Content-Type** parameter on the **file** part to indicate + "! the media type of the document. If the **Content-Type** parameter is missing or + "! is one of the generic media types (for example, `application/octet-stream`), + "! then the service attempts to automatically detect the document's media + "! type.
+ "!
+ "! * If the document is uploaded to a collection that shares its data with + "! another collection, the **X-Watson-Discovery-Force** header must be set to + "! `true`.
+ "!
+ "! * In curl requests only, you can assign an ID to a document that you add by + "! appending the ID to the endpoint + "! (`/v2/projects/{project_id}/collections/{collection_id}/doc + "! uments/{document_id}`). If a document already exists with the + "! specified ID, it is replaced.
+ "!
+ "! For more information about how certain file types and field names are handled + "! when a file is added to a collection, see the [product + "! documentation](/docs/discovery-data?topic=discovery-data-index-overview#field-n + "! ame-limits). + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_FILE | + "! When adding a document, the content of the document to ingest. For maximum + "! supported file size limits, see [the + "! documentation](/docs/discovery-data?topic=discovery-data-collections#collection + "! s-doc-limits).
+ "!
+ "! When analyzing a document, the content of the document to analyze but not + "! ingest. Only the `application/json` content type is supported currently. For + "! maximum supported file size limits, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- + "! limits). + "! @parameter I_FILENAME | + "! The filename for file. + "! @parameter I_FILE_CONTENT_TYPE | + "! The content type of file. + "! @parameter I_METADATA | + "! Add information about the file that you want to include in the response.
+ "!
+ "! The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 + "! MB are rejected.
+ "!
+ "! Example:
+ "!
+ "! ```
+ "! {
+ "! "filename": "favorites2.json",
+ "! "file_type": "json"
+ "! }. + "! @parameter I_X_WATSON_DISCOVERY_FORCE | + "! When `true`, the uploaded document is added to the collection even if the data + "! for that collection is shared with other collections. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_ACCEPTED + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods ADD_DOCUMENT + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_FILE type FILE optional + !I_FILENAME type STRING optional + !I_FILE_CONTENT_TYPE type STRING optional + !I_METADATA type STRING optional + !I_X_WATSON_DISCOVERY_FORCE type BOOLEAN default c_boolean_false + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_ACCEPTED + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get document details

+ "! Get details about a specific document, whether the document is added by + "! uploading a file or by crawling an external data source.
+ "!
+ "! **Note**: This method is available only from Cloud Pak for Data version 4.0.9 + "! and later installed instances and from Plus and Enterprise plan IBM + "! Cloud-managed instances. It is not currently available from Premium plan + "! instances. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_DOCUMENT_ID | + "! The ID of the document. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_DETAILS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_DOCUMENT + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_DOCUMENT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_DETAILS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update a document

+ "! Replace an existing document or add a document with a specified document ID. + "! Starts ingesting a document with optional metadata.
+ "!
+ "! Use this method to upload a file to a collection. You cannot use this method to + "! crawl an external data source.
+ "!
+ "! If the document is uploaded to a collection that shares its data with another + "! collection, the **X-Watson-Discovery-Force** header must be set to `true`.
+ "!
+ "! **Notes:**
+ "!
+ "! * Uploading a new document with this method automatically replaces any existing + "! document stored with the same document ID.
+ "!
+ "! * If an uploaded document is split into child documents during ingestion, all + "! existing child documents are overwritten, even if the updated version of the + "! document has fewer child documents. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_DOCUMENT_ID | + "! The ID of the document. + "! @parameter I_FILE | + "! When adding a document, the content of the document to ingest. For maximum + "! supported file size limits, see [the + "! documentation](/docs/discovery-data?topic=discovery-data-collections#collection + "! s-doc-limits).
+ "!
+ "! When analyzing a document, the content of the document to analyze but not + "! ingest. Only the `application/json` content type is supported currently. For + "! maximum supported file size limits, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- + "! limits). + "! @parameter I_FILENAME | + "! The filename for file. + "! @parameter I_FILE_CONTENT_TYPE | + "! The content type of file. + "! @parameter I_METADATA | + "! Add information about the file that you want to include in the response.
+ "!
+ "! The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 + "! MB are rejected.
+ "!
+ "! Example:
+ "!
+ "! ```
+ "! {
+ "! "filename": "favorites2.json",
+ "! "file_type": "json"
+ "! }. + "! @parameter I_X_WATSON_DISCOVERY_FORCE | + "! When `true`, the uploaded document is added to the collection even if the data + "! for that collection is shared with other collections. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_ACCEPTED + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_DOCUMENT + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_DOCUMENT_ID type STRING + !I_FILE type FILE optional + !I_FILENAME type STRING optional + !I_FILE_CONTENT_TYPE type STRING optional + !I_METADATA type STRING optional + !I_X_WATSON_DISCOVERY_FORCE type BOOLEAN default c_boolean_false + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_ACCEPTED + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a document

+ "! Deletes the document with the document ID that you specify from the collection. + "! Removes uploaded documents from the collection permanently. If you delete a + "! document that was added by crawling an external data source, the document will + "! be added again with the next scheduled crawl of the data source. The delete + "! function removes the document from the collection, not from the external data + "! source.
+ "!
+ "! **Note:** Files such as CSV or JSON files generate subdocuments when they are + "! added to a collection. If you delete a subdocument, and then repeat the action + "! that created it, the deleted document is added back in to your collection. To + "! remove subdocuments that are generated by an uploaded file, delete the original + "! document instead. You can get the document ID of the original document from the + "! `parent_document_id` of the subdocument result. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_DOCUMENT_ID | + "! The ID of the document. + "! @parameter I_X_WATSON_DISCOVERY_FORCE | + "! When `true`, the uploaded document is added to the collection even if the data + "! for that collection is shared with other collections. + "! @parameter E_RESPONSE | + "! Service return value of type T_DELETE_DOCUMENT_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_DOCUMENT + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_DOCUMENT_ID type STRING + !I_X_WATSON_DISCOVERY_FORCE type BOOLEAN default c_boolean_false + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DELETE_DOCUMENT_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Query a project

+ "! Search your data by submitting queries that are written in natural language or + "! formatted in the Discovery Query Language. For more information, see the + "! [Discovery + "! documentation](/docs/discovery-data?topic=discovery-data-query-concepts). The + "! default query parameters differ by project type. For more information about the + "! project default settings, see the [Discovery + "! documentation](/docs/discovery-data?topic=discovery-data-query-defaults). See + "! [the Projects API documentation](#create-project) for details about how to set + "! custom default query settings.
+ "!
+ "! The length of the UTF-8 encoding of the POST body cannot exceed 10,000 bytes, + "! which is roughly equivalent to 10,000 characters in English. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_QUERY_LONG | + "! An object that represents the query to be submitted. + "! @parameter E_RESPONSE | + "! Service return value of type T_QUERY_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods QUERY + importing + !I_PROJECT_ID type STRING + !I_QUERY_LONG type T_QUERY_LARGE optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_QUERY_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get Autocomplete Suggestions

+ "! Returns completion query suggestions for the specified prefix. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_PREFIX | + "! The prefix to use for autocompletion. For example, the prefix `Ho` could + "! autocomplete to `hot`, `housing`, or `how`. + "! @parameter I_COLLECTION_IDS | + "! Comma separated list of the collection IDs. If this parameter is not specified, + "! all collections in the project are used. + "! @parameter I_FIELD | + "! The field in the result documents that autocompletion suggestions are identified + "! from. + "! @parameter I_COUNT | + "! The number of autocompletion suggestions to return. + "! @parameter E_RESPONSE | + "! Service return value of type T_COMPLETIONS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_AUTOCOMPLETION + importing + !I_PROJECT_ID type STRING + !I_PREFIX type STRING + !I_COLLECTION_IDS type TT_STRING optional + !I_FIELD type STRING optional + !I_COUNT type INTEGER default 5 + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_COMPLETIONS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Query collection notices

+ "! Finds collection-level notices (errors and warnings) that are generated when + "! documents are ingested. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_FILTER | + "! Searches for documents that match the Discovery Query Language criteria that is + "! specified as input. Filter calls are cached and are faster than query calls + "! because the results are not ordered by relevance. When used with the + "! `aggregation`, `query`, or `natural_language_query` parameters, the `filter` + "! parameter runs first. This parameter is useful for limiting results to those + "! that contain specific metadata values. + "! @parameter I_QUERY | + "! A query search that is written in the Discovery Query Language and returns all + "! matching documents in your data set with full enrichments and full text, and + "! with the most relevant documents listed first. + "! @parameter I_NATURAL_LANGUAGE_QUERY | + "! A natural language query that returns relevant documents by using training data + "! and natural language understanding. + "! @parameter I_COUNT | + "! Number of results to return. The maximum for the **count** and **offset** values + "! together in any one query is **10,000**. + "! @parameter I_OFFSET | + "! The number of query results to skip at the beginning. For example, if the total + "! number of results that are returned is 10 and the offset is 8, it returns the + "! last two results. The maximum for the **count** and **offset** values together + "! in any one query is **10000**. + "! @parameter E_RESPONSE | + "! Service return value of type T_QUERY_NOTICES_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods QUERY_COLLECTION_NOTICES + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_FILTER type STRING optional + !I_QUERY type STRING optional + !I_NATURAL_LANGUAGE_QUERY type STRING optional + !I_COUNT type INTEGER default 10 + !I_OFFSET type INTEGER optional + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_QUERY_NOTICES_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Query project notices

+ "! Finds project-level notices (errors and warnings). Currently, project-level + "! notices are generated by relevancy training. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_FILTER | + "! Searches for documents that match the Discovery Query Language criteria that is + "! specified as input. Filter calls are cached and are faster than query calls + "! because the results are not ordered by relevance. When used with the + "! `aggregation`, `query`, or `natural_language_query` parameters, the `filter` + "! parameter runs first. This parameter is useful for limiting results to those + "! that contain specific metadata values. + "! @parameter I_QUERY | + "! A query search that is written in the Discovery Query Language and returns all + "! matching documents in your data set with full enrichments and full text, and + "! with the most relevant documents listed first. + "! @parameter I_NATURAL_LANGUAGE_QUERY | + "! A natural language query that returns relevant documents by using training data + "! and natural language understanding. + "! @parameter I_COUNT | + "! Number of results to return. The maximum for the **count** and **offset** values + "! together in any one query is **10,000**. + "! @parameter I_OFFSET | + "! The number of query results to skip at the beginning. For example, if the total + "! number of results that are returned is 10 and the offset is 8, it returns the + "! last two results. The maximum for the **count** and **offset** values together + "! in any one query is **10000**. + "! @parameter E_RESPONSE | + "! Service return value of type T_QUERY_NOTICES_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods QUERY_NOTICES + importing + !I_PROJECT_ID type STRING + !I_FILTER type STRING optional + !I_QUERY type STRING optional + !I_NATURAL_LANGUAGE_QUERY type STRING optional + !I_COUNT type INTEGER default 10 + !I_OFFSET type INTEGER optional + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_QUERY_NOTICES_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Get a custom stop words list

+ "! Returns the custom stop words list that is used by the collection. For + "! information about the default stop words lists that are applied to queries, see + "! [the product + "! documentation](/docs/discovery-data?topic=discovery-data-stopwords). + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter E_RESPONSE | + "! Service return value of type T_STOP_WORD_LIST + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_STOPWORD_LIST + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_STOP_WORD_LIST + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create a custom stop words list

+ "! Adds a list of custom stop words. Stop words are words that you want the service + "! to ignore when they occur in a query because they're not useful in + "! distinguishing the semantic meaning of the query. The stop words list cannot + "! contain more than 1 million characters.
+ "!
+ "! A default stop words list is used by all collections. The default list is + "! applied both at indexing time and at query time. A custom stop words list that + "! you add is used at query time only.
+ "!
+ "! The custom stop words list augments the default stop words list; you cannot + "! remove stop words. For information about the default stop words lists per + "! language, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-stopwords). + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_STOPWORDLIST | + "! No documentation available. + "! @parameter E_RESPONSE | + "! Service return value of type T_STOP_WORD_LIST + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_STOPWORD_LIST + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_STOPWORDLIST type T_STOP_WORD_LIST optional + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_STOP_WORD_LIST + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a custom stop words list

+ "! Deletes a custom stop words list to stop using it in queries against the + "! collection. After a custom stop words list is deleted, the default stop words + "! list is used. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_STOPWORD_LIST + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get the expansion list

+ "! Returns the current expansion list for the specified collection. If an expansion + "! list is not specified, an empty expansions array is returned. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter E_RESPONSE | + "! Service return value of type T_EXPANSIONS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_EXPANSIONS + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_EXPANSIONS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create or update an expansion list

+ "! Creates or replaces the expansion list for this collection. An expansion list + "! introduces alternative wording for key terms that are mentioned in your + "! collection. By identifying synonyms or common misspellings, you expand the + "! scope of a query beyond exact matches. The maximum number of expanded terms + "! allowed per collection is 5,000. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_BODY | + "! An object that defines the expansion list. + "! @parameter E_RESPONSE | + "! Service return value of type T_EXPANSIONS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_EXPANSIONS + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_BODY type T_EXPANSIONS + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_EXPANSIONS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete the expansion list

+ "! Removes the expansion information for this collection. To disable query + "! expansion for a collection, delete the expansion list. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_EXPANSIONS + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List component settings

+ "! Returns default configuration settings for components. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter E_RESPONSE | + "! Service return value of type T_COMPONENT_SETTINGS_RESPONSE + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_COMPONENT_SETTINGS + importing + !I_PROJECT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_COMPONENT_SETTINGS_RESPONSE + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List training queries

+ "! List the training queries for the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter E_RESPONSE | + "! Service return value of type T_TRAINING_QUERY_SET + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_TRAINING_QUERIES + importing + !I_PROJECT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_TRAINING_QUERY_SET + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete training queries

+ "! Removes all training queries for the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_TRAINING_QUERIES + importing + !I_PROJECT_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create training query

+ "! Add a query to the training data for this project. The query can contain a + "! filter and natural language query. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_TRAININGQUERY | + "! An object that represents the query to be submitted. At least 50 queries are + "! required for training to begin. A maximum of 10,000 queries are allowed. + "! @parameter E_RESPONSE | + "! Service return value of type T_TRAINING_QUERY + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_TRAINING_QUERY + importing + !I_PROJECT_ID type STRING + !I_TRAININGQUERY type T_TRAINING_QUERY + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_TRAINING_QUERY + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get a training data query

+ "! Get details for a specific training data query, including the query string and + "! all examples + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_QUERY_ID | + "! The ID of the query used for training. + "! @parameter E_RESPONSE | + "! Service return value of type T_TRAINING_QUERY + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_TRAINING_QUERY + importing + !I_PROJECT_ID type STRING + !I_QUERY_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_TRAINING_QUERY + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update a training query

+ "! Updates an existing training query and it's examples. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_QUERY_ID | + "! The ID of the query used for training. + "! @parameter I_BODY | + "! The body of the example that is to be added to the specified query. + "! @parameter E_RESPONSE | + "! Service return value of type T_TRAINING_QUERY + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_TRAINING_QUERY + importing + !I_PROJECT_ID type STRING + !I_QUERY_ID type STRING + !I_BODY type T_TRAINING_QUERY + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_TRAINING_QUERY + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a training data query

+ "! Removes details from a training data query, including the query string and all + "! examples. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_QUERY_ID | + "! The ID of the query used for training. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_TRAINING_QUERY + importing + !I_PROJECT_ID type STRING + !I_QUERY_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List enrichments

+ "! Lists the enrichments available to this project. The *Part of Speech* and + "! *Sentiment of Phrases* enrichments might be listed, but are reserved for + "! internal use only. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENRICHMENTS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_ENRICHMENTS + importing + !I_PROJECT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENRICHMENTS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create an enrichment

+ "! Create an enrichment for use with the specified project. To apply the enrichment + "! to a collection in the project, use the [Collections + "! API](/apidocs/discovery-data#createcollection). + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_ENRICHMENT | + "! Information about a specific enrichment. + "! @parameter I_FILE | + "! The enrichment file to upload. Expected file types per enrichment are as + "! follows:
+ "!
+ "! * CSV for `dictionary`
+ "!
+ "! * PEAR for `uima_annotator` and `rule_based` (Explorer)
+ "!
+ "! * ZIP for `watson_knowledge_studio_model` and `rule_based` (Studio Advanced Rule + "! Editor). + "! @parameter E_RESPONSE | + "! Service return value of type T_ENRICHMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_ENRICHMENT + importing + !I_PROJECT_ID type STRING + !I_ENRICHMENT type T_CREATE_ENRICHMENT + !I_FILE type FILE optional + !I_FILE_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENRICHMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get enrichment

+ "! Get details about a specific enrichment. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_ENRICHMENT_ID | + "! The ID of the enrichment. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENRICHMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_ENRICHMENT + importing + !I_PROJECT_ID type STRING + !I_ENRICHMENT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENRICHMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update an enrichment

+ "! Updates an existing enrichment's name and description. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_ENRICHMENT_ID | + "! The ID of the enrichment. + "! @parameter I_UPDATEENRICHMENT | + "! An object that lists the new name and description for an enrichment. + "! @parameter E_RESPONSE | + "! Service return value of type T_ENRICHMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_ENRICHMENT + importing + !I_PROJECT_ID type STRING + !I_ENRICHMENT_ID type STRING + !I_UPDATEENRICHMENT type T_UPDATE_ENRICHMENT + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ENRICHMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete an enrichment

+ "! Deletes an existing enrichment from the specified project.
+ "!
+ "! **Note:** Only enrichments that have been manually created can be deleted. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_ENRICHMENT_ID | + "! The ID of the enrichment. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_ENRICHMENT + importing + !I_PROJECT_ID type STRING + !I_ENRICHMENT_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List document classifiers

+ "! Get a list of the document classifiers in a project. Returns only the name and + "! classifier ID of each document classifier. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIERS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_DOCUMENT_CLASSIFIERS + importing + !I_PROJECT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIERS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create a document classifier

+ "! Create a document classifier. You can use the API to create a document + "! classifier in any project type. After you create a document classifier, you can + "! use the Enrichments API to create a classifier enrichment, and then the + "! Collections API to apply the enrichment to a collection in the project.
+ "!
+ "! **Note:** This method is supported on installed instances (IBM Cloud Pak for + "! Data) or IBM Cloud-managed Premium or Enterprise plan instances. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_TRAINING_DATA | + "! The training data CSV file to upload. The CSV file must have headers. The file + "! must include a field that contains the text you want to classify and a field + "! that contains the classification labels that you want to use to classify your + "! data. If you want to specify multiple values in a single field, use a semicolon + "! as the value separator. For a sample file, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-cm-doc-classifier). + "! @parameter I_CLASSIFIER | + "! An object that manages the settings and data that is required to train a + "! document classification model. + "! @parameter I_TEST_DATA | + "! The CSV with test data to upload. The column values in the test file must be the + "! same as the column values in the training data file. If no test data is + "! provided, the training data is split into two separate groups of training and + "! test data. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_DOCUMENT_CLASSIFIER + importing + !I_PROJECT_ID type STRING + !I_TRAINING_DATA type FILE + !I_CLASSIFIER type T_CREATE_DOCUMENT_CLASSIFIER + !I_TEST_DATA type FILE optional + !I_TRAINING_DATA_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL + !I_TEST_DATA_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get a document classifier

+ "! Get details about a specific document classifier. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_DOCUMENT_CLASSIFIER + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update a document classifier

+ "! Update the document classifier name or description, update the training data, or + "! add or update the test data. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter I_CLASSIFIER | + "! An object that contains a new name or description for a document classifier, + "! updated training data, or new or updated test data. + "! @parameter I_TRAINING_DATA | + "! The training data CSV file to upload. The CSV file must have headers. The file + "! must include a field that contains the text you want to classify and a field + "! that contains the classification labels that you want to use to classify your + "! data. If you want to specify multiple values in a single column, use a + "! semicolon as the value separator. For a sample file, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-cm-doc-classifier). + "! @parameter I_TEST_DATA | + "! The CSV with test data to upload. The column values in the test file must be the + "! same as the column values in the training data file. If no test data is + "! provided, the training data is split into two separate groups of training and + "! test data. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_DOCUMENT_CLASSIFIER + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_CLASSIFIER type T_UPDATE_DOCUMENT_CLASSIFIER + !I_TRAINING_DATA type FILE optional + !I_TEST_DATA type FILE optional + !I_TRAINING_DATA_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL + !I_TEST_DATA_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a document classifier

+ "! Deletes an existing document classifier from the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_DOCUMENT_CLASSIFIER + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List document classifier models

+ "! Get a list of the document classifier models in a project. Returns only the name + "! and model ID of each document classifier model. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER_MODELS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LST_DOCUMENT_CLASSIFIER_MODELS + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER_MODELS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create a document classifier model

+ "! Create a document classifier model by training a model that uses the data and + "! classifier settings defined in the specified document classifier.
+ "!
+ "! **Note:** This method is supported on installed intances (IBM Cloud Pak for + "! Data) or IBM Cloud-managed Premium or Enterprise plan instances. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter I_DOCUMENTCLASSIFIERMODELTRAIN | + "! An object that contains the training configuration information for the document + "! classifier to be trained. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CRE_DOCUMENT_CLASSIFIER_MODEL + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_DOCUMENTCLASSIFIERMODELTRAIN type T_DOC_CLASSIFIER_MODEL_TRAIN + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get a document classifier model

+ "! Get details about a specific document classifier model. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter I_MODEL_ID | + "! The ID of the classifier model. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_DOCUMENT_CLASSIFIER_MODEL + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_MODEL_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update a document classifier model

+ "! Update the document classifier model name or description. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter I_MODEL_ID | + "! The ID of the classifier model. + "! @parameter I_UPDTDCMNTCLSSFRMDL | + "! An object that lists a new name or description for a document classifier model. + "! @parameter E_RESPONSE | + "! Service return value of type T_DOCUMENT_CLASSIFIER_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPD_DOCUMENT_CLASSIFIER_MODEL + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_MODEL_ID type STRING + !I_UPDTDCMNTCLSSFRMDL type T_UPD_DOC_CLASSIFIER_MODEL + !I_contenttype type string default 'application/json' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DOCUMENT_CLASSIFIER_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a document classifier model

+ "! Deletes an existing document classifier model from the specified project. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_CLASSIFIER_ID | + "! The ID of the classifier. + "! @parameter I_MODEL_ID | + "! The ID of the classifier model. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DEL_DOCUMENT_CLASSIFIER_MODEL + importing + !I_PROJECT_ID type STRING + !I_CLASSIFIER_ID type STRING + !I_MODEL_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Analyze a Document

+ "! Process a document and return it for realtime use. Supports JSON files + "! only.
+ "!
+ "! The file is not stored in the collection, but is processed according to the + "! collection's configuration settings. To get results, enrichments must be + "! applied to a field in the collection that also exists in the file that you want + "! to analyze. For example, to analyze text in a `Quote` field, you must apply + "! enrichments to the `Quote` field in the collection configuration. Then, when + "! you analyze the file, the text in the `Quote` field is analyzed and results are + "! written to a field named `enriched_Quote`.
+ "!
+ "! **Note:** This method is supported with Enterprise plan deployments and + "! installed deployments only. + "! + "! @parameter I_PROJECT_ID | + "! The ID of the project. This information can be found from the *Integrate and + "! Deploy* page in Discovery. + "! @parameter I_COLLECTION_ID | + "! The ID of the collection. + "! @parameter I_FILE | + "! When adding a document, the content of the document to ingest. For maximum + "! supported file size limits, see [the + "! documentation](/docs/discovery-data?topic=discovery-data-collections#collection + "! s-doc-limits).
+ "!
+ "! When analyzing a document, the content of the document to analyze but not + "! ingest. Only the `application/json` content type is supported currently. For + "! maximum supported file size limits, see [the product + "! documentation](/docs/discovery-data?topic=discovery-data-analyzeapi#analyzeapi- + "! limits). + "! @parameter I_FILENAME | + "! The filename for file. + "! @parameter I_FILE_CONTENT_TYPE | + "! The content type of file. + "! @parameter I_METADATA | + "! Add information about the file that you want to include in the response.
+ "!
+ "! The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 + "! MB are rejected.
+ "!
+ "! Example:
+ "!
+ "! ```
+ "! {
+ "! "filename": "favorites2.json",
+ "! "file_type": "json"
+ "! }. + "! @parameter E_RESPONSE | + "! Service return value of type T_ANALYZED_DOCUMENT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods ANALYZE_DOCUMENT + importing + !I_PROJECT_ID type STRING + !I_COLLECTION_ID type STRING + !I_FILE type FILE optional + !I_FILENAME type STRING optional + !I_FILE_CONTENT_TYPE type STRING optional + !I_METADATA type STRING optional + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_ANALYZED_DOCUMENT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

Delete labeled data

+ "! Deletes all data associated with a specified customer ID. The method has no + "! effect if no data is associated with the customer ID.
+ "!
+ "! You associate a customer ID with data by passing the **X-Watson-Metadata** + "! header with a request that passes data. For more information about personal + "! data and customer IDs, see [Information + "! security](/docs/discovery-data?topic=discovery-data-information-security#inform + "! ation-security).
+ "!
+ "! **Note:** This method is only supported on IBM Cloud instances of Discovery. + "! + "! @parameter I_CUSTOMER_ID | + "! The customer ID for which all data is to be deleted. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_USER_DATA + importing + !I_CUSTOMER_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + +protected section. + +private section. + +ENDCLASS. + +class ZCL_IBMC_DISCOVERY_V2 IMPLEMENTATION. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_APPNAME +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_APPNAME TYPE STRING +* +-------------------------------------------------------------------------------------- + method GET_APPNAME. + + e_appname = 'Discovery v2'. + + endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Protected Method ZCL_IBMC_DISCOVERY_V2->GET_REQUEST_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) +* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP +* +-------------------------------------------------------------------------------------- +method GET_REQUEST_PROP. + + data: + lv_auth_method type string ##NEEDED. + + e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). + + lv_auth_method = i_auth_method. + if lv_auth_method eq c_default. + lv_auth_method = 'IAM'. + endif. + if lv_auth_method is initial. + e_request_prop-auth_basic = c_boolean_false. + e_request_prop-auth_oauth = c_boolean_false. + e_request_prop-auth_apikey = c_boolean_false. + elseif lv_auth_method eq 'IAM'. + e_request_prop-auth_name = 'IAM'. + e_request_prop-auth_type = 'apiKey'. + e_request_prop-auth_headername = 'Authorization'. + e_request_prop-auth_query = c_boolean_false. + e_request_prop-auth_header = c_boolean_true. + else. + endif. + + e_request_prop-url-protocol = 'https'. + e_request_prop-url-host = 'api.us-south.discovery.watson.cloud.ibm.com'. + e_request_prop-url-path_base = ''. + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_SDK_VERSION_DATE +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_SDK_VERSION_DATE TYPE STRING +* +-------------------------------------------------------------------------------------- + method get_sdk_version_date. + + e_sdk_version_date = '20231212104233'. + + endmethod. + + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_PROJECTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_LIST_PROJECTS_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_PROJECTS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_PROJECT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECTCREATION TYPE T_PROJECT_CREATION +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_PROJECT_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_PROJECT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects'. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_PROJECTCREATION ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_PROJECTCREATION i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'ProjectCreation' i_value = i_PROJECTCREATION ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_PROJECTCREATION to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_PROJECT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_PROJECT_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_PROJECT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPDATE_PROJECT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_PROJECTNAME TYPE T_PROJECT_NAME(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_PROJECT_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_PROJECT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_PROJECTNAME is initial. + lv_datatype = get_datatype( i_PROJECTNAME ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_PROJECTNAME i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'ProjectName' i_value = i_PROJECTNAME ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_PROJECTNAME to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_PROJECT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_PROJECT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_FIELDS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_IDS TYPE TT_STRING(optional) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_LIST_FIELDS_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_FIELDS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/fields'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_COLLECTION_IDS is supplied. + data: + lv_item_COLLECTION_IDS type STRING. + clear: lv_queryparam, lv_sep. + loop at i_COLLECTION_IDS into lv_item_COLLECTION_IDS. + lv_queryparam = lv_queryparam && lv_sep && lv_item_COLLECTION_IDS. + lv_sep = ','. + endloop. + lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `collection_ids` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_COLLECTIONS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_LIST_COLLECTIONS_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_COLLECTIONS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_COLLECTION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTIONDETAILS TYPE T_COLLECTION_DETAILS +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_COLLECTION_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_COLLECTION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_COLLECTIONDETAILS ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_COLLECTIONDETAILS i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'CollectionDetails' i_value = i_COLLECTIONDETAILS ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_COLLECTIONDETAILS to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_COLLECTION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_COLLECTION_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_COLLECTION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPDATE_COLLECTION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_UPDATECOLLECTION TYPE T_UPDATE_COLLECTION +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_COLLECTION_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_COLLECTION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_UPDATECOLLECTION ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_UPDATECOLLECTION i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'UpdateCollection' i_value = i_UPDATECOLLECTION ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_UPDATECOLLECTION to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_COLLECTION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_COLLECTION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_DOCUMENTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_COUNT TYPE INTEGER (default =1000) +* | [--->] I_STATUS TYPE STRING(optional) +* | [--->] I_HAS_NOTICES TYPE BOOLEAN(optional) +* | [--->] I_IS_PARENT TYPE BOOLEAN(optional) +* | [--->] I_PARENT_DOCUMENT_ID TYPE STRING(optional) +* | [--->] I_SHA256 TYPE STRING(optional) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_LIST_DOCUMENTS_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_DOCUMENTS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/documents'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_COUNT is supplied. + lv_queryparam = i_COUNT. + add_query_parameter( + exporting + i_parameter = `count` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_STATUS is supplied. + lv_queryparam = escape( val = i_STATUS format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `status` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_HAS_NOTICES is supplied. + lv_queryparam = i_HAS_NOTICES. + add_query_parameter( + exporting + i_parameter = `has_notices` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_IS_PARENT is supplied. + lv_queryparam = i_IS_PARENT. + add_query_parameter( + exporting + i_parameter = `is_parent` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_PARENT_DOCUMENT_ID is supplied. + lv_queryparam = escape( val = i_PARENT_DOCUMENT_ID format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `parent_document_id` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_SHA256 is supplied. + lv_queryparam = escape( val = i_SHA256 format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `sha256` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->ADD_DOCUMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_FILE TYPE FILE(optional) +* | [--->] I_FILENAME TYPE STRING(optional) +* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_METADATA TYPE STRING(optional) +* | [--->] I_X_WATSON_DISCOVERY_FORCE TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_ACCEPTED +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method ADD_DOCUMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/documents'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + " process header parameters + data: + lv_headerparam type string ##NEEDED. + + if i_X_WATSON_DISCOVERY_FORCE is supplied. + lv_headerparam = I_X_WATSON_DISCOVERY_FORCE. + add_header_parameter( + exporting + i_parameter = 'X-Watson-Discovery-Force' + i_value = lv_headerparam + i_is_boolean = c_boolean_true + changing + c_headers = ls_request_prop-headers ) ##NO_TEXT. + endif. + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_METADATA. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_FILE is initial. + if not I_filename is initial. + lv_value = `form-data; name="file"; filename="` && I_filename && `"` ##NO_TEXT. + else. + lv_extension = get_file_extension( I_file_content_type ). + lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + endif. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_file_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_FILE. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_DOCUMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_DOCUMENT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_DETAILS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_DOCUMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/documents/{document_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPDATE_DOCUMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_DOCUMENT_ID TYPE STRING +* | [--->] I_FILE TYPE FILE(optional) +* | [--->] I_FILENAME TYPE STRING(optional) +* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_METADATA TYPE STRING(optional) +* | [--->] I_X_WATSON_DISCOVERY_FORCE TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_ACCEPTED +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_DOCUMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/documents/{document_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + " process header parameters + data: + lv_headerparam type string ##NEEDED. + + if i_X_WATSON_DISCOVERY_FORCE is supplied. + lv_headerparam = I_X_WATSON_DISCOVERY_FORCE. + add_header_parameter( + exporting + i_parameter = 'X-Watson-Discovery-Force' + i_value = lv_headerparam + i_is_boolean = c_boolean_true + changing + c_headers = ls_request_prop-headers ) ##NO_TEXT. + endif. + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_METADATA. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_FILE is initial. + if not I_filename is initial. + lv_value = `form-data; name="file"; filename="` && I_filename && `"` ##NO_TEXT. + else. + lv_extension = get_file_extension( I_file_content_type ). + lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + endif. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_file_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_FILE. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_DOCUMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_DOCUMENT_ID TYPE STRING +* | [--->] I_X_WATSON_DISCOVERY_FORCE TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DELETE_DOCUMENT_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_DOCUMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/documents/{document_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + " process header parameters + data: + lv_headerparam type string ##NEEDED. + + if i_X_WATSON_DISCOVERY_FORCE is supplied. + lv_headerparam = I_X_WATSON_DISCOVERY_FORCE. + add_header_parameter( + exporting + i_parameter = 'X-Watson-Discovery-Force' + i_value = lv_headerparam + i_is_boolean = c_boolean_true + changing + c_headers = ls_request_prop-headers ) ##NO_TEXT. + endif. + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->QUERY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_QUERY_LONG TYPE T_QUERY_LARGE(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_QUERY_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method QUERY. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/query'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_QUERY_LONG is initial. + lv_datatype = get_datatype( i_QUERY_LONG ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_QUERY_LONG i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'query_long' i_value = i_QUERY_LONG ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_QUERY_LONG to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_AUTOCOMPLETION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_PREFIX TYPE STRING +* | [--->] I_COLLECTION_IDS TYPE TT_STRING(optional) +* | [--->] I_FIELD TYPE STRING(optional) +* | [--->] I_COUNT TYPE INTEGER (default =5) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_COMPLETIONS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_AUTOCOMPLETION. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/autocompletion'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + lv_queryparam = escape( val = i_PREFIX format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `prefix` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + + if i_COLLECTION_IDS is supplied. + data: + lv_item_COLLECTION_IDS type STRING. + clear: lv_queryparam, lv_sep. + loop at i_COLLECTION_IDS into lv_item_COLLECTION_IDS. + lv_queryparam = lv_queryparam && lv_sep && lv_item_COLLECTION_IDS. + lv_sep = ','. + endloop. + lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `collection_ids` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_FIELD is supplied. + lv_queryparam = escape( val = i_FIELD format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `field` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_COUNT is supplied. + lv_queryparam = i_COUNT. + add_query_parameter( + exporting + i_parameter = `count` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->QUERY_COLLECTION_NOTICES +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_FILTER TYPE STRING(optional) +* | [--->] I_QUERY TYPE STRING(optional) +* | [--->] I_NATURAL_LANGUAGE_QUERY TYPE STRING(optional) +* | [--->] I_COUNT TYPE INTEGER (default =10) +* | [--->] I_OFFSET TYPE INTEGER(optional) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_QUERY_NOTICES_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method QUERY_COLLECTION_NOTICES. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/notices'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_FILTER is supplied. + lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `filter` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_QUERY is supplied. + lv_queryparam = escape( val = i_QUERY format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `query` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_NATURAL_LANGUAGE_QUERY is supplied. + lv_queryparam = escape( val = i_NATURAL_LANGUAGE_QUERY format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `natural_language_query` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_COUNT is supplied. + lv_queryparam = i_COUNT. + add_query_parameter( + exporting + i_parameter = `count` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_OFFSET is supplied. + lv_queryparam = i_OFFSET. + add_query_parameter( + exporting + i_parameter = `offset` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->QUERY_NOTICES +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_FILTER TYPE STRING(optional) +* | [--->] I_QUERY TYPE STRING(optional) +* | [--->] I_NATURAL_LANGUAGE_QUERY TYPE STRING(optional) +* | [--->] I_COUNT TYPE INTEGER (default =10) +* | [--->] I_OFFSET TYPE INTEGER(optional) +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_QUERY_NOTICES_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method QUERY_NOTICES. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/notices'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + if i_FILTER is supplied. + lv_queryparam = escape( val = i_FILTER format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `filter` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_QUERY is supplied. + lv_queryparam = escape( val = i_QUERY format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `query` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_NATURAL_LANGUAGE_QUERY is supplied. + lv_queryparam = escape( val = i_NATURAL_LANGUAGE_QUERY format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `natural_language_query` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_COUNT is supplied. + lv_queryparam = i_COUNT. + add_query_parameter( + exporting + i_parameter = `count` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_OFFSET is supplied. + lv_queryparam = i_OFFSET. + add_query_parameter( + exporting + i_parameter = `offset` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_STOPWORD_LIST +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_STOP_WORD_LIST +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_STOPWORD_LIST. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/stopwords'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_STOPWORD_LIST +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_STOPWORDLIST TYPE T_STOP_WORD_LIST(optional) +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_STOP_WORD_LIST +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_STOPWORD_LIST. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/stopwords'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + if not i_STOPWORDLIST is initial. + lv_datatype = get_datatype( i_STOPWORDLIST ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_STOPWORDLIST i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'StopWordList' i_value = i_STOPWORDLIST ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_STOPWORDLIST to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_STOPWORD_LIST +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_STOPWORD_LIST. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/stopwords'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_EXPANSIONS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_EXPANSIONS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_EXPANSIONS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/expansions'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_EXPANSIONS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_BODY TYPE T_EXPANSIONS +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_EXPANSIONS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_EXPANSIONS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/expansions'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_BODY ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_BODY to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_EXPANSIONS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_EXPANSIONS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/expansions'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_COMPONENT_SETTINGS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_COMPONENT_SETTINGS_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_COMPONENT_SETTINGS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/component_settings'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_TRAINING_QUERIES +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_TRAINING_QUERY_SET +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_TRAINING_QUERIES. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/training_data/queries'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_TRAINING_QUERIES +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_TRAINING_QUERIES. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/training_data/queries'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_TRAINING_QUERY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_TRAININGQUERY TYPE T_TRAINING_QUERY +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_TRAINING_QUERY +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_TRAINING_QUERY. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/training_data/queries'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_TRAININGQUERY ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_TRAININGQUERY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'TrainingQuery' i_value = i_TRAININGQUERY ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_TRAININGQUERY to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_TRAINING_QUERY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_QUERY_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_TRAINING_QUERY +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_TRAINING_QUERY. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/training_data/queries/{query_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPDATE_TRAINING_QUERY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_QUERY_ID TYPE STRING +* | [--->] I_BODY TYPE T_TRAINING_QUERY +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_TRAINING_QUERY +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_TRAINING_QUERY. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/training_data/queries/{query_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_BODY ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_BODY to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_TRAINING_QUERY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_QUERY_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_TRAINING_QUERY. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/training_data/queries/{query_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{query_id}` in ls_request_prop-url-path with i_QUERY_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_ENRICHMENTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENRICHMENTS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_ENRICHMENTS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/enrichments'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_ENRICHMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_ENRICHMENT TYPE T_CREATE_ENRICHMENT +* | [--->] I_FILE TYPE FILE(optional) +* | [--->] I_FILE_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENRICHMENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_ENRICHMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/enrichments'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_ENRICHMENT is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="enrichment"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_ENRICHMENT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_FILE is initial. + lv_extension = get_file_extension( I_FILE_CT ). + lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_FILE_CT. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_FILE. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_ENRICHMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_ENRICHMENT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENRICHMENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_ENRICHMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/enrichments/{enrichment_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{enrichment_id}` in ls_request_prop-url-path with i_ENRICHMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPDATE_ENRICHMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_ENRICHMENT_ID TYPE STRING +* | [--->] I_UPDATEENRICHMENT TYPE T_UPDATE_ENRICHMENT +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ENRICHMENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_ENRICHMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/enrichments/{enrichment_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{enrichment_id}` in ls_request_prop-url-path with i_ENRICHMENT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_UPDATEENRICHMENT ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_UPDATEENRICHMENT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'UpdateEnrichment' i_value = i_UPDATEENRICHMENT ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_UPDATEENRICHMENT to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_ENRICHMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_ENRICHMENT_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_ENRICHMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/enrichments/{enrichment_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{enrichment_id}` in ls_request_prop-url-path with i_ENRICHMENT_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LIST_DOCUMENT_CLASSIFIERS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIERS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_DOCUMENT_CLASSIFIERS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CREATE_DOCUMENT_CLASSIFIER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_TRAINING_DATA TYPE FILE +* | [--->] I_CLASSIFIER TYPE T_CREATE_DOCUMENT_CLASSIFIER +* | [--->] I_TEST_DATA TYPE FILE(optional) +* | [--->] I_TRAINING_DATA_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) +* | [--->] I_TEST_DATA_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_DOCUMENT_CLASSIFIER. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_CLASSIFIER is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="classifier"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_CLASSIFIER i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_TRAINING_DATA is initial. + lv_extension = get_file_extension( I_TRAINING_DATA_CT ). + lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_TRAINING_DATA_CT. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TRAINING_DATA. + append ls_form_part to lt_form_part. + endif. + + if not i_TEST_DATA is initial. + lv_extension = get_file_extension( I_TEST_DATA_CT ). + lv_value = `form-data; name="test_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_TEST_DATA_CT. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TEST_DATA. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_DOCUMENT_CLASSIFIER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_DOCUMENT_CLASSIFIER. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPDATE_DOCUMENT_CLASSIFIER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_CLASSIFIER TYPE T_UPDATE_DOCUMENT_CLASSIFIER +* | [--->] I_TRAINING_DATA TYPE FILE(optional) +* | [--->] I_TEST_DATA TYPE FILE(optional) +* | [--->] I_TRAINING_DATA_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) +* | [--->] I_TEST_DATA_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_DOCUMENT_CLASSIFIER. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_CLASSIFIER is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="classifier"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_CLASSIFIER i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_TRAINING_DATA is initial. + lv_extension = get_file_extension( I_TRAINING_DATA_CT ). + lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_TRAINING_DATA_CT. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TRAINING_DATA. + append ls_form_part to lt_form_part. + endif. + + if not i_TEST_DATA is initial. + lv_extension = get_file_extension( I_TEST_DATA_CT ). + lv_value = `form-data; name="test_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_TEST_DATA_CT. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TEST_DATA. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_DOCUMENT_CLASSIFIER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_DOCUMENT_CLASSIFIER. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->LST_DOCUMENT_CLASSIFIER_MODELS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER_MODELS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LST_DOCUMENT_CLASSIFIER_MODELS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}/models'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->CRE_DOCUMENT_CLASSIFIER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_DOCUMENTCLASSIFIERMODELTRAIN TYPE T_DOC_CLASSIFIER_MODEL_TRAIN +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CRE_DOCUMENT_CLASSIFIER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}/models'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_DOCUMENTCLASSIFIERMODELTRAIN ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_DOCUMENTCLASSIFIERMODELTRAIN i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'DocumentClassifierModelTrain' i_value = i_DOCUMENTCLASSIFIERMODELTRAIN ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_DOCUMENTCLASSIFIERMODELTRAIN to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->GET_DOCUMENT_CLASSIFIER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_DOCUMENT_CLASSIFIER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}/models/{model_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->UPD_DOCUMENT_CLASSIFIER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_UPDTDCMNTCLSSFRMDL TYPE T_UPD_DOC_CLASSIFIER_MODEL +* | [--->] I_contenttype TYPE string (default ='application/json') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DOCUMENT_CLASSIFIER_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPD_DOCUMENT_CLASSIFIER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}/models/{model_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + " process body parameters + data: + lv_body type string, + lv_bodyparam type string, + lv_datatype type char. + field-symbols: + type any. + lv_separator = ''. + lv_datatype = get_datatype( i_UPDTDCMNTCLSSFRMDL ). + + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or + ls_request_prop-header_content_type cp '*json*'. + if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or + lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. + lv_bodyparam = abap_to_json( i_value = i_UPDTDCMNTCLSSFRMDL i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + else. + lv_bodyparam = abap_to_json( i_name = 'UpdateDocumentClassifierModel' i_value = i_UPDTDCMNTCLSSFRMDL ). + endif. + lv_body = lv_body && lv_separator && lv_bodyparam. + else. + assign i_UPDTDCMNTCLSSFRMDL to . + lv_bodyparam = . + concatenate lv_body lv_bodyparam into lv_body. + endif. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. + endif. + + if ls_request_prop-header_content_type cp '*charset=utf-8*'. + ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). + else. + ls_request_prop-body = lv_body. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DEL_DOCUMENT_CLASSIFIER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_CLASSIFIER_ID TYPE STRING +* | [--->] I_MODEL_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DEL_DOCUMENT_CLASSIFIER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/document_classifiers/{classifier_id}/models/{model_id}'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->ANALYZE_DOCUMENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PROJECT_ID TYPE STRING +* | [--->] I_COLLECTION_ID TYPE STRING +* | [--->] I_FILE TYPE FILE(optional) +* | [--->] I_FILENAME TYPE STRING(optional) +* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_METADATA TYPE STRING(optional) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_ANALYZED_DOCUMENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method ANALYZE_DOCUMENT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/projects/{project_id}/collections/{collection_id}/analyze'. + replace all occurrences of `{project_id}` in ls_request_prop-url-path with i_PROJECT_ID ignoring case. + replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_METADATA. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_FILE is initial. + if not I_filename is initial. + lv_value = `form-data; name="file"; filename="` && I_filename && `"` ##NO_TEXT. + else. + lv_extension = get_file_extension( I_file_content_type ). + lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + endif. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_file_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_FILE. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_DISCOVERY_V2->DELETE_USER_DATA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CUSTOMER_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_USER_DATA. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v2/user_data'. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + lv_queryparam = escape( val = i_CUSTOMER_ID format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `customer_id` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +ENDCLASS. diff --git a/src/zcl_ibmc_discovery_v2.clas.xml b/src/zcl_ibmc_discovery_v2.clas.xml new file mode 100644 index 0000000..0f3d690 --- /dev/null +++ b/src/zcl_ibmc_discovery_v2.clas.xml @@ -0,0 +1,318 @@ + + + + + + ZCL_IBMC_DISCOVERY_V2 + E + Discovery v2 + 1 + X + X + X + + + + ZCL_IBMC_DISCOVERY_V2 + ADD_DOCUMENT + E + Add a document + + + ZCL_IBMC_DISCOVERY_V2 + ANALYZE_DOCUMENT + E + Analyze a Document + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_COLLECTION + E + Create a collection + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_DOCUMENT_CLASSIFIER + E + Create a document classifier + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_ENRICHMENT + E + Create an enrichment + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_EXPANSIONS + E + Create or update an expansion list + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_PROJECT + E + Create a project + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_STOPWORD_LIST + E + Create a custom stop words list + + + ZCL_IBMC_DISCOVERY_V2 + CREATE_TRAINING_QUERY + E + Create training query + + + ZCL_IBMC_DISCOVERY_V2 + CRE_DOCUMENT_CLASSIFIER_MODEL + E + Create a document classifier model + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_COLLECTION + E + Delete a collection + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_DOCUMENT + E + Delete a document + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_DOCUMENT_CLASSIFIER + E + Delete a document classifier + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_ENRICHMENT + E + Delete an enrichment + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_EXPANSIONS + E + Delete the expansion list + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_PROJECT + E + Delete a project + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_STOPWORD_LIST + E + Delete a custom stop words list + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_TRAINING_QUERIES + E + Delete training queries + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_TRAINING_QUERY + E + Delete a training data query + + + ZCL_IBMC_DISCOVERY_V2 + DELETE_USER_DATA + E + Delete labeled data + + + ZCL_IBMC_DISCOVERY_V2 + DEL_DOCUMENT_CLASSIFIER_MODEL + E + Delete a document classifier model + + + ZCL_IBMC_DISCOVERY_V2 + GET_AUTOCOMPLETION + E + Get Autocomplete Suggestions + + + ZCL_IBMC_DISCOVERY_V2 + GET_COLLECTION + E + Get collection + + + ZCL_IBMC_DISCOVERY_V2 + GET_COMPONENT_SETTINGS + E + List component settings + + + ZCL_IBMC_DISCOVERY_V2 + GET_DOCUMENT + E + Get document details + + + ZCL_IBMC_DISCOVERY_V2 + GET_DOCUMENT_CLASSIFIER + E + Get a document classifier + + + ZCL_IBMC_DISCOVERY_V2 + GET_DOCUMENT_CLASSIFIER_MODEL + E + Get a document classifier model + + + ZCL_IBMC_DISCOVERY_V2 + GET_ENRICHMENT + E + Get enrichment + + + ZCL_IBMC_DISCOVERY_V2 + GET_PROJECT + E + Get project + + + ZCL_IBMC_DISCOVERY_V2 + GET_STOPWORD_LIST + E + Get a custom stop words list + + + ZCL_IBMC_DISCOVERY_V2 + GET_TRAINING_QUERY + E + Get a training data query + + + ZCL_IBMC_DISCOVERY_V2 + LIST_COLLECTIONS + E + List collections + + + ZCL_IBMC_DISCOVERY_V2 + LIST_DOCUMENTS + E + List documents + + + ZCL_IBMC_DISCOVERY_V2 + LIST_DOCUMENT_CLASSIFIERS + E + List document classifiers + + + ZCL_IBMC_DISCOVERY_V2 + LIST_ENRICHMENTS + E + List enrichments + + + ZCL_IBMC_DISCOVERY_V2 + LIST_EXPANSIONS + E + Get the expansion list + + + ZCL_IBMC_DISCOVERY_V2 + LIST_FIELDS + E + List fields + + + ZCL_IBMC_DISCOVERY_V2 + LIST_PROJECTS + E + List projects + + + ZCL_IBMC_DISCOVERY_V2 + LIST_TRAINING_QUERIES + E + List training queries + + + ZCL_IBMC_DISCOVERY_V2 + LST_DOCUMENT_CLASSIFIER_MODELS + E + List document classifier models + + + ZCL_IBMC_DISCOVERY_V2 + QUERY + E + Query a project + + + ZCL_IBMC_DISCOVERY_V2 + QUERY_COLLECTION_NOTICES + E + Query collection notices + + + ZCL_IBMC_DISCOVERY_V2 + QUERY_NOTICES + E + Query project notices + + + ZCL_IBMC_DISCOVERY_V2 + UPDATE_COLLECTION + E + Update a collection + + + ZCL_IBMC_DISCOVERY_V2 + UPDATE_DOCUMENT + E + Update a document + + + ZCL_IBMC_DISCOVERY_V2 + UPDATE_DOCUMENT_CLASSIFIER + E + Update a document classifier + + + ZCL_IBMC_DISCOVERY_V2 + UPDATE_ENRICHMENT + E + Update an enrichment + + + ZCL_IBMC_DISCOVERY_V2 + UPDATE_PROJECT + E + Update a project + + + ZCL_IBMC_DISCOVERY_V2 + UPDATE_TRAINING_QUERY + E + Update a training query + + + ZCL_IBMC_DISCOVERY_V2 + UPD_DOCUMENT_CLASSIFIER_MODEL + E + Update a document classifier model + + + + + diff --git a/src/zcl_ibmc_lang_translator_v3.clas.abap b/src/zcl_ibmc_lang_translator_v3.clas.abap index a9fdca6..d40cc5f 100644 --- a/src/zcl_ibmc_lang_translator_v3.clas.abap +++ b/src/zcl_ibmc_lang_translator_v3.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -186,11 +186,25 @@ public section. "! enter the `document_id` of the document. DOCUMENT_ID type STRING, "! The contents of the source file to translate. The maximum file size for document - "! translation is 20 MB for service instances on the Standard, Advanced, and - "! Premium plans, and 2 MB for service instances on the Lite plan. For more - "! information, see [Supported file formats - "! (Beta)](https://cloud.ibm.com/docs/language-translator?topic=language-translato - "! r-document-translator-tutorial#supported-file-formats). + "! translation is
+ "! * **2 MB** for service instances on the Lite plan
+ "! * **20 MB** for service instances on the Standard plan
+ "! * **50 MB** for service instances on the Advanced plan
+ "! * **150 MB** for service instances on the Premium plan
+ "!
+ "! You can specify the format of the file to be translated in one of two ways:
+ "! * By specifying the appropriate file extension for the format.
+ "! * By specifying the content type (MIME type) of the format as the `type` of the + "! `file` parameter.
+ "!
+ "! In some cases, especially for subtitle file formats, you must use either the + "! file extension or the content type.
+ "!
+ "! For more information about all supported file formats, their file extensions and + "! content types, and how and when to specify the file extension or content type, + "! see [Supported file + "! formats](https://cloud.ibm.com/docs/language-translator?topic=language-translat + "! or-document-translator-tutorial#supported-file-formats). FILE type FILE, end of T_INLINE_OBJECT1. types: @@ -585,6 +599,8 @@ constants: "! method description.
"!
"! *With `curl`, use `--form forced_glossary=@{filename}`.*. + "! @parameter I_FORCED_GLOSSARY_CONTENT_TYPE | + "! The content type of forcedGlossary. "! @parameter I_PARALLEL_CORPUS | "! A file with parallel sentences for the source and target languages. You can "! upload multiple parallel corpus files in one request by repeating the @@ -597,6 +613,8 @@ constants: "! information, see **Supported file formats** in the method description.
"!
"! *With `curl`, use `--form parallel_corpus=@{filename}`.*. + "! @parameter I_PARALLEL_CORPUS_CONTENT_TYPE | + "! The content type of parallelCorpus. "! @parameter I_NAME | "! An optional model name that you can use to identify the model. Valid characters "! are letters, numbers, dashes, underscores, spaces, and apostrophes. The maximum @@ -609,10 +627,10 @@ constants: importing !I_BASE_MODEL_ID type STRING !I_FORCED_GLOSSARY type FILE optional + !I_FORCED_GLOSSARY_CONTENT_TYPE type STRING optional !I_PARALLEL_CORPUS type FILE optional + !I_PARALLEL_CORPUS_CONTENT_TYPE type STRING optional !I_NAME type STRING optional - !I_FORCED_GLOSSARY_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_PARALLEL_CORPUS_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL !I_contenttype type string default 'multipart/form-data' !I_accept type string default 'application/json' exporting @@ -638,8 +656,8 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

Get model details

"! Gets information about a translation model, including training status for custom - "! models. Use this API call to poll the status of your customization request. A - "! successfully completed training has a status of `available`. + "! models. Use this method to poll the status of your customization request. A + "! successfully completed training request has a status of `available`. "! "! @parameter I_MODEL_ID | "! Model ID of the model to get. @@ -672,18 +690,50 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

Translate document

"! Submit a document for translation. You can submit the document contents in the - "! `file` parameter, or you can reference a previously submitted document by + "! `file` parameter, or you can specify a previously submitted document by "! document ID. The maximum file size for document translation is
- "! * 20 MB for service instances on the Standard, Advanced, and Premium plans
- "! * 2 MB for service instances on the Lite plan + "! * **2 MB** for service instances on the Lite plan
+ "! * **20 MB** for service instances on the Standard plan
+ "! * **50 MB** for service instances on the Advanced plan
+ "! * **150 MB** for service instances on the Premium plan
+ "!
+ "! You can specify the format of the file to be translated in one of two ways:
+ "! * By specifying the appropriate file extension for the format.
+ "! * By specifying the content type (MIME type) of the format as the `type` of the + "! `file` parameter.
+ "!
+ "! In some cases, especially for subtitle file formats, you must use either the + "! file extension or the content type. For more information about all supported + "! file formats, their file extensions and content types, and how and when to + "! specify the file extension or content type, see [Supported file + "! formats](https://cloud.ibm.com/docs/language-translator?topic=language-translat + "! or-document-translator-tutorial#supported-file-formats).
+ "!
+ "! **Note:** When translating a previously submitted document, the target language + "! must be different from the target language of the original request when the + "! document was initially submitted. "! "! @parameter I_FILE | "! The contents of the source file to translate. The maximum file size for document - "! translation is 20 MB for service instances on the Standard, Advanced, and - "! Premium plans, and 2 MB for service instances on the Lite plan. For more - "! information, see [Supported file formats - "! (Beta)](https://cloud.ibm.com/docs/language-translator?topic=language-translato - "! r-document-translator-tutorial#supported-file-formats). + "! translation is
+ "! * **2 MB** for service instances on the Lite plan
+ "! * **20 MB** for service instances on the Standard plan
+ "! * **50 MB** for service instances on the Advanced plan
+ "! * **150 MB** for service instances on the Premium plan
+ "!
+ "! You can specify the format of the file to be translated in one of two ways:
+ "! * By specifying the appropriate file extension for the format.
+ "! * By specifying the content type (MIME type) of the format as the `type` of the + "! `file` parameter.
+ "!
+ "! In some cases, especially for subtitle file formats, you must use either the + "! file extension or the content type.
+ "!
+ "! For more information about all supported file formats, their file extensions and + "! content types, and how and when to specify the file extension or content type, + "! see [Supported file + "! formats](https://cloud.ibm.com/docs/language-translator?topic=language-translat + "! or-document-translator-tutorial#supported-file-formats). "! @parameter I_FILENAME | "! The filename for file. "! @parameter I_FILE_CONTENT_TYPE | @@ -848,7 +898,7 @@ endmethod. * +-------------------------------------------------------------------------------------- method get_sdk_version_date. - e_sdk_version_date = '20210312144434'. + e_sdk_version_date = '20231212104235'. endmethod. @@ -958,13 +1008,24 @@ method TRANSLATE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1089,13 +1150,24 @@ method IDENTIFY. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1204,10 +1276,10 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_BASE_MODEL_ID TYPE STRING * | [--->] I_FORCED_GLOSSARY TYPE FILE(optional) +* | [--->] I_FORCED_GLOSSARY_CONTENT_TYPE TYPE STRING(optional) * | [--->] I_PARALLEL_CORPUS TYPE FILE(optional) +* | [--->] I_PARALLEL_CORPUS_CONTENT_TYPE TYPE STRING(optional) * | [--->] I_NAME TYPE STRING(optional) -* | [--->] I_FORCED_GLOSSARY_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_PARALLEL_CORPUS_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) * | [--->] I_contenttype TYPE string (default ='multipart/form-data') * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_TRANSLATION_MODEL @@ -1270,22 +1342,22 @@ method CREATE_MODEL. if not i_FORCED_GLOSSARY is initial. - lv_extension = get_file_extension( I_FORCED_GLOSSARY_CT ). + lv_extension = get_file_extension( I_forced_glossary_content_type ). lv_value = `form-data; name="forced_glossary"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. lv_index = lv_index + 1. clear ls_form_part. - ls_form_part-content_type = I_FORCED_GLOSSARY_CT. + ls_form_part-content_type = I_forced_glossary_content_type. ls_form_part-content_disposition = lv_value. ls_form_part-xdata = i_FORCED_GLOSSARY. append ls_form_part to lt_form_part. endif. if not i_PARALLEL_CORPUS is initial. - lv_extension = get_file_extension( I_PARALLEL_CORPUS_CT ). + lv_extension = get_file_extension( I_parallel_corpus_content_type ). lv_value = `form-data; name="parallel_corpus"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. lv_index = lv_index + 1. clear ls_form_part. - ls_form_part-content_type = I_PARALLEL_CORPUS_CT. + ls_form_part-content_type = I_parallel_corpus_content_type. ls_form_part-content_disposition = lv_value. ls_form_part-xdata = i_PARALLEL_CORPUS. append ls_form_part to lt_form_part. diff --git a/src/zcl_ibmc_nat_lang_class_v1.clas.abap b/src/zcl_ibmc_nat_lang_class_v1.clas.abap deleted file mode 100644 index 22f7150..0000000 --- a/src/zcl_ibmc_nat_lang_class_v1.clas.abap +++ /dev/null @@ -1,797 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Natural Language Classifier

-"! IBM Watson™ Natural Language Classifier uses machine learning algorithms -"! to return the top matching predefined classes for short text input. You create -"! and train a classifier to connect predefined classes to example texts so that -"! the service can apply those classes to new inputs.
-class ZCL_IBMC_NAT_LANG_CLASS_V1 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! Response payload for HTTP errors.

- begin of T_ERROR_RESPONSE, - "! HTTP status code. - CODE type INTEGER, - "! Error name. - ERROR type STRING, - "! Error description. - DESCRIPTION type STRING, - end of T_ERROR_RESPONSE. - types: - "!

- "! Request payload to classify.

- begin of T_CLASSIFY_INPUT, - "! The submitted phrase. The maximum length is 2048 characters. - TEXT type STRING, - end of T_CLASSIFY_INPUT. - types: - "! No documentation available. - begin of T_INLINE_OBJECT, - "! Metadata in JSON format. The metadata identifies the language of the data, and - "! an optional name to identify the classifier. Specify the language with the - "! 2-letter primary language code as assigned in ISO standard 639.
- "!
- "! Supported languages are English (`en`), Arabic (`ar`), French (`fr`), German, - "! (`de`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Brazilian Portuguese - "! (`pt`), and Spanish (`es`). - TRAINING_METADATA type FILE, - "! Training data in CSV format. Each text value must have at least one class. The - "! data can include up to 3,000 classes and 20,000 records. For details, see [Data - "! preparation](https://cloud.ibm.com/docs/natural-language-classifier?topic=natur - "! al-language-classifier-using-your-data). - TRAINING_DATA type FILE, - end of T_INLINE_OBJECT. - types: - "!

- "! Class and confidence.

- begin of T_CLASSIFIED_CLASS, - "! A decimal percentage that represents the confidence that Watson has in this - "! class. Higher values represent higher confidences. - CONFIDENCE type DOUBLE, - "! Class label. - CLASS_NAME type STRING, - end of T_CLASSIFIED_CLASS. - types: - "!

- "! Response from the classifier for a phrase in a collection.

- begin of T_COLLECTION_ITEM, - "! The submitted phrase. The maximum length is 2048 characters. - TEXT type STRING, - "! The class with the highest confidence. - TOP_CLASS type STRING, - "! An array of up to ten class-confidence pairs sorted in descending order of - "! confidence. - CLASSES type STANDARD TABLE OF T_CLASSIFIED_CLASS WITH NON-UNIQUE DEFAULT KEY, - end of T_COLLECTION_ITEM. - types: - "!

- "! A classifier for natural language phrases.

- begin of T_CLASSIFIER, - "! User-supplied name for the classifier. - NAME type STRING, - "! Link to the classifier. - URL type STRING, - "! The state of the classifier. - STATUS type STRING, - "! Unique identifier for this classifier. - CLASSIFIER_ID type STRING, - "! Date and time (UTC) the classifier was created. - CREATED type DATETIME, - "! Additional detail about the status. - STATUS_DESCRIPTION type STRING, - "! The language used for the classifier. - LANGUAGE type STRING, - end of T_CLASSIFIER. - types: - "!

- "! List of available classifiers.

- begin of T_CLASSIFIER_LIST, - "! The classifiers available to the user. Returns an empty array if no classifiers - "! are available. - CLASSIFIERS type STANDARD TABLE OF T_CLASSIFIER WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFIER_LIST. - types: - "!

- "! Response from the classifier for a phrase.

- begin of T_CLASSIFICATION, - "! Unique identifier for this classifier. - CLASSIFIER_ID type STRING, - "! Link to the classifier. - URL type STRING, - "! The submitted phrase. - TEXT type STRING, - "! The class with the highest confidence. - TOP_CLASS type STRING, - "! An array of up to ten class-confidence pairs sorted in descending order of - "! confidence. - CLASSES type STANDARD TABLE OF T_CLASSIFIED_CLASS WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFICATION. - types: - "!

- "! Request payload to classify.

- begin of T_CLASSIFY_COLLECTION_INPUT, - "! The submitted phrases. - COLLECTION type STANDARD TABLE OF T_CLASSIFY_INPUT WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFY_COLLECTION_INPUT. - types: - "!

- "! Response payload for Cloud errors.

- begin of T_ERROR_CLOUD, - "! HTTP status code. - CODE type INTEGER, - "! Error name. - ERROR type STRING, - end of T_ERROR_CLOUD. - types: - "! No documentation available. - T_EMPTY type JSONOBJECT. - types: - "!

- "! Response from the classifier for multiple phrases.

- begin of T_CLASSIFICATION_COLLECTION, - "! Unique identifier for this classifier. - CLASSIFIER_ID type STRING, - "! Link to the classifier. - URL type STRING, - "! An array of classifier responses for each submitted phrase. - COLLECTION type STANDARD TABLE OF T_COLLECTION_ITEM WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFICATION_COLLECTION. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_ERROR_RESPONSE type string value '|', - T_CLASSIFY_INPUT type string value '|TEXT|', - T_INLINE_OBJECT type string value '|TRAINING_METADATA|TRAINING_DATA|', - T_CLASSIFIED_CLASS type string value '|', - T_COLLECTION_ITEM type string value '|', - T_CLASSIFIER type string value '|URL|CLASSIFIER_ID|', - T_CLASSIFIER_LIST type string value '|CLASSIFIERS|', - T_CLASSIFICATION type string value '|', - T_CLASSIFY_COLLECTION_INPUT type string value '|COLLECTION|', - T_ERROR_CLOUD type string value '|', - T_CLASSIFICATION_COLLECTION type string value '|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - CODE type string value 'code', - ERROR type string value 'error', - DESCRIPTION type string value 'description', - CLASSIFIERS type string value 'classifiers', - NAME type string value 'name', - URL type string value 'url', - STATUS type string value 'status', - CLASSIFIER_ID type string value 'classifier_id', - CREATED type string value 'created', - STATUS_DESCRIPTION type string value 'status_description', - LANGUAGE type string value 'language', - COLLECTION type string value 'collection', - TEXT type string value 'text', - TOP_CLASS type string value 'top_class', - CLASSES type string value 'classes', - CONFIDENCE type string value 'confidence', - CLASS_NAME type string value 'class_name', - CLASSIFY_INPUT type string value 'classify_input', - TRAINING_METADATA type string value 'training_metadata', - TRAINING_DATA type string value 'training_data', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Classify a phrase

- "! Returns label information for the input. The status must be `Available` before - "! you can use the classifier to classify text. - "! - "! @parameter I_CLASSIFIER_ID | - "! Classifier ID to use. - "! @parameter I_BODY | - "! Phrase to classify. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFICATION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CLASSIFY - importing - !I_CLASSIFIER_ID type STRING - !I_BODY type T_CLASSIFY_INPUT - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFICATION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Classify multiple phrases

- "! Returns label information for multiple phrases. The status must be `Available` - "! before you can use the classifier to classify text.
- "!
- "! Note that classifying Japanese texts is a beta feature. - "! - "! @parameter I_CLASSIFIER_ID | - "! Classifier ID to use. - "! @parameter I_BODY | - "! Phrase to classify. You can submit up to 30 text phrases in a request. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFICATION_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CLASSIFY_COLLECTION - importing - !I_CLASSIFIER_ID type STRING - !I_BODY type T_CLASSIFY_COLLECTION_INPUT - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFICATION_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Create classifier

- "! Sends data to create and train a classifier and returns information about the - "! new classifier. - "! - "! @parameter I_TRAINING_METADATA | - "! Metadata in JSON format. The metadata identifies the language of the data, and - "! an optional name to identify the classifier. Specify the language with the - "! 2-letter primary language code as assigned in ISO standard 639.
- "!
- "! Supported languages are English (`en`), Arabic (`ar`), French (`fr`), German, - "! (`de`), Italian (`it`), Japanese (`ja`), Korean (`ko`), Brazilian Portuguese - "! (`pt`), and Spanish (`es`). - "! @parameter I_TRAINING_DATA | - "! Training data in CSV format. Each text value must have at least one class. The - "! data can include up to 3,000 classes and 20,000 records. For details, see [Data - "! preparation](https://cloud.ibm.com/docs/natural-language-classifier?topic=natur - "! al-language-classifier-using-your-data). - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIER - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_CLASSIFIER - importing - !I_TRAINING_METADATA type FILE - !I_TRAINING_DATA type FILE - !I_TRAINING_METADATA_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_TRAINING_DATA_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIER - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List classifiers

- "! Returns an empty array if no classifiers are available. - "! - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIER_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_CLASSIFIERS - importing - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIER_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get information about a classifier

- "! Returns status and other information about a classifier. - "! - "! @parameter I_CLASSIFIER_ID | - "! Classifier ID to query. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIER - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_CLASSIFIER - importing - !I_CLASSIFIER_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIER - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete classifier

- "! - "! @parameter I_CLASSIFIER_ID | - "! Classifier ID to delete. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_CLASSIFIER - importing - !I_CLASSIFIER_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_NAT_LANG_CLASS_V1 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Natural Language Classifier'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_NAT_LANG_CLASS_V1->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.natural-language-classifier.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144435'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->CLASSIFY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_BODY TYPE T_CLASSIFY_INPUT -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFICATION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CLASSIFY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/classifiers/{classifier_id}/classify'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->CLASSIFY_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_BODY TYPE T_CLASSIFY_COLLECTION_INPUT -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFICATION_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CLASSIFY_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/classifiers/{classifier_id}/classify_collection'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_BODY ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_BODY i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'body' i_value = i_BODY ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_BODY to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->CREATE_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_TRAINING_METADATA TYPE FILE -* | [--->] I_TRAINING_DATA TYPE FILE -* | [--->] I_TRAINING_METADATA_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_TRAINING_DATA_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIER -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/classifiers'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_TRAINING_METADATA is initial. - lv_extension = get_file_extension( I_TRAINING_METADATA_CT ). - lv_value = `form-data; name="training_metadata"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_TRAINING_METADATA_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_TRAINING_METADATA. - append ls_form_part to lt_form_part. - endif. - - if not i_TRAINING_DATA is initial. - lv_extension = get_file_extension( I_TRAINING_DATA_CT ). - lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_TRAINING_DATA_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_TRAINING_DATA. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->LIST_CLASSIFIERS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIER_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_CLASSIFIERS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/classifiers'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->GET_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIER -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/classifiers/{classifier_id}'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_CLASS_V1->DELETE_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v1/classifiers/{classifier_id}'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_nat_lang_class_v1.clas.xml b/src/zcl_ibmc_nat_lang_class_v1.clas.xml deleted file mode 100644 index 3103c7b..0000000 --- a/src/zcl_ibmc_nat_lang_class_v1.clas.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - E - Natural Language Classifier - 1 - X - X - X - - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - CLASSIFY - E - Classify a phrase - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - CLASSIFY_COLLECTION - E - Classify multiple phrases - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - CREATE_CLASSIFIER - E - Create classifier - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - DELETE_CLASSIFIER - E - Delete classifier - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - GET_CLASSIFIER - E - Get information about a classifier - - - ZCL_IBMC_NAT_LANG_CLASS_V1 - LIST_CLASSIFIERS - E - List classifiers - - - - - diff --git a/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap index c72ca66..2b0c46a 100644 --- a/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap +++ b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,17 @@ "! models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural "! -language-understanding-customizing) with Watson Knowledge Studio to detect "! custom entities and relations in Natural Language Understanding.
+"!
+"! IBM is sunsetting Watson Natural Language Understanding Custom Sentiment (BETA). +"! From **June 1, 2023** onward, you will no longer be able to use the Custom +"! Sentiment feature.<br /><br />To ensure we continue providing our +"! clients with robust and powerful text classification capabilities, IBM recently +"! announced the general availability of a new [single-label text classification +"! capability](https://cloud.ibm.com/docs/natural-language-understanding?topic=nat +"! ural-language-understanding-classifications). This new feature includes extended +"! language support and training data customizations suited for building a custom +"! sentiment classifier.<br /><br />If you would like more information +"! or further guidance, please contact IBM Cloud Support.{: deprecated}
class ZCL_IBMC_NAT_LANG_UNDRSTND_V1 DEFINITION public inheriting from ZCL_IBMC_SERVICE_EXT @@ -115,21 +126,68 @@ public section. "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, end of T_MODEL_METADATA. + types: + "!

+ "! A list of messages describing model training issues when

+ "! model status is `error`. + begin of T_NOTICE, + "! Describes deficiencies or inconsistencies in training data. + MESSAGE type STRING, + end of T_NOTICE. + types: + "!

+ "! Classifications model.

+ begin of T_CLASSIFICATIONS_MODEL, + "! An optional name for the model. + NAME type STRING, + "! An optional map of metadata key-value pairs to store with this model. + USER_METADATA type JSONOBJECT, + "! The 2-letter language code of this model. + LANGUAGE type STRING, + "! An optional description of the model. + DESCRIPTION type STRING, + "! An optional version string. + MODEL_VERSION type STRING, + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + WORKSPACE_ID type STRING, + "! The description of the version. + VERSION_DESCRIPTION type STRING, + "! The service features that are supported by the custom model. + FEATURES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! When the status is `available`, the model is ready to use. + STATUS type STRING, + "! Unique model ID. + MODEL_ID type STRING, + "! dateTime indicating when the model was created. + CREATED type DATETIME, + "! No documentation available. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, + "! dateTime of last successful model training. + LAST_TRAINED type DATETIME, + "! dateTime of last successful model deployment. + LAST_DEPLOYED type DATETIME, + end of T_CLASSIFICATIONS_MODEL. + types: + "!

+ "! List of classifications models.

+ begin of T_CLASSIFICATIONS_MODEL_LIST, + "! The classifications models. + MODELS type STANDARD TABLE OF T_CLASSIFICATIONS_MODEL WITH NON-UNIQUE DEFAULT KEY, + end of T_CLASSIFICATIONS_MODEL_LIST. types: "!

"! An entity that corresponds with an argument in a relation.

@@ -391,6 +449,16 @@ public section. "! No documentation available. SENTENCES type STANDARD TABLE OF T_SENTENCE_RESULT WITH NON-UNIQUE DEFAULT KEY, end of T_SYNTAX_RESULT. + types: + "!

+ "! A classification of the analyzed text.

+ begin of T_CLASSIFICATIONS_RESULT, + "! Classification assigned to the text. + CLASS_NAME type STRING, + "! Confidence score for the classification. Higher values indicate greater + "! confidence. + CONFIDENCE type DOUBLE, + end of T_CLASSIFICATIONS_RESULT. types: "!

"! The general concepts referenced or alluded to in the

@@ -418,7 +486,7 @@ public section. "!

"! A categorization of the analyzed text.

begin of T_CATEGORIES_RESULT, - "! The path to the category through the 5-level taxonomy hierarchy. For more + "! The path to the category through the multi-level taxonomy hierarchy. For more "! information about the categories, see [Categories "! hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natu "! ral-language-understanding-categories#categories-hierarchy). @@ -452,6 +520,8 @@ public section. KEYWORDS type STANDARD TABLE OF T_KEYWORDS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The categories that the service assigned to the analyzed text. CATEGORIES type STANDARD TABLE OF T_CATEGORIES_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! The classifications assigned to the analyzed text. + CLASSIFICATIONS type STANDARD TABLE OF T_CLASSIFICATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The anger, disgust, fear, joy, or sadness conveyed by the content. EMOTION type T_EMOTION_RESULT, "! Webpage metadata, such as the author and the title of the page. @@ -557,26 +627,40 @@ public section. "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, + "! The advanced rules feature is deprecated. Existing models are supported until 24 + "! June 2021, but after 10 June 2021, you will not be able to deploy advanced + "! rules models to Natural Language Understanding. After 24 June 2021, advanced + "! rules models will not run in Natural Language Understanding.
+ "!
"! Model file exported from the advanced rules editor in Watson Knowledge Studio. "! For more information, see [Creating an advanced rules "! model](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledg "! e-studio-create-advanced-rules-model#create-advanced-rules-model-procedure). MODEL type FILE, end of T_FILE_AND_METADATA. + types: + "!

+ "! (Experimental) Returns a summary of content.


+ "!
+ "! Supported languages: English only.
+ "!
+ "! Supported regions: Dallas region only. + begin of T_SUMMARIZATION_OPTIONS, + "! Maximum number of summary sentences to return. + LIMIT type INTEGER, + end of T_SUMMARIZATION_OPTIONS. types: "!

"! Returns important keywords in the content.


@@ -657,8 +741,22 @@ public section. end of T_SYNTAX_OPTIONS. types: "!

- "! Returns a five-level taxonomy of the content. The top three

- "! categories are returned.
+ "! Returns text classifications for the content.

+ begin of T_CLASSIFICATIONS_OPTIONS, + "! Enter a [custom + "! model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- + "! language-understanding-customizing) ID of the classifications model to be used. + "!
+ "!
+ "! You can analyze tone by using a language-specific model ID. See [Tone analytics + "! (Classifications)](https://cloud.ibm.com/docs/natural-language-understanding?to + "! pic=natural-language-understanding-tone_analytics) for more information. + MODEL type STRING, + end of T_CLASSIFICATIONS_OPTIONS. + types: + "!

+ "! Returns a hierarchical taxonomy of the content. The top

+ "! three categories are returned by default.
"!
"! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. @@ -668,22 +766,18 @@ public section. EXPLANATION type BOOLEAN, "! Maximum number of categories to return. LIMIT type INTEGER, - "! Enter a [custom + "! (Beta) Enter a [custom "! model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-customizing) ID to override the standard categories - "! model.
- "!
- "! The custom categories experimental feature will be retired on 19 December 2019. - "! On that date, deployed custom categories models will no longer be accessible in - "! Natural Language Understanding. The feature will be removed from Knowledge - "! Studio on an earlier date. Custom categories models will no longer be - "! accessible in Knowledge Studio on 17 December 2019. + "! model. **This is available only for English categories.**. MODEL type STRING, end of T_CATEGORIES_OPTIONS. types: "!

"! Analysis features and options.

begin of T_FEATURES, + "! Returns text classifications for the content. + CLASSIFICATIONS type T_CLASSIFICATIONS_OPTIONS, "! 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.
@@ -738,8 +832,14 @@ public section. "! Supported languages: Arabic, English, French, German, Italian, Japanese, "! Korean, Portuguese, Russian, Spanish. SENTIMENT type T_SENTIMENT_OPTIONS, - "! Returns a five-level taxonomy of the content. The top three categories are - "! returned.
+ "! (Experimental) Returns a summary of content.
+ "!
+ "! Supported languages: English only.
+ "!
+ "! Supported regions: Dallas region only. + SUMMARIZATION type T_SUMMARIZATION_OPTIONS, + "! Returns a hierarchical taxonomy of the content. The top three categories are + "! returned by default.
"!
"! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. @@ -749,20 +849,50 @@ public section. end of T_FEATURES. types: "!

- "! Advanced rules model.

+ "! Metadata associated with this custom model.

+ begin of T_CLSSFCTNS_MDL_FL_AND_MTDT, + "! An optional name for the model. + NAME type STRING, + "! An optional map of metadata key-value pairs to store with this model. + USER_METADATA type JSONOBJECT, + "! The 2-letter language code of this model. + LANGUAGE type STRING, + "! An optional description of the model. + DESCRIPTION type STRING, + "! An optional version string. + MODEL_VERSION type STRING, + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + WORKSPACE_ID type STRING, + "! The description of the version. + VERSION_DESCRIPTION type STRING, + "! Training data in JSON format. For more information, see [Classifications + "! training data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-classifications#classification-training-data-requi + "! rements). + TRAINING_DATA type FILE, + end of T_CLSSFCTNS_MDL_FL_AND_MTDT. + types: + "!

+ "! The advanced rules feature is deprecated. Existing models

+ "! are supported until 24 June 2021, but after 10 June 2021, you will not be able + "! to deploy advanced rules models to Natural Language Understanding. After 24 + "! June 2021, advanced rules models will not run in Natural Language + "! Understanding.
+ "!
+ "! Advanced rules model. begin of T_BASE_ADVANCED_RULES_MODEL, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, @@ -776,6 +906,8 @@ public section. MODEL_ID type STRING, "! dateTime indicating when the model was created. CREATED type DATETIME, + "! No documentation available. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, "! dateTime of last successful model training. LAST_TRAINED type DATETIME, "! dateTime of last successful model deployment. @@ -812,6 +944,8 @@ public section. KEYWORDS type STANDARD TABLE OF T_KEYWORDS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The categories that the service assigned to the analyzed text. CATEGORIES type STANDARD TABLE OF T_CATEGORIES_RESULT WITH NON-UNIQUE DEFAULT KEY, + "! The classifications assigned to the analyzed text. + CLASSIFICATIONS type STANDARD TABLE OF T_CLASSIFICATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The anger, disgust, fear, joy, or sadness conveyed by the content. EMOTION type T_EMOTION_RESULT, "! Webpage metadata, such as the author and the title of the page. @@ -825,6 +959,83 @@ public section. "! Tokens and sentences returned from syntax analysis. SYNTAX type T_SYNTAX_RESULT, end of T_ANALYSIS_RESULTS. + types: + "!

+ "! Categories model.

+ begin of T_CATEGORIES_MODEL, + "! An optional name for the model. + NAME type STRING, + "! An optional map of metadata key-value pairs to store with this model. + USER_METADATA type JSONOBJECT, + "! The 2-letter language code of this model. + LANGUAGE type STRING, + "! An optional description of the model. + DESCRIPTION type STRING, + "! An optional version string. + MODEL_VERSION type STRING, + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + WORKSPACE_ID type STRING, + "! The description of the version. + VERSION_DESCRIPTION type STRING, + "! The service features that are supported by the custom model. + FEATURES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, + "! When the status is `available`, the model is ready to use. + STATUS type STRING, + "! Unique model ID. + MODEL_ID type STRING, + "! dateTime indicating when the model was created. + CREATED type DATETIME, + "! No documentation available. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, + "! dateTime of last successful model training. + LAST_TRAINED type DATETIME, + "! dateTime of last successful model deployment. + LAST_DEPLOYED type DATETIME, + end of T_CATEGORIES_MODEL. + types: + "!

+ "! List of categories models.

+ begin of T_CATEGORIES_MODEL_LIST, + "! The categories models. + MODELS type STANDARD TABLE OF T_CATEGORIES_MODEL WITH NON-UNIQUE DEFAULT KEY, + end of T_CATEGORIES_MODEL_LIST. + types: + "!

+ "! Optional classifications training parameters along with

+ "! model train requests. + begin of T_CLSSFCTNS_TRNNG_PARAMETERS, + "! Model type selector to train either a single_label or a multi_label classifier. + MODEL_TYPE type STRING, + end of T_CLSSFCTNS_TRNNG_PARAMETERS. + types: + "!

+ "! Metadata associated with this custom model.

+ begin of T_CLSSFCTNS_MDL_FL_MTDT_AND_T1, + "! An optional name for the model. + NAME type STRING, + "! An optional map of metadata key-value pairs to store with this model. + USER_METADATA type JSONOBJECT, + "! The 2-letter language code of this model. + LANGUAGE type STRING, + "! An optional description of the model. + DESCRIPTION type STRING, + "! An optional version string. + MODEL_VERSION type STRING, + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + WORKSPACE_ID type STRING, + "! The description of the version. + VERSION_DESCRIPTION type STRING, + "! Training data in JSON format. For more information, see [Classifications + "! training data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-classifications#classification-training-data-requi + "! rements). + TRAINING_DATA type FILE, + "! Optional classifications training parameters along with model train requests. + TRAINING_PARAMETERS type T_CLSSFCTNS_TRNNG_PARAMETERS, + end of T_CLSSFCTNS_MDL_FL_MTDT_AND_T1. types: "! No documentation available. begin of T_SEMANTIC_ROLES_SUBJECT, @@ -835,15 +1046,6 @@ public section. "! An array of extracted keywords. KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_SUBJECT. - types: - "!

- "! (Experimental) Returns a summary of content.


- "!
- "! Supported languages: English only. - begin of T_SUMMARIZATION_OPTIONS, - "! Maximum number of summary sentences to return. - LIMIT type INTEGER, - end of T_SUMMARIZATION_OPTIONS. types: "!

"! (Experimental) Summary of content.

@@ -853,20 +1055,24 @@ public section. end of T_SUMMARIZATION_RESULT. types: "!

- "! Advanced rules model.

+ "! The advanced rules feature is deprecated. Existing models

+ "! are supported until 24 June 2021, but after 10 June 2021, you will not be able + "! to deploy advanced rules models to Natural Language Understanding. After 24 + "! June 2021, advanced rules models will not run in Natural Language + "! Understanding.
+ "!
+ "! Advanced rules model. begin of T_ADVANCED_RULES_MODEL, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, @@ -880,6 +1086,8 @@ public section. MODEL_ID type STRING, "! dateTime indicating when the model was created. CREATED type DATETIME, + "! No documentation available. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, "! dateTime of last successful model training. LAST_TRAINED type DATETIME, "! dateTime of last successful model deployment. @@ -887,7 +1095,13 @@ public section. end of T_ADVANCED_RULES_MODEL. types: "!

- "! List of advanced rules models.

+ "! The advanced rules feature is deprecated. Existing models

+ "! are supported until 24 June 2021, but after 10 June 2021, you will not be able + "! to deploy advanced rules models to Natural Language Understanding. After 24 + "! June 2021, advanced rules models will not run in Natural Language + "! Understanding.
+ "!
+ "! List of advanced rules models. begin of T_ADVANCED_RULES_MODEL_LIST, "! The advanced rules models. MODELS type STANDARD TABLE OF T_ADVANCED_RULES_MODEL WITH NON-UNIQUE DEFAULT KEY, @@ -971,21 +1185,47 @@ public section. "! A name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, + "! No documentation available. + NOTICES type STANDARD TABLE OF T_NOTICE WITH NON-UNIQUE DEFAULT KEY, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, end of T_SENTIMENT_MODEL. + types: + "!

+ "! Metadata associated with this custom model.

+ begin of T_CTGRS_MDL_FILE_AND_METADATA, + "! An optional name for the model. + NAME type STRING, + "! An optional map of metadata key-value pairs to store with this model. + USER_METADATA type JSONOBJECT, + "! The 2-letter language code of this model. + LANGUAGE type STRING, + "! An optional description of the model. + DESCRIPTION type STRING, + "! An optional version string. + MODEL_VERSION type STRING, + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + WORKSPACE_ID type STRING, + "! The description of the version. + VERSION_DESCRIPTION type STRING, + "! Training data in JSON format. For more information, see [Categories training + "! data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-categories##categories-training-data-requirements) + "! . + TRAINING_DATA type FILE, + end of T_CTGRS_MDL_FILE_AND_METADATA. types: "!

"! Link to the corresponding DBpedia resource.

@@ -997,15 +1237,13 @@ public section. "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, @@ -1013,8 +1251,8 @@ public section. VERSION_DESCRIPTION type STRING, "! Training data in CSV format. For more information, see [Sentiment training data "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n - "! atural-language-understanding-customizing#sentiment-training-data-requirements). - "! + "! atural-language-understanding-custom-sentiment#sentiment-training-data-requireme + "! nts). TRAINING_DATA type FILE, end of T_SNTMNT_MDL_FILE_AND_METADATA. types: @@ -1024,15 +1262,13 @@ public section. "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. - USER_METADATA type MAP, + USER_METADATA type JSONOBJECT, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, - "! Deprecated — use `model_version`. - VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, @@ -1064,6 +1300,9 @@ constants: T_SEMANTIC_ROLES_RESULT type string value '|', T_SEMANTIC_ROLES_OPTIONS type string value '|', T_MODEL_METADATA type string value '|LANGUAGE|', + T_NOTICE type string value '|', + T_CLASSIFICATIONS_MODEL type string value '|LANGUAGE|STATUS|MODEL_ID|CREATED|', + T_CLASSIFICATIONS_MODEL_LIST type string value '|', T_RELATION_ENTITY type string value '|', T_RELATION_ARGUMENT type string value '|', T_RELATIONS_RESULT type string value '|', @@ -1086,6 +1325,7 @@ constants: T_TOKEN_RESULT type string value '|', T_SENTENCE_RESULT type string value '|', T_SYNTAX_RESULT type string value '|', + T_CLASSIFICATIONS_RESULT type string value '|', T_CONCEPTS_RESULT type string value '|', T_CTGRS_RESULT_EXPLANATION type string value '|', T_CATEGORIES_RESULT type string value '|', @@ -1099,18 +1339,24 @@ constants: T_SEMANTIC_ROLES_ACTION type string value '|', T_SYNTAX_OPTIONS_TOKENS type string value '|', T_FILE_AND_METADATA type string value '|LANGUAGE|', + T_SUMMARIZATION_OPTIONS type string value '|', T_KEYWORDS_OPTIONS type string value '|', T_RELATIONS_OPTIONS type string value '|', T_ENTITIES_OPTIONS type string value '|', T_CONCEPTS_OPTIONS type string value '|', T_SYNTAX_OPTIONS type string value '|', + T_CLASSIFICATIONS_OPTIONS type string value '|', T_CATEGORIES_OPTIONS type string value '|', T_FEATURES type string value '|', + T_CLSSFCTNS_MDL_FL_AND_MTDT type string value '|LANGUAGE|TRAINING_DATA|', T_BASE_ADVANCED_RULES_MODEL type string value '|LANGUAGE|', T_ANALYSIS_RESULTS_USAGE type string value '|', T_ANALYSIS_RESULTS type string value '|', + T_CATEGORIES_MODEL type string value '|LANGUAGE|STATUS|MODEL_ID|CREATED|', + T_CATEGORIES_MODEL_LIST type string value '|', + T_CLSSFCTNS_TRNNG_PARAMETERS type string value '|', + T_CLSSFCTNS_MDL_FL_MTDT_AND_T1 type string value '|LANGUAGE|TRAINING_DATA|', T_SEMANTIC_ROLES_SUBJECT type string value '|', - T_SUMMARIZATION_OPTIONS type string value '|', T_SUMMARIZATION_RESULT type string value '|', T_ADVANCED_RULES_MODEL type string value '|LANGUAGE|STATUS|MODEL_ID|CREATED|', T_ADVANCED_RULES_MODEL_LIST type string value '|', @@ -1118,6 +1364,7 @@ constants: T_SEMANTIC_ROLES_OBJECT type string value '|', T_PARAMETERS type string value '|FEATURES|', T_SENTIMENT_MODEL type string value '|', + T_CTGRS_MDL_FILE_AND_METADATA type string value '|LANGUAGE|TRAINING_DATA|', T_SNTMNT_MDL_FILE_AND_METADATA type string value '|LANGUAGE|TRAINING_DATA|', T_MODEL_FILE_AND_METADATA type string value '|LANGUAGE|FILE|', T_DELETE_MODEL_RESULTS type string value '|', @@ -1133,13 +1380,13 @@ constants: LANGUAGE type string value 'language', DESCRIPTION type string value 'description', MODEL_VERSION type string value 'model_version', - VERSION type string value 'version', WORKSPACE_ID type string value 'workspace_id', VERSION_DESCRIPTION type string value 'version_description', FEATURES type string value 'features', STATUS type string value 'status', MODEL_ID type string value 'model_id', CREATED type string value 'created', + NOTICES type string value 'notices', LAST_TRAINED type string value 'last_trained', LAST_DEPLOYED type string value 'last_deployed', MODELS type string value 'models', @@ -1152,6 +1399,7 @@ constants: FALLBACK_TO_RAW type string value 'fallback_to_raw', RETURN_ANALYZED_TEXT type string value 'return_analyzed_text', LIMIT_TEXT_CHARACTERS type string value 'limit_text_characters', + CLASSIFICATIONS type string value 'classifications', CONCEPTS type string value 'concepts', EMOTION type string value 'emotion', ENTITIES type string value 'entities', @@ -1160,9 +1408,11 @@ constants: RELATIONS type string value 'relations', SEMANTIC_ROLES type string value 'semantic_roles', SENTIMENT type string value 'sentiment', + SUMMARIZATION type string value 'summarization', CATEGORIES type string value 'categories', SYNTAX type string value 'syntax', DELETED type string value 'deleted', + VERSION type string value 'version', TRAINING_DATA type string value 'training_data', FILE type string value 'file', ANALYZED_TEXT type string value 'analyzed_text', @@ -1170,6 +1420,7 @@ constants: USAGE type string value 'usage', TEXT_CHARACTERS type string value 'text_characters', TEXT_UNITS type string value 'text_units', + MESSAGE type string value 'message', RELEVANCE type string value 'relevance', DBPEDIA_RESOURCE type string value 'dbpedia_resource', SUBTYPE type string value 'subtype', @@ -1182,6 +1433,7 @@ constants: LABEL type string value 'label', SCORE type string value 'score', EXPLANATION type string value 'explanation', + CLASS_NAME type string value 'class_name', DOCUMENT type string value 'document', TARGETS type string value 'targets', ANGER type string value 'anger', @@ -1208,8 +1460,10 @@ constants: PART_OF_SPEECH type string value 'part_of_speech', LEMMA type string value 'lemma', LIMIT type string value 'limit', + TRAINING_PARAMETERS type string value 'training_parameters', CODE type string value 'code', ERROR type string value 'error', + MODEL_TYPE type string value 'model_type', RELEVANT_TEXT type string value 'relevant_text', end of C_ABAPNAME_DICTIONARY . @@ -1225,6 +1479,7 @@ constants: "!

Analyze text

"! Analyzes text, HTML, or a public webpage for the following features:
"! - Categories
+ "! - Classifications
"! - Concepts
"! - Emotion
"! - Entities
@@ -1293,31 +1548,340 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create categories model

+ "! (Beta) Creates a custom categories model by uploading training data and + "! associated metadata. The model begins the training and deploying process and is + "! ready to use when the `status` is `available`. + "! + "! @parameter I_LANGUAGE | + "! The 2-letter language code of this model. + "! @parameter I_TRAINING_DATA | + "! Training data in JSON format. For more information, see [Categories training + "! data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-categories##categories-training-data-requirements) + "! . + "! @parameter I_TRAINING_DATA_CONTENT_TYPE | + "! The content type of trainingData. + "! @parameter I_NAME | + "! An optional name for the model. + "! @parameter I_USER_METADATA | + "! An optional map of metadata key-value pairs to store with this model. + "! @parameter I_DESCRIPTION | + "! An optional description of the model. + "! @parameter I_MODEL_VERSION | + "! An optional version string. + "! @parameter I_WORKSPACE_ID | + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + "! @parameter I_VERSION_DESCRIPTION | + "! The description of the version. + "! @parameter E_RESPONSE | + "! Service return value of type T_CATEGORIES_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_CATEGORIES_MODEL + importing + !I_LANGUAGE type STRING + !I_TRAINING_DATA type FILE + !I_TRAINING_DATA_CONTENT_TYPE type STRING optional + !I_NAME type STRING optional + !I_USER_METADATA type JSONOBJECT optional + !I_DESCRIPTION type STRING optional + !I_MODEL_VERSION type STRING optional + !I_WORKSPACE_ID type STRING optional + !I_VERSION_DESCRIPTION type STRING optional + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CATEGORIES_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

List categories models

+ "! (Beta) Returns all custom categories models associated with this service + "! instance. + "! + "! @parameter E_RESPONSE | + "! Service return value of type T_CATEGORIES_MODEL_LIST + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_CATEGORIES_MODELS + importing + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CATEGORIES_MODEL_LIST + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get categories model details

+ "! (Beta) Returns the status of the categories model with the given model ID. + "! + "! @parameter I_MODEL_ID | + "! ID of the model. + "! @parameter E_RESPONSE | + "! Service return value of type T_CATEGORIES_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_CATEGORIES_MODEL + importing + !I_MODEL_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CATEGORIES_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update categories model

+ "! (Beta) Overwrites the training data associated with this custom categories model + "! and retrains the model. The new model replaces the current deployment. + "! + "! @parameter I_MODEL_ID | + "! ID of the model. + "! @parameter I_LANGUAGE | + "! The 2-letter language code of this model. + "! @parameter I_TRAINING_DATA | + "! Training data in JSON format. For more information, see [Categories training + "! data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-categories##categories-training-data-requirements) + "! . + "! @parameter I_TRAINING_DATA_CONTENT_TYPE | + "! The content type of trainingData. + "! @parameter I_NAME | + "! An optional name for the model. + "! @parameter I_USER_METADATA | + "! An optional map of metadata key-value pairs to store with this model. + "! @parameter I_DESCRIPTION | + "! An optional description of the model. + "! @parameter I_MODEL_VERSION | + "! An optional version string. + "! @parameter I_WORKSPACE_ID | + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + "! @parameter I_VERSION_DESCRIPTION | + "! The description of the version. + "! @parameter E_RESPONSE | + "! Service return value of type T_CATEGORIES_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_CATEGORIES_MODEL + importing + !I_MODEL_ID type STRING + !I_LANGUAGE type STRING + !I_TRAINING_DATA type FILE + !I_TRAINING_DATA_CONTENT_TYPE type STRING optional + !I_NAME type STRING optional + !I_USER_METADATA type JSONOBJECT optional + !I_DESCRIPTION type STRING optional + !I_MODEL_VERSION type STRING optional + !I_WORKSPACE_ID type STRING optional + !I_VERSION_DESCRIPTION type STRING optional + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CATEGORIES_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete categories model

+ "! (Beta) Un-deploys the custom categories model with the given model ID and + "! deletes all associated customer data, including any training data or binary + "! artifacts. + "! + "! @parameter I_MODEL_ID | + "! ID of the model. + "! @parameter E_RESPONSE | + "! Service return value of type T_DELETE_MODEL_RESULTS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_CATEGORIES_MODEL + importing + !I_MODEL_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DELETE_MODEL_RESULTS + raising + ZCX_IBMC_SERVICE_EXCEPTION . -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_NAT_LANG_UNDRSTND_V1 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Natural Language Understanding'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) + "!

Create classifications model

+ "! Creates a custom classifications model by uploading training data and associated + "! metadata. The model begins the training and deploying process and is ready to + "! use when the `status` is `available`. + "! + "! @parameter I_LANGUAGE | + "! The 2-letter language code of this model. + "! @parameter I_TRAINING_DATA | + "! Training data in JSON format. For more information, see [Classifications + "! training data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-classifications#classification-training-data-requi + "! rements). + "! @parameter I_TRAINING_DATA_CONTENT_TYPE | + "! The content type of trainingData. + "! @parameter I_NAME | + "! An optional name for the model. + "! @parameter I_USER_METADATA | + "! An optional map of metadata key-value pairs to store with this model. + "! @parameter I_DESCRIPTION | + "! An optional description of the model. + "! @parameter I_MODEL_VERSION | + "! An optional version string. + "! @parameter I_WORKSPACE_ID | + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + "! @parameter I_VERSION_DESCRIPTION | + "! The description of the version. + "! @parameter I_TRAINING_PARAMETERS | + "! Optional classifications training parameters along with model train requests. + "! @parameter E_RESPONSE | + "! Service return value of type T_CLASSIFICATIONS_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_CLASSIFICATIONS_MODEL + importing + !I_LANGUAGE type STRING + !I_TRAINING_DATA type FILE + !I_TRAINING_DATA_CONTENT_TYPE type STRING optional + !I_NAME type STRING optional + !I_USER_METADATA type JSONOBJECT optional + !I_DESCRIPTION type STRING optional + !I_MODEL_VERSION type STRING optional + !I_WORKSPACE_ID type STRING optional + !I_VERSION_DESCRIPTION type STRING optional + !I_TRAINING_PARAMETERS type T_CLSSFCTNS_TRNNG_PARAMETERS optional + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CLASSIFICATIONS_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

List classifications models

+ "! Returns all custom classifications models associated with this service instance. + "! + "! + "! @parameter E_RESPONSE | + "! Service return value of type T_CLASSIFICATIONS_MODEL_LIST + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_CLASSIFICATIONS_MODELS + importing + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CLASSIFICATIONS_MODEL_LIST + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get classifications model details

+ "! Returns the status of the classifications model with the given model ID. + "! + "! @parameter I_MODEL_ID | + "! ID of the model. + "! @parameter E_RESPONSE | + "! Service return value of type T_CLASSIFICATIONS_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_CLASSIFICATIONS_MODEL + importing + !I_MODEL_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CLASSIFICATIONS_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Update classifications model

+ "! Overwrites the training data associated with this custom classifications model + "! and retrains the model. The new model replaces the current deployment. + "! + "! @parameter I_MODEL_ID | + "! ID of the model. + "! @parameter I_LANGUAGE | + "! The 2-letter language code of this model. + "! @parameter I_TRAINING_DATA | + "! Training data in JSON format. For more information, see [Classifications + "! training data + "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n + "! atural-language-understanding-classifications#classification-training-data-requi + "! rements). + "! @parameter I_TRAINING_DATA_CONTENT_TYPE | + "! The content type of trainingData. + "! @parameter I_NAME | + "! An optional name for the model. + "! @parameter I_USER_METADATA | + "! An optional map of metadata key-value pairs to store with this model. + "! @parameter I_DESCRIPTION | + "! An optional description of the model. + "! @parameter I_MODEL_VERSION | + "! An optional version string. + "! @parameter I_WORKSPACE_ID | + "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural + "! Language Understanding. + "! @parameter I_VERSION_DESCRIPTION | + "! The description of the version. + "! @parameter I_TRAINING_PARAMETERS | + "! Optional classifications training parameters along with model train requests. + "! @parameter E_RESPONSE | + "! Service return value of type T_CLASSIFICATIONS_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods UPDATE_CLASSIFICATIONS_MODEL + importing + !I_MODEL_ID type STRING + !I_LANGUAGE type STRING + !I_TRAINING_DATA type FILE + !I_TRAINING_DATA_CONTENT_TYPE type STRING optional + !I_NAME type STRING optional + !I_USER_METADATA type JSONOBJECT optional + !I_DESCRIPTION type STRING optional + !I_MODEL_VERSION type STRING optional + !I_WORKSPACE_ID type STRING optional + !I_VERSION_DESCRIPTION type STRING optional + !I_TRAINING_PARAMETERS type T_CLSSFCTNS_TRNNG_PARAMETERS optional + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_CLASSIFICATIONS_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete classifications model

+ "! Un-deploys the custom classifications model with the given model ID and deletes + "! all associated customer data, including any training data or binary artifacts. + "! + "! @parameter I_MODEL_ID | + "! ID of the model. + "! @parameter E_RESPONSE | + "! Service return value of type T_DELETE_MODEL_RESULTS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_CLASSIFICATIONS_MODEL + importing + !I_MODEL_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_DELETE_MODEL_RESULTS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + +protected section. + +private section. + +ENDCLASS. + +class ZCL_IBMC_NAT_LANG_UNDRSTND_V1 IMPLEMENTATION. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_APPNAME +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_APPNAME TYPE STRING +* +-------------------------------------------------------------------------------------- + method GET_APPNAME. + + e_appname = 'Natural Language Understanding'. + + endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Protected Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_REQUEST_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) * | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP * +-------------------------------------------------------------------------------------- method GET_REQUEST_PROP. @@ -1358,7 +1922,7 @@ endmethod. * +--------------------------------------------------------------------------------------
method get_sdk_version_date. - e_sdk_version_date = '20210312144437'. + e_sdk_version_date = '20231212104237'. endmethod. @@ -1421,13 +1985,24 @@ method ANALYZE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1528,6 +2103,896 @@ method DELETE_MODEL. + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->CREATE_CATEGORIES_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_LANGUAGE TYPE STRING +* | [--->] I_TRAINING_DATA TYPE FILE +* | [--->] I_TRAINING_DATA_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_NAME TYPE STRING(optional) +* | [--->] I_USER_METADATA TYPE JSONOBJECT(optional) +* | [--->] I_DESCRIPTION TYPE STRING(optional) +* | [--->] I_MODEL_VERSION TYPE STRING(optional) +* | [--->] I_WORKSPACE_ID TYPE STRING(optional) +* | [--->] I_VERSION_DESCRIPTION TYPE STRING(optional) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CATEGORIES_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_CATEGORIES_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/categories'. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_LANGUAGE is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="language"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_LANGUAGE. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_NAME is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="name"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_NAME. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_USER_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="user_metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_USER_METADATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_MODEL_VERSION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="model_version"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_MODEL_VERSION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_WORKSPACE_ID is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="workspace_id"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_WORKSPACE_ID. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_VERSION_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="version_description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_VERSION_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_TRAINING_DATA is initial. + lv_extension = get_file_extension( I_training_data_content_type ). + lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_training_data_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TRAINING_DATA. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->LIST_CATEGORIES_MODELS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CATEGORIES_MODEL_LIST +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_CATEGORIES_MODELS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/categories'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_CATEGORIES_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CATEGORIES_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_CATEGORIES_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/categories/{model_id}'. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->UPDATE_CATEGORIES_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_LANGUAGE TYPE STRING +* | [--->] I_TRAINING_DATA TYPE FILE +* | [--->] I_TRAINING_DATA_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_NAME TYPE STRING(optional) +* | [--->] I_USER_METADATA TYPE JSONOBJECT(optional) +* | [--->] I_DESCRIPTION TYPE STRING(optional) +* | [--->] I_MODEL_VERSION TYPE STRING(optional) +* | [--->] I_WORKSPACE_ID TYPE STRING(optional) +* | [--->] I_VERSION_DESCRIPTION TYPE STRING(optional) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CATEGORIES_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_CATEGORIES_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/categories/{model_id}'. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_LANGUAGE is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="language"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_LANGUAGE. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_NAME is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="name"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_NAME. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_USER_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="user_metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_USER_METADATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_MODEL_VERSION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="model_version"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_MODEL_VERSION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_WORKSPACE_ID is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="workspace_id"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_WORKSPACE_ID. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_VERSION_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="version_description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_VERSION_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_TRAINING_DATA is initial. + lv_extension = get_file_extension( I_training_data_content_type ). + lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_training_data_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TRAINING_DATA. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP PUT request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->DELETE_CATEGORIES_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DELETE_MODEL_RESULTS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_CATEGORIES_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/categories/{model_id}'. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->CREATE_CLASSIFICATIONS_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_LANGUAGE TYPE STRING +* | [--->] I_TRAINING_DATA TYPE FILE +* | [--->] I_TRAINING_DATA_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_NAME TYPE STRING(optional) +* | [--->] I_USER_METADATA TYPE JSONOBJECT(optional) +* | [--->] I_DESCRIPTION TYPE STRING(optional) +* | [--->] I_MODEL_VERSION TYPE STRING(optional) +* | [--->] I_WORKSPACE_ID TYPE STRING(optional) +* | [--->] I_VERSION_DESCRIPTION TYPE STRING(optional) +* | [--->] I_TRAINING_PARAMETERS TYPE T_CLSSFCTNS_TRNNG_PARAMETERS(optional) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CLASSIFICATIONS_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_CLASSIFICATIONS_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/classifications'. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_LANGUAGE is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="language"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_LANGUAGE. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_NAME is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="name"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_NAME. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_USER_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="user_metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_USER_METADATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_MODEL_VERSION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="model_version"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_MODEL_VERSION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_WORKSPACE_ID is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="workspace_id"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_WORKSPACE_ID. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_VERSION_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="version_description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_VERSION_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_TRAINING_PARAMETERS is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="training_parameters"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_TRAINING_PARAMETERS i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_TRAINING_DATA is initial. + lv_extension = get_file_extension( I_training_data_content_type ). + lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_training_data_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TRAINING_DATA. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->LIST_CLASSIFICATIONS_MODELS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CLASSIFICATIONS_MODEL_LIST +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_CLASSIFICATIONS_MODELS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/classifications'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_CLASSIFICATIONS_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CLASSIFICATIONS_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_CLASSIFICATIONS_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/classifications/{model_id}'. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->UPDATE_CLASSIFICATIONS_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_LANGUAGE TYPE STRING +* | [--->] I_TRAINING_DATA TYPE FILE +* | [--->] I_TRAINING_DATA_CONTENT_TYPE TYPE STRING(optional) +* | [--->] I_NAME TYPE STRING(optional) +* | [--->] I_USER_METADATA TYPE JSONOBJECT(optional) +* | [--->] I_DESCRIPTION TYPE STRING(optional) +* | [--->] I_MODEL_VERSION TYPE STRING(optional) +* | [--->] I_WORKSPACE_ID TYPE STRING(optional) +* | [--->] I_VERSION_DESCRIPTION TYPE STRING(optional) +* | [--->] I_TRAINING_PARAMETERS TYPE T_CLSSFCTNS_TRNNG_PARAMETERS(optional) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_CLASSIFICATIONS_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method UPDATE_CLASSIFICATIONS_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/classifications/{model_id}'. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_LANGUAGE is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="language"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_LANGUAGE. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_NAME is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="name"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_NAME. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_USER_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="user_metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_USER_METADATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_MODEL_VERSION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="model_version"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_MODEL_VERSION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_WORKSPACE_ID is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="workspace_id"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_WORKSPACE_ID. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_VERSION_DESCRIPTION is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="version_description"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. + lv_formdata = i_VERSION_DESCRIPTION. + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + if not i_TRAINING_PARAMETERS is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="training_parameters"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_TRAINING_PARAMETERS i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_TRAINING_DATA is initial. + lv_extension = get_file_extension( I_training_data_content_type ). + lv_value = `form-data; name="training_data"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_training_data_content_type. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_TRAINING_DATA. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP PUT request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->DELETE_CLASSIFICATIONS_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MODEL_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_DELETE_MODEL_RESULTS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_CLASSIFICATIONS_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/models/classifications/{model_id}'. + replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_MODEL_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + " execute HTTP DELETE request lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). diff --git a/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml index 4d7633f..ec812f2 100644 --- a/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml +++ b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml @@ -18,18 +18,78 @@ E Analyze text + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + CREATE_CATEGORIES_MODEL + E + Create categories model + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + CREATE_CLASSIFICATIONS_MODEL + E + Create classifications model + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + DELETE_CATEGORIES_MODEL + E + Delete categories model + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + DELETE_CLASSIFICATIONS_MODEL + E + Delete classifications model + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 DELETE_MODEL E Delete model + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + GET_CATEGORIES_MODEL + E + Get categories model details + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + GET_CLASSIFICATIONS_MODEL + E + Get classifications model details + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + LIST_CATEGORIES_MODELS + E + List categories models + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + LIST_CLASSIFICATIONS_MODELS + E + List classifications models + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 LIST_MODELS E List models + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + UPDATE_CATEGORIES_MODEL + E + Update categories model + + + ZCL_IBMC_NAT_LANG_UNDRSTND_V1 + UPDATE_CLASSIFICATIONS_MODEL + E + Update classifications model + diff --git a/src/zcl_ibmc_personal_insights_v3.clas.abap b/src/zcl_ibmc_personal_insights_v3.clas.abap deleted file mode 100644 index 5ec9825..0000000 --- a/src/zcl_ibmc_personal_insights_v3.clas.abap +++ /dev/null @@ -1,918 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Personality Insights

-"! IBM® will begin sunsetting IBM Watson™ Personality Insights on 1 -"! December 2020. For a period of one year from this date, you will still be able -"! to use Watson Personality Insights. However, as of 1 December 2021, the -"! offering will no longer be available.<br/><br/>As an alternative, -"! we encourage you to consider migrating to IBM Watson™ Natural Language -"! Understanding, a service on IBM Cloud® that uses deep learning to extract -"! data and insights from text such as keywords, categories, sentiment, emotion, -"! and syntax to provide insights for your business or industry. For more -"! information, see [About Natural Language -"! Understanding](https://cloud.ibm.com/docs/natural-language-understanding?topic= -"! natural-language-understanding-about).
-"! {: deprecated}
-"!
-"! The IBM Watson Personality Insights service enables applications to derive -"! insights from social media, enterprise data, or other digital communications. -"! The service uses linguistic analytics to infer individuals' intrinsic -"! personality characteristics, including Big Five, Needs, and Values, from -"! digital communications such as email, text messages, tweets, and forum -"! posts.
-"!
-"! The service can automatically infer, from potentially noisy social media, -"! portraits of individuals that reflect their personality characteristics. The -"! service can infer consumption preferences based on the results of its analysis -"! and, for JSON content that is timestamped, can report temporal behavior.
-"! * For information about the meaning of the models that the service uses to -"! describe personality characteristics, see [Personality -"! models](https://cloud.ibm.com/docs/personality-insights?topic=personality-insig -"! hts-models#models).
-"! * For information about the meaning of the consumption preferences, see -"! [Consumption -"! preferences](https://cloud.ibm.com/docs/personality-insights?topic=personality- -"! insights-preferences#preferences).
-"!
-"! **Note:** Request logging is disabled for the Personality Insights service. -"! Regardless of whether you set the `X-Watson-Learning-Opt-Out` request header, -"! the service does not log or retain data from requests and responses.
-class ZCL_IBMC_PERSONAL_INSIGHTS_V3 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! The characteristics that the service inferred from the input

- "! content. - begin of T_TRAIT, - "! The unique, non-localized identifier of the characteristic to which the results - "! pertain. IDs have the form
- "! * `big5_{characteristic}` for Big Five personality dimensions
- "! * `facet_{characteristic}` for Big Five personality facets
- "! * `need_{characteristic}` for Needs
- "! *`value_{characteristic}` for Values. - TRAIT_ID type STRING, - "! The user-visible, localized name of the characteristic. - NAME type STRING, - "! The category of the characteristic: `personality` for Big Five personality - "! characteristics, `needs` for Needs, and `values` for Values. - CATEGORY type STRING, - "! The normalized percentile score for the characteristic. The range is 0 to 1. For - "! example, if the percentage for Openness is 0.60, the author scored in the 60th - "! percentile; the author is more open than 59 percent of the population and less - "! open than 39 percent of the population. - PERCENTILE type DOUBLE, - "! The raw score for the characteristic. The range is 0 to 1. A higher score - "! generally indicates a greater likelihood that the author has that - "! characteristic, but raw scores must be considered in aggregate: The range of - "! values in practice might be much smaller than 0 to 1, so an individual score - "! must be considered in the context of the overall scores and their range.
- "!
- "! The raw score is computed based on the input and the service model; it is not - "! normalized or compared with a sample population. The raw score enables - "! comparison of the results against a different sampling population and with a - "! custom normalization approach. - RAW_SCORE type DOUBLE, - "! **`2017-10-13`**: Indicates whether the characteristic is meaningful for the - "! input language. The field is always `true` for all characteristics of English, - "! Spanish, and Japanese input. The field is `false` for the subset of - "! characteristics of Arabic and Korean input for which the service's models - "! are unable to generate meaningful results. **`2016-10-19`**: Not returned. - SIGNIFICANT type BOOLEAN, - "! For `personality` (Big Five) dimensions, more detailed results for the facets of - "! each dimension as inferred from the input text. - CHILDREN type STANDARD TABLE OF DATA_REFERENCE WITH NON-UNIQUE DEFAULT KEY, - end of T_TRAIT. - types: - "!

- "! The temporal behavior for the input content.

- begin of T_BEHAVIOR, - "! The unique, non-localized identifier of the characteristic to which the results - "! pertain. IDs have the form `behavior_{value}`. - TRAIT_ID type STRING, - "! The user-visible, localized name of the characteristic. - NAME type STRING, - "! The category of the characteristic: `behavior` for temporal data. - CATEGORY type STRING, - "! For JSON content that is timestamped, the percentage of timestamped input data - "! that occurred during that day of the week or hour of the day. The range is 0 to - "! 1. - PERCENTAGE type DOUBLE, - end of T_BEHAVIOR. - types: - "!

- "! A consumption preference that the service inferred from the

- "! input content. - begin of T_CONSUMPTION_PREFERENCES, - "! The unique, non-localized identifier of the consumption preference to which the - "! results pertain. IDs have the form - "! `consumption_preferences_{preference}`. - CONSUMPTION_PREFERENCE_ID type STRING, - "! The user-visible, localized name of the consumption preference. - NAME type STRING, - "! The score for the consumption preference:
- "! * `0.0`: Unlikely
- "! * `0.5`: Neutral
- "! * `1.0`: Likely
- "!
- "! The scores for some preferences are binary and do not allow a neutral value. The - "! score is an indication of preference based on the results inferred from the - "! input text, not a normalized percentile. - SCORE type DOUBLE, - end of T_CONSUMPTION_PREFERENCES. - types: - "!

- "! A warning message that is associated with the input content.

- begin of T_WARNING, - "! The identifier of the warning message. - WARNING_ID type STRING, - "! The message associated with the `warning_id`:
- "! * `WORD_COUNT_MESSAGE`: "There were {number} words in the input. - "! We need a minimum of 600, preferably 1,200 or more, to compute statistically - "! significant estimates."
- "! * `JSON_AS_TEXT`: "Request input was processed as text/plain as indicated, - "! however detected a JSON input. Did you mean application/json?"
- "! * `CONTENT_TRUNCATED`: "For maximum accuracy while also optimizing - "! processing time, only the first 250KB of input text (excluding markup) was - "! analyzed. Accuracy levels off at approximately 3,000 words so this did not - "! affect the accuracy of the profile."
- "! * `PARTIAL_TEXT_USED`, "The text provided to compute the profile was - "! trimmed for performance reasons. This action does not affect the accuracy of - "! the output, as not all of the input text was required." Applies only when - "! Arabic input text exceeds a threshold at which additional words do not - "! contribute to the accuracy of the profile. - MESSAGE type STRING, - end of T_WARNING. - types: - "!

- "! The consumption preferences that the service inferred from

- "! the input content. - begin of T_CNSMPTN_PREFERENCES_CATEGORY, - "! The unique, non-localized identifier of the consumption preferences category to - "! which the results pertain. IDs have the form - "! `consumption_preferences_{category}`. - CNSMPTN_PREFERENCE_CATEGORY_ID type STRING, - "! The user-visible name of the consumption preferences category. - NAME type STRING, - "! Detailed results inferred from the input text for the individual preferences of - "! the category. - CONSUMPTION_PREFERENCES type STANDARD TABLE OF T_CONSUMPTION_PREFERENCES WITH NON-UNIQUE DEFAULT KEY, - end of T_CNSMPTN_PREFERENCES_CATEGORY. - types: - "!

- "! The personality profile that the service generated for the

- "! input content. - begin of T_PROFILE, - "! The language model that was used to process the input. - PROCESSED_LANGUAGE type STRING, - "! The number of words from the input that were used to produce the profile. - WORD_COUNT type INTEGER, - "! When guidance is appropriate, a string that provides a message that indicates - "! the number of words found and where that value falls in the range of required - "! or suggested number of words. - WORD_COUNT_MESSAGE type STRING, - "! A recursive array of `Trait` objects that provides detailed results for the Big - "! Five personality characteristics (dimensions and facets) inferred from the - "! input text. - PERSONALITY type STANDARD TABLE OF T_TRAIT WITH NON-UNIQUE DEFAULT KEY, - "! Detailed results for the Needs characteristics inferred from the input text. - NEEDS type STANDARD TABLE OF T_TRAIT WITH NON-UNIQUE DEFAULT KEY, - "! Detailed results for the Values characteristics inferred from the input text. - VALUES type STANDARD TABLE OF T_TRAIT WITH NON-UNIQUE DEFAULT KEY, - "! For JSON content that is timestamped, detailed results about the social behavior - "! disclosed by the input in terms of temporal characteristics. The results - "! include information about the distribution of the content over the days of the - "! week and the hours of the day. - BEHAVIOR type STANDARD TABLE OF T_BEHAVIOR WITH NON-UNIQUE DEFAULT KEY, - "! If the **consumption_preferences** parameter is `true`, detailed results for - "! each category of consumption preferences. Each element of the array provides - "! information inferred from the input text for the individual preferences of that - "! category. - CONSUMPTION_PREFERENCES type STANDARD TABLE OF T_CNSMPTN_PREFERENCES_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - "! An array of warning messages that are associated with the input text for the - "! request. The array is empty if the input generated no warnings. - WARNINGS type STANDARD TABLE OF T_WARNING WITH NON-UNIQUE DEFAULT KEY, - end of T_PROFILE. - types: - "!

- "! An input content item that the service is to analyze.

- begin of T_CONTENT_ITEM, - "! The content that is to be analyzed. The service supports up to 20 MB of content - "! for all `ContentItem` objects combined. - CONTENT type STRING, - "! A unique identifier for this content item. - ID type STRING, - "! A timestamp that identifies when this content was created. Specify a value in - "! milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only - "! for results that include temporal behavior data. - CREATED type LONG, - "! A timestamp that identifies when this content was last updated. Specify a value - "! in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required - "! only for results that include temporal behavior data. - UPDATED type LONG, - "! The MIME type of the content. The default is plain text. The tags are stripped - "! from HTML content before it is analyzed; plain text is processed as submitted. - CONTENTTYPE type STRING, - "! The language identifier (two-letter ISO 639-1 identifier) for the language of - "! the content item. The default is `en` (English). Regional variants are treated - "! as their parent language; for example, `en-US` is interpreted as `en`. A - "! language specified with the **Content-Type** parameter overrides the value of - "! this parameter; any content items that specify a different language are - "! ignored. Omit the **Content-Type** parameter to base the language on the most - "! prevalent specification among the content items; again, content items that - "! specify a different language are ignored. You can specify any combination of - "! languages for the input and response content. - LANGUAGE type STRING, - "! The unique ID of the parent content item for this item. Used to identify - "! hierarchical relationships between posts/replies, messages/replies, and so on. - PARENTID type STRING, - "! Indicates whether this content item is a reply to another content item. - REPLY type BOOLEAN, - "! Indicates whether this content item is a forwarded/copied version of another - "! content item. - FORWARD type BOOLEAN, - end of T_CONTENT_ITEM. - types: - "!

- "! A CSV file that contains the results of the personality

- "! profile that the service generated for the input content. - T_CSV_FILE type String. - types: - "!

- "! The error response from a failed request.

- begin of T_ERROR_MODEL, - "! The HTTP status code. - CODE type INTEGER, - "! A service-specific error code. - SUB_CODE type STRING, - "! A description of the error. - ERROR type STRING, - "! A URL to documentation explaining the cause and possibly solutions for the - "! error. - HELP type STRING, - end of T_ERROR_MODEL. - types: - "!

- "! The full input content that the service is to analyze.

- begin of T_CONTENT, - "! An array of `ContentItem` objects that provides the text that is to be analyzed. - "! - CONTENTITEMS type STANDARD TABLE OF T_CONTENT_ITEM WITH NON-UNIQUE DEFAULT KEY, - end of T_CONTENT. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_TRAIT type string value '|TRAIT_ID|NAME|CATEGORY|PERCENTILE|', - T_BEHAVIOR type string value '|TRAIT_ID|NAME|CATEGORY|PERCENTAGE|', - T_CONSUMPTION_PREFERENCES type string value '|CONSUMPTION_PREFERENCE_ID|NAME|SCORE|', - T_WARNING type string value '|WARNING_ID|MESSAGE|', - T_CNSMPTN_PREFERENCES_CATEGORY type string value '|CNSMPTN_PREFERENCE_CATEGORY_ID|NAME|CONSUMPTION_PREFERENCES|', - T_PROFILE type string value '|PROCESSED_LANGUAGE|WORD_COUNT|PERSONALITY|NEEDS|VALUES|WARNINGS|', - T_CONTENT_ITEM type string value '|CONTENT|', - T_ERROR_MODEL type string value '|CODE|ERROR|', - T_CONTENT type string value '|CONTENTITEMS|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - PROCESSED_LANGUAGE type string value 'processed_language', - WORD_COUNT type string value 'word_count', - WORD_COUNT_MESSAGE type string value 'word_count_message', - PERSONALITY type string value 'personality', - NEEDS type string value 'needs', - VALUES type string value 'values', - BEHAVIOR type string value 'behavior', - CONSUMPTION_PREFERENCES type string value 'consumption_preferences', - WARNINGS type string value 'warnings', - TRAIT_ID type string value 'trait_id', - NAME type string value 'name', - CATEGORY type string value 'category', - PERCENTILE type string value 'percentile', - RAW_SCORE type string value 'raw_score', - SIGNIFICANT type string value 'significant', - CHILDREN type string value 'children', - PERCENTAGE type string value 'percentage', - CNSMPTN_PREFERENCE_CATEGORY_ID type string value 'consumption_preference_category_id', - CONSUMPTION_PREFERENCE_ID type string value 'consumption_preference_id', - SCORE type string value 'score', - WARNING_ID type string value 'warning_id', - MESSAGE type string value 'message', - CONTENTITEMS type string value 'contentItems', - CONTENT_ITEM type string value 'content_item', - CONTENT type string value 'content', - ID type string value 'id', - CREATED type string value 'created', - UPDATED type string value 'updated', - CONTENTTYPE type string value 'contenttype', - LANGUAGE type string value 'language', - PARENTID type string value 'parentid', - REPLY type string value 'reply', - FORWARD type string value 'forward', - CODE type string value 'code', - SUB_CODE type string value 'sub_code', - ERROR type string value 'error', - HELP type string value 'help', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Get profile

- "! Generates a personality profile for the author of the input text. The service - "! accepts a maximum of 20 MB of input content, but it requires much less text to - "! produce an accurate profile. The service can analyze text in Arabic, English, - "! Japanese, Korean, or Spanish. It can return its results in a variety of - "! languages.
- "!
- "! **See also:**
- "! * [Requesting a - "! profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-input#input)
- "! * [Providing sufficient - "! input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - "! ts-input#sufficient)
- "!
- "! ### Content types
- "!
- "! You can provide input content as plain text (`text/plain`), HTML (`text/html`), - "! or JSON (`application/json`) by specifying the **Content-Type** parameter. The - "! default is `text/plain`.
- "! * Per the JSON specification, the default character encoding for JSON content is - "! effectively always UTF-8.
- "! * Per the HTTP specification, the default encoding for plain text and HTML is - "! ISO-8859-1 (effectively, the ASCII character set).
- "!
- "! When specifying a content type of plain text or HTML, include the `charset` - "! parameter to indicate the character encoding of the input text; for example, - "! `Content-Type: text/plain;charset=utf-8`.
- "!
- "! **See also:** [Specifying request and response - "! formats](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-input#formats)
- "!
- "! ### Accept types
- "!
- "! You must request a response as JSON (`application/json`) or comma-separated - "! values (`text/csv`) by specifying the **Accept** parameter. CSV output includes - "! a fixed number of columns. Set the **csv_headers** parameter to `true` to - "! request optional column headers for CSV output.
- "!
- "! **See also:**
- "! * [Understanding a JSON - "! profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-output#output)
- "! * [Understanding a CSV - "! profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-outputCSV#outputCSV) - "! - "! @parameter I_CONTENT | - "! A maximum of 20 MB of content to analyze, though the service requires much less - "! text; for more information, see [Providing sufficient - "! input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - "! ts-input#sufficient). For JSON input, provide an object of type `Content`. - "! @parameter I_CONTENT_TYPE | - "! The type of the input. For more information, see **Content types** in the method - "! description. - "! @parameter I_CONTENT_LANGUAGE | - "! The language of the input text for the request: Arabic, English, Japanese, - "! Korean, or Spanish. Regional variants are treated as their parent language; for - "! example, `en-US` is interpreted as `en`.
- "!
- "! The effect of the **Content-Language** parameter depends on the **Content-Type** - "! parameter. When **Content-Type** is `text/plain` or `text/html`, - "! **Content-Language** is the only way to specify the language. When - "! **Content-Type** is `application/json`, **Content-Language** overrides a - "! language specified with the `language` parameter of a `ContentItem` object, and - "! content items that specify a different language are ignored; omit this - "! parameter to base the language on the specification of the content items. You - "! can specify any combination of languages for **Content-Language** and - "! **Accept-Language**. - "! @parameter I_ACCEPT_LANGUAGE | - "! The desired language of the response. For two-character arguments, regional - "! variants are treated as their parent language; for example, `en-US` is - "! interpreted as `en`. You can specify any combination of languages for the input - "! and response content. - "! @parameter I_RAW_SCORES | - "! Indicates whether a raw score in addition to a normalized percentile is returned - "! for each characteristic; raw scores are not compared with a sample population. - "! By default, only normalized percentiles are returned. - "! @parameter I_CSV_HEADERS | - "! Indicates whether column labels are returned with a CSV response. By default, no - "! column labels are returned. Applies only when the response type is CSV - "! (`text/csv`). - "! @parameter I_CONSUMPTION_PREFERENCES | - "! Indicates whether consumption preferences are returned with the results. By - "! default, no consumption preferences are returned. - "! @parameter E_RESPONSE | - "! Service return value of type T_PROFILE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods PROFILE - importing - !I_CONTENT type T_CONTENT - !I_CONTENT_TYPE type STRING default 'text/plain' - !I_CONTENT_LANGUAGE type STRING default 'en' - !I_ACCEPT_LANGUAGE type STRING default 'en' - !I_RAW_SCORES type BOOLEAN default c_boolean_false - !I_CSV_HEADERS type BOOLEAN default c_boolean_false - !I_CONSUMPTION_PREFERENCES type BOOLEAN default c_boolean_false - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_PROFILE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get profile as csv

- "! Generates a personality profile for the author of the input text. The service - "! accepts a maximum of 20 MB of input content, but it requires much less text to - "! produce an accurate profile. The service can analyze text in Arabic, English, - "! Japanese, Korean, or Spanish. It can return its results in a variety of - "! languages.
- "!
- "! **See also:**
- "! * [Requesting a - "! profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-input#input)
- "! * [Providing sufficient - "! input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - "! ts-input#sufficient)
- "!
- "! ### Content types
- "!
- "! You can provide input content as plain text (`text/plain`), HTML (`text/html`), - "! or JSON (`application/json`) by specifying the **Content-Type** parameter. The - "! default is `text/plain`.
- "! * Per the JSON specification, the default character encoding for JSON content is - "! effectively always UTF-8.
- "! * Per the HTTP specification, the default encoding for plain text and HTML is - "! ISO-8859-1 (effectively, the ASCII character set).
- "!
- "! When specifying a content type of plain text or HTML, include the `charset` - "! parameter to indicate the character encoding of the input text; for example, - "! `Content-Type: text/plain;charset=utf-8`.
- "!
- "! **See also:** [Specifying request and response - "! formats](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-input#formats)
- "!
- "! ### Accept types
- "!
- "! You must request a response as JSON (`application/json`) or comma-separated - "! values (`text/csv`) by specifying the **Accept** parameter. CSV output includes - "! a fixed number of columns. Set the **csv_headers** parameter to `true` to - "! request optional column headers for CSV output.
- "!
- "! **See also:**
- "! * [Understanding a JSON - "! profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-output#output)
- "! * [Understanding a CSV - "! profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insi - "! ghts-outputCSV#outputCSV) - "! - "! @parameter I_CONTENT | - "! A maximum of 20 MB of content to analyze, though the service requires much less - "! text; for more information, see [Providing sufficient - "! input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insigh - "! ts-input#sufficient). For JSON input, provide an object of type `Content`. - "! @parameter I_CONTENT_TYPE | - "! The type of the input. For more information, see **Content types** in the method - "! description. - "! @parameter I_CONTENT_LANGUAGE | - "! The language of the input text for the request: Arabic, English, Japanese, - "! Korean, or Spanish. Regional variants are treated as their parent language; for - "! example, `en-US` is interpreted as `en`.
- "!
- "! The effect of the **Content-Language** parameter depends on the **Content-Type** - "! parameter. When **Content-Type** is `text/plain` or `text/html`, - "! **Content-Language** is the only way to specify the language. When - "! **Content-Type** is `application/json`, **Content-Language** overrides a - "! language specified with the `language` parameter of a `ContentItem` object, and - "! content items that specify a different language are ignored; omit this - "! parameter to base the language on the specification of the content items. You - "! can specify any combination of languages for **Content-Language** and - "! **Accept-Language**. - "! @parameter I_ACCEPT_LANGUAGE | - "! The desired language of the response. For two-character arguments, regional - "! variants are treated as their parent language; for example, `en-US` is - "! interpreted as `en`. You can specify any combination of languages for the input - "! and response content. - "! @parameter I_RAW_SCORES | - "! Indicates whether a raw score in addition to a normalized percentile is returned - "! for each characteristic; raw scores are not compared with a sample population. - "! By default, only normalized percentiles are returned. - "! @parameter I_CSV_HEADERS | - "! Indicates whether column labels are returned with a CSV response. By default, no - "! column labels are returned. Applies only when the response type is CSV - "! (`text/csv`). - "! @parameter I_CONSUMPTION_PREFERENCES | - "! Indicates whether consumption preferences are returned with the results. By - "! default, no consumption preferences are returned. - "! @parameter E_RESPONSE | - "! Service return value of type STRING - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods PROFILE_AS_CSV - importing - !I_CONTENT type T_CONTENT - !I_CONTENT_TYPE type STRING default 'text/plain' - !I_CONTENT_LANGUAGE type STRING default 'en' - !I_ACCEPT_LANGUAGE type STRING default 'en' - !I_RAW_SCORES type BOOLEAN default c_boolean_false - !I_CSV_HEADERS type BOOLEAN default c_boolean_false - !I_CONSUMPTION_PREFERENCES type BOOLEAN default c_boolean_false - !I_accept type string default 'text/csv' - exporting - !E_RESPONSE type STRING - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_PERSONAL_INSIGHTS_V3 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_PERSONAL_INSIGHTS_V3->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Personality Insights'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_PERSONAL_INSIGHTS_V3->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.personality-insights.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_PERSONAL_INSIGHTS_V3->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144439'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_PERSONAL_INSIGHTS_V3->PROFILE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CONTENT TYPE T_CONTENT -* | [--->] I_CONTENT_TYPE TYPE STRING (default ='text/plain') -* | [--->] I_CONTENT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_ACCEPT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_RAW_SCORES TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_CSV_HEADERS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_CONSUMPTION_PREFERENCES TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_PROFILE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method PROFILE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/profile'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_RAW_SCORES is supplied. - lv_queryparam = i_RAW_SCORES. - add_query_parameter( - exporting - i_parameter = `raw_scores` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CSV_HEADERS is supplied. - lv_queryparam = i_CSV_HEADERS. - add_query_parameter( - exporting - i_parameter = `csv_headers` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CONSUMPTION_PREFERENCES is supplied. - lv_queryparam = i_CONSUMPTION_PREFERENCES. - add_query_parameter( - exporting - i_parameter = `consumption_preferences` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_CONTENT_TYPE is supplied. - ls_request_prop-header_content_type = I_CONTENT_TYPE. - endif. - - if i_CONTENT_LANGUAGE is supplied. - lv_headerparam = I_CONTENT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Content-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - if i_ACCEPT_LANGUAGE is supplied. - lv_headerparam = I_ACCEPT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Accept-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_CONTENT ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_CONTENT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'content' i_value = i_CONTENT ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_CONTENT to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_PERSONAL_INSIGHTS_V3->PROFILE_AS_CSV -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CONTENT TYPE T_CONTENT -* | [--->] I_CONTENT_TYPE TYPE STRING (default ='text/plain') -* | [--->] I_CONTENT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_ACCEPT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_RAW_SCORES TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_CSV_HEADERS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_CONSUMPTION_PREFERENCES TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_accept TYPE string (default ='text/csv') -* | [<---] E_RESPONSE TYPE STRING -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method PROFILE_AS_CSV. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/profile'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_RAW_SCORES is supplied. - lv_queryparam = i_RAW_SCORES. - add_query_parameter( - exporting - i_parameter = `raw_scores` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CSV_HEADERS is supplied. - lv_queryparam = i_CSV_HEADERS. - add_query_parameter( - exporting - i_parameter = `csv_headers` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_CONSUMPTION_PREFERENCES is supplied. - lv_queryparam = i_CONSUMPTION_PREFERENCES. - add_query_parameter( - exporting - i_parameter = `consumption_preferences` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_CONTENT_TYPE is supplied. - ls_request_prop-header_content_type = I_CONTENT_TYPE. - endif. - - if i_CONTENT_LANGUAGE is supplied. - lv_headerparam = I_CONTENT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Content-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - if i_ACCEPT_LANGUAGE is supplied. - lv_headerparam = I_ACCEPT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Accept-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_CONTENT ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_CONTENT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'content' i_value = i_CONTENT ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_CONTENT to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve file data - e_response = get_response_string( lo_response ). - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_personal_insights_v3.clas.xml b/src/zcl_ibmc_personal_insights_v3.clas.xml deleted file mode 100644 index 1f792b4..0000000 --- a/src/zcl_ibmc_personal_insights_v3.clas.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ZCL_IBMC_PERSONAL_INSIGHTS_V3 - E - Personality Insights - 1 - X - X - X - - - - ZCL_IBMC_PERSONAL_INSIGHTS_V3 - PROFILE - E - Get profile - - - ZCL_IBMC_PERSONAL_INSIGHTS_V3 - PROFILE_AS_CSV - E - Get profile as csv - - - - - diff --git a/src/zcl_ibmc_service.clas.abap b/src/zcl_ibmc_service.clas.abap index c824515..839c40a 100644 --- a/src/zcl_ibmc_service.clas.abap +++ b/src/zcl_ibmc_service.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019,2020 IBM Corp. All Rights Reserved. +* Copyright 2019,2020 IBM Corp. All Rights Reserved.OR * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -11,88 +11,88 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -class ZCL_IBMC_SERVICE definition +class ZCL_IBMC_service definition public - inheriting from ZCL_IBMC_SERVICE_ARCH + inheriting from ZCL_IBMC_service_arch create public . public section. - types DATA_REFERENCE type ref to DATA . + types data_reference type ref to data . types: - FIELDNAME(30) type c . - types BOOLEAN type ZIF_IBMC_SERVICE_ARCH~BOOLEAN . - types CHAR type ZIF_IBMC_SERVICE_ARCH~CHAR . - types DATE type STRING . - types TIME type STRING . - types INTEGER type I . - types SHORT type INT2 . - types LONG type INT8 . - types FLOAT type F . - types DOUBLE type F . - types NUMBER type F . - types FILE type XSTRING . - types BINARY type XSTRING . - types JSONOBJECT type ref to DATA . - types MAP type ref to DATA . + fieldname(30) type c . + types boolean type ZIF_IBMC_service_arch~boolean . + types char type ZIF_IBMC_service_arch~char . + types date type string . + types time type string . + types integer type i . + types short type int2 . + types long type int8 . + types float type f . + types double type f . + types number type f . + types file type xstring . + types binary type xstring . + types jsonobject type ref to data . + types map type ref to data . types: "!

DateTime type, format 2018-10-23T15:18:18.914xxxZ

- DATETIME(27) type c . - types TT_STRING type ZIF_IBMC_SERVICE_ARCH~TT_STRING . + datetime(27) type c . + types tt_string type ZIF_IBMC_service_arch~tt_string . types: - TT_BOOLEAN type standard table of ZIF_IBMC_SERVICE_ARCH~BOOLEAN with non-unique default key . + tt_boolean type standard table of ZIF_IBMC_service_arch~boolean with non-unique default key . types: - TT_CHAR type standard table of ZIF_IBMC_SERVICE_ARCH~CHAR with non-unique default key . + tt_char type standard table of ZIF_IBMC_service_arch~char with non-unique default key . types: - TT_INTEGER type standard table of INTEGER with non-unique default key . + tt_integer type standard table of integer with non-unique default key . types: - TT_SHORT type standard table of SHORT with non-unique default key . + tt_short type standard table of short with non-unique default key . types: - TT_LONG type standard table of LONG with non-unique default key . + tt_long type standard table of long with non-unique default key . types: - TT_FLOAT type standard table of FLOAT with non-unique default key . + tt_float type standard table of float with non-unique default key . types: - TT_DOUBLE type standard table of DOUBLE with non-unique default key . + tt_double type standard table of double with non-unique default key . types: - TT_NUMBER type standard table of NUMBER with non-unique default key . + tt_number type standard table of number with non-unique default key . types: - TT_FILE type standard table of FILE with non-unique default key . + tt_file type standard table of file with non-unique default key . types: - begin of TS_MAP_FILE, - KEY type STRING, - DATA type FILE, - end of TS_MAP_FILE . + begin of ts_map_file, + key type string, + data type file, + end of ts_map_file . types: - TT_MAP_FILE type standard table of TS_MAP_FILE with non-unique default key . + tt_map_file type standard table of ts_map_file with non-unique default key . types: - begin of TS_FILE_WITH_METADATA, - FILENAME type string, - CONTENT_TYPE type string, - DATA type xstring, - end of TS_FILE_WITH_METADATA . + begin of ts_file_with_metadata, + filename type string, + content_type type string, + data type xstring, + end of ts_file_with_metadata . types: - TT_FILE_WITH_METADATA type standard table of TS_FILE_WITH_METADATA with non-unique default key . - types TS_FORM_PART type ZIF_IBMC_SERVICE_ARCH~TS_FORM_PART . - types TT_FORM_PART type ZIF_IBMC_SERVICE_ARCH~TT_FORM_PART . - - constants C_BOOLEAN_FALSE type BOOLEAN value SPACE ##NO_TEXT. - constants C_BOOLEAN_TRUE type BOOLEAN value 'X' ##NO_TEXT. - constants C_TRIBOOL_FALSE type BOOLEAN value '-' ##NO_TEXT. - constants C_DEFAULT type STRING value 'DEFAULT' ##NO_TEXT. - constants C_SUBRC_UNKNOWN type SY-SUBRC value 999999 ##NO_TEXT. - constants C_MSGID type SY-MSGID value 'ZIBMC' ##NO_TEXT. - constants C_I_ZERO type I value -2147481648 ##NO_TEXT. - constants C_I8_ZERO type INT8 value -9223372036854775608 ##NO_TEXT. - constants C_F_ZERO type F value '-2147481.648' ##NO_TEXT. - constants C_BLANK type STRING value '&#§§#&__%$X' ##NO_TEXT. + tt_file_with_metadata type standard table of ts_file_with_metadata with non-unique default key . + types ts_form_part type ZIF_IBMC_service_arch~ts_form_part . + types tt_form_part type ZIF_IBMC_service_arch~tt_form_part . + + constants c_boolean_false type boolean value space ##NO_TEXT. + constants c_boolean_true type boolean value 'X' ##NO_TEXT. + constants c_tribool_false type boolean value '-' ##NO_TEXT. + constants c_default type string value 'DEFAULT' ##NO_TEXT. + constants c_subrc_unknown type sy-subrc value 999999 ##NO_TEXT. + constants c_msgid type sy-msgid value 'ZIBMC' ##NO_TEXT. + constants c_i_zero type i value -2147481648 ##NO_TEXT. + constants c_i8_zero type int8 value -9223372036854775608 ##NO_TEXT. + constants c_f_zero type f value '-2147481.648' ##NO_TEXT. + constants c_blank type string value '&#!-#&__%$X' ##NO_TEXT. constants: - begin of C_DATATYPE, + begin of c_datatype, string type char value 'g', struct type char value 'v', - end of C_DATATYPE . - data P_REQUEST_PROP_DEFAULT type TS_REQUEST_PROP . - data P_DEBUG_MODE type CHAR value SPACE ##NO_TEXT. - data P_VERSION type STRING . + end of c_datatype . + data p_request_prop_default type ts_request_prop . + data p_debug_mode type char value space ##NO_TEXT. + data p_version type string . "!

Raises an exception.

"! @@ -107,19 +107,19 @@ public section. "! @parameter I_HTTP_STATUS | HTTP status code if exception is triggered by HTTP error "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised. "! - class-methods RAISE_EXCEPTION + class-methods raise_exception importing - !I_MSGNO type SY-MSGNO optional - !I_MSGV1 type STRING optional - !I_MSGV2 type STRING optional - !I_MSGV3 type STRING optional - !I_MSGV4 type STRING optional - !I_TEXT type STRING optional - !I_SUBRC type SY-SUBRC default C_SUBRC_UNKNOWN - !I_PREVIOUS type ref to CX_ROOT optional - !I_HTTP_STATUS type TS_HTTP_STATUS optional + !i_msgno type sy-msgno optional + !i_msgv1 type string optional + !i_msgv2 type string optional + !i_msgv3 type string optional + !i_msgv4 type string optional + !i_text type string optional + !i_subrc type sy-subrc default c_subrc_unknown + !i_previous type ref to cx_root optional + !i_http_status type ts_http_status optional raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Returns field type and length of a given parameter.

"! "! @parameter I_FIELD | Field of type that is supposed to be determined. @@ -127,23 +127,23 @@ public section. "! @parameter E_RELATIVE_TYPE | Relative type (= data type) of I_FIELD. "! @parameter E_LENGTH | Length of type of I_FIELD. "! - class-methods GET_FIELD_TYPE + class-methods get_field_type importing - !I_FIELD type ANY + !i_field type any exporting - !E_TECHNICAL_TYPE type ZIF_IBMC_SERVICE_ARCH~CHAR - !E_RELATIVE_TYPE type STRING - !E_LENGTH type I . + !e_technical_type type ZIF_IBMC_service_arch~char + !e_relative_type type string + !e_length type i . "!

Returns component names of a given structure.

"! "! @parameter I_STRUCTURE | Structure with components. "! @parameter E_COMPONENTS | Internal table of component names. "! - class-methods GET_COMPONENTS + class-methods get_components importing - !I_STRUCTURE type ANY + !i_structure type any exporting - value(E_COMPONENTS) type ZIF_IBMC_SERVICE_ARCH~TT_STRING . + value(e_components) type ZIF_IBMC_service_arch~tt_string . "!

Parses a JSON string into an ABAP structure.

"! "! @parameter I_JSON | JSON string. @@ -151,103 +151,103 @@ public section. "! @parameter C_ABAP | ABAP structure to be filled "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - class-methods PARSE_JSON + class-methods parse_json importing - !I_JSON type STRING - !I_DICTIONARY type ANY optional + !i_json type string + !i_dictionary type any optional changing - value(C_ABAP) type ANY + value(c_abap) type any raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Method for internal use.

"! - methods GET_REQUEST_PROP + methods get_request_prop importing - !I_AUTH_METHOD type STRING default C_DEFAULT + !i_auth_method type string default c_default returning - value(E_REQUEST_PROP) type TS_REQUEST_PROP . + value(e_request_prop) type ts_request_prop . "!

Returns data type of a given parameter.

"! "! @parameter I_FIELD | Field of type that is supposed to be determined. "! @parameter E_DATATYPE | Technical type (= base type) of I_FIELD. "! - class-methods GET_DATATYPE + class-methods get_datatype importing - !I_FIELD type ANY + !i_field type any returning - value(E_DATATYPE) type ZIF_IBMC_SERVICE_ARCH~CHAR . + value(e_datatype) type ZIF_IBMC_service_arch~char . "!

Unescape unicode codepoints to characters in a string

, "! e.g. '\u0041 b \u0063' -> 'A b c' "! "! @parameter I_IN | String with unicode codepoints. "! @parameter E_OUT | Unescaped string. "! - class-methods UNESCAPE_UNICODE + class-methods unescape_unicode importing - !I_IN type STRING + !i_in type string returning - value(E_OUT) type STRING . + value(e_out) type string . "!

Returns the file extension for a mime type

, "! e.g. 'text/plain' -> 'txt' "! "! @parameter I_MIME_TYPE | MIME type. "! @parameter E_EXTENSION | File extension (without leading dot). "! - class-methods GET_FILE_EXTENSION + class-methods get_file_extension importing - value(I_MIME_TYPE) type STRING + value(i_mime_type) type string returning - value(E_EXTENSION) type STRING . + value(e_extension) type string . "!

Moves a referenced data structure to an ABAP structure.

"! "! @parameter I_DATA_REFERENCE | Reference to data object. "! @parameter E_ABAP | ABAP structure to be filled. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - class-methods MOVE_DATA_REFERENCE_TO_ABAP + class-methods move_data_reference_to_abap importing - !I_DATA_REFERENCE type DATA_REFERENCE + !i_data_reference type data_reference exporting - value(E_ABAP) type ANY + value(e_abap) type any raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Method for internal use.

"! - class-methods ADD_QUERY_PARAMETER + class-methods add_query_parameter importing - !I_PARAMETER type STRING - !I_VALUE type STRING - !I_IS_BOOLEAN type BOOLEAN default C_BOOLEAN_FALSE + !i_parameter type string + !i_value type string + !i_is_boolean type boolean default c_boolean_false changing - !C_URL type TS_URL . + !c_url type ts_url . "!

Method for internal use.

"! - class-methods ADD_HEADER_PARAMETER + class-methods add_header_parameter importing - !I_PARAMETER type STRING - !I_VALUE type STRING - !I_IS_BOOLEAN type BOOLEAN default C_BOOLEAN_FALSE + !i_parameter type string + !i_value type string + !i_is_boolean type boolean default c_boolean_false changing - !C_HEADERS type ZIF_IBMC_SERVICE_ARCH~TS_REQUEST_PROP-HEADERS . + !c_headers type ZIF_IBMC_service_arch~ts_request_prop-headers . "!

Method for internal use.

"! - class-methods GET_FULL_URL + class-methods get_full_url importing - !I_URL type TS_URL + !i_url type ts_url returning - value(E_URL) type STRING . + value(e_url) type string . "!

Returns the service name.

"! "! @parameter E_APPNAME | Name of the service. "! - methods GET_APPNAME + methods get_appname returning - value(E_APPNAME) type STRING . + value(e_appname) type string . "!

Method for internal use.

"! - class-methods NORMALIZE_URL + class-methods normalize_url changing - !C_URL type TS_URL . + !c_url type ts_url . "!

Extracts a JSON string from an ABAP structure.

"! "! @parameter I_NAME | Name of component to be extracted. @@ -260,27 +260,27 @@ public section. "! @parameter I_LOWER_CASE | If set to C_BOOLEAN_TRUE all keys in JSON string will be lower case. "! @parameter E_JSON | JSON string. "! - class-methods ABAP_TO_JSON + class-methods abap_to_json importing - !I_NAME type STRING optional - !I_VALUE type ANY - !I_DICTIONARY type ANY optional - !I_REQUIRED_FIELDS type ANY optional - !I_LOWER_CASE type BOOLEAN default C_BOOLEAN_TRUE + !i_name type string optional + !i_value type any + !i_dictionary type any optional + !i_required_fields type any optional + !i_lower_case type boolean default c_boolean_true returning - value(E_JSON) type STRING . + value(e_json) type string . "!

Throws an exception, if HTTP response indicates an error.

"! "! @parameter I_RESPONSE | HTTP response to be checked. "! @parameter I_URL | URL that the request has been sent to. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - methods CHECK_HTTP_RESPONSE + methods check_http_response importing - !I_RESPONSE type TO_REST_RESPONSE optional - !I_URL type TS_URL optional + !i_response type to_rest_response optional + !i_url type ts_url optional raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Class constructor.

"! "! @parameter I_URL | URL of the service. @@ -294,82 +294,95 @@ public section. "! @parameter I_SSL_ID | ID of PSE, not applicable on SAP Cloud Platform. "! @parameter I_DEBUG_MODE | not used. "! - methods CONSTRUCTOR + methods constructor importing - !I_URL type STRING optional - !I_HOST type STRING optional - !I_PROXY_HOST type STRING optional - !I_PROXY_PORT type STRING optional - !I_USERNAME type STRING optional - !I_PASSWORD type STRING optional - !I_APIKEY type STRING optional - !I_ACCESS_TOKEN type TS_ACCESS_TOKEN optional - !I_SSL_ID type ZIF_IBMC_SERVICE_ARCH~TY_SSL_ID optional - !I_DEBUG_MODE type CHAR default SPACE . + !i_url type string optional + !i_host type string optional + !i_proxy_host type string optional + !i_proxy_port type string optional + !i_username type string optional + !i_password type string optional + !i_apikey type string optional + !i_access_token type ts_access_token optional + !i_ssl_id type ZIF_IBMC_service_arch~ty_ssl_id optional + !i_debug_mode type char default space . "!

Method for internal use.

"! - methods GET_REST_CLIENT + methods get_rest_client importing - !I_REQUEST_PROP type TS_REQUEST_PROP + !i_request_prop type ts_request_prop returning - value(E_CLIENT) type TS_CLIENT + value(e_client) type ts_client raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Method for internal use.

"! - methods GET_ACCESS_TOKEN + methods get_access_token importing - !I_REQUEST_PROP type TS_REQUEST_PROP optional + !i_request_prop type ts_request_prop optional returning - value(E_ACCESS_TOKEN) type TS_ACCESS_TOKEN + value(e_access_token) type ts_access_token raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Sends a HTTP DELETE request.

"! "! @parameter I_REQUEST_PROP | Request properties. "! @parameter E_RESPONSE | Response returned by service. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - methods HTTP_DELETE + methods http_delete importing - !I_REQUEST_PROP type TS_REQUEST_PROP + !i_request_prop type ts_request_prop returning - value(E_RESPONSE) type TO_REST_RESPONSE + value(e_response) type to_rest_response raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Sets an access token explicitly.

"! "! @parameter I_ACCESS_TOKEN | Access token. "! - methods SET_ACCESS_TOKEN + methods set_access_token importing - !I_ACCESS_TOKEN type TS_ACCESS_TOKEN . + !i_access_token type ts_access_token . "!

Sends a HTTP GET request.

"! "! @parameter I_REQUEST_PROP | Request properties. "! @parameter E_RESPONSE | Response returned by service. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - methods HTTP_GET + methods http_get importing - !I_REQUEST_PROP type TS_REQUEST_PROP + !i_request_prop type ts_request_prop returning - value(E_RESPONSE) type TO_REST_RESPONSE + value(e_response) type to_rest_response raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Sends a HTTP POST request.

"! "! @parameter I_REQUEST_PROP | Request properties. "! @parameter E_RESPONSE | Response returned by service. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - methods HTTP_POST + methods http_post importing - !I_REQUEST_PROP type TS_REQUEST_PROP + !i_request_prop type ts_request_prop returning - value(E_RESPONSE) type TO_REST_RESPONSE + value(e_response) type to_rest_response raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . + "!

Sends a HTTP PATCH request.

+ "! + "! @parameter I_REQUEST_PROP | Request properties. + "! @parameter E_RESPONSE | Response returned by service. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods http_patch + importing + !i_request_prop type ts_request_prop + returning + value(e_response) type to_rest_response + raising + ZCX_IBMC_service_exception . "!

Sends a HTTP POST request with multipart body.

"! "! @parameter I_REQUEST_PROP | Request properties. @@ -377,52 +390,52 @@ public section. "! @parameter E_RESPONSE | Response returned by service. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - methods HTTP_POST_MULTIPART + methods http_post_multipart importing - !I_REQUEST_PROP type TS_REQUEST_PROP - !IT_FORM_PART type TT_FORM_PART + !i_request_prop type ts_request_prop + !it_form_part type tt_form_part returning - value(E_RESPONSE) type TO_REST_RESPONSE + value(e_response) type to_rest_response raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . "!

Sends a HTTP PUT request.

"! "! @parameter I_REQUEST_PROP | Request properties. "! @parameter E_RESPONSE | Response returned by service. "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! - methods HTTP_PUT + methods http_put importing - !I_REQUEST_PROP type TS_REQUEST_PROP + !i_request_prop type ts_request_prop returning - value(E_RESPONSE) type TO_REST_RESPONSE + value(e_response) type to_rest_response raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . protected section. "!

Method for internal use.

- methods ADJUST_REQUEST_PROP + methods adjust_request_prop changing - !C_REQUEST_PROP type TS_REQUEST_PROP . + !c_request_prop type ts_request_prop . "!

Method for internal use.

- class-methods MERGE_STRUCTURE + class-methods merge_structure importing - !I_ALTERNATIVE type ANY + !i_alternative type any changing - !C_BASE type ANY . + !c_base type any . "!

Method for internal use.

- methods SET_DEFAULT_QUERY_PARAMETERS + methods set_default_query_parameters changing - !C_URL type TS_URL . + !c_url type ts_url . "!

Method for internal use.

- methods SET_URI_AND_AUTHORIZATION + methods set_uri_and_authorization importing - !I_CLIENT type TS_CLIENT - !I_REQUEST_PROP type TS_REQUEST_PROP + !i_client type ts_client + !i_request_prop type ts_request_prop returning - value(E_URI) type STRING + value(e_uri) type string raising - ZCX_IBMC_SERVICE_EXCEPTION . + ZCX_IBMC_service_exception . private section. ENDCLASS. @@ -431,6 +444,16 @@ ENDCLASS. CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>ABAP_TO_JSON +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_NAME TYPE STRING(optional) +* | [--->] I_VALUE TYPE ANY +* | [--->] I_DICTIONARY TYPE ANY(optional) +* | [--->] I_REQUIRED_FIELDS TYPE ANY(optional) +* | [--->] I_LOWER_CASE TYPE BOOLEAN (default =C_BOOLEAN_TRUE) +* | [<-()] E_JSON TYPE STRING +* +-------------------------------------------------------------------------------------- method abap_to_json. data: @@ -464,7 +487,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. importing e_technical_type = lv_type e_relative_type = lv_relative_type ). - if lv_type eq zif_ibmc_service_arch~c_datatype-dataref or lv_type eq zif_ibmc_service_arch~c_datatype-objectref. + if lv_type eq ZIF_IBMC_service_arch~c_datatype-dataref or lv_type eq ZIF_IBMC_service_arch~c_datatype-objectref. if i_value is initial. return. endif. @@ -480,7 +503,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endif. - if lv_type ne zif_ibmc_service_arch~c_datatype-struct and lv_type ne zif_ibmc_service_arch~c_datatype-struct_deep and lv_type ne zif_ibmc_service_arch~c_datatype-itab. + if lv_type ne ZIF_IBMC_service_arch~c_datatype-struct and lv_type ne ZIF_IBMC_service_arch~c_datatype-struct_deep and lv_type ne ZIF_IBMC_service_arch~c_datatype-itab. " simple type if lv_type eq 'C' or lv_type eq 'N' or lv_type eq 'g'. @@ -489,13 +512,21 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. " parameter is blank, not initial (i.e. null) lv_str = ''. else. + replace all occurrences of '\' in lv_str with '\\'. replace all occurrences of '"' in lv_str with '\"'. replace all occurrences of cl_abap_char_utilities=>cr_lf in lv_str with '\n'. replace all occurrences of cl_abap_char_utilities=>newline in lv_str with '\n'. + replace all occurrences of cl_abap_char_utilities=>backspace in lv_str with '\b'. endif. " quote value unless it is a boolean - if lv_relative_type eq 'BOOLEAN'. + if lv_relative_type eq 'BOOLEAN' or + lv_relative_type eq 'ABAP_BOOL' or + lv_relative_type eq 'BOOL' or + lv_relative_type eq 'TRIBOOL' or + lv_relative_type eq 'BOOLE_D' or + lv_relative_type eq 'BOOLE' or + lv_relative_type eq 'XFELD'. if lv_str eq c_boolean_true. lv_json = `true`. elseif lv_str eq c_boolean_false. @@ -536,7 +567,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. lv_json = lv_json_num. endif. - elseif lv_type eq zif_ibmc_service_arch~c_datatype-struct or lv_type eq zif_ibmc_service_arch~c_datatype-struct_deep. + elseif lv_type eq ZIF_IBMC_service_arch~c_datatype-struct or lv_type eq ZIF_IBMC_service_arch~c_datatype-struct_deep. " structure get_components( @@ -588,7 +619,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endloop. lv_json = lv_json && `}`. - elseif lv_type eq zif_ibmc_service_arch~c_datatype-itab. + elseif lv_type eq ZIF_IBMC_service_arch~c_datatype-itab. " internal table lv_json = lv_json && `[`. @@ -625,10 +656,18 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>ADD_HEADER_PARAMETER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PARAMETER TYPE STRING +* | [--->] I_VALUE TYPE STRING +* | [--->] I_IS_BOOLEAN TYPE BOOLEAN (default =C_BOOLEAN_FALSE) +* | [<-->] C_HEADERS TYPE ZIF_IBMC_SERVICE_ARCH~TS_REQUEST_PROP-HEADERS +* +-------------------------------------------------------------------------------------- method add_header_parameter. data: - ls_header type line of zif_ibmc_service_arch~ts_request_prop-headers, + ls_header type line of ZIF_IBMC_service_arch~ts_request_prop-headers, lv_value type string. if i_is_boolean eq c_boolean_true. @@ -649,6 +688,14 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>ADD_QUERY_PARAMETER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_PARAMETER TYPE STRING +* | [--->] I_VALUE TYPE STRING +* | [--->] I_IS_BOOLEAN TYPE BOOLEAN (default =C_BOOLEAN_FALSE) +* | [<-->] C_URL TYPE TS_URL +* +-------------------------------------------------------------------------------------- method add_query_parameter. data: @@ -675,6 +722,11 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Protected Method ZCL_IBMC_SERVICE->ADJUST_REQUEST_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [<-->] C_REQUEST_PROP TYPE TS_REQUEST_PROP +* +-------------------------------------------------------------------------------------- method adjust_request_prop. data: @@ -720,6 +772,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->CHECK_HTTP_RESPONSE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_RESPONSE TYPE TO_REST_RESPONSE(optional) +* | [--->] I_URL TYPE TS_URL(optional) +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method check_http_response. data: @@ -728,7 +787,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. ls_url type ts_url, lv_strlen type i, lv_code type string, - lo_service_exception type ref to zcx_ibmc_service_exception. + lo_service_exception type ref to ZCX_IBMC_service_exception. lv_http_status = get_http_status( i_rest_response = i_response ). lv_code = lv_http_status-code. @@ -753,7 +812,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. i_msgv2 = lv_http_status-reason i_msgv3 = lv_full_url i_http_status = lv_http_status ). - catch zcx_ibmc_service_exception into lo_service_exception. + catch ZCX_IBMC_service_exception into lo_service_exception. lo_service_exception->p_msg_json = lv_http_status-json. endtry. @@ -763,6 +822,20 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->CONSTRUCTOR +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_URL TYPE STRING(optional) +* | [--->] I_HOST TYPE STRING(optional) +* | [--->] I_PROXY_HOST TYPE STRING(optional) +* | [--->] I_PROXY_PORT TYPE STRING(optional) +* | [--->] I_USERNAME TYPE STRING(optional) +* | [--->] I_PASSWORD TYPE STRING(optional) +* | [--->] I_APIKEY TYPE STRING(optional) +* | [--->] I_ACCESS_TOKEN TYPE TS_ACCESS_TOKEN(optional) +* | [--->] I_SSL_ID TYPE ZIF_IBMC_SERVICE_ARCH~TY_SSL_ID(optional) +* | [--->] I_DEBUG_MODE TYPE CHAR (default =SPACE) +* +-------------------------------------------------------------------------------------- method constructor. data: @@ -811,6 +884,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->GET_ACCESS_TOKEN +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP(optional) +* | [<-()] E_ACCESS_TOKEN TYPE TS_ACCESS_TOKEN +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method get_access_token. e_access_token = p_request_prop_default-access_token. @@ -818,10 +898,21 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->GET_APPNAME +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_APPNAME TYPE STRING +* +-------------------------------------------------------------------------------------- method get_appname. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>GET_COMPONENTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_STRUCTURE TYPE ANY +* | [<---] E_COMPONENTS TYPE ZIF_IBMC_SERVICE_ARCH~TT_STRING +* +-------------------------------------------------------------------------------------- method get_components. data: @@ -842,6 +933,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>GET_DATATYPE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_FIELD TYPE ANY +* | [<-()] E_DATATYPE TYPE ZIF_IBMC_SERVICE_ARCH~CHAR +* +-------------------------------------------------------------------------------------- method get_datatype. get_field_type( @@ -853,6 +950,14 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>GET_FIELD_TYPE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_FIELD TYPE ANY +* | [<---] E_TECHNICAL_TYPE TYPE ZIF_IBMC_SERVICE_ARCH~CHAR +* | [<---] E_RELATIVE_TYPE TYPE STRING +* | [<---] E_LENGTH TYPE I +* +-------------------------------------------------------------------------------------- method get_field_type. data: lo_abap_type type ref to cl_abap_typedescr, @@ -867,7 +972,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. e_technical_type = lo_typedescr->type_kind. if e_relative_type is requested. - if e_technical_type eq zif_ibmc_service_arch~c_datatype-objectref. + if e_technical_type eq ZIF_IBMC_service_arch~c_datatype-objectref. data lo_refdescr type ref to cl_abap_refdescr. lo_refdescr ?= cl_abap_typedescr=>describe_by_data( i_field ). lo_abap_type ?= lo_refdescr->get_referenced_type( ). @@ -878,8 +983,8 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endif. if e_length is requested. - if e_technical_type eq zif_ibmc_service_arch~c_datatype-c or - e_technical_type eq zif_ibmc_service_arch~c_datatype-n. + if e_technical_type eq ZIF_IBMC_service_arch~c_datatype-c or + e_technical_type eq ZIF_IBMC_service_arch~c_datatype-n. e_length = lo_typedescr->length. else. e_length = 0. @@ -889,6 +994,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>GET_FILE_EXTENSION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MIME_TYPE TYPE STRING +* | [<-()] E_EXTENSION TYPE STRING +* +-------------------------------------------------------------------------------------- method get_file_extension. data: @@ -904,8 +1015,14 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. when 'application/octet-stream'. e_extension = 'bin'. when others. e_extension = 'dat'. - find regex '([^/]*)$' in i_mime_type submatches lv_ext. - if sy-subrc = 0. + "find regex '([^/]*)$' in i_mime_type submatches lv_ext. + data(l_subrc) = find_regex( + exporting + i_regex = '([^/]*)$' + i_in = i_mime_type + changing + c_submatch1 = lv_ext ). + if l_subrc = 0. lv_len = strlen( lv_ext ). if lv_len >= 2 and lv_len <= 4. e_extension = lv_ext. @@ -916,6 +1033,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>GET_FULL_URL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_URL TYPE TS_URL +* | [<-()] E_URL TYPE STRING +* +-------------------------------------------------------------------------------------- method get_full_url. data: @@ -940,6 +1063,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->GET_REQUEST_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) +* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP +* +-------------------------------------------------------------------------------------- method get_request_prop. e_request_prop-url-protocol = 'http'. @@ -953,6 +1082,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->GET_REST_CLIENT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_CLIENT TYPE TS_CLIENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method get_rest_client. data: @@ -982,12 +1118,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. " set 'Content-Type' header if not i_request_prop-header_content_type is initial. - set_request_header( i_client = e_client i_name = zif_ibmc_service_arch~c_header_content_type i_value = ls_request_prop-header_content_type ). + set_request_header( i_client = e_client i_name = ZIF_IBMC_service_arch~c_header_content_type i_value = ls_request_prop-header_content_type ). endif. " set 'Accept' header if not i_request_prop-header_accept is initial. - set_request_header( i_client = e_client i_name = zif_ibmc_service_arch~c_header_accept i_value = ls_request_prop-header_accept ). + set_request_header( i_client = e_client i_name = ZIF_IBMC_service_arch~c_header_accept i_value = ls_request_prop-header_accept ). endif. " set additional headers @@ -1000,6 +1136,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->HTTP_DELETE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method http_delete. data: @@ -1009,7 +1152,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. lo_client = get_rest_client( i_request_prop = i_request_prop ). " execute DELETE request - e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_delete ). + e_response = execute( i_client = lo_client i_method = ZIF_IBMC_service_arch~c_method_delete ). " check response check_http_response( @@ -1019,6 +1162,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->HTTP_GET +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method http_get. data: @@ -1028,7 +1178,41 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. lo_client = get_rest_client( i_request_prop = i_request_prop ). " execute GET request - e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_get ). + e_response = execute( i_client = lo_client i_method = ZIF_IBMC_service_arch~c_method_get ). + + " check response + check_http_response( + i_response = e_response + i_url = i_request_prop-url ). + + endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->HTTP_PATCH +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- + method http_patch. + + data: + lo_client type ts_client. + + " create REST client + lo_client = get_rest_client( i_request_prop = i_request_prop ). + + " set request body + if not i_request_prop-body is initial. + set_request_body_cdata( i_client = lo_client i_data = i_request_prop-body ). + endif. + if not i_request_prop-body_bin is initial. + set_request_body_xdata( i_client = lo_client i_data = i_request_prop-body_bin ). + endif. + + " execute PATCH request + e_response = execute( i_client = lo_client i_method = ZIF_IBMC_service_arch~c_method_patch ). " check response check_http_response( @@ -1038,6 +1222,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->HTTP_POST +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method http_post. data: @@ -1058,11 +1249,11 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. " workaround: set an empty json object for request body if i_request_prop-body is initial and i_request_prop-body_bin is initial. set_request_body_cdata( i_client = lo_client i_data = `{}` ). - set_request_header( i_client = lo_client i_name = zif_ibmc_service_arch~c_header_content_type i_value = zif_ibmc_service_arch~c_mediatype-appl_json ). + set_request_header( i_client = lo_client i_name = ZIF_IBMC_service_arch~c_header_content_type i_value = ZIF_IBMC_service_arch~c_mediatype-appl_json ). endif. " execute POST request - e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_post ). + e_response = execute( i_client = lo_client i_method = ZIF_IBMC_service_arch~c_method_post ). " check response check_http_response( @@ -1072,7 +1263,15 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. - method HTTP_POST_MULTIPART. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->HTTP_POST_MULTIPART +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [--->] IT_FORM_PART TYPE TT_FORM_PART +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- + method http_post_multipart. data: lo_client type ts_client. @@ -1084,7 +1283,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. add_form_part( i_client = lo_client it_form_part = it_form_part ). " execute POST request - e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_post ). + e_response = execute( i_client = lo_client i_method = ZIF_IBMC_service_arch~c_method_post ). " check response check_http_response( @@ -1094,6 +1293,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->HTTP_PUT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method http_put. data: @@ -1111,7 +1317,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endif. " execute PUT request - e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_put ). + e_response = execute( i_client = lo_client i_method = ZIF_IBMC_service_arch~c_method_put ). " check response check_http_response( @@ -1121,6 +1327,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Protected Method ZCL_IBMC_SERVICE=>MERGE_STRUCTURE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ALTERNATIVE TYPE ANY +* | [<-->] C_BASE TYPE ANY +* +-------------------------------------------------------------------------------------- method merge_structure. data: @@ -1148,7 +1360,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. i_field = importing e_technical_type = lv_type ). - if lv_type eq zif_ibmc_service_arch~c_datatype-struct or lv_type eq zif_ibmc_service_arch~c_datatype-struct_deep. + if lv_type eq ZIF_IBMC_service_arch~c_datatype-struct or lv_type eq ZIF_IBMC_service_arch~c_datatype-struct_deep. assign component of structure i_alternative to . check sy-subrc = 0. merge_structure( @@ -1158,7 +1370,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. c_base = ). else. if is initial. - if lv_type eq zif_ibmc_service_arch~c_datatype-itab. + if lv_type eq ZIF_IBMC_service_arch~c_datatype-itab. assign component of structure c_base to . check sy-subrc = 0. assign component of structure i_alternative to . @@ -1178,6 +1390,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>MOVE_DATA_REFERENCE_TO_ABAP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_DATA_REFERENCE TYPE DATA_REFERENCE +* | [<---] E_ABAP TYPE ANY +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method move_data_reference_to_abap. data: @@ -1289,6 +1508,11 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>NORMALIZE_URL +* +-------------------------------------------------------------------------------------------------+ +* | [<-->] C_URL TYPE TS_URL +* +-------------------------------------------------------------------------------------- method normalize_url. check not c_url is initial. @@ -1322,7 +1546,15 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. shift lv_url_full left deleting leading space. clear: c_url-protocol, c_url-host, c_url-path_base, c_url-path. " do not clear other components - find regex '^(http.?:\/\/)?([^\/]*)(.*)$' in lv_url_full submatches c_url-protocol c_url-host c_url-path. + "find regex '^(http.?:\/\/)?([^\/]*)(.*)$' in lv_url_full submatches c_url-protocol c_url-host c_url-path. + find_regex( + exporting + i_regex = '^(http.?:\/\/)?([^\/]*)(.*)$' + i_in = lv_url_full + changing + c_submatch1 = c_url-protocol + c_submatch2 = c_url-host + c_submatch3 = c_url-path ). shift c_url-protocol right deleting trailing '/'. shift c_url-protocol right deleting trailing ':'. @@ -1345,11 +1577,19 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. - method PARSE_JSON. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>PARSE_JSON +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_JSON TYPE STRING +* | [--->] I_DICTIONARY TYPE ANY(optional) +* | [<-->] C_ABAP TYPE ANY +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- + method parse_json. data: lv_json type string, - lt_dictionary type zif_ibmc_service_arch~tt_string, + lt_dictionary type ZIF_IBMC_service_arch~tt_string, lv_dictionary type string, lv_orgname type string, lv_abapname type string, @@ -1378,7 +1618,13 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. if lv_dictionary ne lv_orgname. lv_regex = `"` && && `"\s*:`. lv_abapname = `"` && lv_dictionary && `":`. - replace all occurrences of regex lv_regex in lv_json with lv_abapname. + "replace all occurrences of regex lv_regex in lv_json with lv_abapname. + find_regex( + exporting + i_regex = lv_regex + i_with = lv_abapname + changing + c_in = lv_json ). endif. endloop. @@ -1389,7 +1635,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. try. lo_json->deserialize_int( exporting json = lv_json changing data = c_abap ). catch cx_sy_move_cast_error into lr_exception. - zcl_ibmc_service=>raise_exception( + ZCL_IBMC_service=>raise_exception( exporting i_msgno = 20 ). endtry. @@ -1399,12 +1645,26 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>RAISE_EXCEPTION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_MSGNO TYPE SY-MSGNO(optional) +* | [--->] I_MSGV1 TYPE STRING(optional) +* | [--->] I_MSGV2 TYPE STRING(optional) +* | [--->] I_MSGV3 TYPE STRING(optional) +* | [--->] I_MSGV4 TYPE STRING(optional) +* | [--->] I_TEXT TYPE STRING(optional) +* | [--->] I_SUBRC TYPE SY-SUBRC (default =C_SUBRC_UNKNOWN) +* | [--->] I_PREVIOUS TYPE REF TO CX_ROOT(optional) +* | [--->] I_HTTP_STATUS TYPE TS_HTTP_STATUS(optional) +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method raise_exception. data: ls_msg like if_t100_message=>t100key, lv_charval(11) type c, - lo_service_exception type ref to zcx_ibmc_service_exception. + lo_service_exception type ref to ZCX_IBMC_service_exception. ls_msg-msgid = c_msgid. @@ -1451,12 +1711,17 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endif. endif. - raise exception type zcx_ibmc_service_exception + raise exception type ZCX_IBMC_service_exception message id c_msgid type 'E' number ls_msg-msgno with ls_msg-attr1 ls_msg-attr2 ls_msg-attr3 ls_msg-attr4. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE->SET_ACCESS_TOKEN +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ACCESS_TOKEN TYPE TS_ACCESS_TOKEN +* +-------------------------------------------------------------------------------------- method set_access_token. p_request_prop_default-access_token = i_access_token. @@ -1470,6 +1735,11 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Protected Method ZCL_IBMC_SERVICE->SET_DEFAULT_QUERY_PARAMETERS +* +-------------------------------------------------------------------------------------------------+ +* | [<-->] C_URL TYPE TS_URL +* +-------------------------------------------------------------------------------------- method set_default_query_parameters. if not p_version is initial. @@ -1484,6 +1754,14 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Protected Method ZCL_IBMC_SERVICE->SET_URI_AND_AUTHORIZATION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<-()] E_URI TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method set_uri_and_authorization. data: @@ -1552,7 +1830,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. lv_body = `{ "userid": "` && i_request_prop-username && `", "password": "` && i_request_prop-password && `" }` ##NO_TEXT. endif. set_request_body_cdata( i_client = i_client i_data = lv_body ). - set_request_header( i_client = i_client i_name = zif_ibmc_service_arch~c_header_content_type i_value = zif_ibmc_service_arch~c_mediatype-appl_json ). + set_request_header( i_client = i_client i_name = ZIF_IBMC_service_arch~c_header_content_type i_value = ZIF_IBMC_service_arch~c_mediatype-appl_json ). endif. endif. @@ -1561,6 +1839,12 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE=>UNESCAPE_UNICODE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_IN TYPE STRING +* | [<-()] E_OUT TYPE STRING +* +-------------------------------------------------------------------------------------- method unescape_unicode. data: @@ -1575,8 +1859,15 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. e_out = i_in. do. - find regex '(\\u[A-Fa-f0-9]{4})' in e_out ignoring case submatches lv_match ##NO_TEXT. - if sy-subrc <> 0. + "find regex '(\\u[A-Fa-f0-9]{4})' in e_out ignoring case submatches lv_match ##NO_TEXT. + data(l_subrc) = find_regex( + exporting + i_regex = '(\\u[A-Fa-f0-9]{4})' + i_ignoring_case = 'X' + i_in = e_out + changing + c_submatch1 = lv_match ) ##NO_TEXT. + if l_subrc <> 0. exit. endif. @@ -1584,7 +1875,7 @@ CLASS ZCL_IBMC_SERVICE IMPLEMENTATION. translate lv_cp_str to upper case. lv_cp_hex = lv_cp_str. - assign lv_cp_hex to CASTING. + assign lv_cp_hex to casting. lv_ucchar = . replace all occurrences of lv_match in e_out with lv_ucchar. diff --git a/src/zcl_ibmc_service.clas.xml b/src/zcl_ibmc_service.clas.xml index a64be6e..80014df 100644 --- a/src/zcl_ibmc_service.clas.xml +++ b/src/zcl_ibmc_service.clas.xml @@ -1,198 +1,204 @@ - - - - - - ZCL_IBMC_SERVICE - E - ABAP SDK for IBM Watson - Service Class - 1 - X - X - X - - - - ZCL_IBMC_SERVICE - ABAP_TO_JSON - E - Extracts a JSON string from an ABAP structure. - - - ZCL_IBMC_SERVICE - ADD_HEADER_PARAMETER - E - Method for internal use. - - - ZCL_IBMC_SERVICE - ADD_QUERY_PARAMETER - E - Method for internal use. - - - ZCL_IBMC_SERVICE - ADJUST_REQUEST_PROP - E - Method for internal use. - - - ZCL_IBMC_SERVICE - CHECK_HTTP_RESPONSE - E - Throws an exception, if HTTP response indicates an error. - - - ZCL_IBMC_SERVICE - CONSTRUCTOR - E - Class constructor. - - - ZCL_IBMC_SERVICE - DATETIME - E - DateTime type, format 2018-10-23T15:18:18.914xxxZ - - - ZCL_IBMC_SERVICE - GET_ACCESS_TOKEN - E - Method for internal use. - - - ZCL_IBMC_SERVICE - GET_APPNAME - E - Returns the service name. - - - ZCL_IBMC_SERVICE - GET_COMPONENTS - E - Returns component names of a given structure. - - - ZCL_IBMC_SERVICE - GET_DATATYPE - E - Returns data type of a given parameter. - - - ZCL_IBMC_SERVICE - GET_FIELD_TYPE - E - Returns field type and length of a given parameter. - - - ZCL_IBMC_SERVICE - GET_FILE_EXTENSION - E - Returns the file extension for a mime type - - - ZCL_IBMC_SERVICE - GET_FULL_URL - E - Method for internal use. - - - ZCL_IBMC_SERVICE - GET_REQUEST_PROP - E - Method for internal use. - - - ZCL_IBMC_SERVICE - GET_REST_CLIENT - E - Method for internal use. - - - ZCL_IBMC_SERVICE - HTTP_DELETE - E - Sends a HTTP DELETE request. - - - ZCL_IBMC_SERVICE - HTTP_GET - E - Sends a HTTP GET request. - - - ZCL_IBMC_SERVICE - HTTP_POST - E - Sends a HTTP POST request. - - - ZCL_IBMC_SERVICE - HTTP_POST_MULTIPART - E - Sends a HTTP POST request with multipart body. - - - ZCL_IBMC_SERVICE - HTTP_PUT - E - Sends a HTTP PUT request. - - - ZCL_IBMC_SERVICE - MERGE_STRUCTURE - E - Method for internal use. - - - ZCL_IBMC_SERVICE - MOVE_DATA_REFERENCE_TO_ABAP - E - Moves a referenced data structure to an ABAP structure. - - - ZCL_IBMC_SERVICE - NORMALIZE_URL - E - Method for internal use. - - - ZCL_IBMC_SERVICE - PARSE_JSON - E - Parses a JSON string into an ABAP structure. - - - ZCL_IBMC_SERVICE - RAISE_EXCEPTION - E - Raises an exception. - - - ZCL_IBMC_SERVICE - SET_ACCESS_TOKEN - E - Sets an access token explicitly. - - - ZCL_IBMC_SERVICE - SET_DEFAULT_QUERY_PARAMETERS - E - Method for internal use. - - - ZCL_IBMC_SERVICE - SET_URI_AND_AUTHORIZATION - E - Method for internal use. - - - ZCL_IBMC_SERVICE - UNESCAPE_UNICODE - E - Unescape unicode codepoints to characters in a string - - - - - + + + + + + ZCL_IBMC_SERVICE + E + ABAP SDK for IBM Watson - Service Class + 1 + X + X + X + + + + ZCL_IBMC_SERVICE + ABAP_TO_JSON + E + Extracts a JSON string from an ABAP structure. + + + ZCL_IBMC_SERVICE + ADD_HEADER_PARAMETER + E + Method for internal use. + + + ZCL_IBMC_SERVICE + ADD_QUERY_PARAMETER + E + Method for internal use. + + + ZCL_IBMC_SERVICE + ADJUST_REQUEST_PROP + E + Method for internal use. + + + ZCL_IBMC_SERVICE + CHECK_HTTP_RESPONSE + E + Throws an exception, if HTTP response indicates an error. + + + ZCL_IBMC_SERVICE + CONSTRUCTOR + E + Class constructor. + + + ZCL_IBMC_SERVICE + DATETIME + E + DateTime type, format 2018-10-23T15:18:18.914xxxZ + + + ZCL_IBMC_SERVICE + GET_ACCESS_TOKEN + E + Method for internal use. + + + ZCL_IBMC_SERVICE + GET_APPNAME + E + Returns the service name. + + + ZCL_IBMC_SERVICE + GET_COMPONENTS + E + Returns component names of a given structure. + + + ZCL_IBMC_SERVICE + GET_DATATYPE + E + Returns data type of a given parameter. + + + ZCL_IBMC_SERVICE + GET_FIELD_TYPE + E + Returns field type and length of a given parameter. + + + ZCL_IBMC_SERVICE + GET_FILE_EXTENSION + E + Returns the file extension for a mime type + + + ZCL_IBMC_SERVICE + GET_FULL_URL + E + Method for internal use. + + + ZCL_IBMC_SERVICE + GET_REQUEST_PROP + E + Method for internal use. + + + ZCL_IBMC_SERVICE + GET_REST_CLIENT + E + Method for internal use. + + + ZCL_IBMC_SERVICE + HTTP_DELETE + E + Sends a HTTP DELETE request. + + + ZCL_IBMC_SERVICE + HTTP_GET + E + Sends a HTTP GET request. + + + ZCL_IBMC_SERVICE + HTTP_POST + E + Sends a HTTP POST request. + + + ZCL_IBMC_SERVICE + HTTP_PATCH + E + Sends a HTTP PATCH request. + + + ZCL_IBMC_SERVICE + HTTP_POST_MULTIPART + E + Sends a HTTP POST request with multipart body. + + + ZCL_IBMC_SERVICE + HTTP_PUT + E + Sends a HTTP PUT request. + + + ZCL_IBMC_SERVICE + MERGE_STRUCTURE + E + Method for internal use. + + + ZCL_IBMC_SERVICE + MOVE_DATA_REFERENCE_TO_ABAP + E + Moves a referenced data structure to an ABAP structure. + + + ZCL_IBMC_SERVICE + NORMALIZE_URL + E + Method for internal use. + + + ZCL_IBMC_SERVICE + PARSE_JSON + E + Parses a JSON string into an ABAP structure. + + + ZCL_IBMC_SERVICE + RAISE_EXCEPTION + E + Raises an exception. + + + ZCL_IBMC_SERVICE + SET_ACCESS_TOKEN + E + Sets an access token explicitly. + + + ZCL_IBMC_SERVICE + SET_DEFAULT_QUERY_PARAMETERS + E + Method for internal use. + + + ZCL_IBMC_SERVICE + SET_URI_AND_AUTHORIZATION + E + Method for internal use. + + + ZCL_IBMC_SERVICE + UNESCAPE_UNICODE + E + Unescape unicode codepoints to characters in a string + + + + + \ No newline at end of file diff --git a/src/zcl_ibmc_service_arch.clas.abap b/src/zcl_ibmc_service_arch.clas.abap index f43c8f7..9f063ba 100644 --- a/src/zcl_ibmc_service_arch.clas.abap +++ b/src/zcl_ibmc_service_arch.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019,2020 IBM Corp. All Rights Reserved. +* Copyright 2019,2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -11,13 +11,13 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -class zcl_ibmc_service_arch definition +class ZCL_IBMC_SERVICE_ARCH definition public create public . public section. - interfaces zif_ibmc_service_arch . + interfaces ZIF_IBMC_SERVICE_ARCH . types to_http_client type ref to if_http_client . types to_rest_client type ref to cl_rest_http_client . @@ -31,12 +31,12 @@ class zcl_ibmc_service_arch definition http type to_http_client, rest type to_rest_client, end of ts_client . - types ts_http_status type zif_ibmc_service_arch~ts_http_status . - types ts_header type zif_ibmc_service_arch~ts_header . - types tt_header type zif_ibmc_service_arch~tt_header . - types ts_url type zif_ibmc_service_arch~ts_url . - types ts_access_token type zif_ibmc_service_arch~ts_access_token . - types ts_request_prop type zif_ibmc_service_arch~ts_request_prop . + types ts_http_status type ZIF_IBMC_SERVICE_ARCH~ts_http_status . + types ts_header type ZIF_IBMC_SERVICE_ARCH~ts_header . + types tt_header type ZIF_IBMC_SERVICE_ARCH~tt_header . + types ts_url type ZIF_IBMC_SERVICE_ARCH~ts_url . + types ts_access_token type ZIF_IBMC_SERVICE_ARCH~ts_access_token . + types ts_request_prop type ZIF_IBMC_SERVICE_ARCH~ts_request_prop . "!

Returns a HTTP response header.

"! @@ -56,7 +56,7 @@ class zcl_ibmc_service_arch definition "! class-methods get_timezone returning - value(e_timezone) type zif_ibmc_service_arch~ty_timezone . + value(e_timezone) type ZIF_IBMC_SERVICE_ARCH~ty_timezone . "!

Returns an ABAP module identifier.

"! "! @parameter E_PROGNAME | ABAP module identifier @@ -101,7 +101,7 @@ class zcl_ibmc_service_arch definition methods add_form_part importing !i_client type ts_client - !it_form_part type zif_ibmc_service_arch=>tt_form_part + !it_form_part type ZIF_IBMC_SERVICE_ARCH=>tt_form_part raising zcx_ibmc_service_exception . "!

Returns the default proxy host and port.

@@ -157,7 +157,7 @@ class zcl_ibmc_service_arch definition class-methods execute importing !i_client type ts_client - !i_method type zif_ibmc_service_arch~char default zif_ibmc_service_arch~c_method_get + !i_method type ZIF_IBMC_SERVICE_ARCH~char default ZIF_IBMC_SERVICE_ARCH~c_method_get returning value(e_response) type to_rest_response raising @@ -232,6 +232,36 @@ class zcl_ibmc_service_arch definition value(e_utf8) type xstring raising zcx_ibmc_service_exception . + "!

Finds (and replaces) a regular expression.

+ "! + "! @parameter I_REGEX | Regular expression + "! @parameter I_WITH | Replacement (if omitted, FIND is performed) + "! @parameter I_ALL_OCCURRENCES | 'X' if ALL OCCURRENCES OF should be used + "! @parameter I_IGNORING_CASE | 'X', if IGNORING CASE should be used + "! @parameter I_IN | String to be searched + "! @parameter E_OFFSET | Returns position of occurrence + "! @parameter C_SUBMATCH1 | 1st submatch + "! @parameter C_SUBMATCH2 | 2nd submatch + "! @parameter C_SUBMATCH3 | 3rd submatch + "! @parameter C_IN | String to be searched and returned + "! @parameter E_SUBRC | sy-subrc of FIND / REPLACE + "! + class-methods find_regex + importing + !i_regex type string + !i_with type string optional + !i_all_occurrences type ZIF_IBMC_SERVICE_ARCH=>boolean default 'X' + !i_ignoring_case type ZIF_IBMC_SERVICE_ARCH=>boolean optional + !i_in type string optional + exporting + !e_offset type int4 + changing + !c_submatch1 type string optional + !c_submatch2 type string optional + !c_submatch3 type string optional + !c_in type string optional + returning + value(e_subrc) type sysubrc . protected section. private section. ENDCLASS. @@ -241,10 +271,17 @@ ENDCLASS. CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_ARCH->ADD_FORM_PART +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] IT_FORM_PART TYPE ZIF_IBMC_SERVICE_ARCH=>TT_FORM_PART +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method add_form_part. data: - ls_form_part type zif_ibmc_service_arch=>ts_form_part, + ls_form_part type ZIF_IBMC_SERVICE_ARCH=>ts_form_part, lo_part type to_form_part. loop at it_form_part into ls_form_part. @@ -271,6 +308,13 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>BASE64_DECODE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_BASE64 TYPE STRING +* | [<-()] E_BINARY TYPE XSTRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method base64_decode. call function 'SCMS_BASE64_DECODE_STR' @@ -289,6 +333,13 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>CONVERT_STRING_TO_UTF8 +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_STRING TYPE STRING +* | [<-()] E_UTF8 TYPE XSTRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method convert_string_to_utf8. data: @@ -324,6 +375,14 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>CREATE_CLIENT_BY_URL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_URL TYPE STRING +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP +* | [<---] E_CLIENT TYPE TS_CLIENT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method create_client_by_url. data: @@ -367,6 +426,14 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>EXECUTE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_METHOD TYPE ZIF_IBMC_SERVICE_ARCH~CHAR (default =ZIF_IBMC_SERVICE_ARCH~C_METHOD_GET) +* | [<-()] E_RESPONSE TYPE TO_REST_RESPONSE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method execute. data: @@ -377,18 +444,18 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. try. case i_method. - when zif_ibmc_service_arch~c_method_get. + when ZIF_IBMC_SERVICE_ARCH~c_method_get. lv_method = 'GET' ##NO_TEXT. i_client-rest->if_rest_client~get( ). - when zif_ibmc_service_arch~c_method_post. + when ZIF_IBMC_SERVICE_ARCH~c_method_post. lv_method = 'POST' ##NO_TEXT. lo_request = get_rest_request( i_client = i_client ). i_client-rest->if_rest_client~post( lo_request ). - when zif_ibmc_service_arch~c_method_put. + when ZIF_IBMC_SERVICE_ARCH~c_method_put. lv_method = 'PUT' ##NO_TEXT. lo_request = get_rest_request( i_client = i_client ). i_client-rest->if_rest_client~put( lo_request ). - when zif_ibmc_service_arch~c_method_delete. + when ZIF_IBMC_SERVICE_ARCH~c_method_delete. lv_method = 'DELETE' ##NO_TEXT. i_client-rest->if_rest_client~delete( ). when others. @@ -405,6 +472,13 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_DEFAULT_PROXY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_URL TYPE TS_URL(optional) +* | [<---] E_PROXY_HOST TYPE STRING +* | [<---] E_PROXY_PORT TYPE STRING +* +-------------------------------------------------------------------------------------- method get_default_proxy. data: @@ -442,6 +516,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_HTTP_STATUS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REST_RESPONSE TYPE TO_REST_RESPONSE +* | [<-()] E_STATUS TYPE TS_HTTP_STATUS +* +-------------------------------------------------------------------------------------- method get_http_status. e_status-code = i_rest_response->get_header_field( '~status_code' ). @@ -451,6 +531,11 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_PROGNAME +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_PROGNAME TYPE STRING +* +-------------------------------------------------------------------------------------- method get_progname. e_progname = sy-cprog. @@ -458,6 +543,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_RESPONSE_BINARY +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_RESPONSE TYPE TO_REST_RESPONSE +* | [<-()] E_DATA TYPE XSTRING +* +-------------------------------------------------------------------------------------- method get_response_binary. e_data = i_response->get_binary_data( ). @@ -465,6 +556,13 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_RESPONSE_HEADER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_RESPONSE TYPE TO_REST_RESPONSE +* | [--->] I_HEADER_FIELD TYPE STRING +* | [<-()] E_VALUE TYPE STRING +* +-------------------------------------------------------------------------------------- method get_response_header. e_value = i_response->get_header_field( iv_name = i_header_field ). @@ -472,6 +570,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_RESPONSE_STRING +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_RESPONSE TYPE TO_REST_RESPONSE +* | [<-()] E_DATA TYPE STRING +* +-------------------------------------------------------------------------------------- method get_response_string. e_data = i_response->get_string_data( ). @@ -479,6 +583,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_REST_REQUEST +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [<-()] E_REST_REQUEST TYPE TO_REST_REQUEST +* +-------------------------------------------------------------------------------------- method get_rest_request. e_rest_request = i_client-rest->if_rest_client~create_request_entity( ). @@ -486,6 +596,11 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>GET_TIMEZONE +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_TIMEZONE TYPE ZIF_IBMC_SERVICE_ARCH~TY_TIMEZONE +* +-------------------------------------------------------------------------------------- method get_timezone. e_timezone = sy-zonlo. @@ -493,6 +608,13 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>SET_AUTHENTICATION_BASIC +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_USERNAME TYPE STRING +* | [--->] I_PASSWORD TYPE STRING +* +-------------------------------------------------------------------------------------- method set_authentication_basic. i_client-http->authenticate( username = i_username password = i_password ). @@ -500,6 +622,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>SET_REQUEST_BODY_CDATA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_DATA TYPE STRING +* +-------------------------------------------------------------------------------------- method set_request_body_cdata. i_client-http->request->if_http_entity~set_cdata( data = i_data ). @@ -507,6 +635,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>SET_REQUEST_BODY_XDATA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_DATA TYPE XSTRING +* +-------------------------------------------------------------------------------------- method set_request_body_xdata. i_client-http->request->if_http_entity~set_data( data = i_data ). @@ -514,6 +648,13 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>SET_REQUEST_HEADER +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_NAME TYPE STRING +* | [--->] I_VALUE TYPE STRING +* +-------------------------------------------------------------------------------------- method set_request_header. i_client-rest->if_rest_client~set_request_header( iv_name = i_name iv_value = i_value ) . @@ -521,6 +662,12 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>SET_REQUEST_URI +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CLIENT TYPE TS_CLIENT +* | [--->] I_URI TYPE STRING +* +-------------------------------------------------------------------------------------- method set_request_uri. cl_http_utility=>set_request_uri( @@ -529,4 +676,81 @@ CLASS ZCL_IBMC_SERVICE_ARCH IMPLEMENTATION. uri = i_uri ). endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_ARCH=>FIND_REGEX +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REGEX TYPE STRING +* | [--->] I_WITH TYPE STRING(optional) +* | [--->] I_ALL_OCCURRENCES TYPE BOOLEAN (default ='X') +* | [--->] I_IGNORING_CASE TYPE BOOLEAN(optional) +* | [--->] I_IN TYPE STRING(optional) +* | [<---] E_OFFSET TYPE INT4 +* | [<-->] C_SUBMATCH1 TYPE STRING(optional) +* | [<-->] C_SUBMATCH2 TYPE STRING(optional) +* | [<-->] C_SUBMATCH3 TYPE STRING(optional) +* | [<-->] C_IN TYPE STRING +* | [<-()] E_SUBRC TYPE SYSUBRC +* +-------------------------------------------------------------------------------------- + method find_regex. + + data: + l_in type string. + + if not i_with is supplied. + " FIND + if i_in is supplied. + l_in = i_in. + else. + l_in = c_in. + endif. + if c_submatch3 is supplied. + if i_ignoring_case eq 'X'. + find regex i_regex in l_in match offset e_offset ignoring case submatches c_submatch1 c_submatch2 c_submatch3. + else. + find regex i_regex in l_in match offset e_offset submatches c_submatch1 c_submatch2 c_submatch3. + endif. + elseif c_submatch2 is supplied. + if i_ignoring_case eq 'X'. + find regex i_regex in l_in match offset e_offset ignoring case submatches c_submatch1 c_submatch2. + else. + find regex i_regex in l_in match offset e_offset submatches c_submatch1 c_submatch2. + endif. + elseif c_submatch1 is supplied. + if i_ignoring_case eq 'X'. + find regex i_regex in l_in match offset e_offset ignoring case submatches c_submatch1. + else. + find regex i_regex in l_in match offset e_offset submatches c_submatch1. + endif. + else. + if i_ignoring_case eq 'X'. + find regex i_regex in c_in match offset e_offset ignoring case. + else. + find regex i_regex in c_in match offset e_offset. + endif. + endif. + + else. + " REPLACE + e_offset = 0. + if i_all_occurrences eq 'X'. + if i_ignoring_case eq 'X'. + replace all occurrences of regex i_regex in c_in with i_with ignoring case. + else. + replace all occurrences of regex i_regex in c_in with i_with. + endif. + else. + if i_ignoring_case eq 'X'. + replace first occurrence of regex i_regex in c_in with i_with ignoring case. + else. + replace first occurrence of regex i_regex in c_in with i_with. + endif. + endif. + + endif. + + e_subrc = sy-subrc. + + endmethod. ENDCLASS. diff --git a/src/zcl_ibmc_service_arch.clas.xml b/src/zcl_ibmc_service_arch.clas.xml index 570e35b..031f92f 100644 --- a/src/zcl_ibmc_service_arch.clas.xml +++ b/src/zcl_ibmc_service_arch.clas.xml @@ -1,138 +1,144 @@ - - - - - - ZCL_IBMC_SERVICE_ARCH - E - IBM Watson SDK Platform-specifics - 1 - X - X - X - - - - ZCL_IBMC_SERVICE_ARCH - ADD_FORM_PART - E - Generates a multi-part request body. - - - ZCL_IBMC_SERVICE_ARCH - BASE64_DECODE - E - Decodes base64 encoded data to binary. - - - ZCL_IBMC_SERVICE_ARCH - CONVERT_STRING_TO_UTF8 - E - Converts STRING data to UTF8 encoded XSTRING. - - - ZCL_IBMC_SERVICE_ARCH - CREATE_CLIENT_BY_URL - E - Returns a HTTP/REST client based on an URL. - - - ZCL_IBMC_SERVICE_ARCH - EXECUTE - E - Executes a HTTP request. - - - ZCL_IBMC_SERVICE_ARCH - GET_DEFAULT_PROXY - E - Returns the default proxy host and port. - - - ZCL_IBMC_SERVICE_ARCH - GET_HTTP_STATUS - E - Returns the status of a REST response. - - - ZCL_IBMC_SERVICE_ARCH - GET_PROGNAME - E - Returns an ABAP module identifier. - - - ZCL_IBMC_SERVICE_ARCH - GET_RESPONSE_BINARY - E - Reads binary data from a HTTP response. - - - ZCL_IBMC_SERVICE_ARCH - GET_RESPONSE_HEADER - E - Returns a HTTP response header. - - - ZCL_IBMC_SERVICE_ARCH - GET_RESPONSE_STRING - E - Reads character data from a HTTP response. - - - ZCL_IBMC_SERVICE_ARCH - GET_REST_REQUEST - E - Returns a request object from a HTTP client object. - - - ZCL_IBMC_SERVICE_ARCH - GET_TIMEZONE - E - Returns the user's time zone. - - - ZCL_IBMC_SERVICE_ARCH - SET_AUTHENTICATION_BASIC - E - Sets request header for basic authentication. - - - ZCL_IBMC_SERVICE_ARCH - SET_REQUEST_BODY_CDATA - E - Set character data for the body of a HTTP request. - - - ZCL_IBMC_SERVICE_ARCH - SET_REQUEST_BODY_XDATA - E - Set binary data for the body of a HTTP request. - - - ZCL_IBMC_SERVICE_ARCH - SET_REQUEST_HEADER - E - Sets a HTTP header. - - - ZCL_IBMC_SERVICE_ARCH - SET_REQUEST_URI - E - Sets the URI for a HTTP request. - - - ZCL_IBMC_SERVICE_ARCH - TO_HTTP_CLIENT - E - HTTP Client Control Block - - - ZCL_IBMC_SERVICE_ARCH - TO_REST_CLIENT - E - REST HTTP Client - - - - - + + + + + + ZCL_IBMC_SERVICE_ARCH + E + IBM Watson SDK Platform-specifics + 1 + X + X + X + + + + ZCL_IBMC_SERVICE_ARCH + ADD_FORM_PART + E + Generates a multi-part request body. + + + ZCL_IBMC_SERVICE_ARCH + BASE64_DECODE + E + Decodes base64 encoded data to binary. + + + ZCL_IBMC_SERVICE_ARCH + CONVERT_STRING_TO_UTF8 + E + Converts STRING data to UTF8 encoded XSTRING. + + + ZCL_IBMC_SERVICE_ARCH + CREATE_CLIENT_BY_URL + E + Returns a HTTP/REST client based on an URL. + + + ZCL_IBMC_SERVICE_ARCH + EXECUTE + E + Executes a HTTP request. + + + ZCL_IBMC_SERVICE_ARCH + FIND_REGEX + E + Finds (and replaces) a regular expression. + + + ZCL_IBMC_SERVICE_ARCH + GET_DEFAULT_PROXY + E + Returns the default proxy host and port. + + + ZCL_IBMC_SERVICE_ARCH + GET_HTTP_STATUS + E + Returns the status of a REST response. + + + ZCL_IBMC_SERVICE_ARCH + GET_PROGNAME + E + Returns an ABAP module identifier. + + + ZCL_IBMC_SERVICE_ARCH + GET_RESPONSE_BINARY + E + Reads binary data from a HTTP response. + + + ZCL_IBMC_SERVICE_ARCH + GET_RESPONSE_HEADER + E + Returns a HTTP response header. + + + ZCL_IBMC_SERVICE_ARCH + GET_RESPONSE_STRING + E + Reads character data from a HTTP response. + + + ZCL_IBMC_SERVICE_ARCH + GET_REST_REQUEST + E + Returns a request object from a HTTP client object. + + + ZCL_IBMC_SERVICE_ARCH + GET_TIMEZONE + E + Returns the user's time zone. + + + ZCL_IBMC_SERVICE_ARCH + SET_AUTHENTICATION_BASIC + E + Sets request header for basic authentication. + + + ZCL_IBMC_SERVICE_ARCH + SET_REQUEST_BODY_CDATA + E + Set character data for the body of a HTTP request. + + + ZCL_IBMC_SERVICE_ARCH + SET_REQUEST_BODY_XDATA + E + Set binary data for the body of a HTTP request. + + + ZCL_IBMC_SERVICE_ARCH + SET_REQUEST_HEADER + E + Sets a HTTP header. + + + ZCL_IBMC_SERVICE_ARCH + SET_REQUEST_URI + E + Sets the URI for a HTTP request. + + + ZCL_IBMC_SERVICE_ARCH + TO_HTTP_CLIENT + E + HTTP Client Control Block + + + ZCL_IBMC_SERVICE_ARCH + TO_REST_CLIENT + E + REST HTTP Client + + + + + \ No newline at end of file diff --git a/src/zcl_ibmc_service_ext.clas.abap b/src/zcl_ibmc_service_ext.clas.abap index f576911..29eda24 100644 --- a/src/zcl_ibmc_service_ext.clas.abap +++ b/src/zcl_ibmc_service_ext.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019,2020 IBM Corp. All Rights Reserved. +* Copyright 2019,2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,7 +82,7 @@ public section. value(E_VALUE) type ZIBMC_CONFIG-VALUE raising ZCX_IBMC_SERVICE_EXCEPTION . - "!

Factory method to instantiate a service specific wrapper class.

+ "!

Factory method to instantiate a service wrapper class.

"! "! @parameter I_INSTANCE_ID | "! Value of field INSTANCE_UID in table ZIBMC_CONFIG. @@ -200,6 +200,13 @@ ENDCLASS. CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. +* ---------------------------------------------------------------------------------------+ +* | Static Private Method ZCL_IBMC_SERVICE_EXT=>ADD_CONFIG_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_SERVICENAME TYPE TY_SERVICENAME +* | [--->] I_INSTANCE_ID TYPE TY_INSTANCE_ID(optional) +* | [<-->] C_REQUEST_PROP TYPE ANY +* +-------------------------------------------------------------------------------------- method add_config_prop. data: @@ -287,6 +294,17 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Private Method ZCL_IBMC_SERVICE_EXT=>ADD_IMAGE_TO_ZIP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] IS_TABLELINE TYPE ANY +* | [--->] IO_ZIP TYPE REF TO CL_ABAP_ZIP +* | [--->] IV_BASE64 TYPE BOOLEAN +* | [--->] IV_FILENAME TYPE STRING(optional) +* | [--->] IV_FIELD_IMAGE TYPE FIELDNAME +* | [--->] IV_FIELD_FILENAME TYPE FIELDNAME(optional) +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method add_image_to_zip. data: lx_image type xstring, @@ -326,6 +344,13 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_EXT->GET_ACCESS_TOKEN +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_REQUEST_PROP TYPE TS_REQUEST_PROP(optional) +* | [<-()] E_ACCESS_TOKEN TYPE TS_ACCESS_TOKEN +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method get_access_token. data: lo_response type to_rest_response, @@ -440,7 +465,7 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. " parse expected response: " { "username": "joe", "role": "User", "uid": "1003", - " "accessToken": "eyJhbGc…1AjT_w", + " "accessToken": "eyJhbGc...1AjT_w", " "messageCode": "success", "message": "success" } data: begin of ls_access_token_icp4d, @@ -480,7 +505,7 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. if ls_token-expires_in > 0. get time stamp field lv_timestamp. lv_seconds = ls_token-expires_in - 300. " subtract 5 minutes to be save - ls_token-expires_ts = cl_abap_tstmp=>add( tstmp = lv_timestamp secs = lv_seconds ). + ls_token-expires_ts = cl_abap_tstmp=>add( tstmp = lv_timestamp secs = lv_seconds ) ##TYPE. endif. ls_token-service = p_servicename. @@ -499,6 +524,11 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_EXT->GET_BEARER_TOKEN +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_BEARER_TOKEN TYPE STRING +* +-------------------------------------------------------------------------------------- method get_bearer_token. data: @@ -520,6 +550,14 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_EXT->GET_CONFIG_VALUE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_DEFAULT TYPE ZIBMC_CONFIG-VALUE(optional) +* | [--->] I_PARAM TYPE ZIBMC_CONFIG-PARAM +* | [<-()] E_VALUE TYPE ZIBMC_CONFIG-VALUE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method get_config_value. @@ -551,6 +589,19 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Private Method ZCL_IBMC_SERVICE_EXT=>GET_FIELD_DATA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] IS_TABLELINE TYPE ANY +* | [--->] IV_FIELD_CLASS TYPE FIELDNAME(optional) +* | [--->] IV_FIELD_FILENAME TYPE FIELDNAME(optional) +* | [--->] IV_FIELD_IMAGE TYPE FIELDNAME(optional) +* | [<---] EV_FIELD_CLASS TYPE FIELDNAME +* | [<---] EV_FIELD_FILENAME TYPE FIELDNAME +* | [<---] EV_FIELD_IMAGE TYPE FIELDNAME +* | [<---] EV_FIELD_IMAGE_BASE64 TYPE FIELDNAME +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method get_field_data. data: @@ -696,6 +747,25 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_EXT=>GET_INSTANCE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_INSTANCE_ID TYPE TY_INSTANCE_ID(optional) +* | [--->] I_URL TYPE STRING(optional) +* | [--->] I_HOST TYPE STRING(optional) +* | [--->] I_USERNAME TYPE STRING(optional) +* | [--->] I_PASSWORD TYPE STRING(optional) +* | [--->] I_PROXY_HOST TYPE STRING(optional) +* | [--->] I_PROXY_PORT TYPE STRING(optional) +* | [--->] I_APIKEY TYPE STRING(optional) +* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) +* | [--->] I_OAUTH_PROP TYPE TS_OAUTH_PROP(optional) +* | [--->] I_ACCESS_TOKEN TYPE TS_ACCESS_TOKEN(optional) +* | [--->] I_TOKEN_GENERATION TYPE CHAR (default =C_TOKEN_GENERATION_AUTO) +* | [--->] I_REQUEST_HEADERS TYPE STRING(optional) +* | [--->] I_VERSION TYPE STRING(optional) +* | [<---] EO_INSTANCE TYPE ANY +* +-------------------------------------------------------------------------------------- method get_instance. data: lv_classname type string, @@ -703,7 +773,8 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. lo_instance type ref to zcl_ibmc_service_ext, lt_headerstr type tt_string, lv_headerstr type string, - ls_header type ts_header. + ls_header type ts_header, + lv_str type string. " instantiate object of type of exporting parameter get_field_type( @@ -726,12 +797,36 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. " Set service name (= class name without namespace and prefix 'CL_') if lv_classname cp 'Z*'. - find first occurrence of regex 'ZCL_[^_]*_([^\/]*)$' in lv_classname submatches lo_instance->p_servicename. + "find first occurrence of regex 'ZCL_[^_]*_([^\/]*)$' in lv_classname submatches lo_instance->p_servicename. + find_regex( + exporting + i_regex = 'ZCL_[^_]*_([^\/]*)$' + i_all_occurrences = space + i_in = lv_classname + changing + c_submatch1 = lv_str ). + lo_instance->p_servicename = conv #( lv_str ). else. - find first occurrence of regex 'CL_([^\/]*)$' in lv_classname submatches lo_instance->p_servicename. + "find first occurrence of regex 'CL_([^\/]*)$' in lv_classname submatches lo_instance->p_servicename. + find_regex( + exporting + i_regex = 'CL_([^\/]*)$' + i_all_occurrences = space + i_in = lv_classname + changing + c_submatch1 = lv_str ). + lo_instance->p_servicename = conv #( lv_str ). endif. if lo_instance->p_servicename is initial. - find first occurrence of regex '([^\/]*)$' in lv_classname submatches lo_instance->p_servicename. + "find first occurrence of regex '([^\/]*)$' in lv_classname submatches lo_instance->p_servicename. + find_regex( + exporting + i_regex = '([^\/]*)$' + i_all_occurrences = space + i_in = lv_classname + changing + c_submatch1 = lv_str ). + lo_instance->p_servicename = conv #( lv_str ). if lo_instance->p_servicename is initial. lo_instance->p_servicename = lv_classname. endif. @@ -828,6 +923,12 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_EXT->GET_REQUEST_PROP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) +* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP +* +-------------------------------------------------------------------------------------- method get_request_prop. data: lv_auth_method type string. @@ -860,6 +961,11 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_EXT->GET_SDK_VERSION_DATE +* +-------------------------------------------------------------------------------------------------+ +* | [<-()] E_SDK_VERSION_DATE TYPE STRING +* +-------------------------------------------------------------------------------------- method get_sdk_version_date. e_sdk_version_date = ''. @@ -867,6 +973,18 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_SERVICE_EXT=>GET_ZIPDATA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] IT_EXAMPLES TYPE ANY TABLE +* | [--->] IV_FIELD_CLASS TYPE FIELDNAME (default =C_FIELD_NONE) +* | [--->] IV_FIELD_FILENAME TYPE FIELDNAME(optional) +* | [--->] IV_FIELD_IMAGE TYPE FIELDNAME(optional) +* | [--->] IV_IMAGE_FORMAT TYPE TY_IMAGE_FORMAT(optional) +* | [--->] IV_IMAGE_NAME TYPE STRING(optional) +* | [<---] ET_ZIPDATA TYPE TT_MAP_FILE +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- method get_zipdata. constants: @@ -972,7 +1090,13 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. assign component lv_field_filename of structure to . if sy-subrc = 0. " remove path from filename - find regex '([^/\\]*)$' in submatches lv_filename. + "find regex '([^/\\]*)$' in submatches lv_filename. + find_regex( + exporting + i_regex = '([^/\\]*)$' + i_in = + changing + c_submatch1 = lv_filename ). endif. endif. @@ -1034,6 +1158,11 @@ CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_SERVICE_EXT->SET_BEARER_TOKEN +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_BEARER_TOKEN TYPE STRING +* +-------------------------------------------------------------------------------------- method set_bearer_token. data: diff --git a/src/zcl_ibmc_service_ext.clas.xml b/src/zcl_ibmc_service_ext.clas.xml index ef1d076..9aa836b 100644 --- a/src/zcl_ibmc_service_ext.clas.xml +++ b/src/zcl_ibmc_service_ext.clas.xml @@ -1,120 +1,120 @@ - - - - - - ZCL_IBMC_SERVICE_EXT - E - Extended REST API service class - 1 - X - X - X - - - - ZCL_IBMC_SERVICE_EXT - ADD_CONFIG_PROP - E - Method for internal use. - - - ZCL_IBMC_SERVICE_EXT - ADD_IMAGE_TO_ZIP - E - Method for internal use. - - - ZCL_IBMC_SERVICE_EXT - C_FIELD_NONE - E - Field Name - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_ALL - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_GIF - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_JPG - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_PNG - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_TIF - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_UNKNOWN - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - C_FORMAT_ZIP - E - Image encoding (jpg, png, ...) - - - ZCL_IBMC_SERVICE_EXT - GET_BEARER_TOKEN - E - Returns the bearer token, if available. - - - ZCL_IBMC_SERVICE_EXT - GET_CONFIG_VALUE - E - Retrieves a value of a configuration parameter - - - ZCL_IBMC_SERVICE_EXT - GET_FIELD_DATA - E - Method for internal use. - - - ZCL_IBMC_SERVICE_EXT - GET_INSTANCE - E - Factory method to instantiate a service specific wrapper cla - - - ZCL_IBMC_SERVICE_EXT - GET_SDK_VERSION_DATE - E - Returns the SDK built date. - - - ZCL_IBMC_SERVICE_EXT - GET_ZIPDATA - E - Compresses multiple images from an internal table - - - ZCL_IBMC_SERVICE_EXT - SET_BEARER_TOKEN - E - Method for internal use. - - - - - + + + + + + ZCL_IBMC_SERVICE_EXT + E + Extended REST API service class + 1 + X + X + X + + + + ZCL_IBMC_SERVICE_EXT + ADD_CONFIG_PROP + E + Method for internal use. + + + ZCL_IBMC_SERVICE_EXT + ADD_IMAGE_TO_ZIP + E + Method for internal use. + + + ZCL_IBMC_SERVICE_EXT + C_FIELD_NONE + E + Field Name + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_ALL + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_GIF + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_JPG + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_PNG + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_TIF + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_UNKNOWN + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + C_FORMAT_ZIP + E + Image encoding (jpg, png, ...) + + + ZCL_IBMC_SERVICE_EXT + GET_BEARER_TOKEN + E + Returns the bearer token, if available. + + + ZCL_IBMC_SERVICE_EXT + GET_CONFIG_VALUE + E + Retrieves a value of a configuration parameter + + + ZCL_IBMC_SERVICE_EXT + GET_FIELD_DATA + E + Method for internal use. + + + ZCL_IBMC_SERVICE_EXT + GET_INSTANCE + E + Factory method to instantiate a service specific wrapper cla + + + ZCL_IBMC_SERVICE_EXT + GET_SDK_VERSION_DATE + E + Returns the SDK built date. + + + ZCL_IBMC_SERVICE_EXT + GET_ZIPDATA + E + Compresses multiple images from an internal table + + + ZCL_IBMC_SERVICE_EXT + SET_BEARER_TOKEN + E + Method for internal use. + + + + + \ No newline at end of file diff --git a/src/zcl_ibmc_speech_to_text_v1.clas.abap b/src/zcl_ibmc_speech_to_text_v1.clas.abap index 9c89eee..cde68ac 100644 --- a/src/zcl_ibmc_speech_to_text_v1.clas.abap +++ b/src/zcl_ibmc_speech_to_text_v1.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,23 @@ "! speech-recognition capabilities to produce transcripts of spoken audio. The "! service can transcribe speech from various languages and audio formats. In "! addition to basic transcription, the service can produce detailed information -"! about many different aspects of the audio. For most languages, the service -"! supports two sampling rates, broadband and narrowband. It returns all JSON -"! response content in the UTF-8 character set.
+"! about many different aspects of the audio. It returns all JSON response content +"! in the UTF-8 character set.
+"!
+"! The service supports two types of models: previous-generation models that +"! include the terms `Broadband` and `Narrowband` in their names, and +"! next-generation models that include the terms `Multimedia` and `Telephony` in +"! their names. Broadband and multimedia models have minimum sampling rates of 16 +"! kHz. Narrowband and telephony models have minimum sampling rates of 8 kHz. The +"! next-generation models offer high throughput and greater transcription +"! accuracy.
+"!
+"! Effective **31 July 2023**, all previous-generation models will be removed from +"! the service and the documentation. Most previous-generation models were +"! deprecated on 15 March 2022. You must migrate to the equivalent next-generation +"! model by 31 July 2023. For more information, see [Migrating to next-generation +"! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m +"! igrate).{: deprecated}
"!
"! For speech recognition, the service supports synchronous and asynchronous HTTP "! Representational State Transfer (REST) interfaces. It also supports a WebSocket @@ -33,10 +47,9 @@ "! service also supports grammars. A grammar is a formal language specification "! that lets you restrict the phrases that the service can recognize.
"!
-"! Language model customization and acoustic model customization are generally -"! available for production use with all language models that are generally -"! available. Grammars are beta functionality for all language models that support -"! language model customization.
+"! Language model customization and grammars are available for most previous- and +"! next-generation models. Acoustic model customization is available for all +"! previous-generation models.
class ZCL_IBMC_SPEECH_TO_TEXT_V1 DEFINITION public inheriting from ZCL_IBMC_SERVICE_EXT @@ -142,7 +155,7 @@ public section. "! A transcription of the audio. TRANSCRIPT type STRING, "! A score that indicates the service's confidence in the transcript in the - "! range of 0.0 to 1.0. A confidence score is returned only for the best + "! range of 0.0 to 1.0. The service returns a confidence score only for the best "! alternative and only with results marked as final. CONFIDENCE type DOUBLE, "! Time alignments for each word from the transcript as a list of lists. Each inner @@ -154,7 +167,7 @@ public section. "! A confidence score for each word of the transcript as a list of lists. Each "! inner list consists of two elements: the word and its confidence score in the "! range of 0.0 to 1.0, for example: - "! `[["hello",0.95],["world",0.866]]`. Confidence scores are + "! `[["hello",0.95],["world",0.86]]`. Confidence scores are "! returned only for the best alternative and only with results marked as final. WORD_CONFIDENCE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_SPCH_RECOGNITION_ALTERNATIVE. @@ -192,7 +205,7 @@ public section. "!

"! If processing metrics are requested, information about the

"! service's processing of the input audio. Processing metrics are not - "! available with the synchronous **Recognize audio** method. + "! available with the synchronous [Recognize audio](#recognize) method. begin of T_PROCESSING_METRICS, "! Detailed timing information about the service's processing of the input "! audio. @@ -286,9 +299,14 @@ public section. "!

"! Component results for a speech recognition request.

begin of T_SPEECH_RECOGNITION_RESULT, - "! An indication of whether the transcription results are final. If `true`, the - "! results for this utterance are not updated further; no additional results are - "! sent for a `result_index` once its results are indicated as final. + "! An indication of whether the transcription results are final:
+ "! * If `true`, the results for this utterance are final. They are guaranteed not + "! to be updated further.
+ "! * If `false`, the results are interim. They can be updated with further interim + "! results until final results are eventually sent.
+ "!
+ "! **Note:** Because `final` is a reserved word in Java and Swift, the field is + "! renamed `xFinal` in Java and is escaped with back quotes in Swift. FINAL type BOOLEAN, "! An array of alternative transcripts. The `alternatives` array can include "! additional requested output such as word confidence or timestamps. @@ -323,13 +341,23 @@ public section. "! An array of `SpeechRecognitionResult` objects that can include interim and final "! results (interim results are returned only if supported by the method). Final "! results are guaranteed not to change; interim results might be replaced by - "! further interim results and final results. The service periodically sends - "! updates to the results list; the `result_index` is set to the lowest index in - "! the array that has changed; it is incremented for new results. + "! further interim results and eventually final results.
+ "!
+ "! For the HTTP interfaces, all results arrive at the same time. For the WebSocket + "! interface, results can be sent as multiple separate responses. The service + "! periodically sends updates to the results list. The `result_index` is + "! incremented to the lowest index in the array that has changed for new results. + "!
+ "!
+ "! For more information, see [Understanding speech recognition + "! results](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-basic-r + "! esponse). RESULTS type STANDARD TABLE OF T_SPEECH_RECOGNITION_RESULT WITH NON-UNIQUE DEFAULT KEY, "! An index that indicates a change point in the `results` array. The service - "! increments the index only for additional results that it sends for new audio - "! for the same request. + "! increments the index for additional results that it sends for new audio for the + "! same request. All results with the same index are delivered at the same time. + "! The same index can include multiple final results that are delivered with the + "! same response. RESULT_INDEX type INTEGER, "! An array of `SpeakerLabelsResult` objects that identifies which words were "! spoken by which speakers in a multi-person exchange. The array is returned only @@ -339,7 +367,7 @@ public section. SPEAKER_LABELS type STANDARD TABLE OF T_SPEAKER_LABELS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! If processing metrics are requested, information about the service's "! processing of the input audio. Processing metrics are not available with the - "! synchronous **Recognize audio** method. + "! synchronous [Recognize audio](#recognize) method. PROCESSING_METRICS type T_PROCESSING_METRICS, "! If audio metrics are requested, information about the signal characteristics of "! the input audio. @@ -349,7 +377,9 @@ public section. "! and a list of invalid argument strings, for example, `"Unknown "! arguments:"` or `"Unknown url query arguments:"` followed by a "! list of the form `"{invalid_arg_1}, - "! {invalid_arg_2}."`
+ "! {invalid_arg_2}."` (If you use the `character_insertion_bias` + "! parameter with a previous-generation model, the warning message refers to the + "! parameter as `lambdaBias`.)
"! * The following warning is returned if the request passes a custom model that is "! based on an older version of a base model for which an updated version is "! available: `"Using previous version of base model, because your custom @@ -367,8 +397,12 @@ public section. begin of T_GRAMMAR, "! The name of the grammar. NAME type STRING, - "! The number of OOV words in the grammar. The value is `0` while the grammar is - "! being processed. + "! _For custom models that are based on previous-generation models_, the number of + "! OOV words extracted from the grammar. The value is `0` while the grammar is + "! being processed.
+ "!
+ "! _For custom models that are based on next-generation models_, no OOV words are + "! extracted from grammars, so the value is always `0`. OUT_OF_VOCABULARY_WORDS type INTEGER, "! The status of the grammar:
"! * `analyzed`: The service successfully analyzed the grammar. The custom model @@ -417,25 +451,29 @@ public section. CREATED type STRING, "! The date and time in Coordinated Universal Time (UTC) at which the job was last "! updated by the service. The value is provided in full ISO 8601 format - "! (`YYYY-MM-DDThh:mm:ss.sTZD`). This field is returned only by the **Check jobs** - "! and **Check a job** methods. + "! (`YYYY-MM-DDThh:mm:ss.sTZD`). This field is returned only by the [Check + "! jobs](#checkjobs) and [Check a job[(#checkjob) methods. UPDATED type STRING, - "! The URL to use to request information about the job with the **Check a job** - "! method. This field is returned only by the **Create a job** method. + "! The URL to use to request information about the job with the [Check a + "! job](#checkjob) method. This field is returned only by the [Create a + "! job](#createjob) method. URL type STRING, "! The user token associated with a job that was created with a callback URL and a - "! user token. This field can be returned only by the **Check jobs** method. + "! user token. This field can be returned only by the [Check jobs](#checkjobs) + "! method. USER_TOKEN type STRING, "! If the status is `completed`, the results of the recognition request as an array "! that includes a single instance of a `SpeechRecognitionResults` object. This - "! field is returned only by the **Check a job** method. + "! field is returned only by the [Check a job](#checkjob) method. RESULTS type STANDARD TABLE OF T_SPEECH_RECOGNITION_RESULTS WITH NON-UNIQUE DEFAULT KEY, "! An array of warning messages about invalid parameters included with the request. "! Each warning includes a descriptive message and a list of invalid argument "! strings, for example, `"unexpected query parameter 'user_token', "! query parameter 'callback_url' was not specified"`. The request - "! succeeds despite the warnings. This field can be returned only by the **Create - "! a job** method. + "! succeeds despite the warnings. This field can be returned only by the [Create a + "! job](#createjob) method. (If you use the `character_insertion_bias` parameter + "! with a previous-generation model, the warning message refers to the parameter + "! as `lambdaBias`.). WARNINGS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_RECOGNITION_JOB. types: @@ -460,13 +498,13 @@ public section. "! if the user mistakenly passes a file that does not contain audio, such as a "! JPEG file). TYPE type STRING, - "! **For an audio-type resource,** the codec in which the audio is encoded. Omitted + "! _For an audio-type resource_, the codec in which the audio is encoded. Omitted "! for an archive-type resource. CODEC type STRING, - "! **For an audio-type resource,** the sampling rate of the audio in Hertz (samples + "! _For an audio-type resource_, the sampling rate of the audio in Hertz (samples "! per second). Omitted for an archive-type resource. FREQUENCY type INTEGER, - "! **For an archive-type resource,** the format of the compressed archive:
+ "! _For an archive-type resource_, the format of the compressed archive:
"! * `zip` for a **.zip** file
"! * `gzip` for a **.tar.gz** file
"!
@@ -493,9 +531,9 @@ public section. begin of T_AUDIO_RESOURCE, "! The total seconds of audio in the audio resource. DURATION type INTEGER, - "! **For an archive-type resource,** the user-specified name of the resource.
+ "! _For an archive-type resource_, the user-specified name of the resource.
"!
- "! **For an audio-type resource,** the user-specified name of the resource or the + "! _For an audio-type resource_, the user-specified name of the resource or the "! name of the audio file that the user added for the resource. The value depends "! on the method that is called. NAME type STRING, @@ -519,17 +557,17 @@ public section. "! Information about an audio resource from a custom acoustic

"! model. begin of T_AUDIO_LISTING, - "! **For an audio-type resource,** the total seconds of audio in the resource. + "! _For an audio-type resource_, the total seconds of audio in the resource. "! Omitted for an archive-type resource. DURATION type INTEGER, - "! **For an audio-type resource,** the user-specified name of the resource. Omitted + "! _For an audio-type resource_, the user-specified name of the resource. Omitted "! for an archive-type resource. NAME type STRING, - "! **For an audio-type resource,** an `AudioDetails` object that provides detailed + "! _For an audio-type resource_, an `AudioDetails` object that provides detailed "! information about the resource. The object is empty until the service finishes "! processing the audio. Omitted for an archive-type resource. DETAILS type T_AUDIO_DETAILS, - "! **For an audio-type resource,** the status of the resource:
+ "! _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 @@ -541,10 +579,10 @@ public section. "!
"! Omitted for an archive-type resource. STATUS type STRING, - "! **For an archive-type resource,** an object of type `AudioResource` that - "! provides information about the resource. Omitted for an audio-type resource. + "! _For an archive-type resource_, an object of type `AudioResource` that provides + "! information about the resource. Omitted for an audio-type resource. CONTAINER type T_AUDIO_RESOURCE, - "! **For an archive-type resource,** an array of `AudioResource` objects that + "! _For an archive-type resource_, an array of `AudioResource` objects that "! provides information about the audio-type resources that are contained in the "! resource. Omitted for an audio-type resource. AUDIO type STANDARD TABLE OF T_AUDIO_RESOURCE WITH NON-UNIQUE DEFAULT KEY, @@ -571,27 +609,46 @@ public section. "! A word from the custom model's words resource. The spelling of the word is "! used to train the model. WORD type STRING, - "! An array of pronunciations for the word. The array can include the sounds-like - "! pronunciation automatically generated by the service if none is provided for - "! the word; the service adds this pronunciation when it finishes processing the - "! word. + "! An array of as many as five pronunciations for the word.
+ "! * _For a custom model that is based on a previous-generation model_, in addition + "! to sounds-like pronunciations that were added by a user, the array can include + "! a sounds-like pronunciation that is automatically generated by the service if + "! none is provided when the word is added to the custom model.
+ "! * _For a custom model that is based on a next-generation model_, the array can + "! include only sounds-like pronunciations that were added by a user. SOUNDS_LIKE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! The spelling of the word that the service uses to display the word in a - "! transcript. The field contains an empty string if no display-as value is - "! provided for the word, in which case the word is displayed as it is spelled. + "! transcript.
+ "! * _For a custom model that is based on a previous-generation model_, the field + "! can contain an empty string if no display-as value is provided for a word that + "! exists in the service's base vocabulary. In this case, the word is + "! displayed as it is spelled.
+ "! * _For a custom model that is based on a next-generation model_, the service + "! uses the spelling of the word as the value of the display-as field when the + "! word is added to the model. DISPLAY_AS type STRING, - "! A sum of the number of times the word is found across all corpora. For example, + "! _For a custom model that is based on a previous-generation model_, a sum of the + "! number of times the word is found across all corpora and grammars. For example, "! if the word occurs five times in one corpus and seven times in another, its "! count is `12`. If you add a custom word to a model before it is added by any - "! corpora, the count begins at `1`; if the word is added from a corpus first and - "! later modified, the count reflects only the number of times it is found in - "! corpora. + "! corpora or grammars, the count begins at `1`; if the word is added from a + "! corpus or grammar first and later modified, the count reflects only the number + "! of times it is found in corpora and grammars.
+ "!
+ "! _For a custom model that is based on a next-generation model_, the `count` field + "! for any word is always `1`. COUNT type INTEGER, "! An array of sources that describes how the word was added to the custom - "! model's words resource. For OOV words added from a corpus, includes the - "! name of the corpus; if the word was added by multiple corpora, the names of all - "! corpora are listed. If the word was modified or added by the user directly, the - "! field includes the string `user`. + "! model's words resource.
+ "! * _For a custom model that is based on previous-generation model,_ the field + "! includes the name of each corpus and grammar from which the service extracted + "! the word. For OOV that are added by multiple corpora or grammars, the names of + "! all corpora and grammars are listed. If you modified or added the word + "! directly, the field includes the string `user`.
+ "! * _For a custom model that is based on a next-generation model,_ this field + "! shows only `user` for custom words that were added directly to the custom + "! model. Words from corpora and grammars are not added to the words resource for + "! custom models that are based on next-generation models. SOURCE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! If the service discovered one or more problems that you need to correct for the "! word's definition, an array that describes each of the errors. @@ -611,19 +668,20 @@ public section. "! Information about a word that is to be added to a custom

"! language model. begin of T_CUSTOM_WORD, - "! For the **Add custom words** method, you must specify the custom word that is to - "! be added to or updated in the custom model. Do not include spaces in the word. - "! Use a `-` (dash) or `_` (underscore) to connect the tokens of compound words. - "!
+ "! For the [Add custom words](#addwords) method, you must specify the custom word + "! that is to be added to or updated in the custom model. Do not include spaces in + "! the word. Use a `-` (dash) or `_` (underscore) to connect the tokens of + "! compound words.
"!
- "! Omit this parameter for the **Add a custom word** method. + "! Omit this parameter for the [Add a custom word](#addword) method. WORD type STRING, - "! An array of sounds-like pronunciations for the custom word. Specify how words + "! As array of sounds-like pronunciations for the custom word. Specify how words "! that are difficult to pronounce, foreign words, acronyms, and so on can be "! pronounced by users.
- "! * For a word that is not in the service's base vocabulary, omit the - "! parameter to have the service automatically generate a sounds-like - "! pronunciation for the word.
+ "! * _For custom models that are based on previous-generation models_, for a word + "! that is not in the service's base vocabulary, omit the parameter to have + "! the service automatically generate a sounds-like pronunciation for the + "! word.
"! * For a word that is in the service's base vocabulary, use the parameter to "! specify additional pronunciations for the word. You cannot override the default "! pronunciation of a word; pronunciations you add augment the pronunciation from @@ -634,7 +692,10 @@ public section. SOUNDS_LIKE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! An alternative spelling for the custom word when it appears in a transcript. Use "! the parameter when you want the word to have a spelling that is different from - "! its usual representation or from its spelling in corpora training data. + "! its usual representation or from its spelling in corpora training data.
+ "!
+ "! _For custom models that are based on next-generation models_, the service uses + "! the spelling of the word as the display-as value if you omit the field. DISPLAY_AS type STRING, end of T_CUSTOM_WORD. types: @@ -660,8 +721,12 @@ public section. "! The total number of words in the corpus. The value is `0` while the corpus is "! being processed. TOTAL_WORDS type INTEGER, - "! The number of OOV words in the corpus. The value is `0` while the corpus is - "! being processed. + "! _For custom models that are based on previous-generation models_, the number of + "! OOV words extracted from the corpus. The value is `0` while the corpus is being + "! processed.
+ "!
+ "! _For custom models that are based on next-generation models_, no OOV words are + "! extracted from corpora, so the value is always `0`. OUT_OF_VOCABULARY_WORDS type INTEGER, "! The status of the corpus:
"! * `analyzed`: The service successfully analyzed the corpus. The custom model can @@ -688,9 +753,9 @@ public section. "!

"! Information about an existing custom language model.

begin of T_LANGUAGE_MODEL, - "! The customization ID (GUID) of the custom language model. The **Create a custom - "! language model** method returns only this field of the object; it does not - "! return the other fields. + "! The customization ID (GUID) of the custom language model. The [Create a custom + "! language model](#createlanguagemodel) method returns only this field of the + "! object; it does not return the other fields. CUSTOMIZATION_ID type STRING, "! The date and time in Coordinated Universal Time (UTC) at which the custom "! language model was created. The value is provided in full ISO 8601 format @@ -701,12 +766,18 @@ public section. "! when a language model is first added but has yet to be updated. The value is "! provided in full ISO 8601 format (YYYY-MM-DDThh:mm:ss.sTZD). UPDATED type STRING, - "! The language identifier of the custom language model (for example, `en-US`). + "! The language identifier of the custom language model (for example, `en-US`). The + "! value matches the five-character language identifier from the name of the base + "! model for the custom model. This value might be different from the value of the + "! `dialect` field. LANGUAGE type STRING, - "! The dialect of the language for the custom language model. For non-Spanish - "! models, the field matches the language of the base model; for example, `en-US` - "! for either of the US English language models. For Spanish models, the field - "! indicates the dialect for which the model was created:
+ "! The dialect of the language for the custom language model. _For custom models + "! that are based on non-Spanish previous-generation models and on next-generation + "! models,_ the field matches the language of the base model; for example, `en-US` + "! for one of the US English models. _For custom models that are based on Spanish + "! previous-generation models,_ the field indicates the dialect with which the + "! model was created. The value can match the name of the base model or, if it was + "! specified by the user, can be one of the following:
"! * `es-ES` for Castilian Spanish (`es-ES` models)
"! * `es-LA` for Latin American Spanish (`es-AR`, `es-CL`, `es-CO`, and `es-PE` "! models)
@@ -716,8 +787,8 @@ public section. DIALECT type STRING, "! A list of the available versions of the custom language model. Each element of "! the array indicates a version of the base model with which the custom model can - "! be used. Multiple versions exist only if the custom model has been upgraded; - "! otherwise, only a single version is shown. + "! be used. Multiple versions exist only if the custom model has been upgraded to + "! a new version of its base model. Otherwise, only a single version is shown. VERSIONS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! The GUID of the credentials for the instance of the service that owns the custom "! language model. @@ -768,9 +839,9 @@ public section. "!

"! Information about an existing custom acoustic model.

begin of T_ACOUSTIC_MODEL, - "! The customization ID (GUID) of the custom acoustic model. The **Create a custom - "! acoustic model** method returns only this field of the object; it does not - "! return the other fields. + "! The customization ID (GUID) of the custom acoustic model. The [Create a custom + "! acoustic model](#createacousticmodel) method returns only this field of the + "! object; it does not return the other fields. CUSTOMIZATION_ID type STRING, "! The date and time in Coordinated Universal Time (UTC) at which the custom "! acoustic model was created. The value is provided in full ISO 8601 format @@ -785,8 +856,8 @@ public section. LANGUAGE type STRING, "! A list of the available versions of the custom acoustic model. Each element of "! the array indicates a version of the base model with which the custom model can - "! be used. Multiple versions exist only if the custom model has been upgraded; - "! otherwise, only a single version is shown. + "! be used. Multiple versions exist only if the custom model has been upgraded to + "! a new version of its base model. Otherwise, only a single version is shown. VERSIONS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! The GUID of the credentials for the instance of the service that owns the custom "! acoustic model. @@ -836,10 +907,10 @@ public section. "! encoding if it encounters non-ASCII characters.
"!
"! Make sure that you know the character encoding of the file. You must use that - "! encoding when working with the words in the custom language model. For more - "! information, see [Character - "! encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - "! aWords#charEncoding).
+ "! same encoding when working with the words in the custom language model. For + "! more information, see [Character encoding for custom + "! words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor + "! ds#charEncoding).
"!
"! With the `curl` command, use the `--data-binary` option to upload the file for "! the request. @@ -847,63 +918,78 @@ public section. end of T_INLINE_OBJECT. types: "!

- "! Additional service features that are supported with the

- "! model. + "! Indicates whether select service features are supported with

+ "! the model. begin of T_SUPPORTED_FEATURES, "! Indicates whether the customization interface can be used to create a custom "! language model based on the language model. CUSTOM_LANGUAGE_MODEL type BOOLEAN, + "! Indicates whether the customization interface can be used to create a custom + "! acoustic model based on the language model. + CUSTOM_ACOUSTIC_MODEL type BOOLEAN, "! Indicates whether the `speaker_labels` parameter can be used with the language "! model.
"!
"! **Note:** The field returns `true` for all models. However, speaker labels are - "! supported only for US English, Australian English, German, Japanese, Korean, - "! and Spanish (both broadband and narrowband models) and UK English (narrowband - "! model only). Speaker labels are not supported for any other models. + "! supported for use only with the following languages and models:
+ "! * _For previous-generation models,_ the parameter can be used with Australian + "! English, US English, German, Japanese, Korean, and Spanish (both broadband and + "! narrowband models) and UK English (narrowband model) transcription only.
+ "! * _For next-generation models,_ the parameter can be used with Czech, English + "! (Australian, Indian, UK, and US), German, Japanese, Korean, and Spanish + "! transcription only.
+ "!
+ "! Speaker labels are not supported for use with any other languages or models. SPEAKER_LABELS type BOOLEAN, + "! Indicates whether the `low_latency` parameter can be used with a next-generation + "! language model. The field is returned only for next-generation models. + "! Previous-generation models do not support the `low_latency` parameter. + LOW_LATENCY type BOOLEAN, end of T_SUPPORTED_FEATURES. types: "!

"! Information about the new custom language model.

begin of T_CREATE_LANGUAGE_MODEL, - "! A user-defined name for the new custom language model. Use a name that is unique - "! among all custom language models that you own. Use a localized name that + "! A user-defined name for the new custom language model. Use a localized name that "! matches the language of the custom model. Use a name that describes the domain "! of the custom model, such as `Medical custom model` or `Legal custom model`. + "! Use a name that is unique among all custom language models that you own.
+ "!
+ "! Include a maximum of 256 characters in the name. Do not use backslashes, + "! slashes, colons, equal signs, ampersands, or question marks in the name. NAME type STRING, "! The name of the base language model that is to be customized by the new custom "! language model. The new custom model can be used only with the base model that "! it customizes.
"!
"! To determine whether a base model supports language model customization, use the - "! **Get a model** method and check that the attribute `custom_language_model` is - "! set to `true`. You can also refer to [Language support for + "! [Get a model](#getmodel) method and check that the attribute + "! `custom_language_model` is set to `true`. You can also refer to [Language + "! support for "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c - "! ustomization#languageSupport). + "! ustom-support). BASE_MODEL_NAME type STRING, "! The dialect of the specified language that is to be used with the custom - "! language model. For most languages, the dialect matches the language of the - "! base model by default. For example, `en-US` is used for either of the US - "! English language models.
+ "! language model. _For all languages, it is always safe to omit this field._ The + "! service automatically uses the language identifier from the name of the base + "! model. For example, the service automatically uses `en-US` for all US English + "! models.
"!
- "! For a Spanish language, the service creates a custom language model that is - "! suited for speech in one of the following dialects:
+ "! If you specify the `dialect` for a new custom model, follow these guidelines. + "! _For non-Spanish previous-generation models and for next-generation models,_ + "! you must specify a value that matches the five-character language identifier + "! from the name of the base model. _For Spanish previous-generation models,_ you + "! must specify one of the following values:
"! * `es-ES` for Castilian Spanish (`es-ES` models)
"! * `es-LA` for Latin American Spanish (`es-AR`, `es-CL`, `es-CO`, and `es-PE` "! models)
"! * `es-US` for Mexican (North American) Spanish (`es-MX` models)
"!
- "! The parameter is meaningful only for Spanish models, for which you can always - "! safely omit the parameter to have the service create the correct mapping.
- "!
- "! If you specify the `dialect` parameter for non-Spanish language models, its - "! value must match the language of the base model. If you specify the `dialect` - "! for Spanish language models, its value must match one of the defined mappings - "! as indicated (`es-ES`, `es-LA`, or `es-MX`). All dialect values are - "! case-insensitive. + "! All values that you pass for the `dialect` field are case-insensitive. DIALECT type STRING, - "! A description of the new custom language model. Use a localized description that - "! matches the language of the custom model. + "! A recommended description of the new custom language model. Use a localized + "! description that matches the language of the custom model. Include a maximum of + "! 128 characters in the description. DESCRIPTION type STRING, end of T_CREATE_LANGUAGE_MODEL. types: @@ -920,7 +1006,7 @@ public section. RATE type INTEGER, "! The URI for the model. URL type STRING, - "! Additional service features that are supported with the model. + "! Indicates whether select service features are supported with the model. SUPPORTED_FEATURES type T_SUPPORTED_FEATURES, "! A brief description of the model. DESCRIPTION type STRING, @@ -937,24 +1023,27 @@ public section. "!

"! Information about the new custom acoustic model.

begin of T_CREATE_ACOUSTIC_MODEL, - "! A user-defined name for the new custom acoustic model. Use a name that is unique - "! among all custom acoustic models that you own. Use a localized name that + "! A user-defined name for the new custom acoustic model. Use a localized name that "! matches the language of the custom model. Use a name that describes the "! acoustic environment of the custom model, such as `Mobile custom model` or - "! `Noisy car custom model`. + "! `Noisy car custom model`. Use a name that is unique among all custom acoustic + "! models that you own.
+ "!
+ "! Include a maximum of 256 characters in the name. Do not use backslashes, + "! slashes, colons, equal signs, ampersands, or question marks in the name. NAME type STRING, "! The name of the base language model that is to be customized by the new custom "! acoustic model. The new custom model can be used only with the base model that - "! it customizes. (**Note:** The model `ar-AR_BroadbandModel` is deprecated; use - "! `ar-MS_BroadbandModel` instead.)
+ "! it customizes.
"!
"! To determine whether a base model supports acoustic model customization, refer "! to [Language support for "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c - "! ustomization#languageSupport). + "! ustom-support). BASE_MODEL_NAME type STRING, - "! A description of the new custom acoustic model. Use a localized description that - "! matches the language of the custom model. + "! A recommended description of the new custom acoustic model. Use a localized + "! description that matches the language of the custom model. Include a maximum of + "! 128 characters in the description. DESCRIPTION type STRING, end of T_CREATE_ACOUSTIC_MODEL. types: @@ -1035,7 +1124,7 @@ constants: T_ACOUSTIC_MODEL type string value '|CUSTOMIZATION_ID|', T_ACOUSTIC_MODELS type string value '|CUSTOMIZATIONS|', T_INLINE_OBJECT type string value '|CORPUS_FILE|', - T_SUPPORTED_FEATURES type string value '|CUSTOM_LANGUAGE_MODEL|SPEAKER_LABELS|', + T_SUPPORTED_FEATURES type string value '|CUSTOM_LANGUAGE_MODEL|CUSTOM_ACOUSTIC_MODEL|SPEAKER_LABELS|', T_CREATE_LANGUAGE_MODEL type string value '|NAME|BASE_MODEL_NAME|', T_SPEECH_MODEL type string value '|NAME|LANGUAGE|RATE|URL|SUPPORTED_FEATURES|DESCRIPTION|', T_SPEECH_MODELS type string value '|MODELS|', @@ -1104,6 +1193,8 @@ constants: SUPPORTED_FEATURES type string value 'supported_features', DESCRIPTION type string value 'description', CUSTOM_LANGUAGE_MODEL type string value 'custom_language_model', + CUSTOM_ACOUSTIC_MODEL type string value 'custom_acoustic_model', + LOW_LATENCY type string value 'low_latency', BASE_MODEL_NAME type string value 'base_model_name', DIALECT type string value 'dialect', CUSTOMIZATIONS type string value 'customizations', @@ -1151,9 +1242,9 @@ constants: "! Hertz, among other things. The ordering of the list of models can change from "! call to call; do not rely on an alphabetized or static list of models.
"!
- "! **See also:** [Languages and - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - "! odels). + "! **See also:** [Listing all + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-l + "! ist#models-list-all). "! "! @parameter E_RESPONSE | "! Service return value of type T_SPEECH_MODELS @@ -1171,14 +1262,13 @@ constants: "! with the service. The information includes the name of the model and its "! minimum sampling rate in Hertz, among other things.
"!
- "! **See also:** [Languages and - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - "! odels). + "! **See also:** [Listing a specific + "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-li + "! st#models-list-specific). "! "! @parameter I_MODEL_ID | - "! The identifier of the model in the form of its name from the output of the **Get - "! a model** method. (**Note:** The model `ar-AR_BroadbandModel` is deprecated; - "! use `ar-MS_BroadbandModel` instead.). + "! The identifier of the model in the form of its name from the output of the [List + "! models](#listmodels) method. "! @parameter E_RESPONSE | "! Service return value of type T_SPEECH_MODEL "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -1266,13 +1356,53 @@ constants: "! rate. If the sampling rate of the audio is lower than the minimum required "! rate, the request fails.
"!
- "! **See also:** [Audio + "! **See also:** [Supported audio "! formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-f - "! ormats#audio-formats).
+ "! ormats).
+ "!
+ "! ### Next-generation models
+ "!
+ "! The service supports next-generation `Multimedia` (16 kHz) and `Telephony` (8 + "! kHz) models for many languages. Next-generation models have higher throughput + "! than the service's previous generation of `Broadband` and `Narrowband` + "! models. When you use next-generation models, the service can return + "! transcriptions more quickly and also provide noticeably better transcription + "! accuracy.
+ "!
+ "! You specify a next-generation model by using the `model` query parameter, as you + "! do a previous-generation model. Most next-generation models support the + "! `low_latency` parameter, and all next-generation models support the + "! `character_insertion_bias` parameter. These parameters are not available with + "! previous-generation models.
+ "!
+ "! Next-generation models do not support all of the speech recognition parameters + "! that are available for use with previous-generation models. Next-generation + "! models do not support the following parameters:
+ "! * `acoustic_customization_id`
+ "! * `keywords` and `keywords_threshold`
+ "! * `processing_metrics` and `processing_metrics_interval`
+ "! * `word_alternatives_threshold`
+ "!
+ "! **Important:** Effective **31 July 2023**, all previous-generation models will + "! be removed from the service and the documentation. Most previous-generation + "! models were deprecated on 15 March 2022. You must migrate to the equivalent + "! next-generation model by 31 July 2023. For more information, see [Migrating to + "! next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + "! igrate).
+ "!
+ "! **See also:**
+ "! * [Next-generation languages and + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + "! g)
+ "! * [Supported features for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + "! g#models-ng-features)
"!
"! ### Multipart speech recognition
"!
- "! **Note:** The Watson SDKs do not support multipart speech recognition.
+ "! **Note:** The asynchronous HTTP interface, WebSocket interface, and Watson SDKs + "! do not support multipart speech recognition.
"!
"! The HTTP `POST` method of the service also supports multipart speech "! recognition. With multipart requests, you pass all audio data as multipart form @@ -1296,19 +1426,29 @@ constants: "! The format (MIME type) of the audio. For more information about specifying an "! audio format, see **Audio formats (content types)** in the method description. "! @parameter I_MODEL | - "! The identifier of the model that is to be used for the recognition request. - "! (**Note:** The model `ar-AR_BroadbandModel` is deprecated; use - "! `ar-MS_BroadbandModel` instead.) See [Languages and - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - "! odels). + "! The model to use for speech recognition. If you omit the `model` parameter, the + "! service uses the US English `en-US_BroadbandModel` by default.
+ "!
+ "! _For IBM Cloud Pak for Data,_ if you do not install the `en-US_BroadbandModel`, + "! you must either specify a model with the request or specify a new default model + "! for your installation of the service.
+ "!
+ "! **See also:**
+ "! * [Using a model for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-mod + "! els-use)
+ "! * [Using the default + "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-us + "! e#models-use-default). "! @parameter I_LANGUAGE_CUSTOMIZATION_ID | "! The customization ID (GUID) of a custom language model that is to be used with "! the recognition request. The base model of the specified custom language model "! must match the model specified with the `model` parameter. You must make the "! request with credentials for the instance of the service that owns the custom - "! model. By default, no custom language model is used. See [Custom - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - "! stom-input).
+ "! model. By default, no custom language model is used. See [Using a custom + "! language model for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-lan + "! guageUse).
"!
"! **Note:** Use this parameter instead of the deprecated `customization_id` "! parameter. @@ -1317,18 +1457,19 @@ constants: "! the recognition request. The base model of the specified custom acoustic model "! must match the model specified with the `model` parameter. You must make the "! request with credentials for the instance of the service that owns the custom - "! model. By default, no custom acoustic model is used. See [Custom - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - "! stom-input). + "! model. By default, no custom acoustic model is used. See [Using a custom + "! acoustic model for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-aco + "! usticUse). "! @parameter I_BASE_MODEL_VERSION | "! The version of the specified base model that is to be used with the recognition "! request. Multiple versions of a base model can exist when a model is updated "! for internal improvements. The parameter is intended primarily for use with "! custom models that have been upgraded for a new base model. The default value "! depends on whether the parameter is used with or without a custom model. See - "! [Base model - "! version](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#v - "! ersion). + "! [Making speech recognition requests with upgraded custom + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + "! pgrade-use#custom-upgrade-use-recognition). "! @parameter I_CUSTOMIZATION_WEIGHT | "! If you specify the customization ID (GUID) of a custom language model with the "! recognition request, the customization weight tells the service how much weight @@ -1336,19 +1477,22 @@ constants: "! model for the current request.
"!
"! Specify a value between 0.0 and 1.0. Unless a different customization weight was - "! specified for the custom model when it was trained, the default value is 0.3. A - "! customization weight that you specify overrides a weight that was specified - "! when the custom model was trained.
- "!
- "! The default value yields the best performance in general. Assign a higher value - "! if your audio makes frequent use of OOV words from the custom model. Use - "! caution when setting the weight: a higher value can improve the accuracy of - "! phrases from the custom model's domain, but it can negatively affect - "! performance on non-domain phrases.
- "!
- "! See [Custom - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - "! stom-input). + "! specified for the custom model when the model was trained, the default value + "! is:
+ "! * 0.3 for previous-generation models
+ "! * 0.2 for most next-generation models
+ "! * 0.1 for next-generation English and Japanese models
+ "!
+ "! A customization weight that you specify overrides a weight that was specified + "! when the custom model was trained. The default value yields the best + "! performance in general. Assign a higher value if your audio makes frequent use + "! of OOV words from the custom model. Use caution when setting the weight: a + "! higher value can improve the accuracy of phrases from the custom model's + "! domain, but it can negatively affect performance on non-domain phrases.
+ "!
+ "! See [Using customization + "! weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-language + "! Use#weight). "! @parameter I_INACTIVITY_TIMEOUT | "! The time in seconds after which, if only silence (no speech) is detected in "! streaming audio, the connection is closed with a 400 error. The parameter is @@ -1369,48 +1513,50 @@ constants: "! case-insensitive.
"!
"! See [Keyword - "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - "! #keyword_spotting). + "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + "! ng#keyword-spotting). "! @parameter I_KEYWORDS_THRESHOLD | "! A confidence value that is the lower bound for spotting a keyword. A word is "! considered to match a keyword if its confidence is greater than or equal to the "! threshold. Specify a probability between 0.0 and 1.0. If you specify a "! threshold, you must also specify one or more keywords. The service performs no "! keyword spotting if you omit either parameter. See [Keyword - "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - "! #keyword_spotting). + "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + "! ng#keyword-spotting). "! @parameter I_MAX_ALTERNATIVES | "! The maximum number of alternative transcripts that the service is to return. By "! default, the service returns a single transcript. If you specify a value of "! `0`, the service uses the default value, `1`. See [Maximum - "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - "! tput#max_alternatives). + "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-me + "! tadata#max-alternatives). "! @parameter I_WORD_ALTERNATIVES_THRESHOLD | "! A confidence value that is the lower bound for identifying a hypothesis as a "! possible word alternative (also known as "Confusion Networks"). An "! alternative word is considered if its confidence is greater than or equal to "! the threshold. Specify a probability between 0.0 and 1.0. By default, the "! service computes no alternative words. See [Word - "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - "! tput#word_alternatives). + "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-sp + "! otting#word-alternatives). "! @parameter I_WORD_CONFIDENCE | "! If `true`, the service returns a confidence measure in the range of 0.0 to 1.0 "! for each word. By default, the service returns no word confidence scores. See "! [Word - "! confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - "! ut#word_confidence). + "! confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + "! data#word-confidence). "! @parameter I_TIMESTAMPS | "! If `true`, the service returns time alignment for each word. By default, no "! timestamps are returned. See [Word - "! timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - "! ut#word_timestamps). + "! timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + "! data#word-timestamps). "! @parameter I_PROFANITY_FILTER | "! If `true`, the service filters profanity from all output except for keyword "! results by replacing inappropriate words with a series of asterisks. Set the - "! parameter to `false` to return results with no censoring. Applies to US English - "! transcription only. See [Profanity - "! filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - "! t#profanity_filter). + "! parameter to `false` to return results with no censoring.
+ "!
+ "! **Note:** The parameter can be used with US English and Japanese transcription + "! only. See [Profanity + "! filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + "! tting#profanity-filtering). "! @parameter I_SMART_FORMATTING | "! If `true`, the service converts dates, times, series of digits and numbers, "! phone numbers, currency values, and internet addresses into more readable, @@ -1419,38 +1565,39 @@ constants: "! punctuation symbols. By default, the service performs no smart formatting. "!
"!
- "! **Note:** Applies to US English, Japanese, and Spanish transcription only.
+ "! **Note:** The parameter can be used with US English, Japanese, and Spanish (all + "! dialects) transcription only.
"!
"! See [Smart - "! formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - "! ut#smart_formatting). + "! formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-form + "! atting#smart-formatting). "! @parameter I_SPEAKER_LABELS | "! If `true`, the response includes labels that identify which words were spoken by "! which participants in a multi-person exchange. By default, the service returns "! no speaker labels. Setting `speaker_labels` to `true` forces the `timestamps` "! parameter to be `true`, regardless of whether you specify `false` for the "! parameter.
- "!
- "! **Note:** Applies to US English, Australian English, German, Japanese, Korean, - "! and Spanish (both broadband and narrowband models) and UK English (narrowband - "! model) transcription only.
+ "! * _For previous-generation models,_ the parameter can be used with Australian + "! English, US English, German, Japanese, Korean, and Spanish (both broadband and + "! narrowband models) and UK English (narrowband model) transcription only.
+ "! * _For next-generation models,_ the parameter can be used with Czech, English + "! (Australian, Indian, UK, and US), German, Japanese, Korean, and Spanish + "! transcription only.
"!
"! See [Speaker - "! labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#s - "! peaker_labels). - "! @parameter I_CUSTOMIZATION_ID | - "! **Deprecated.** Use the `language_customization_id` parameter to specify the - "! customization ID (GUID) of a custom language model that is to be used with the - "! recognition request. Do not specify both parameters with a request. + "! labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker- + "! labels). "! @parameter I_GRAMMAR_NAME | "! The name of a grammar that is to be used with the recognition request. If you "! specify a grammar, you must also use the `language_customization_id` parameter "! to specify the name of the custom language model for which the grammar is "! defined. The service recognizes only strings that are recognized by the "! specified grammar; it does not recognize other custom words from the - "! model's words resource. See - "! [Grammars](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - "! #grammars-input). + "! model's words resource.
+ "!
+ "! See [Using a grammar for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-gra + "! mmarUse). "! @parameter I_REDACTION | "! If `true`, the service redacts, or masks, numeric data from final transcripts. "! The feature redacts any number that has three or more consecutive digits by @@ -1464,11 +1611,12 @@ constants: "! and `keywords_threshold` parameters) and returns only a single final transcript "! (forces the `max_alternatives` parameter to be `1`).
"!
- "! **Note:** Applies to US English, Japanese, and Korean transcription only.
+ "! **Note:** The parameter can be used with US English, Japanese, and Korean + "! transcription only.
"!
"! See [Numeric - "! redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - "! t#redaction). + "! redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + "! tting#numeric-redaction). "! @parameter I_AUDIO_METRICS | "! If `true`, requests detailed information about the signal characteristics of the "! input audio. The service returns audio metrics with the final transcription @@ -1476,11 +1624,11 @@ constants: "!
"! See [Audio "! metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - "! #audio_metrics). + "! #audio-metrics). "! @parameter I_END_OF_PHRASE_SILENCE_TIME | - "! If `true`, specifies the duration of the pause interval at which the service - "! splits a transcript into multiple final results. If the service detects pauses - "! or extended silence before it reaches the end of the audio stream, its response + "! Specifies the duration of the pause interval at which the service splits a + "! transcript into multiple final results. If the service detects pauses or + "! extended silence before it reaches the end of the audio stream, its response "! can include multiple final results. Silence indicates a point at which the "! speaker pauses between spoken words or phrases.
"!
@@ -1494,20 +1642,24 @@ constants: "! Chinese is 0.6 seconds.
"!
"! See [End of phrase silence - "! time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#sil - "! ence_time). + "! time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#si + "! lence-time). "! @parameter I_SPLT_TRNSCRPT_AT_PHRASE_END | "! If `true`, directs the service to split the transcript into multiple final "! results based on semantic features of the input, for example, at the conclusion "! of meaningful phrases such as sentences. The service bases its understanding of "! semantic features on the base language model that you use with a request. "! Custom language models and grammars can also influence how and where the - "! service splits a transcript. By default, the service splits transcripts based - "! solely on the pause interval.
+ "! service splits a transcript.
+ "!
+ "! By default, the service splits transcripts based solely on the pause interval. + "! If the parameters are used together on the same request, + "! `end_of_phrase_silence_time` has precedence over + "! `split_transcript_at_phrase_end`.
"!
"! See [Split transcript at phrase - "! end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#spli - "! t_transcript). + "! end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#spl + "! it-transcript). "! @parameter I_SPEECH_DETECTOR_SENSITIVITY | "! The sensitivity of speech activity detection that the service is to perform. Use "! the parameter to suppress word insertions from music, coughing, and other @@ -1521,9 +1673,15 @@ constants: "! sensitivity.
"! * 1.0 suppresses no audio (speech detection sensitivity is disabled).
"!
- "! The values increase on a monotonic curve. See [Speech Activity - "! Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - "! #detection). + "! The values increase on a monotonic curve. Specifying one or two decimal places + "! of precision (for example, `0.55`) is typically more than sufficient.
+ "!
+ "! The parameter is supported with all next-generation models and with most + "! previous-generation models. See [Speech detector + "! sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + "! ection#detection-parameters-sensitivity) and [Language model + "! support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + "! on#detection-support). "! @parameter I_BACKGROUND_AUDIO_SUPPRESSION | "! The level to which the service is to suppress background audio based on its "! volume to prevent it from being transcribed as speech. Use the parameter to @@ -1535,9 +1693,56 @@ constants: "! * 0.5 provides a reasonable level of audio suppression for general usage.
"! * 1.0 suppresses all audio (no audio is transcribed).
"!
- "! The values increase on a monotonic curve. See [Speech Activity - "! Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - "! #detection). + "! The values increase on a monotonic curve. Specifying one or two decimal places + "! of precision (for example, `0.55`) is typically more than sufficient.
+ "!
+ "! The parameter is supported with all next-generation models and with most + "! previous-generation models. See [Background audio + "! suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + "! ection#detection-parameters-suppression) and [Language model + "! support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + "! on#detection-support). + "! @parameter I_LOW_LATENCY | + "! If `true` for next-generation `Multimedia` and `Telephony` models that support + "! low latency, directs the service to produce results even more quickly than it + "! usually does. Next-generation models produce transcription results faster than + "! previous-generation models. The `low_latency` parameter causes the models to + "! produce results even more quickly, though the results might be less accurate + "! when the parameter is used.
+ "!
+ "! The parameter is not available for previous-generation `Broadband` and + "! `Narrowband` models. It is available for most next-generation models.
+ "! * For a list of next-generation models that support low latency, see [Supported + "! next-generation language + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + "! g#models-ng-supported).
+ "! * For more information about the `low_latency` parameter, see [Low + "! latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim + "! #low-latency). + "! @parameter I_CHARACTER_INSERTION_BIAS | + "! For next-generation models, an indication of whether the service is biased to + "! recognize shorter or longer strings of characters when developing transcription + "! hypotheses. By default, the service is optimized to produce the best balance of + "! strings of different lengths.
+ "!
+ "! The default bias is 0.0. The allowable range of values is -1.0 to 1.0.
+ "! * Negative values bias the service to favor hypotheses with shorter strings of + "! characters.
+ "! * Positive values bias the service to favor hypotheses with longer strings of + "! characters.
+ "!
+ "! As the value approaches -1.0 or 1.0, the impact of the parameter becomes more + "! pronounced. To determine the most effective value for your scenario, start by + "! setting the value of the parameter to a small increment, such as -0.1, -0.05, + "! 0.05, or 0.1, and assess how the value impacts the transcription results. Then + "! experiment with different values as necessary, adjusting the value by small + "! increments.
+ "!
+ "! The parameter is not available for previous-generation models.
+ "!
+ "! See [Character insertion + "! bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#in + "! sertion-bias). "! @parameter E_RESPONSE | "! Service return value of type T_SPEECH_RECOGNITION_RESULTS "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -1551,24 +1756,25 @@ constants: !I_ACOUSTIC_CUSTOMIZATION_ID type STRING optional !I_BASE_MODEL_VERSION type STRING optional !I_CUSTOMIZATION_WEIGHT type DOUBLE optional - !I_INACTIVITY_TIMEOUT type INTEGER optional + !I_INACTIVITY_TIMEOUT type INTEGER default 30 !I_KEYWORDS type TT_STRING optional !I_KEYWORDS_THRESHOLD type FLOAT optional - !I_MAX_ALTERNATIVES type INTEGER optional + !I_MAX_ALTERNATIVES type INTEGER default 1 !I_WORD_ALTERNATIVES_THRESHOLD type FLOAT optional !I_WORD_CONFIDENCE type BOOLEAN default c_boolean_false !I_TIMESTAMPS type BOOLEAN default c_boolean_false !I_PROFANITY_FILTER type BOOLEAN default c_boolean_true !I_SMART_FORMATTING type BOOLEAN default c_boolean_false !I_SPEAKER_LABELS type BOOLEAN default c_boolean_false - !I_CUSTOMIZATION_ID type STRING optional !I_GRAMMAR_NAME type STRING optional !I_REDACTION type BOOLEAN default c_boolean_false !I_AUDIO_METRICS type BOOLEAN default c_boolean_false - !I_END_OF_PHRASE_SILENCE_TIME type DOUBLE optional + !I_END_OF_PHRASE_SILENCE_TIME type DOUBLE default '0.8' !I_SPLT_TRNSCRPT_AT_PHRASE_END type BOOLEAN default c_boolean_false - !I_SPEECH_DETECTOR_SENSITIVITY type FLOAT optional - !I_BACKGROUND_AUDIO_SUPPRESSION type FLOAT optional + !I_SPEECH_DETECTOR_SENSITIVITY type FLOAT default '0.5' + !I_BACKGROUND_AUDIO_SUPPRESSION type FLOAT default '0.0' + !I_LOW_LATENCY type BOOLEAN default c_boolean_false + !I_CHARACTER_INSERTION_BIAS type FLOAT default '0.0' !I_accept type string default 'application/json' exporting !E_RESPONSE type T_SPEECH_RECOGNITION_RESULTS @@ -1593,7 +1799,7 @@ constants: "! service does not receive a reply with a response code of 200 and a body that "! echoes the challenge string sent by the service within five seconds, it does "! not allowlist the URL; it instead sends status code 400 in response to the - "! **Register a callback** request. If the requested callback URL is already + "! request to register a callback. If the requested callback URL is already "! allowlisted, the service responds to the initial registration request with "! response code 200.
"!
@@ -1639,9 +1845,10 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . "!

Unregister a callback

- "! Unregisters a callback URL that was previously allowlisted with a **Register a - "! callback** request for use with the asynchronous interface. Once unregistered, - "! the URL can no longer be used with asynchronous recognition requests.
+ "! Unregisters a callback URL that was previously allowlisted with a [Register a + "! callback](#registercallback) request for use with the asynchronous interface. + "! Once unregistered, the URL can no longer be used with asynchronous recognition + "! requests.
"!
"! **See also:** [Unregistering a callback "! URL](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#unreg @@ -1667,17 +1874,18 @@ constants: "! parameters to subscribe to specific events and to specify a string that is to "! be included with each notification for the job.
"! * By polling the service: Omit the `callback_url`, `events`, and `user_token` - "! parameters. You must then use the **Check jobs** or **Check a job** methods to - "! check the status of the job, using the latter to retrieve the results when the - "! job is complete.
+ "! parameters. You must then use the [Check jobs](#checkjobs) or [Check a + "! job](#checkjob) methods to check the status of the job, using the latter to + "! retrieve the results when the job is complete.
"!
"! The two approaches are not mutually exclusive. You can poll the service for job "! status or obtain results from the service manually even if you include a "! callback URL. In both cases, you can include the `results_ttl` parameter to "! specify how long the results are to remain available after the job is complete. - "! Using the HTTPS **Check a job** method to retrieve results is more secure than - "! receiving them via callback notification over HTTP because it provides - "! confidentiality in addition to authentication and data integrity.
+ "! Using the HTTPS [Check a job](#checkjob) method to retrieve results is more + "! secure than receiving them via callback notification over HTTP because it + "! provides confidentiality in addition to authentication and data integrity. + "!
"!
"! The method supports the same basic parameters as other HTTP and WebSocket "! recognition requests. It also supports the following parameters specific to the @@ -1759,9 +1967,48 @@ constants: "! rate. If the sampling rate of the audio is lower than the minimum required "! rate, the request fails.
"!
- "! **See also:** [Audio + "! **See also:** [Supported audio "! formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-f - "! ormats#audio-formats). + "! ormats).
+ "!
+ "! ### Next-generation models
+ "!
+ "! The service supports next-generation `Multimedia` (16 kHz) and `Telephony` (8 + "! kHz) models for many languages. Next-generation models have higher throughput + "! than the service's previous generation of `Broadband` and `Narrowband` + "! models. When you use next-generation models, the service can return + "! transcriptions more quickly and also provide noticeably better transcription + "! accuracy.
+ "!
+ "! You specify a next-generation model by using the `model` query parameter, as you + "! do a previous-generation model. Most next-generation models support the + "! `low_latency` parameter, and all next-generation models support the + "! `character_insertion_bias` parameter. These parameters are not available with + "! previous-generation models.
+ "!
+ "! Next-generation models do not support all of the speech recognition parameters + "! that are available for use with previous-generation models. Next-generation + "! models do not support the following parameters:
+ "! * `acoustic_customization_id`
+ "! * `keywords` and `keywords_threshold`
+ "! * `processing_metrics` and `processing_metrics_interval`
+ "! * `word_alternatives_threshold`
+ "!
+ "! **Important:** Effective **31 July 2023**, all previous-generation models will + "! be removed from the service and the documentation. Most previous-generation + "! models were deprecated on 15 March 2022. You must migrate to the equivalent + "! next-generation model by 31 July 2023. For more information, see [Migrating to + "! next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + "! igrate).
+ "!
+ "! **See also:**
+ "! * [Next-generation languages and + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + "! g)
+ "! * [Supported features for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + "! g#models-ng-features) "! "! @parameter I_AUDIO | "! The audio to transcribe. @@ -1769,16 +2016,26 @@ constants: "! The format (MIME type) of the audio. For more information about specifying an "! audio format, see **Audio formats (content types)** in the method description. "! @parameter I_MODEL | - "! The identifier of the model that is to be used for the recognition request. - "! (**Note:** The model `ar-AR_BroadbandModel` is deprecated; use - "! `ar-MS_BroadbandModel` instead.) See [Languages and - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models#m - "! odels). + "! The model to use for speech recognition. If you omit the `model` parameter, the + "! service uses the US English `en-US_BroadbandModel` by default.
+ "!
+ "! _For IBM Cloud Pak for Data,_ if you do not install the `en-US_BroadbandModel`, + "! you must either specify a model with the request or specify a new default model + "! for your installation of the service.
+ "!
+ "! **See also:**
+ "! * [Using a model for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-mod + "! els-use)
+ "! * [Using the default + "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-us + "! e#models-use-default). "! @parameter I_CALLBACK_URL | "! A URL to which callback notifications are to be sent. The URL must already be - "! successfully allowlisted by using the **Register a callback** method. You can - "! include the same callback URL with any number of job creation requests. Omit - "! the parameter to poll the service for job completion and results.
+ "! successfully allowlisted by using the [Register a callback](#registercallback) + "! method. You can include the same callback URL with any number of job creation + "! requests. Omit the parameter to poll the service for job completion and + "! results.
"!
"! Use the `user_token` parameter to specify a unique user-specified string with "! each job to differentiate the callback notifications for the jobs. @@ -1788,8 +2045,8 @@ constants: "! * `recognitions.started` generates a callback notification when the service "! begins to process the job.
"! * `recognitions.completed` generates a callback notification when the job is - "! complete. You must use the **Check a job** method to retrieve the results - "! before they time out or are deleted.
+ "! complete. You must use the [Check a job](#checkjob) method to retrieve the + "! results before they time out or are deleted.
"! * `recognitions.completed_with_results` generates a callback notification when "! the job is complete. The notification includes the results of the request.
"! * `recognitions.failed` generates a callback notification if the service @@ -1817,9 +2074,10 @@ constants: "! the recognition request. The base model of the specified custom language model "! must match the model specified with the `model` parameter. You must make the "! request with credentials for the instance of the service that owns the custom - "! model. By default, no custom language model is used. See [Custom - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - "! stom-input).
+ "! model. By default, no custom language model is used. See [Using a custom + "! language model for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-lan + "! guageUse).
"!
"! **Note:** Use this parameter instead of the deprecated `customization_id` "! parameter. @@ -1828,18 +2086,19 @@ constants: "! the recognition request. The base model of the specified custom acoustic model "! must match the model specified with the `model` parameter. You must make the "! request with credentials for the instance of the service that owns the custom - "! model. By default, no custom acoustic model is used. See [Custom - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - "! stom-input). + "! model. By default, no custom acoustic model is used. See [Using a custom + "! acoustic model for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-aco + "! usticUse). "! @parameter I_BASE_MODEL_VERSION | "! The version of the specified base model that is to be used with the recognition "! request. Multiple versions of a base model can exist when a model is updated "! for internal improvements. The parameter is intended primarily for use with "! custom models that have been upgraded for a new base model. The default value "! depends on whether the parameter is used with or without a custom model. See - "! [Base model - "! version](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#v - "! ersion). + "! [Making speech recognition requests with upgraded custom + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + "! pgrade-use#custom-upgrade-use-recognition). "! @parameter I_CUSTOMIZATION_WEIGHT | "! If you specify the customization ID (GUID) of a custom language model with the "! recognition request, the customization weight tells the service how much weight @@ -1847,19 +2106,22 @@ constants: "! model for the current request.
"!
"! Specify a value between 0.0 and 1.0. Unless a different customization weight was - "! specified for the custom model when it was trained, the default value is 0.3. A - "! customization weight that you specify overrides a weight that was specified - "! when the custom model was trained.
- "!
- "! The default value yields the best performance in general. Assign a higher value - "! if your audio makes frequent use of OOV words from the custom model. Use - "! caution when setting the weight: a higher value can improve the accuracy of - "! phrases from the custom model's domain, but it can negatively affect - "! performance on non-domain phrases.
- "!
- "! See [Custom - "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input#cu - "! stom-input). + "! specified for the custom model when the model was trained, the default value + "! is:
+ "! * 0.3 for previous-generation models
+ "! * 0.2 for most next-generation models
+ "! * 0.1 for next-generation English and Japanese models
+ "!
+ "! A customization weight that you specify overrides a weight that was specified + "! when the custom model was trained. The default value yields the best + "! performance in general. Assign a higher value if your audio makes frequent use + "! of OOV words from the custom model. Use caution when setting the weight: a + "! higher value can improve the accuracy of phrases from the custom model's + "! domain, but it can negatively affect performance on non-domain phrases.
+ "!
+ "! See [Using customization + "! weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-language + "! Use#weight). "! @parameter I_INACTIVITY_TIMEOUT | "! The time in seconds after which, if only silence (no speech) is detected in "! streaming audio, the connection is closed with a 400 error. The parameter is @@ -1880,48 +2142,50 @@ constants: "! case-insensitive.
"!
"! See [Keyword - "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - "! #keyword_spotting). + "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + "! ng#keyword-spotting). "! @parameter I_KEYWORDS_THRESHOLD | "! A confidence value that is the lower bound for spotting a keyword. A word is "! considered to match a keyword if its confidence is greater than or equal to the "! threshold. Specify a probability between 0.0 and 1.0. If you specify a "! threshold, you must also specify one or more keywords. The service performs no "! keyword spotting if you omit either parameter. See [Keyword - "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output - "! #keyword_spotting). + "! spotting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-spotti + "! ng#keyword-spotting). "! @parameter I_MAX_ALTERNATIVES | "! The maximum number of alternative transcripts that the service is to return. By "! default, the service returns a single transcript. If you specify a value of "! `0`, the service uses the default value, `1`. See [Maximum - "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - "! tput#max_alternatives). + "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-me + "! tadata#max-alternatives). "! @parameter I_WORD_ALTERNATIVES_THRESHOLD | "! A confidence value that is the lower bound for identifying a hypothesis as a "! possible word alternative (also known as "Confusion Networks"). An "! alternative word is considered if its confidence is greater than or equal to "! the threshold. Specify a probability between 0.0 and 1.0. By default, the "! service computes no alternative words. See [Word - "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-ou - "! tput#word_alternatives). + "! alternatives](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-sp + "! otting#word-alternatives). "! @parameter I_WORD_CONFIDENCE | "! If `true`, the service returns a confidence measure in the range of 0.0 to 1.0 "! for each word. By default, the service returns no word confidence scores. See "! [Word - "! confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - "! ut#word_confidence). + "! confidence](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + "! data#word-confidence). "! @parameter I_TIMESTAMPS | "! If `true`, the service returns time alignment for each word. By default, no "! timestamps are returned. See [Word - "! timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - "! ut#word_timestamps). + "! timestamps](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-meta + "! data#word-timestamps). "! @parameter I_PROFANITY_FILTER | "! If `true`, the service filters profanity from all output except for keyword "! results by replacing inappropriate words with a series of asterisks. Set the - "! parameter to `false` to return results with no censoring. Applies to US English - "! transcription only. See [Profanity - "! filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - "! t#profanity_filter). + "! parameter to `false` to return results with no censoring.
+ "!
+ "! **Note:** The parameter can be used with US English and Japanese transcription + "! only. See [Profanity + "! filtering](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + "! tting#profanity-filtering). "! @parameter I_SMART_FORMATTING | "! If `true`, the service converts dates, times, series of digits and numbers, "! phone numbers, currency values, and internet addresses into more readable, @@ -1930,38 +2194,39 @@ constants: "! punctuation symbols. By default, the service performs no smart formatting. "!
"!
- "! **Note:** Applies to US English, Japanese, and Spanish transcription only.
+ "! **Note:** The parameter can be used with US English, Japanese, and Spanish (all + "! dialects) transcription only.
"!
"! See [Smart - "! formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outp - "! ut#smart_formatting). + "! formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-form + "! atting#smart-formatting). "! @parameter I_SPEAKER_LABELS | "! If `true`, the response includes labels that identify which words were spoken by "! which participants in a multi-person exchange. By default, the service returns "! no speaker labels. Setting `speaker_labels` to `true` forces the `timestamps` "! parameter to be `true`, regardless of whether you specify `false` for the "! parameter.
- "!
- "! **Note:** Applies to US English, Australian English, German, Japanese, Korean, - "! and Spanish (both broadband and narrowband models) and UK English (narrowband - "! model) transcription only.
+ "! * _For previous-generation models,_ the parameter can be used with Australian + "! English, US English, German, Japanese, Korean, and Spanish (both broadband and + "! narrowband models) and UK English (narrowband model) transcription only.
+ "! * _For next-generation models,_ the parameter can be used with Czech, English + "! (Australian, Indian, UK, and US), German, Japanese, Korean, and Spanish + "! transcription only.
"!
"! See [Speaker - "! labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#s - "! peaker_labels). - "! @parameter I_CUSTOMIZATION_ID | - "! **Deprecated.** Use the `language_customization_id` parameter to specify the - "! customization ID (GUID) of a custom language model that is to be used with the - "! recognition request. Do not specify both parameters with a request. + "! labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker- + "! labels). "! @parameter I_GRAMMAR_NAME | "! The name of a grammar that is to be used with the recognition request. If you "! specify a grammar, you must also use the `language_customization_id` parameter "! to specify the name of the custom language model for which the grammar is "! defined. The service recognizes only strings that are recognized by the "! specified grammar; it does not recognize other custom words from the - "! model's words resource. See - "! [Grammars](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - "! #grammars-input). + "! model's words resource.
+ "!
+ "! See [Using a grammar for speech + "! recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-gra + "! mmarUse). "! @parameter I_REDACTION | "! If `true`, the service redacts, or masks, numeric data from final transcripts. "! The feature redacts any number that has three or more consecutive digits by @@ -1975,11 +2240,12 @@ constants: "! and `keywords_threshold` parameters) and returns only a single final transcript "! (forces the `max_alternatives` parameter to be `1`).
"!
- "! **Note:** Applies to US English, Japanese, and Korean transcription only.
+ "! **Note:** The parameter can be used with US English, Japanese, and Korean + "! transcription only.
"!
"! See [Numeric - "! redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-outpu - "! t#redaction). + "! redaction](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-forma + "! tting#numeric-redaction). "! @parameter I_PROCESSING_METRICS | "! If `true`, requests processing metrics about the service's transcription of "! the input audio. The service returns processing metrics at the interval @@ -1989,7 +2255,7 @@ constants: "!
"! See [Processing "! metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - "! #processing_metrics). + "! #processing-metrics). "! @parameter I_PROCESSING_METRICS_INTERVAL | "! Specifies the interval in real wall-clock seconds at which the service is to "! return processing metrics. The parameter is ignored unless the @@ -2005,7 +2271,7 @@ constants: "!
"! See [Processing "! metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - "! #processing_metrics). + "! #processing-metrics). "! @parameter I_AUDIO_METRICS | "! If `true`, requests detailed information about the signal characteristics of the "! input audio. The service returns audio metrics with the final transcription @@ -2013,11 +2279,11 @@ constants: "!
"! See [Audio "! metrics](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-metrics - "! #audio_metrics). + "! #audio-metrics). "! @parameter I_END_OF_PHRASE_SILENCE_TIME | - "! If `true`, specifies the duration of the pause interval at which the service - "! splits a transcript into multiple final results. If the service detects pauses - "! or extended silence before it reaches the end of the audio stream, its response + "! Specifies the duration of the pause interval at which the service splits a + "! transcript into multiple final results. If the service detects pauses or + "! extended silence before it reaches the end of the audio stream, its response "! can include multiple final results. Silence indicates a point at which the "! speaker pauses between spoken words or phrases.
"!
@@ -2031,20 +2297,24 @@ constants: "! Chinese is 0.6 seconds.
"!
"! See [End of phrase silence - "! time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#sil - "! ence_time). + "! time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#si + "! lence-time). "! @parameter I_SPLT_TRNSCRPT_AT_PHRASE_END | "! If `true`, directs the service to split the transcript into multiple final "! results based on semantic features of the input, for example, at the conclusion "! of meaningful phrases such as sentences. The service bases its understanding of "! semantic features on the base language model that you use with a request. "! Custom language models and grammars can also influence how and where the - "! service splits a transcript. By default, the service splits transcripts based - "! solely on the pause interval.
+ "! service splits a transcript.
+ "!
+ "! By default, the service splits transcripts based solely on the pause interval. + "! If the parameters are used together on the same request, + "! `end_of_phrase_silence_time` has precedence over + "! `split_transcript_at_phrase_end`.
"!
"! See [Split transcript at phrase - "! end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-output#spli - "! t_transcript). + "! end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#spl + "! it-transcript). "! @parameter I_SPEECH_DETECTOR_SENSITIVITY | "! The sensitivity of speech activity detection that the service is to perform. Use "! the parameter to suppress word insertions from music, coughing, and other @@ -2058,9 +2328,15 @@ constants: "! sensitivity.
"! * 1.0 suppresses no audio (speech detection sensitivity is disabled).
"!
- "! The values increase on a monotonic curve. See [Speech Activity - "! Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - "! #detection). + "! The values increase on a monotonic curve. Specifying one or two decimal places + "! of precision (for example, `0.55`) is typically more than sufficient.
+ "!
+ "! The parameter is supported with all next-generation models and with most + "! previous-generation models. See [Speech detector + "! sensitivity](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + "! ection#detection-parameters-sensitivity) and [Language model + "! support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + "! on#detection-support). "! @parameter I_BACKGROUND_AUDIO_SUPPRESSION | "! The level to which the service is to suppress background audio based on its "! volume to prevent it from being transcribed as speech. Use the parameter to @@ -2072,9 +2348,56 @@ constants: "! * 0.5 provides a reasonable level of audio suppression for general usage.
"! * 1.0 suppresses all audio (no audio is transcribed).
"!
- "! The values increase on a monotonic curve. See [Speech Activity - "! Detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-input - "! #detection). + "! The values increase on a monotonic curve. Specifying one or two decimal places + "! of precision (for example, `0.55`) is typically more than sufficient.
+ "!
+ "! The parameter is supported with all next-generation models and with most + "! previous-generation models. See [Background audio + "! suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-det + "! ection#detection-parameters-suppression) and [Language model + "! support](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detecti + "! on#detection-support). + "! @parameter I_LOW_LATENCY | + "! If `true` for next-generation `Multimedia` and `Telephony` models that support + "! low latency, directs the service to produce results even more quickly than it + "! usually does. Next-generation models produce transcription results faster than + "! previous-generation models. The `low_latency` parameter causes the models to + "! produce results even more quickly, though the results might be less accurate + "! when the parameter is used.
+ "!
+ "! The parameter is not available for previous-generation `Broadband` and + "! `Narrowband` models. It is available for most next-generation models.
+ "! * For a list of next-generation models that support low latency, see [Supported + "! next-generation language + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-n + "! g#models-ng-supported).
+ "! * For more information about the `low_latency` parameter, see [Low + "! latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim + "! #low-latency). + "! @parameter I_CHARACTER_INSERTION_BIAS | + "! For next-generation models, an indication of whether the service is biased to + "! recognize shorter or longer strings of characters when developing transcription + "! hypotheses. By default, the service is optimized to produce the best balance of + "! strings of different lengths.
+ "!
+ "! The default bias is 0.0. The allowable range of values is -1.0 to 1.0.
+ "! * Negative values bias the service to favor hypotheses with shorter strings of + "! characters.
+ "! * Positive values bias the service to favor hypotheses with longer strings of + "! characters.
+ "!
+ "! As the value approaches -1.0 or 1.0, the impact of the parameter becomes more + "! pronounced. To determine the most effective value for your scenario, start by + "! setting the value of the parameter to a small increment, such as -0.1, -0.05, + "! 0.05, or 0.1, and assess how the value impacts the transcription results. Then + "! experiment with different values as necessary, adjusting the value by small + "! increments.
+ "!
+ "! The parameter is not available for previous-generation models.
+ "!
+ "! See [Character insertion + "! bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsing#in + "! sertion-bias). "! @parameter E_RESPONSE | "! Service return value of type T_RECOGNITION_JOB "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -2092,26 +2415,27 @@ constants: !I_ACOUSTIC_CUSTOMIZATION_ID type STRING optional !I_BASE_MODEL_VERSION type STRING optional !I_CUSTOMIZATION_WEIGHT type DOUBLE optional - !I_INACTIVITY_TIMEOUT type INTEGER optional + !I_INACTIVITY_TIMEOUT type INTEGER default 30 !I_KEYWORDS type TT_STRING optional !I_KEYWORDS_THRESHOLD type FLOAT optional - !I_MAX_ALTERNATIVES type INTEGER optional + !I_MAX_ALTERNATIVES type INTEGER default 1 !I_WORD_ALTERNATIVES_THRESHOLD type FLOAT optional !I_WORD_CONFIDENCE type BOOLEAN default c_boolean_false !I_TIMESTAMPS type BOOLEAN default c_boolean_false !I_PROFANITY_FILTER type BOOLEAN default c_boolean_true !I_SMART_FORMATTING type BOOLEAN default c_boolean_false !I_SPEAKER_LABELS type BOOLEAN default c_boolean_false - !I_CUSTOMIZATION_ID type STRING optional !I_GRAMMAR_NAME type STRING optional !I_REDACTION type BOOLEAN default c_boolean_false !I_PROCESSING_METRICS type BOOLEAN default c_boolean_false - !I_PROCESSING_METRICS_INTERVAL type FLOAT optional + !I_PROCESSING_METRICS_INTERVAL type FLOAT default '1.0' !I_AUDIO_METRICS type BOOLEAN default c_boolean_false - !I_END_OF_PHRASE_SILENCE_TIME type DOUBLE optional + !I_END_OF_PHRASE_SILENCE_TIME type DOUBLE default '0.8' !I_SPLT_TRNSCRPT_AT_PHRASE_END type BOOLEAN default c_boolean_false - !I_SPEECH_DETECTOR_SENSITIVITY type FLOAT optional - !I_BACKGROUND_AUDIO_SUPPRESSION type FLOAT optional + !I_SPEECH_DETECTOR_SENSITIVITY type FLOAT default '0.5' + !I_BACKGROUND_AUDIO_SUPPRESSION type FLOAT default '0.0' + !I_LOW_LATENCY type BOOLEAN default c_boolean_false + !I_CHARACTER_INSERTION_BIAS type FLOAT default '0.0' !I_accept type string default 'application/json' exporting !E_RESPONSE type T_RECOGNITION_JOB @@ -2123,9 +2447,9 @@ constants: "! update times of each job, and, if a job was created with a callback URL and a "! user token, the user token for the job. To obtain the results for a job whose "! status is `completed` or not one of the latest 100 outstanding jobs, use the - "! **Check a job** method. A job and its results remain available until you delete - "! them with the **Delete a job** method or until the job's time to live - "! expires, whichever comes first.
+ "! [Check a job[(#checkjob) method. A job and its results remain available until + "! you delete them with the [Delete a job](#deletejob) method or until the + "! job's time to live expires, whichever comes first.
"!
"! **See also:** [Checking the status of the latest "! jobs](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#jobs @@ -2152,9 +2476,9 @@ constants: "! You can use the method to retrieve the results of any job, regardless of whether "! it was submitted with a callback URL and the "! `recognitions.completed_with_results` event, and you can retrieve the results - "! multiple times for as long as they remain available. Use the **Check jobs** - "! method to request information about the most recent jobs associated with the - "! calling credentials.
+ "! multiple times for as long as they remain available. Use the [Check + "! jobs](#checkjobs) method to request information about the most recent jobs + "! associated with the calling credentials.
"!
"! **See also:** [Checking the status and retrieving the results of a "! job](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-async#job). @@ -2210,9 +2534,21 @@ constants: "! You do not lose any models, but you cannot create any more until your model "! count is below the limit.
"!
- "! **See also:** [Create a custom language + "! **Important:** Effective **31 July 2023**, all previous-generation models will + "! be removed from the service and the documentation. Most previous-generation + "! models were deprecated on 15 March 2022. You must migrate to the equivalent + "! next-generation model by 31 July 2023. For more information, see [Migrating to + "! next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + "! igrate).
+ "!
+ "! **See also:**
+ "! * [Create a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC - "! reate#createModel-language). + "! reate#createModel-language)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CREATE_LANGUAGE_MODEL | "! A `CreateLanguageModel` object that provides basic information about the new @@ -2237,20 +2573,26 @@ constants: "! models for all languages. You must use credentials for the instance of the "! service that owns a model to list information about it.
"!
- "! **See also:** [Listing custom language + "! **See also:**
+ "! * [Listing custom language "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLa - "! nguageModels#listModels-language). + "! nguageModels#listModels-language)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_LANGUAGE | "! The identifier of the language for which custom language or custom acoustic - "! models are to be returned. Omit the parameter to see all custom language or - "! custom acoustic models that are owned by the requesting credentials. (**Note:** - "! The identifier `ar-AR` is deprecated; use `ar-MS` instead.)
+ "! models are to be returned. Specify the five-character language identifier; for + "! example, specify `en-US` to see all custom language or custom acoustic models + "! that are based on US English models. Omit the parameter to see all custom + "! language or custom acoustic models that are owned by the requesting + "! credentials.
"!
"! To determine the languages for which customization is available, see [Language "! support for "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c - "! ustomization#languageSupport). + "! ustom-support). "! @parameter E_RESPONSE | "! Service return value of type T_LANGUAGE_MODELS "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -2268,9 +2610,13 @@ constants: "! credentials for the instance of the service that owns a model to list "! information about it.
"!
- "! **See also:** [Listing custom language + "! **See also:**
+ "! * [Listing custom language "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLa - "! nguageModels#listModels-language). + "! nguageModels#listModels-language)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2294,9 +2640,13 @@ constants: "! being processed. You must use credentials for the instance of the service that "! owns a model to delete it.
"!
- "! **See also:** [Deleting a custom language + "! **See also:**
+ "! * [Deleting a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLan - "! guageModels#deleteModel-language). + "! guageModels#deleteModel-language)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2325,17 +2675,33 @@ constants: "! and the current load on the service. The method returns an HTTP 200 response "! code to indicate that the training process has begun.
"!
- "! You can monitor the status of the training by using the **Get a custom language - "! model** method to poll the model's status. Use a loop to check the status - "! every 10 seconds. The method returns a `LanguageModel` object that includes - "! `status` and `progress` fields. A status of `available` means that the custom - "! model is trained and ready to use. The service cannot accept subsequent - "! training requests or requests to add new resources until the existing request - "! completes.
+ "! You can monitor the status of the training by using the [Get a custom language + "! model](#getlanguagemodel) method to poll the model's status. Use a loop to + "! check the status every 10 seconds. If you added custom words directly to a + "! custom model that is based on a next-generation model, allow for some minutes + "! of extra training time for the model.
"!
- "! **See also:** [Train the custom language + "! The method returns a `LanguageModel` object that includes `status` and + "! `progress` fields. A status of `available` means that the custom model is + "! trained and ready to use. The service cannot accept subsequent training + "! requests or requests to add new resources until the existing request completes. + "!
+ "!
+ "! For custom models that are based on improved base language models, training also + "! performs an automatic upgrade to a newer version of the base model. You do not + "! need to use the [Upgrade a custom language model](#upgradelanguagemodel) method + "! to perform the upgrade.
+ "!
+ "! **See also:**
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support)
+ "! * [Train the custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC - "! reate#trainModel-language).
+ "! reate#trainModel-language)
+ "! * [Upgrading custom language models that are based on improved next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + "! pgrade#custom-upgrade-language-ng)
"!
"! ### Training failures
"!
@@ -2355,19 +2721,27 @@ constants: "! the request. You must make the request with credentials for the instance of the "! service that owns the custom model. "! @parameter I_WORD_TYPE_TO_ADD | - "! The type of words from the custom language model's words resource on which - "! to train the model:
+ "! _For custom models that are based on previous-generation models_, the type of + "! words from the custom language model's words resource on which to train + "! the model:
"! * `all` (the default) trains the model on all new words, regardless of whether "! they were extracted from corpora or grammars or were added or modified by the "! user.
- "! * `user` trains the model only on new words that were added or modified by the - "! user directly. The model is not trained on new words extracted from corpora or - "! grammars. + "! * `user` trains the model only on custom words that were added or modified by + "! the user directly. The model is not trained on new words extracted from corpora + "! or grammars.
+ "!
+ "! _For custom models that are based on next-generation models_, the service + "! ignores the parameter. The words resource contains only custom words that the + "! user adds or modifies directly, so the parameter is unnecessary. "! @parameter I_CUSTOMIZATION_WEIGHT | "! Specifies a customization weight for the custom language model. The "! customization weight tells the service how much weight to give to words from "! the custom language model compared to those from the base model for speech - "! recognition. Specify a value between 0.0 and 1.0; the default is 0.3.
+ "! recognition. Specify a value between 0.0 and 1.0. The default value is:
+ "! * 0.3 for previous-generation models
+ "! * 0.2 for most next-generation models
+ "! * 0.1 for next-generation English and Japanese models
"!
"! The default value yields the best performance in general. Assign a higher value "! if your audio makes frequent use of OOV words from the custom model. Use @@ -2377,7 +2751,18 @@ constants: "!
"! The value that you assign is used for all recognition requests that use the "! model. You can override it for any recognition request by specifying a - "! customization weight for that request. + "! customization weight for that request.
+ "!
+ "! See [Using customization + "! weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-language + "! Use#weight). + "! @parameter I_STRICT | + "! If `false`, allows training of the custom language model to proceed as long as + "! the model contains at least one valid resource. The method returns an array of + "! `TrainingWarning` objects that lists any invalid resources. By default + "! (`true`), training of a custom language model fails (status code 400) if the + "! model contains one or more invalid resources (corpus files, grammar files, or + "! custom words). "! @parameter E_RESPONSE | "! Service return value of type T_TRAINING_RESPONSE "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -2387,6 +2772,7 @@ constants: !I_CUSTOMIZATION_ID type STRING !I_WORD_TYPE_TO_ADD type STRING default 'all' !I_CUSTOMIZATION_WEIGHT type DOUBLE optional + !I_STRICT type BOOLEAN default c_boolean_true !I_accept type string default 'application/json' exporting !E_RESPONSE type T_TRAINING_RESPONSE @@ -2400,9 +2786,13 @@ constants: "! re-created. You must use credentials for the instance of the service that owns "! a model to reset it.
"!
- "! **See also:** [Resetting a custom language + "! **See also:**
+ "! * [Resetting a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLan - "! guageModels#resetModel-language). + "! guageModels#resetModel-language)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2426,17 +2816,31 @@ constants: "!
"! The method returns an HTTP 200 response code to indicate that the upgrade "! process has begun successfully. You can monitor the status of the upgrade by - "! using the **Get a custom language model** method to poll the model's - "! status. The method returns a `LanguageModel` object that includes `status` and - "! `progress` fields. Use a loop to check the status every 10 seconds. While it is - "! being upgraded, the custom model has the status `upgrading`. When the upgrade - "! is complete, the model resumes the status that it had prior to upgrade. The - "! service cannot accept subsequent requests for the model until the upgrade - "! completes.
- "!
- "! **See also:** [Upgrading a custom language - "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customUpg - "! rade#upgradeLanguage). + "! using the [Get a custom language model](#getlanguagemodel) method to poll the + "! model's status. The method returns a `LanguageModel` object that includes + "! `status` and `progress` fields. Use a loop to check the status every 10 + "! seconds.
+ "!
+ "! While it is being upgraded, the custom model has the status `upgrading`. When + "! the upgrade is complete, the model resumes the status that it had prior to + "! upgrade. The service cannot accept subsequent requests for the model until the + "! upgrade completes.
+ "!
+ "! For custom models that are based on improved base language models, the [Train a + "! custom language model](#trainlanguagemodel) method also performs an automatic + "! upgrade to a newer version of the base model. You do not need to use the + "! upgrade method.
+ "!
+ "! **See also:**
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support)
+ "! * [Upgrading a custom language + "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-up + "! grade#custom-upgrade-language)
+ "! * [Upgrading custom language models that are based on improved next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-u + "! pgrade#custom-upgrade-language-ng) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2453,9 +2857,11 @@ constants: "!

List corpora

"! Lists information about all corpora from a custom language model. The - "! information includes the total number of words and out-of-vocabulary (OOV) - "! words, name, and status of each corpus. You must use credentials for the - "! instance of the service that owns a model to list its corpora.
+ "! information includes the name, status, and total number of words for each + "! corpus. _For custom models that are based on previous-generation models_, it + "! also includes the number of out-of-vocabulary (OOV) words from the corpus. You + "! must use credentials for the instance of the service that owns a model to list + "! its corpora.
"!
"! **See also:** [Listing corpora for a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCor @@ -2482,57 +2888,66 @@ constants: "! Use multiple requests to submit multiple corpus text files. You must use "! credentials for the instance of the service that owns a model to add a corpus "! to it. Adding a corpus does not affect the custom language model until you - "! train the model for the new data by using the **Train a custom language model** - "! method.
+ "! train the model for the new data by using the [Train a custom language + "! model](#trainlanguagemodel) method.
"!
"! Submit a plain text file that contains sample sentences from the domain of - "! interest to enable the service to extract words in context. The more sentences - "! you add that represent the context in which speakers use words from the domain, - "! the better the service's recognition accuracy.
+ "! interest to enable the service to parse the words in context. The more + "! sentences you add that represent the context in which speakers use words from + "! the domain, the better the service's recognition accuracy.
"!
"! The call returns an HTTP 201 response code if the corpus is valid. The service - "! then asynchronously processes the contents of the corpus and automatically - "! extracts new words that it finds. This operation can take on the order of - "! minutes to complete depending on the total number of words and the number of - "! new words in the corpus, as well as the current load on the service. You cannot - "! submit requests to add additional resources to the custom model or to train the - "! model until the service's analysis of the corpus for the current request - "! completes. Use the **List a corpus** method to check the status of the + "! then asynchronously processes and automatically extracts data from the contents + "! of the corpus. This operation can take on the order of minutes to complete + "! depending on the current load on the service, the total number of words in the + "! corpus, and, _for custom models that are based on previous-generation models_, + "! the number of new (out-of-vocabulary) words in the corpus. You cannot submit + "! requests to add additional resources to the custom model or to train the model + "! until the service's analysis of the corpus for the current request + "! completes. Use the [Get a corpus](#getcorpus) method to check the status of the "! analysis.
"!
- "! The service auto-populates the model's words resource with words from the - "! corpus that are not found in its base vocabulary. These words are referred to - "! as out-of-vocabulary (OOV) words. After adding a corpus, you must validate the + "! _For custom models that are based on previous-generation models_, the service + "! auto-populates the model's words resource with words from the corpus that + "! are not found in its base vocabulary. These words are referred to as + "! out-of-vocabulary (OOV) words. After adding a corpus, you must validate the "! words resource to ensure that each OOV word's definition is complete and - "! valid. You can use the **List custom words** method to examine the words - "! resource. You can use other words method to eliminate typos and modify how - "! words are pronounced as needed.
+ "! valid. You can use the [List custom words](#listwords) method to examine the + "! words resource. You can use other words method to eliminate typos and modify + "! how words are pronounced and displayed as needed.
"!
"! To add a corpus file that has the same name as an existing corpus, set the "! `allow_overwrite` parameter to `true`; otherwise, the request fails. "! Overwriting an existing corpus causes the service to process the corpus text - "! file and extract OOV words anew. Before doing so, it removes any OOV words + "! file and extract its data anew. _For a custom model that is based on a + "! previous-generation model_, the service first removes any OOV words that are "! associated with the existing corpus from the model's words resource unless "! they were also added by another corpus or grammar, or they have been modified - "! in some way with the **Add custom words** or **Add a custom word** method. - "!
+ "! in some way with the [Add custom words](#addwords) or [Add a custom + "! word](#addword) method.
"!
"! The service limits the overall amount of data that you can add to a custom model - "! to a maximum of 10 million total words from all sources combined. Also, you can - "! add no more than 90 thousand custom (OOV) words to a model. This includes words - "! that the service extracts from corpora and grammars, and words that you add - "! directly.
+ "! to a maximum of 10 million total words from all sources combined. _For a custom + "! model that is based on a previous-generation model_, you can add no more than + "! 90 thousand custom (OOV) words to a model. This includes words that the service + "! extracts from corpora and grammars, and words that you add directly.
"!
"! **See also:**
"! * [Add a corpus to the custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC "! reate#addCorpus)
- "! * [Working with - "! corpora](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpora - "! Words#workingCorpora)
- "! * [Validating a words - "! resource](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - "! aWords#validateModel) + "! * [Working with corpora for previous-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords#workingCorpora)
+ "! * [Working with corpora for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords-ng#workingCorpora-ng)
+ "! * [Validating a words resource for previous-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords#validateModel)
+ "! * [Validating a words resource for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords-ng#validateModel-ng) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2560,10 +2975,10 @@ constants: "! encoding if it encounters non-ASCII characters.
"!
"! Make sure that you know the character encoding of the file. You must use that - "! encoding when working with the words in the custom language model. For more - "! information, see [Character - "! encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - "! aWords#charEncoding).
+ "! same encoding when working with the words in the custom language model. For + "! more information, see [Character encoding for custom + "! words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor + "! ds#charEncoding).
"!
"! With the `curl` command, use the `--data-binary` option to upload the file for "! the request. @@ -2587,9 +3002,11 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

Get a corpus

"! Gets information about a corpus from a custom language model. The information - "! includes the total number of words and out-of-vocabulary (OOV) words, name, and - "! status of the corpus. You must use credentials for the instance of the service - "! that owns a model to list its corpora.
+ "! includes the name, status, and total number of words for the corpus. _For + "! custom models that are based on previous-generation models_, it also includes + "! the number of out-of-vocabulary (OOV) words from the corpus. You must use + "! credentials for the instance of the service that owns a model to list its + "! corpora.
"!
"! **See also:** [Listing corpora for a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCor @@ -2615,14 +3032,18 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . "!

Delete a corpus

- "! Deletes an existing corpus from a custom language model. The service removes any - "! out-of-vocabulary (OOV) words that are associated with the corpus from the - "! custom model's words resource unless they were also added by another - "! corpus or grammar, or they were modified in some way with the **Add custom - "! words** or **Add a custom word** method. Removing a corpus does not affect the - "! custom model until you train the model with the **Train a custom language - "! model** method. You must use credentials for the instance of the service that - "! owns a model to delete its corpora.
+ "! Deletes an existing corpus from a custom language model. Removing a corpus does + "! not affect the custom model until you train the model with the [Train a custom + "! language model](#trainlanguagemodel) method. You must use credentials for the + "! instance of the service that owns a model to delete its corpora.
+ "!
+ "! _For custom models that are based on previous-generation models_, the service + "! removes any out-of-vocabulary (OOV) words that are associated with the corpus + "! from the custom model's words resource unless they were also added by + "! another corpus or grammar, or they were modified in some way with the [Add + "! custom words](#addwords) or [Add a custom word](#addword) method.
+ "!
+ "!
"!
"! **See also:** [Deleting a corpus from a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCor @@ -2647,12 +3068,16 @@ constants: "!

List custom words

"! Lists information about custom words from a custom language model. You can list "! all words from the custom model's words resource, only custom words that - "! were added or modified by the user, or only out-of-vocabulary (OOV) words that - "! were extracted from corpora or are recognized by grammars. You can also - "! indicate the order in which the service is to return words; by default, the - "! service lists words in ascending alphabetical order. You must use credentials - "! for the instance of the service that owns a model to list information about its - "! words.
+ "! were added or modified by the user, or, _for a custom model that is based on a + "! previous-generation model_, only out-of-vocabulary (OOV) words that were + "! extracted from corpora or are recognized by grammars. _For a custom model that + "! is based on a next-generation model_, you can list all words or only those + "! words that were added directly by a user, which return the same results.
+ "!
+ "! You can also indicate the order in which the service is to return words; by + "! default, the service lists words in ascending alphabetical order. You must use + "! credentials for the instance of the service that owns a model to list + "! information about its words.
"!
"! **See also:** [Listing words from a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor @@ -2669,7 +3094,11 @@ constants: "! * `user` shows only custom words that were added or modified by the user "! directly.
"! * `corpora` shows only OOV that were extracted from corpora.
- "! * `grammars` shows only OOV words that are recognized by grammars. + "! * `grammars` shows only OOV words that are recognized by grammars.
+ "!
+ "! _For a custom model that is based on a next-generation model_, only `all` and + "! `user` apply. Both options return the same results. Words from other sources + "! are not added to custom models that are based on next-generation models. "! @parameter I_SORT | "! Indicates the order in which the words are to be listed, `alphabetical` or by "! `count`. You can prepend an optional `+` or `-` to an argument to indicate @@ -2694,37 +3123,42 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . "!

Add custom words

- "! Adds one or more custom words to a custom language model. The service populates - "! the words resource for a custom model with out-of-vocabulary (OOV) words from - "! each corpus or grammar that is added to the model. You can use this method to - "! add additional words or to modify existing words in the words resource. The - "! words resource for a model can contain a maximum of 90 thousand custom (OOV) - "! words. This includes words that the service extracts from corpora and grammars - "! and words that you add directly.
+ "! Adds one or more custom words to a custom language model. You can use this + "! method to add words or to modify existing words in a custom model's words + "! resource. _For custom models that are based on previous-generation models_, the + "! service populates the words resource for a custom model with out-of-vocabulary + "! (OOV) words from each corpus or grammar that is added to the model. You can use + "! this method to modify OOV words in the model's words resource.
+ "!
+ "! _For a custom model that is based on a previous-generation model_, the words + "! resource for a model can contain a maximum of 90 thousand custom (OOV) words. + "! This includes words that the service extracts from corpora and grammars and + "! words that you add directly.
"!
"! You must use credentials for the instance of the service that owns a model to "! add or modify custom words for the model. Adding or modifying custom words does "! not affect the custom model until you train the model for the new data by using - "! the **Train a custom language model** method.
+ "! the [Train a custom language model](#trainlanguagemodel) method.
"!
"! You add custom words by providing a `CustomWords` object, which is an array of - "! `CustomWord` objects, one per word. You must use the object's `word` - "! parameter to identify the word that is to be added. You can also provide one or - "! both of the optional `sounds_like` and `display_as` fields for each word.
+ "! `CustomWord` objects, one per word. Use the object's `word` parameter to + "! identify the word that is to be added. You can also provide one or both of the + "! optional `display_as` or `sounds_like` fields for each word.
+ "! * The `display_as` field provides a different way of spelling the word in a + "! transcript. Use the parameter when you want the word to appear different from + "! its usual representation or from its spelling in training data. For example, + "! you might indicate that the word `IBM` is to be displayed as `IBM™`. + "!
"! * The `sounds_like` field provides an array of one or more pronunciations for "! the word. Use the parameter to specify how the word can be pronounced by users. "! Use the parameter for words that are difficult to pronounce, foreign words, "! acronyms, and so on. For example, you might specify that the word `IEEE` can - "! sound like `i triple e`. You can specify a maximum of five sounds-like - "! pronunciations for a word. If you omit the `sounds_like` field, the service + "! sound like `I triple E`. You can specify a maximum of five sounds-like + "! pronunciations for a word. _For a custom model that is based on a + "! previous-generation model_, if you omit the `sounds_like` field, the service "! attempts to set the field to its pronunciation of the word. It cannot generate "! a pronunciation for all words, so you must review the word's definition to - "! ensure that it is complete and valid.
- "! * The `display_as` field provides a different way of spelling the word in a - "! transcript. Use the parameter when you want the word to appear different from - "! its usual representation or from its spelling in training data. For example, - "! you might indicate that the word `IBM(trademark)` is to be displayed as - "! `IBM™`.
+ "! ensure that it is complete and valid.
"!
"! If you add a custom word that already exists in the words resource for the "! custom model, the new definition overwrites the existing data for the word. If @@ -2737,29 +3171,35 @@ constants: "! number of new words that you add but is generally faster than adding a corpus "! or grammar.
"!
- "! You can monitor the status of the request by using the **List a custom language - "! model** method to poll the model's status. Use a loop to check the status - "! every 10 seconds. The method returns a `Customization` object that includes a - "! `status` field. A status of `ready` means that the words have been added to the - "! custom model. The service cannot accept requests to add new data or to train - "! the model until the existing request completes.
+ "! You can monitor the status of the request by using the [Get a custom language + "! model](#getlanguagemodel) method to poll the model's status. Use a loop to + "! check the status every 10 seconds. The method returns a `Customization` object + "! that includes a `status` field. A status of `ready` means that the words have + "! been added to the custom model. The service cannot accept requests to add new + "! data or to train the model until the existing request completes.
"!
- "! You can use the **List custom words** or **List a custom word** method to review - "! the words that you add. Words with an invalid `sounds_like` field include an - "! `error` field that describes the problem. You can use other words-related - "! methods to correct errors, eliminate typos, and modify how words are pronounced - "! as needed.
+ "! You can use the [List custom words](#listwords) or [Get a custom word](#getword) + "! method to review the words that you add. Words with an invalid `sounds_like` + "! field include an `error` field that describes the problem. You can use other + "! words-related methods to correct errors, eliminate typos, and modify how words + "! are pronounced as needed.
"!
"! **See also:**
"! * [Add words to the custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC "! reate#addWords)
- "! * [Working with custom - "! words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWo - "! rds#workingWords)
- "! * [Validating a words - "! resource](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - "! aWords#validateModel) + "! * [Working with custom words for previous-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords#workingWords)
+ "! * [Working with custom words for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords-ng#workingWords-ng)
+ "! * [Validating a words resource for previous-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords#validateModel)
+ "! * [Validating a words resource for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords-ng#validateModel-ng) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2779,53 +3219,64 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . "!

Add a custom word

- "! Adds a custom word to a custom language model. The service populates the words + "! Adds a custom word to a custom language model. You can use this method to add a + "! word or to modify an existing word in the words resource. _For custom models + "! that are based on previous-generation models_, the service populates the words "! resource for a custom model with out-of-vocabulary (OOV) words from each corpus - "! or grammar that is added to the model. You can use this method to add a word or - "! to modify an existing word in the words resource. The words resource for a - "! model can contain a maximum of 90 thousand custom (OOV) words. This includes - "! words that the service extracts from corpora and grammars and words that you - "! add directly.
+ "! or grammar that is added to the model. You can use this method to modify OOV + "! words in the model's words resource.
+ "!
+ "! _For a custom model that is based on a previous-generation models_, the words + "! resource for a model can contain a maximum of 90 thousand custom (OOV) words. + "! This includes words that the service extracts from corpora and grammars and + "! words that you add directly.
"!
"! You must use credentials for the instance of the service that owns a model to "! add or modify a custom word for the model. Adding or modifying a custom word "! does not affect the custom model until you train the model for the new data by - "! using the **Train a custom language model** method.
+ "! using the [Train a custom language model](#trainlanguagemodel) method.
"!
"! Use the `word_name` parameter to specify the custom word that is to be added or "! modified. Use the `CustomWord` object to provide one or both of the optional - "! `sounds_like` and `display_as` fields for the word.
+ "! `display_as` or `sounds_like` fields for the word.
+ "! * The `display_as` field provides a different way of spelling the word in a + "! transcript. Use the parameter when you want the word to appear different from + "! its usual representation or from its spelling in training data. For example, + "! you might indicate that the word `IBM` is to be displayed as `IBM™`. + "!
"! * The `sounds_like` field provides an array of one or more pronunciations for "! the word. Use the parameter to specify how the word can be pronounced by users. "! Use the parameter for words that are difficult to pronounce, foreign words, "! acronyms, and so on. For example, you might specify that the word `IEEE` can "! sound like `i triple e`. You can specify a maximum of five sounds-like - "! pronunciations for a word. If you omit the `sounds_like` field, the service + "! pronunciations for a word. _For custom models that are based on + "! previous-generation models_, if you omit the `sounds_like` field, the service "! attempts to set the field to its pronunciation of the word. It cannot generate "! a pronunciation for all words, so you must review the word's definition to - "! ensure that it is complete and valid.
- "! * The `display_as` field provides a different way of spelling the word in a - "! transcript. Use the parameter when you want the word to appear different from - "! its usual representation or from its spelling in training data. For example, - "! you might indicate that the word `IBM(trademark)` is to be displayed as - "! `IBM™`.
+ "! ensure that it is complete and valid.
"!
"! If you add a custom word that already exists in the words resource for the "! custom model, the new definition overwrites the existing data for the word. If "! the service encounters an error, it does not add the word to the words - "! resource. Use the **List a custom word** method to review the word that you - "! add.
+ "! resource. Use the [Get a custom word](#getword) method to review the word that + "! you add.
"!
"! **See also:**
"! * [Add words to the custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageC "! reate#addWords)
- "! * [Working with custom - "! words](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWo - "! rds#workingWords)
- "! * [Validating a words - "! resource](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corpor - "! aWords#validateModel) + "! * [Working with custom words for previous-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords#workingWords)
+ "! * [Working with custom words for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords-ng#workingWords-ng)
+ "! * [Validating a words resource for previous-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords#validateModel)
+ "! * [Validating a words resource for next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaW + "! ords-ng#validateModel-ng) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2889,11 +3340,11 @@ constants: "! Deletes a custom word from a custom language model. You can remove any word that "! you added to the custom model's words resource via any means. However, if "! the word also exists in the service's base vocabulary, the service removes - "! only the custom pronunciation for the word; the word remains in the base - "! vocabulary. Removing a custom word does not affect the custom model until you - "! train the model with the **Train a custom language model** method. You must use - "! credentials for the instance of the service that owns a model to delete its - "! words.
+ "! the word only from the words resource; the word remains in the base vocabulary. + "! Removing a custom word does not affect the custom model until you train the + "! model with the [Train a custom language model](#trainlanguagemodel) method. You + "! must use credentials for the instance of the service that owns a model to + "! delete its words.
"!
"! **See also:** [Deleting a word from a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWor @@ -2920,14 +3371,19 @@ constants: ZCX_IBMC_SERVICE_EXCEPTION . "!

List grammars

- "! Lists information about all grammars from a custom language model. The - "! information includes the total number of out-of-vocabulary (OOV) words, name, - "! and status of each grammar. You must use credentials for the instance of the - "! service that owns a model to list its grammars.
+ "! Lists information about all grammars from a custom language model. For each + "! grammar, the information includes the name, status, and (for grammars that are + "! based on previous-generation models) the total number of out-of-vocabulary + "! (OOV) words. You must use credentials for the instance of the service that owns + "! a model to list its grammars.
"!
- "! **See also:** [Listing grammars from a custom language + "! **See also:**
+ "! * [Listing grammars from a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageGra - "! mmars#listGrammars). + "! mmars#listGrammars)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -2951,7 +3407,7 @@ constants: "! multiple grammar files. You must use credentials for the instance of the "! service that owns a model to add a grammar to it. Adding a grammar does not "! affect the custom language model until you train the model for the new data by - "! using the **Train a custom language model** method.
+ "! using the [Train a custom language model](#trainlanguagemodel) method.
"!
"! The call returns an HTTP 201 response code if the grammar is valid. The service "! then asynchronously processes the contents of the grammar and automatically @@ -2960,14 +3416,17 @@ constants: "! well as the current load on the service. You cannot submit requests to add "! additional resources to the custom model or to train the model until the "! service's analysis of the grammar for the current request completes. Use - "! the **Get a grammar** method to check the status of the analysis.
+ "! the [Get a grammar](#getgrammar) method to check the status of the analysis. + "!
"!
- "! The service populates the model's words resource with any word that is - "! recognized by the grammar that is not found in the model's base - "! vocabulary. These are referred to as out-of-vocabulary (OOV) words. You can use - "! the **List custom words** method to examine the words resource and use other + "! _For grammars that are based on previous-generation models,_ the service + "! populates the model's words resource with any word that is recognized by + "! the grammar that is not found in the model's base vocabulary. These are + "! referred to as out-of-vocabulary (OOV) words. You can use the [List custom + "! words](#listwords) method to examine the words resource and use other "! words-related methods to eliminate typos and modify how words are pronounced as - "! needed.
+ "! needed. _For grammars that are based on next-generation models,_ the service + "! extracts no OOV words from the grammars.
"!
"! To add a grammar that has the same name as an existing grammar, set the "! `allow_overwrite` parameter to `true`; otherwise, the request fails. @@ -2975,13 +3434,14 @@ constants: "! and extract OOV words anew. Before doing so, it removes any OOV words "! associated with the existing grammar from the model's words resource "! unless they were also added by another resource or they have been modified in - "! some way with the **Add custom words** or **Add a custom word** method.
+ "! some way with the [Add custom words](#addwords) or [Add a custom + "! word](#addword) method.
"!
- "! The service limits the overall amount of data that you can add to a custom model - "! to a maximum of 10 million total words from all sources combined. Also, you can - "! add no more than 90 thousand OOV words to a model. This includes words that the - "! service extracts from corpora and grammars and words that you add directly. - "!
+ "! _For grammars that are based on previous-generation models,_ the service limits + "! the overall amount of data that you can add to a custom model to a maximum of + "! 10 million total words from all sources combined. Also, you can add no more + "! than 90 thousand OOV words to a model. This includes words that the service + "! extracts from corpora and grammars and words that you add directly.
"!
"! **See also:**
"! * [Understanding @@ -2989,7 +3449,10 @@ constants: "! rUnderstand#grammarUnderstand)
"! * [Add a grammar to the custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammarAd - "! d#addGrammar) + "! d#addGrammar)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -3037,21 +3500,26 @@ constants: importing !I_CUSTOMIZATION_ID type STRING !I_GRAMMAR_NAME type STRING - !I_GRAMMAR_FILE type STRING + !I_GRAMMAR_FILE type FILE !I_CONTENT_TYPE type STRING default 'application/srgs' !I_ALLOW_OVERWRITE type BOOLEAN default c_boolean_false !I_accept type string default 'application/json' raising ZCX_IBMC_SERVICE_EXCEPTION . "!

Get a grammar

- "! Gets information about a grammar from a custom language model. The information - "! includes the total number of out-of-vocabulary (OOV) words, name, and status of - "! the grammar. You must use credentials for the instance of the service that owns - "! a model to list its grammars.
+ "! Gets information about a grammar from a custom language model. For each grammar, + "! the information includes the name, status, and (for grammars that are based on + "! previous-generation models) the total number of out-of-vocabulary (OOV) words. + "! You must use credentials for the instance of the service that owns a model to + "! list its grammars.
"!
- "! **See also:** [Listing grammars from a custom language + "! **See also:**
+ "! * [Listing grammars from a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageGra - "! mmars#listGrammars). + "! mmars#listGrammars)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -3073,18 +3541,23 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . "!

Delete a grammar

- "! Deletes an existing grammar from a custom language model. The service removes - "! any out-of-vocabulary (OOV) words associated with the grammar from the custom - "! model's words resource unless they were also added by another resource or - "! they were modified in some way with the **Add custom words** or **Add a custom - "! word** method. Removing a grammar does not affect the custom model until you - "! train the model with the **Train a custom language model** method. You must use - "! credentials for the instance of the service that owns a model to delete its - "! grammar.
- "!
- "! **See also:** [Deleting a grammar from a custom language + "! Deletes an existing grammar from a custom language model. _For grammars that are + "! based on previous-generation models,_ the service removes any out-of-vocabulary + "! (OOV) words associated with the grammar from the custom model's words + "! resource unless they were also added by another resource or they were modified + "! in some way with the [Add custom words](#addwords) or [Add a custom + "! word](#addword) method. Removing a grammar does not affect the custom model + "! until you train the model with the [Train a custom language + "! model](#trainlanguagemodel) method. You must use credentials for the instance + "! of the service that owns a model to delete its grammar.
+ "!
+ "! **See also:**
+ "! * [Deleting a grammar from a custom language "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageGra - "! mmars#deleteGrammar). + "! mmars#deleteGrammar)
+ "! * [Language support for + "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c + "! ustom-support) "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom language model that is to be used for @@ -3113,6 +3586,18 @@ constants: "! You do not lose any models, but you cannot create any more until your model "! count is below the limit.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
+ "! **Important:** Effective **31 July 2023**, all previous-generation models will + "! be removed from the service and the documentation. Most previous-generation + "! models were deprecated on 15 March 2022. You must migrate to the equivalent + "! next-generation model by 31 July 2023. For more information, see [Migrating to + "! next-generation + "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-m + "! igrate).
+ "!
"! **See also:** [Create a custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic# "! createModel-acoustic). @@ -3140,20 +3625,26 @@ constants: "! models for all languages. You must use credentials for the instance of the "! service that owns a model to list information about it.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Listing custom acoustic "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAc "! ousticModels#listModels-acoustic). "! "! @parameter I_LANGUAGE | "! The identifier of the language for which custom language or custom acoustic - "! models are to be returned. Omit the parameter to see all custom language or - "! custom acoustic models that are owned by the requesting credentials. (**Note:** - "! The identifier `ar-AR` is deprecated; use `ar-MS` instead.)
+ "! models are to be returned. Specify the five-character language identifier; for + "! example, specify `en-US` to see all custom language or custom acoustic models + "! that are based on US English models. Omit the parameter to see all custom + "! language or custom acoustic models that are owned by the requesting + "! credentials.
"!
"! To determine the languages for which customization is available, see [Language "! support for "! customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-c - "! ustomization#languageSupport). + "! ustom-support). "! @parameter E_RESPONSE | "! Service return value of type T_ACOUSTIC_MODELS "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -3171,6 +3662,10 @@ constants: "! credentials for the instance of the service that owns a model to list "! information about it.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Listing custom acoustic "! models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAc "! ousticModels#listModels-acoustic). @@ -3197,6 +3692,10 @@ constants: "! being processed. You must use credentials for the instance of the service that "! owns a model to delete it.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Deleting a custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAco "! usticModels#deleteModel-acoustic). @@ -3230,14 +3729,14 @@ constants: "! of 2 hours of audio. The method returns an HTTP 200 response code to indicate "! that the training process has begun.
"!
- "! You can monitor the status of the training by using the **Get a custom acoustic - "! model** method to poll the model's status. Use a loop to check the status - "! once a minute. The method returns an `AcousticModel` object that includes - "! `status` and `progress` fields. A status of `available` indicates that the - "! custom model is trained and ready to use. The service cannot train a model - "! while it is handling another request for the model. The service cannot accept - "! subsequent training requests, or requests to add new audio resources, until the - "! existing training request completes.
+ "! You can monitor the status of the training by using the [Get a custom acoustic + "! model](#getacousticmodel) method to poll the model's status. Use a loop to + "! check the status once a minute. The method returns an `AcousticModel` object + "! that includes `status` and `progress` fields. A status of `available` indicates + "! that the custom model is trained and ready to use. The service cannot train a + "! model while it is handling another request for the model. The service cannot + "! accept subsequent training requests, or requests to add new audio resources, + "! until the existing training request completes.
"!
"! You can use the optional `custom_language_model_id` parameter to specify the "! GUID of a separately created custom language model that is to be used during @@ -3248,6 +3747,10 @@ constants: "! models must be based on the same version of the same base model, and the custom "! language model must be fully trained and available.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:**
"! * [Train the custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic# @@ -3262,8 +3765,15 @@ constants: "! * The service is currently handling another request for the custom model, such "! as another training request or a request to add audio resources to the "! model.
- "! * The custom model contains less than 10 minutes or more than 200 hours of audio - "! data.
+ "! * The custom model contains less than 10 minutes of audio that includes speech, + "! not silence.
+ "! * The custom model contains more than 50 hours of audio (for IBM Cloud) or more + "! that 200 hours of audio (for IBM Cloud Pak for Data). **Note:** For IBM Cloud, + "! the maximum hours of audio for a custom acoustic model was reduced from 200 to + "! 50 hours in August and September 2022. For more information, see [Maximum hours + "! of + "! audio](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audioReso + "! urces#audioMaximum).
"! * You passed a custom language model with the `custom_language_model_id` query "! parameter that is not in the available state. A custom language model must be "! fully trained and available to be used to train a custom acoustic model.
@@ -3288,6 +3798,12 @@ constants: "! as the custom acoustic model, and the custom language model must be fully "! trained and available. The credentials specified with the request must own both "! custom models. + "! @parameter I_STRICT | + "! If `false`, allows training of the custom acoustic model to proceed as long as + "! the model contains at least one valid audio resource. The method returns an + "! array of `TrainingWarning` objects that lists any invalid resources. By default + "! (`true`), training of a custom acoustic model fails (status code 400) if the + "! model contains one or more invalid audio resources. "! @parameter E_RESPONSE | "! Service return value of type T_TRAINING_RESPONSE "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -3296,6 +3812,7 @@ constants: importing !I_CUSTOMIZATION_ID type STRING !I_CUSTOM_LANGUAGE_MODEL_ID type STRING optional + !I_STRICT type BOOLEAN default c_boolean_true !I_accept type string default 'application/json' exporting !E_RESPONSE type T_TRAINING_RESPONSE @@ -3311,6 +3828,10 @@ constants: "! model until the existing reset request completes. You must use credentials for "! the instance of the service that owns a model to reset it.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Resetting a custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAco "! usticModels#resetModel-acoustic). @@ -3339,14 +3860,16 @@ constants: "!
"! The method returns an HTTP 200 response code to indicate that the upgrade "! process has begun successfully. You can monitor the status of the upgrade by - "! using the **Get a custom acoustic model** method to poll the model's - "! status. The method returns an `AcousticModel` object that includes `status` and - "! `progress` fields. Use a loop to check the status once a minute. While it is - "! being upgraded, the custom model has the status `upgrading`. When the upgrade - "! is complete, the model resumes the status that it had prior to upgrade. The - "! service cannot upgrade a model while it is handling another request for the - "! model. The service cannot accept subsequent requests for the model until the - "! existing upgrade request completes.
+ "! using the [Get a custom acoustic model](#getacousticmodel) method to poll the + "! model's status. The method returns an `AcousticModel` object that includes + "! `status` and `progress` fields. Use a loop to check the status once a minute. + "!
+ "!
+ "! While it is being upgraded, the custom model has the status `upgrading`. When + "! the upgrade is complete, the model resumes the status that it had prior to + "! upgrade. The service cannot upgrade a model while it is handling another + "! request for the model. The service cannot accept subsequent requests for the + "! model until the existing upgrade request completes.
"!
"! If the custom acoustic model was trained with a separately created custom "! language model, you must use the `custom_language_model_id` parameter to @@ -3355,9 +3878,13 @@ constants: "! parameter if the custom acoustic model was not trained with a custom language "! model.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Upgrading a custom acoustic - "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customUpg - "! rade#upgradeAcoustic). + "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-up + "! grade#custom-upgrade-acoustic). "! "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of the custom acoustic model that is to be used for @@ -3375,8 +3902,8 @@ constants: "! the upgrade of a custom acoustic model that is trained with a custom language "! model, and only if you receive a 400 response code and the message `No input "! data modified since last training`. See [Upgrading a custom acoustic - "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customUpg - "! rade#upgradeAcoustic). + "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-up + "! grade#custom-upgrade-acoustic). "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! methods UPGRADE_ACOUSTIC_MODEL @@ -3397,6 +3924,10 @@ constants: "! credentials for the instance of the service that owns a model to list its audio "! resources.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Listing audio resources for a custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAud "! io#listAudio). @@ -3422,8 +3953,8 @@ constants: "! reflects the acoustic characteristics of the audio that you plan to transcribe. "! You must use credentials for the instance of the service that owns a model to "! add an audio resource to it. Adding audio data does not affect the custom - "! acoustic model until you train the model for the new data by using the **Train - "! a custom acoustic model** method.
+ "! acoustic model until you train the model for the new data by using the [Train a + "! custom acoustic model](#trainacousticmodel) method.
"!
"! You can add individual audio files or an archive file that contains multiple "! audio files. Adding multiple audio files via a single archive file is @@ -3434,11 +3965,17 @@ constants: "! You can use this method to add any number of audio resources to a custom model "! by calling the method once for each audio or archive file. You can add multiple "! different audio resources at the same time. You must add a minimum of 10 - "! minutes and a maximum of 200 hours of audio that includes speech, not just - "! silence, to a custom acoustic model before you can train it. No audio resource, - "! audio- or archive-type, can be larger than 100 MB. To add an audio resource - "! that has the same name as an existing audio resource, set the `allow_overwrite` - "! parameter to `true`; otherwise, the request fails.
+ "! minutes of audio that includes speech, not just silence, to a custom acoustic + "! model before you can train it. No audio resource, audio- or archive-type, can + "! be larger than 100 MB. To add an audio resource that has the same name as an + "! existing audio resource, set the `allow_overwrite` parameter to `true`; + "! otherwise, the request fails. A custom model can contain no more than 50 hours + "! of audio (for IBM Cloud) or 200 hours of audio (for IBM Cloud Pak for Data). + "! **Note:** For IBM Cloud, the maximum hours of audio for a custom acoustic model + "! was reduced from 200 to 50 hours in August and September 2022. For more + "! information, see [Maximum hours of + "! audio](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audioReso + "! urces#audioMaximum).
"!
"! The method is asynchronous. It can take several seconds or minutes to complete "! depending on the duration of the audio and, in the case of an archive file, the @@ -3450,10 +3987,14 @@ constants: "! for current requests completes.
"!
"! To determine the status of the service's analysis of the audio, use the - "! **Get an audio resource** method to poll the status of the audio. The method - "! accepts the customization ID of the custom model and the name of the audio - "! resource, and it returns the status of the resource. Use a loop to check the - "! status of the audio every few seconds until it becomes `ok`.
+ "! [Get an audio resource](#getaudio) method to poll the status of the audio. The + "! method accepts the customization ID of the custom model and the name of the + "! audio resource, and it returns the status of the resource. Use a loop to check + "! the status of the audio every few seconds until it becomes `ok`.
+ "!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
"!
"! **See also:** [Add audio to the custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic# @@ -3491,9 +4032,9 @@ constants: "! appropriate rate. If the sampling rate of the audio is lower than the minimum "! required rate, the service labels the audio file as `invalid`.
"!
- "! **See also:** [Audio + "! **See also:** [Supported audio "! formats](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-f - "! ormats#audio-formats).
+ "! ormats).
"!
"! ### Content types for archive-type resources
"!
@@ -3556,7 +4097,7 @@ constants: "! information, see **Content types for archive-type resources** in the method "! description. "! @parameter I_CONTAINED_CONTENT_TYPE | - "! **For an archive-type resource,** specify the format of the audio files that are + "! _For an archive-type resource_, specify the format of the audio files that are "! contained in the archive file if they are of type `audio/alaw`, `audio/basic`, "! `audio/l16`, or `audio/mulaw`. Include the `rate`, `channels`, and `endianness` "! parameters where necessary. In this case, all audio files that are contained in @@ -3570,7 +4111,7 @@ constants: "! speech recognition. For more information, see **Content types for audio-type "! resources** in the method description.
"!
- "! **For an audio-type resource,** omit the header. + "! _For an audio-type resource_, omit the header. "! @parameter I_ALLOW_OVERWRITE | "! If `true`, the specified audio resource overwrites an existing audio resource "! with the same name. If `false`, the request fails if an audio resource with the @@ -3594,24 +4135,28 @@ constants: "! method returns an `AudioListing` object whose fields depend on the type of "! audio resource that you specify with the method's `audio_name` "! parameter:
- "! * **For an audio-type resource,** the object's fields match those of an + "! * _For an audio-type resource_, the object's fields match those of an "! `AudioResource` object: `duration`, `name`, `details`, and `status`.
- "! * **For an archive-type resource,** the object includes a `container` field - "! whose fields match those of an `AudioResource` object. It also includes an - "! `audio` field, which contains an array of `AudioResource` objects that provides + "! * _For an archive-type resource_, the object includes a `container` field whose + "! fields match those of an `AudioResource` object. It also includes an `audio` + "! field, which contains an array of `AudioResource` objects that provides "! information about the audio files that are contained in the archive.
"!
"! The information includes the status of the specified audio resource. The status "! is important for checking the service's analysis of a resource that you "! add to the custom model.
- "! * For an audio-type resource, the `status` field is located in the + "! * _For an audio-type resource_, the `status` field is located in the "! `AudioListing` object.
- "! * For an archive-type resource, the `status` field is located in the + "! * _For an archive-type resource_, the `status` field is located in the "! `AudioResource` object that is returned in the `container` field.
"!
"! You must use credentials for the instance of the service that owns a model to "! list its audio resources.
"!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. + "!
+ "!
"! **See also:** [Listing audio resources for a custom acoustic "! model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageAud "! io#listAudio). @@ -3641,10 +4186,14 @@ constants: "! does not allow deletion of individual files from an archive resource.
"!
"! Removing an audio resource does not affect the custom model until you train the - "! model on its updated data by using the **Train a custom acoustic model** - "! method. You can delete an existing audio resource from a model while a - "! different resource is being added to the model. You must use credentials for - "! the instance of the service that owns a model to delete its audio resources. + "! model on its updated data by using the [Train a custom acoustic + "! model](#trainacousticmodel) method. You can delete an existing audio resource + "! from a model while a different resource is being added to the model. You must + "! use credentials for the instance of the service that owns a model to delete its + "! audio resources.
+ "!
+ "! **Note:** Acoustic model customization is supported only for use with + "! previous-generation models. It is not supported for next-generation models. "!
"!
"! **See also:** [Deleting an audio resource from a custom acoustic @@ -3762,7 +4311,7 @@ endmethod. * +-------------------------------------------------------------------------------------- method get_sdk_version_date. - e_sdk_version_date = '20210312144441'. + e_sdk_version_date = '20231212104238'. endmethod. @@ -3873,24 +4422,25 @@ endmethod. * | [--->] I_ACOUSTIC_CUSTOMIZATION_ID TYPE STRING(optional) * | [--->] I_BASE_MODEL_VERSION TYPE STRING(optional) * | [--->] I_CUSTOMIZATION_WEIGHT TYPE DOUBLE(optional) -* | [--->] I_INACTIVITY_TIMEOUT TYPE INTEGER(optional) +* | [--->] I_INACTIVITY_TIMEOUT TYPE INTEGER (default =30) * | [--->] I_KEYWORDS TYPE TT_STRING(optional) * | [--->] I_KEYWORDS_THRESHOLD TYPE FLOAT(optional) -* | [--->] I_MAX_ALTERNATIVES TYPE INTEGER(optional) +* | [--->] I_MAX_ALTERNATIVES TYPE INTEGER (default =1) * | [--->] I_WORD_ALTERNATIVES_THRESHOLD TYPE FLOAT(optional) * | [--->] I_WORD_CONFIDENCE TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_TIMESTAMPS TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_PROFANITY_FILTER TYPE BOOLEAN (default =c_boolean_true) * | [--->] I_SMART_FORMATTING TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SPEAKER_LABELS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_CUSTOMIZATION_ID TYPE STRING(optional) * | [--->] I_GRAMMAR_NAME TYPE STRING(optional) * | [--->] I_REDACTION TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_AUDIO_METRICS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_END_OF_PHRASE_SILENCE_TIME TYPE DOUBLE(optional) +* | [--->] I_END_OF_PHRASE_SILENCE_TIME TYPE DOUBLE (default ='0.8') * | [--->] I_SPLT_TRNSCRPT_AT_PHRASE_END TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_SPEECH_DETECTOR_SENSITIVITY TYPE FLOAT(optional) -* | [--->] I_BACKGROUND_AUDIO_SUPPRESSION TYPE FLOAT(optional) +* | [--->] I_SPEECH_DETECTOR_SENSITIVITY TYPE FLOAT (default ='0.5') +* | [--->] I_BACKGROUND_AUDIO_SUPPRESSION TYPE FLOAT (default ='0.0') +* | [--->] I_LOW_LATENCY TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_CHARACTER_INSERTION_BIAS TYPE FLOAT (default ='0.0') * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_SPEECH_RECOGNITION_RESULTS * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION @@ -4078,16 +4628,6 @@ method RECOGNIZE. c_url = ls_request_prop-url ) ##NO_TEXT. endif. - if i_CUSTOMIZATION_ID is supplied. - lv_queryparam = escape( val = i_CUSTOMIZATION_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `customization_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - if i_GRAMMAR_NAME is supplied. lv_queryparam = escape( val = i_GRAMMAR_NAME format = cl_abap_format=>e_uri_full ). add_query_parameter( @@ -4161,6 +4701,27 @@ method RECOGNIZE. c_url = ls_request_prop-url ) ##NO_TEXT. endif. + if i_LOW_LATENCY is supplied. + lv_queryparam = i_LOW_LATENCY. + add_query_parameter( + exporting + i_parameter = `low_latency` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CHARACTER_INSERTION_BIAS is supplied. + lv_queryparam = i_CHARACTER_INSERTION_BIAS. + add_query_parameter( + exporting + i_parameter = `character_insertion_bias` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + " process header parameters data: lv_headerparam type string ##NEEDED. @@ -4318,26 +4879,27 @@ endmethod. * | [--->] I_ACOUSTIC_CUSTOMIZATION_ID TYPE STRING(optional) * | [--->] I_BASE_MODEL_VERSION TYPE STRING(optional) * | [--->] I_CUSTOMIZATION_WEIGHT TYPE DOUBLE(optional) -* | [--->] I_INACTIVITY_TIMEOUT TYPE INTEGER(optional) +* | [--->] I_INACTIVITY_TIMEOUT TYPE INTEGER (default =30) * | [--->] I_KEYWORDS TYPE TT_STRING(optional) * | [--->] I_KEYWORDS_THRESHOLD TYPE FLOAT(optional) -* | [--->] I_MAX_ALTERNATIVES TYPE INTEGER(optional) +* | [--->] I_MAX_ALTERNATIVES TYPE INTEGER (default =1) * | [--->] I_WORD_ALTERNATIVES_THRESHOLD TYPE FLOAT(optional) * | [--->] I_WORD_CONFIDENCE TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_TIMESTAMPS TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_PROFANITY_FILTER TYPE BOOLEAN (default =c_boolean_true) * | [--->] I_SMART_FORMATTING TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_SPEAKER_LABELS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_CUSTOMIZATION_ID TYPE STRING(optional) * | [--->] I_GRAMMAR_NAME TYPE STRING(optional) * | [--->] I_REDACTION TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_PROCESSING_METRICS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_PROCESSING_METRICS_INTERVAL TYPE FLOAT(optional) +* | [--->] I_PROCESSING_METRICS_INTERVAL TYPE FLOAT (default ='1.0') * | [--->] I_AUDIO_METRICS TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_END_OF_PHRASE_SILENCE_TIME TYPE DOUBLE(optional) +* | [--->] I_END_OF_PHRASE_SILENCE_TIME TYPE DOUBLE (default ='0.8') * | [--->] I_SPLT_TRNSCRPT_AT_PHRASE_END TYPE BOOLEAN (default =c_boolean_false) -* | [--->] I_SPEECH_DETECTOR_SENSITIVITY TYPE FLOAT(optional) -* | [--->] I_BACKGROUND_AUDIO_SUPPRESSION TYPE FLOAT(optional) +* | [--->] I_SPEECH_DETECTOR_SENSITIVITY TYPE FLOAT (default ='0.5') +* | [--->] I_BACKGROUND_AUDIO_SUPPRESSION TYPE FLOAT (default ='0.0') +* | [--->] I_LOW_LATENCY TYPE BOOLEAN (default =c_boolean_false) +* | [--->] I_CHARACTER_INSERTION_BIAS TYPE FLOAT (default ='0.0') * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_RECOGNITION_JOB * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION @@ -4565,16 +5127,6 @@ method CREATE_JOB. c_url = ls_request_prop-url ) ##NO_TEXT. endif. - if i_CUSTOMIZATION_ID is supplied. - lv_queryparam = escape( val = i_CUSTOMIZATION_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `customization_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - if i_GRAMMAR_NAME is supplied. lv_queryparam = escape( val = i_GRAMMAR_NAME format = cl_abap_format=>e_uri_full ). add_query_parameter( @@ -4669,6 +5221,27 @@ method CREATE_JOB. c_url = ls_request_prop-url ) ##NO_TEXT. endif. + if i_LOW_LATENCY is supplied. + lv_queryparam = i_LOW_LATENCY. + add_query_parameter( + exporting + i_parameter = `low_latency` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_CHARACTER_INSERTION_BIAS is supplied. + lv_queryparam = i_CHARACTER_INSERTION_BIAS. + add_query_parameter( + exporting + i_parameter = `character_insertion_bias` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + " process header parameters data: lv_headerparam type string ##NEEDED. @@ -4886,13 +5459,24 @@ method CREATE_LANGUAGE_MODEL. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5065,6 +5649,7 @@ endmethod. * | [--->] I_CUSTOMIZATION_ID TYPE STRING * | [--->] I_WORD_TYPE_TO_ADD TYPE STRING (default ='all') * | [--->] I_CUSTOMIZATION_WEIGHT TYPE DOUBLE(optional) +* | [--->] I_STRICT TYPE BOOLEAN (default =c_boolean_true) * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_TRAINING_RESPONSE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION @@ -5111,6 +5696,17 @@ method TRAIN_LANGUAGE_MODEL. c_url = ls_request_prop-url ) ##NO_TEXT. endif. + if i_STRICT is supplied. + lv_queryparam = i_STRICT. + add_query_parameter( + exporting + i_parameter = `strict` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + @@ -5564,13 +6160,24 @@ method ADD_WORDS. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5643,13 +6250,24 @@ method ADD_WORD. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -5807,7 +6425,7 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_CUSTOMIZATION_ID TYPE STRING * | [--->] I_GRAMMAR_NAME TYPE STRING -* | [--->] I_GRAMMAR_FILE TYPE STRING +* | [--->] I_GRAMMAR_FILE TYPE FILE * | [--->] I_CONTENT_TYPE TYPE STRING (default ='application/srgs') * | [--->] I_ALLOW_OVERWRITE TYPE BOOLEAN (default =c_boolean_false) * | [--->] I_accept TYPE string (default ='application/json') @@ -5856,41 +6474,7 @@ method ADD_GRAMMAR. " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_GRAMMAR_FILE ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_GRAMMAR_FILE i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'grammar_file' i_value = i_GRAMMAR_FILE ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_GRAMMAR_FILE to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - + ls_request_prop-body_bin = i_GRAMMAR_FILE. " execute HTTP POST request lo_response = HTTP_POST( i_request_prop = ls_request_prop ). @@ -6048,13 +6632,24 @@ method CREATE_ACOUSTIC_MODEL. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -6226,6 +6821,7 @@ endmethod. * +-------------------------------------------------------------------------------------------------+ * | [--->] I_CUSTOMIZATION_ID TYPE STRING * | [--->] I_CUSTOM_LANGUAGE_MODEL_ID TYPE STRING(optional) +* | [--->] I_STRICT TYPE BOOLEAN (default =c_boolean_true) * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_TRAINING_RESPONSE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION @@ -6262,6 +6858,17 @@ method TRAIN_ACOUSTIC_MODEL. c_url = ls_request_prop-url ) ##NO_TEXT. endif. + if i_STRICT is supplied. + lv_queryparam = i_STRICT. + add_query_parameter( + exporting + i_parameter = `strict` + i_value = lv_queryparam + i_is_boolean = c_boolean_true + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + diff --git a/src/zcl_ibmc_text_to_speech_v1.clas.abap b/src/zcl_ibmc_text_to_speech_v1.clas.abap index 8a5e43d..a4569c6 100644 --- a/src/zcl_ibmc_text_to_speech_v1.clas.abap +++ b/src/zcl_ibmc_text_to_speech_v1.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. +* Copyright 2019, 2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,14 +31,62 @@ "! phonetic translation is based on the SSML phoneme format for representing a "! word. You can specify a phonetic translation in standard International Phonetic "! Alphabet (IPA) representation or in the proprietary IBM Symbolic Phonetic -"! Representation (SPR). The Arabic, Chinese, Dutch, Australian English, and -"! Korean languages support only IPA.
+"! Representation (SPR). For phonetic translation, the Arabic, Chinese, Dutch, +"! Australian English, Korean, and Swedish voices support only IPA, not SPR.
+"!
+"! The service also offers a Tune by Example feature that lets you define custom +"! prompts. You can also define speaker models to improve the quality of your +"! custom prompts. The service support custom prompts only for US English custom +"! models and voices.
+"!
+"! Effective **31 March 2022**, all *neural voices* are deprecated. The deprecated +"! voices remain available to existing users until 31 March 2023, when they will +"! be removed from the service and the documentation. *No enhanced neural voices +"! or expressive neural voices are deprecated.*<br/><br/> For more +"! information, see the [1 March 2023 service +"! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- +"! notes#text-to-speech-1march2023) in the release notes for +"! {{site.data.keyword.texttospeechshort}} for +"! {{site.data.keyword.cloud_notm}}.{: deprecated}
class ZCL_IBMC_TEXT_TO_SPEECH_V1 DEFINITION public inheriting from ZCL_IBMC_SERVICE_EXT create public . public section. + types: + "!

+ "! Information about a speaker model.

+ begin of T_SPEAKER, + "! The speaker ID (GUID) of the speaker. + SPEAKER_ID type STRING, + "! The user-defined name of the speaker. + NAME type STRING, + end of T_SPEAKER. + types: + "!

+ "! Information about a custom prompt.

+ begin of T_PROMPT, + "! The user-specified text of the prompt. + PROMPT type STRING, + "! The user-specified identifier (name) of the prompt. + PROMPT_ID type STRING, + "! The status of the prompt:
+ "! * `processing`: The service received the request to add the prompt and is + "! analyzing the validity of the prompt.
+ "! * `available`: The service successfully validated the prompt, which is now ready + "! for use in a speech synthesis request.
+ "! * `failed`: The service's validation of the prompt failed. The status of + "! the prompt includes an `error` field that describes the reason for the failure. + "! + STATUS type STRING, + "! If the status of the prompt is `failed`, an error message that describes the + "! reason for the failure. The field is omitted if no error occurred. + ERROR type STRING, + "! The speaker ID (GUID) of the speaker for which the prompt was defined. The field + "! is omitted if no speaker ID was specified. + SPEAKER_ID type STRING, + end of T_PROMPT. types: "!

"! Information about a word for the custom model.

@@ -65,9 +113,9 @@ public section. "!

"! Information about an existing custom model.

begin of T_CUSTOM_MODEL, - "! The customization ID (GUID) of the custom model. The **Create a custom model** - "! method returns only this field. It does not not return the other fields of this - "! object. + "! The customization ID (GUID) of the custom model. The [Create a custom + "! model](#createcustommodel) method returns only this field. It does not not + "! return the other fields of this object. CUSTOMIZATION_ID type STRING, "! The name of the custom model. NAME type STRING, @@ -89,10 +137,15 @@ public section. DESCRIPTION type STRING, "! An array of `Word` objects that lists the words and their translations from the "! custom model. The words are listed in alphabetical order, with uppercase - "! letters listed before lowercase letters. The array is empty if the custom model - "! contains no words. This field is returned only by the **Get a voice** method - "! and only when you specify the customization ID of a custom model. + "! letters listed before lowercase letters. The array is empty if no words are + "! defined for the custom model. This field is returned only by the [Get a custom + "! model](#getcustommodel) method. WORDS type STANDARD TABLE OF T_WORD WITH NON-UNIQUE DEFAULT KEY, + "! An array of `Prompt` objects that provides information about the prompts that + "! are defined for the specified custom model. The array is empty if no prompts + "! are defined for the custom model. This field is returned only by the [Get a + "! custom model](#getcustommodel) method. + PROMPTS type STANDARD TABLE OF T_PROMPT WITH NON-UNIQUE DEFAULT KEY, end of T_CUSTOM_MODEL. types: "!

@@ -129,10 +182,52 @@ public section. "! Additional service features that are supported with the voice. SUPPORTED_FEATURES type T_SUPPORTED_FEATURES, "! Returns information about a specified custom model. This field is returned only - "! by the **Get a voice** method and only when you specify the customization ID of - "! a custom model. + "! by the [Get a voice](#getvoice) method and only when you specify the + "! customization ID of a custom model. CUSTOMIZATION type T_CUSTOM_MODEL, end of T_VOICE. + types: + "!

+ "! A prompt that a speaker has defined for a custom model.

+ begin of T_SPEAKER_PROMPT, + "! The user-specified text of the prompt. + PROMPT type STRING, + "! The user-specified identifier (name) of the prompt. + PROMPT_ID type STRING, + "! The status of the prompt:
+ "! * `processing`: The service received the request to add the prompt and is + "! analyzing the validity of the prompt.
+ "! * `available`: The service successfully validated the prompt, which is now ready + "! for use in a speech synthesis request.
+ "! * `failed`: The service's validation of the prompt failed. The status of + "! the prompt includes an `error` field that describes the reason for the failure. + "! + STATUS type STRING, + "! If the status of the prompt is `failed`, an error message that describes the + "! reason for the failure. The field is omitted if no error occurred. + ERROR type STRING, + end of T_SPEAKER_PROMPT. + types: + "!

+ "! A custom models for which the speaker has defined prompts.

+ begin of T_SPEAKER_CUSTOM_MODEL, + "! The customization ID (GUID) of a custom model for which the speaker has defined + "! one or more prompts. + CUSTOMIZATION_ID type STRING, + "! An array of `SpeakerPrompt` objects that provides information about each prompt + "! that the user has defined for the custom model. + PROMPTS type STANDARD TABLE OF T_SPEAKER_PROMPT WITH NON-UNIQUE DEFAULT KEY, + end of T_SPEAKER_CUSTOM_MODEL. + types: + "!

+ "! Custom models for which the speaker has defined prompts.

+ begin of T_SPEAKER_CUSTOM_MODELS, + "! An array of `SpeakerCustomModel` objects. Each object provides information about + "! the prompts that are defined for a specified speaker in the custom models that + "! are owned by a specified service instance. The array is empty if no prompts are + "! defined for the speaker. + CUSTOMIZATIONS type STANDARD TABLE OF T_SPEAKER_CUSTOM_MODEL WITH NON-UNIQUE DEFAULT KEY, + end of T_SPEAKER_CUSTOM_MODELS. types: "!

"! The error response from a failed request.

@@ -146,23 +241,30 @@ public section. end of T_ERROR_MODEL. types: "!

- "! For the **Add custom words** 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 [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** method, the words and their translations from the - "! custom model. + "! For the [List custom words](#listwords) method, the words and their translations + "! from the custom model. begin of T_WORDS, - "! The **Add custom words** method accepts an array of `Word` objects. Each object - "! provides a word that is to be added or updated for the custom model and the - "! word's translation.
+ "! The [Add custom words](#addwords) method accepts an array of `Word` objects. + "! Each object provides a word that is to be added or updated for the custom model + "! and the word's translation.
"!
- "! The **List custom words** method returns an array of `Word` objects. Each object - "! shows a word and its translation from the custom model. The words are listed in - "! alphabetical order, with uppercase letters listed before lowercase letters. The - "! array is empty if the custom model contains no words. + "! The [List custom words](#listwords) method returns an array of `Word` objects. + "! Each object shows a word and its translation from the custom model. The words + "! are listed in alphabetical order, with uppercase letters listed before + "! lowercase letters. The array is empty if the custom model contains no words. WORDS type STANDARD TABLE OF T_WORD WITH NON-UNIQUE DEFAULT KEY, end of T_WORDS. + types: + "!

+ "! The speaker ID of the speaker model.

+ begin of T_SPEAKER_MODEL, + "! The speaker ID (GUID) of the speaker model. + SPEAKER_ID type STRING, + end of T_SPEAKER_MODEL. types: "!

"! Information about all available voices.

@@ -170,6 +272,46 @@ public section. "! A list of available voices. VOICES type STANDARD TABLE OF T_VOICE WITH NON-UNIQUE DEFAULT KEY, end of T_VOICES. + types: + "!

+ "! Information about the prompt that is to be added to a custom

+ "! model. The following example of a `PromptMetadata` object includes both the + "! required prompt text and an optional speaker model ID:
+ "!
+ "! `{ "prompt_text": "Thank you and good-bye!", + "! "speaker_id": "823068b2-ed4e-11ea-b6e0-7b6456aa95cc" + "! }`. + begin of T_PROMPT_METADATA, + "! The required written text of the spoken prompt. The length of a prompt's + "! text is limited to a few sentences. Speaking one or two sentences of text is + "! the recommended limit. A prompt cannot contain more than 1000 characters of + "! text. Escape any XML control characters (double quotes, single quotes, + "! ampersands, angle brackets, and slashes) that appear in the text of the prompt. + "! + PROMPT_TEXT type STRING, + "! The optional speaker ID (GUID) of a previously defined speaker model that is to + "! be associated with the prompt. + SPEAKER_ID type STRING, + end of T_PROMPT_METADATA. + types: + "! No documentation available. + begin of T_INLINE_OBJECT, + "! Information about the prompt that is to be added to a custom model. The + "! following example of a `PromptMetadata` object includes both the required + "! prompt text and an optional speaker model ID:
+ "!
+ "! `{ "prompt_text": "Thank you and good-bye!", + "! "speaker_id": "823068b2-ed4e-11ea-b6e0-7b6456aa95cc" + "! }`. + METADATA type T_PROMPT_METADATA, + "! An audio file that speaks the text of the prompt with intonation and prosody + "! that matches how you would like the prompt to be spoken.
+ "! * The prompt audio must be in WAV format and must have a minimum sampling rate + "! of 16 kHz. The service accepts audio with higher sampling rates. The service + "! transcodes all audio to 16 kHz before processing it.
+ "! * The length of the prompt audio is limited to 30 seconds. + FILE type FILE, + end of T_INLINE_OBJECT. types: "!

"! Information about the updated custom model.

@@ -191,15 +333,22 @@ public section. "!

"! Information about the new custom model.

begin of T_CREATE_CUSTOM_MODEL, - "! The name of the new custom model. + "! The name of the new custom model. Use a localized name that matches the language + "! of the custom model. Use a name that describes the purpose of the custom model, + "! such as `Medical custom model` or `Legal custom model`. Use a name that is + "! unique among all custom models that you own.
+ "!
+ "! Include a maximum of 256 characters in the name. Do not use backslashes, + "! slashes, colons, equal signs, ampersands, or question marks in the name. NAME type STRING, "! The language of the new custom model. You create a custom model for a specific "! language, not for a specific voice. A custom model can be used with any voice "! for its specified language. Omit the parameter to use the the default language, - "! `en-US`. **Note:** The `ar-AR` language identifier cannot be used to create a - "! custom model. Use the `ar-MS` identifier instead. + "! `en-US`. LANGUAGE type STRING, - "! A description of the new custom model. Specifying a description is recommended. + "! A recommended description of the new custom model. Use a localized description + "! that matches the language of the custom model. Include a maximum of 128 + "! characters in the description. DESCRIPTION type STRING, end of T_CREATE_CUSTOM_MODEL. types: @@ -207,11 +356,26 @@ public section. "! The text to synthesize. Specify either plain text or a

"! subset of SSML. SSML is an XML-based markup language that provides text "! annotation for speech-synthesis applications. Pass a maximum of 5 KB of input - "! text. + "! text. For more information, see
+ "! * [Specifying input + "! text](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-usingHTTP# + "! input)
+ "! * [Understanding + "! SSML](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-ssml). begin of T_TEXT, "! The text to synthesize. TEXT type STRING, end of T_TEXT. + types: + "!

+ "! Information about all speaker models for the service

+ "! instance. + begin of T_SPEAKERS, + "! An array of `Speaker` objects that provides information about the speakers for + "! the service instance. The array is empty if the service instance has no + "! speakers. + SPEAKERS type STANDARD TABLE OF T_SPEAKER WITH NON-UNIQUE DEFAULT KEY, + end of T_SPEAKERS. types: "!

"! The pronunciation of the specified text.

@@ -220,6 +384,16 @@ public section. "! custom model is specified, the pronunciation also reflects that custom model. PRONUNCIATION type STRING, end of T_PRONUNCIATION. + types: + "!

+ "! Information about the custom prompts that are defined for a

+ "! custom model. + begin of T_PROMPTS, + "! An array of `Prompt` objects that provides information about the prompts that + "! are defined for the specified custom model. The array is empty if no prompts + "! are defined for the custom model. + PROMPTS type STANDARD TABLE OF T_PROMPT WITH NON-UNIQUE DEFAULT KEY, + end of T_PROMPTS. types: "!

"! Information about existing custom models.

@@ -253,17 +427,27 @@ public section. constants: "!

List of required fields per type.

begin of C_REQUIRED_FIELDS, + T_SPEAKER type string value '|SPEAKER_ID|NAME|', + T_PROMPT type string value '|PROMPT|PROMPT_ID|STATUS|', T_WORD type string value '|WORD|TRANSLATION|', T_CUSTOM_MODEL type string value '|CUSTOMIZATION_ID|', T_SUPPORTED_FEATURES type string value '|CUSTOM_PRONUNCIATION|VOICE_TRANSFORMATION|', T_VOICE type string value '|URL|GENDER|NAME|LANGUAGE|DESCRIPTION|CUSTOMIZABLE|SUPPORTED_FEATURES|', + T_SPEAKER_PROMPT type string value '|PROMPT|PROMPT_ID|STATUS|', + T_SPEAKER_CUSTOM_MODEL type string value '|CUSTOMIZATION_ID|PROMPTS|', + T_SPEAKER_CUSTOM_MODELS type string value '|CUSTOMIZATIONS|', T_ERROR_MODEL type string value '|ERROR|CODE|', T_WORDS type string value '|WORDS|', + T_SPEAKER_MODEL type string value '|SPEAKER_ID|', T_VOICES type string value '|VOICES|', + T_PROMPT_METADATA type string value '|PROMPT_TEXT|', + T_INLINE_OBJECT type string value '|METADATA|FILE|', T_UPDATE_CUSTOM_MODEL type string value '|', T_CREATE_CUSTOM_MODEL type string value '|NAME|', T_TEXT type string value '|TEXT|', + T_SPEAKERS type string value '|SPEAKERS|', T_PRONUNCIATION type string value '|PRONUNCIATION|', + T_PROMPTS type string value '|PROMPTS|', T_CUSTOM_MODELS type string value '|CUSTOMIZATIONS|', T_TRANSLATION type string value '|TRANSLATION|', __DUMMY type string value SPACE, @@ -290,13 +474,22 @@ constants: CREATED type string value 'created', LAST_MODIFIED type string value 'last_modified', WORDS type string value 'words', + PROMPTS type string value 'prompts', WORD type string value 'word', TRANSLATION type string value 'translation', PART_OF_SPEECH type string value 'part_of_speech', PRONUNCIATION type string value 'pronunciation', + PROMPT type string value 'prompt', + PROMPT_ID type string value 'prompt_id', + STATUS type string value 'status', ERROR type string value 'error', + SPEAKER_ID type string value 'speaker_id', + SPEAKERS type string value 'speakers', + PROMPT_TEXT type string value 'prompt_text', CODE type string value 'code', CODE_DESCRIPTION type string value 'code_description', + METADATA type string value 'metadata', + FILE type string value 'file', end of C_ABAPNAME_DICTIONARY . @@ -313,11 +506,19 @@ constants: "! the name, language, gender, and other details about the voice. The ordering of "! the list of voices can change from call to call; do not rely on an alphabetized "! or static list of voices. To see information about a specific voice, use the - "! **Get a voice** method.
+ "! [Get a voice](#getvoice).
+ "!
+ "! **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + "! deprecated voices remain available to existing users until 31 March 2023, when + "! they will be removed from the service and the documentation. *No enhanced + "! neural voices or expressive neural voices are deprecated.* For more + "! information, see the [1 March 2023 service + "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + "! notes#text-to-speech-1march2023) in the release notes.
"!
- "! **See also:** [Listing all available - "! voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#l - "! istVoices). + "! **See also:** [Listing all + "! voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-l + "! ist#list-all-voices) "! "! @parameter E_RESPONSE | "! Service return value of type T_VOICES @@ -335,40 +536,22 @@ constants: "! language, gender, and other details about the voice. Specify a customization ID "! to obtain information for a custom model that is defined for the language of "! the specified voice. To list information about all available voices, use the - "! **List voices** method.
+ "! [List voices](#listvoices) method.
"!
"! **See also:** [Listing a specific - "! voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices#li - "! stVoice).
- "!
- "! ### Important voice updates
- "!
- "! The service's voices underwent significant change on 2 December 2020.
- "! * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - "! neural instead of concatenative.
- "! * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - "! instead.
- "! * The `ar-AR` language identifier cannot be used to create a custom model. Use - "! the `ar-MS` identifier instead.
- "! * The standard concatenative voices for the following languages are now - "! deprecated: Brazilian Portuguese, United Kingdom and United States English, - "! French, German, Italian, Japanese, and Spanish (all dialects).
- "! * The features expressive SSML, voice transformation SSML, and use of the - "! `volume` attribute of the `<prosody>` element are deprecated and are not - "! supported with any of the service's neural voices.
- "! * All of the service's voices are now customizable and generally available - "! (GA) for production use.
- "!
- "! The deprecated voices and features will continue to function for at least one - "! year but might be removed at a future date. You are encouraged to migrate to - "! the equivalent neural voices at your earliest convenience. For more information - "! about all voice updates, see the [2 December 2020 service + "! voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-li + "! st#list-specific-voice).
+ "!
+ "! **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + "! deprecated voices remain available to existing users until 31 March 2023, when + "! they will be removed from the service and the documentation. *No enhanced + "! neural voices or expressive neural voices are deprecated.* For more + "! information, see the [1 March 2023 service "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - "! notes#December2020) in the release notes. + "! notes#text-to-speech-1march2023) in the release notes. "! "! @parameter I_VOICE | - "! The voice for which information is to be returned. For more information about - "! specifying a voice, see **Important voice updates** in the method description. + "! The voice for which information is to be returned. "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of a custom model for which information is to be "! returned. You must make the request with credentials for the instance of the @@ -402,13 +585,22 @@ constants: "! interface](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-using "! HTTP#usingHTTP).
"!
+ "! **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + "! deprecated voices remain available to existing users until 31 March 2023, when + "! they will be removed from the service and the documentation. *No enhanced + "! neural voices or expressive neural voices are deprecated.* For more + "! information, see the [1 March 2023 service + "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + "! notes#text-to-speech-1march2023) in the release notes.
+ "!
"! ### Audio formats (accept types)
"!
"! The service can return audio in the following formats (MIME types).
"! * Where indicated, you can optionally specify the sampling rate (`rate`) of the - "! audio. You must specify a sampling rate for the `audio/l16` and `audio/mulaw` - "! formats. A specified sampling rate must lie in the range of 8 kHz to 192 kHz. - "! Some formats restrict the sampling rate to certain values, as noted.
+ "! audio. You must specify a sampling rate for the `audio/alaw`, `audio/l16`, and + "! `audio/mulaw` formats. A specified sampling rate must lie in the range of 8 kHz + "! to 192 kHz. Some formats restrict the sampling rate to certain values, as + "! noted.
"! * For the `audio/l16` format, you can optionally specify the endianness "! (`endianness`) of the audio: `endianness=big-endian` or "! `endianness=little-endian`.
@@ -418,6 +610,7 @@ constants: "! service returns the audio in Ogg format with the Opus codec "! (`audio/ogg;codecs=opus`). The service always returns single-channel "! audio.
+ "! * `audio/alaw` - You must specify the `rate` of the audio.
"! * `audio/basic` - The service returns audio with a sampling rate of 8000 "! Hz.
"! * `audio/flac` - You can optionally specify the `rate` of the audio. The default @@ -449,34 +642,16 @@ constants: "! audio. The default sampling rate is 22,050 Hz.
"!
"! For more information about specifying an audio format, including additional - "! details about some of the formats, see [Audio - "! formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audioFo - "! rmats#audioFormats).
- "!
- "! ### Important voice updates
- "!
- "! The service's voices underwent significant change on 2 December 2020.
- "! * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - "! neural instead of concatenative.
- "! * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - "! instead.
- "! * The `ar-AR` language identifier cannot be used to create a custom model. Use - "! the `ar-MS` identifier instead.
- "! * The standard concatenative voices for the following languages are now - "! deprecated: Brazilian Portuguese, United Kingdom and United States English, - "! French, German, Italian, Japanese, and Spanish (all dialects).
- "! * The features expressive SSML, voice transformation SSML, and use of the - "! `volume` attribute of the `<prosody>` element are deprecated and are not - "! supported with any of the service's neural voices.
- "! * All of the service's voices are now customizable and generally available - "! (GA) for production use.
- "!
- "! The deprecated voices and features will continue to function for at least one - "! year but might be removed at a future date. You are encouraged to migrate to - "! the equivalent neural voices at your earliest convenience. For more information - "! about all voice updates, see the [2 December 2020 service - "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - "! notes#December2020) in the release notes.
+ "! details about some of the formats, see [Using audio + "! formats](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-audio-f + "! ormats).
+ "!
+ "! **Note:** By default, the service returns audio in the Ogg audio format with the + "! Opus codec (`audio/ogg;codecs=opus`). However, the Ogg audio format is not + "! supported with the Safari browser. If you are using the service with the Safari + "! browser, you must use the `Accept` request header or the `accept` query + "! parameter specify a different format in which you want the service to return + "! the audio.
"!
"! ### Warning messages
"!
@@ -496,14 +671,79 @@ constants: "! about specifying an audio format, see **Audio formats (accept types)** in the "! method description. "! @parameter I_VOICE | - "! The voice to use for synthesis. For more information about specifying a voice, - "! see **Important voice updates** in the method description. + "! The voice to use for speech synthesis. If you omit the `voice` parameter, the + "! service uses the US English `en-US_MichaelV3Voice` by default.
+ "!
+ "! _For IBM Cloud Pak for Data,_ if you do not install the `en-US_MichaelV3Voice`, + "! you must either specify a voice with the request or specify a new default voice + "! for your installation of the service.
+ "!
+ "! **See also:**
+ "! * [Languages and + "! voices](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices)< + "! br/> + "! * [Using the default + "! voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-us + "! e#specify-voice-default). "! @parameter I_CUSTOMIZATION_ID | "! The customization ID (GUID) of a custom model to use for the synthesis. If a "! custom model is specified, it works only if it matches the language of the "! indicated voice. You must make the request with credentials for the instance of "! the service that owns the custom model. Omit the parameter to use the specified "! voice with no customization. + "! @parameter I_SPELL_OUT_MODE | + "! *For German voices,* indicates how the service is to spell out strings of + "! individual letters. To indicate the pace of the spelling, specify one of the + "! following values:
+ "! * `default` - The service reads the characters at the rate at which it + "! synthesizes speech for the request. You can also omit the parameter entirely to + "! achieve the default behavior.
+ "! * `singles` - The service reads the characters one at a time, with a brief pause + "! between each character.
+ "! * `pairs` - The service reads the characters two at a time, with a brief pause + "! between each pair.
+ "! * `triples` - The service reads the characters three at a time, with a brief + "! pause between each triplet.
+ "!
+ "! For more information, see [Specifying how strings are spelled + "! out](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis-p + "! arams#params-spell-out-mode). + "! @parameter I_RATE_PERCENTAGE | + "! The percentage change from the default speaking rate of the voice that is used + "! for speech synthesis. Each voice has a default speaking rate that is optimized + "! to represent a normal rate of speech. The parameter accepts an integer that + "! represents the percentage change from the voice's default rate:
+ "! * Specify a signed negative integer to reduce the speaking rate by that + "! percentage. For example, -10 reduces the rate by ten percent.
+ "! * Specify an unsigned or signed positive integer to increase the speaking rate + "! by that percentage. For example, 10 and +10 increase the rate by ten + "! percent.
+ "! * Specify 0 or omit the parameter to get the default speaking rate for the + "! voice.
+ "!
+ "! The parameter affects the rate for an entire request.
+ "!
+ "! For more information, see [Modifying the speaking + "! rate](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis- + "! params#params-rate-percentage). + "! @parameter I_PITCH_PERCENTAGE | + "! The percentage change from the default speaking pitch of the voice that is used + "! for speech synthesis. Each voice has a default speaking pitch that is optimized + "! to represent a normal tone of voice. The parameter accepts an integer that + "! represents the percentage change from the voice's default tone:
+ "! * Specify a signed negative integer to lower the voice's pitch by that + "! percentage. For example, -5 reduces the tone by five percent.
+ "! * Specify an unsigned or signed positive integer to increase the voice's + "! pitch by that percentage. For example, 5 and +5 increase the tone by five + "! percent.
+ "! * Specify 0 or omit the parameter to get the default speaking pitch for the + "! voice.
+ "!
+ "! The parameter affects the pitch for an entire request.
+ "!
+ "! For more information, see [Modifying the speaking + "! pitch](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-synthesis + "! -params#params-pitch-percentage). "! @parameter E_RESPONSE | "! Service return value of type FILE "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. @@ -514,6 +754,9 @@ constants: !I_ACCEPT type STRING default 'audio/ogg;codecs=opus' !I_VOICE type STRING default 'en-US_MichaelV3Voice' !I_CUSTOMIZATION_ID type STRING optional + !I_SPELL_OUT_MODE type STRING default 'default' + !I_RATE_PERCENTAGE type INTEGER default 0 + !I_PITCH_PERCENTAGE type INTEGER default 0 !I_contenttype type string default 'application/json' exporting !E_RESPONSE type FILE @@ -526,42 +769,33 @@ constants: "! a specific voice to see the default translation for the language of that voice "! or for a specific custom model to see the translation for that model.
"!
+ "! **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + "! deprecated voices remain available to existing users until 31 March 2023, when + "! they will be removed from the service and the documentation. *No enhanced + "! neural voices or expressive neural voices are deprecated.* For more + "! information, see the [1 March 2023 service + "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- + "! notes#text-to-speech-1march2023) in the release notes.
+ "!
"! **See also:** [Querying a word from a "! language](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-custom - "! Words#cuWordsQueryLanguage).
- "!
- "! ### Important voice updates
- "!
- "! The service's voices underwent significant change on 2 December 2020.
- "! * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - "! neural instead of concatenative.
- "! * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - "! instead.
- "! * The `ar-AR` language identifier cannot be used to create a custom model. Use - "! the `ar-MS` identifier instead.
- "! * The standard concatenative voices for the following languages are now - "! deprecated: Brazilian Portuguese, United Kingdom and United States English, - "! French, German, Italian, Japanese, and Spanish (all dialects).
- "! * The features expressive SSML, voice transformation SSML, and use of the - "! `volume` attribute of the `<prosody>` element are deprecated and are not - "! supported with any of the service's neural voices.
- "! * All of the service's voices are now customizable and generally available - "! (GA) for production use.
- "!
- "! The deprecated voices and features will continue to function for at least one - "! year but might be removed at a future date. You are encouraged to migrate to - "! the equivalent neural voices at your earliest convenience. For more information - "! about all voice updates, see the [2 December 2020 service - "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - "! notes#December2020) in the release notes. + "! Words#cuWordsQueryLanguage). "! "! @parameter I_TEXT | "! The word for which the pronunciation is requested. "! @parameter I_VOICE | "! A voice that specifies the language in which the pronunciation is to be - "! returned. All voices for the same language (for example, `en-US`) return the - "! same translation. For more information about specifying a voice, see - "! **Important voice updates** in the method description. + "! returned. If you omit the `voice` parameter, the service uses the US English + "! `en-US_MichaelV3Voice` by default. All voices for the same language (for + "! example, `en-US`) return the same translation.
+ "!
+ "! _For IBM Cloud Pak for Data,_ if you do not install the `en-US_MichaelV3Voice`, + "! you must either specify a voice with the request or specify a new default voice + "! for your installation of the service.
+ "!
+ "! **See also:** [Using the default + "! voice](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voices-us + "! e#specify-voice-default). "! @parameter I_FORMAT | "! The phoneme format in which to return the pronunciation. The Arabic, Chinese, "! Dutch, Australian English, and Korean languages support only IPA. Omit the @@ -600,30 +834,13 @@ constants: "! model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customMod "! els#cuModelsCreate).
"!
- "! ### Important voice updates
- "!
- "! The service's voices underwent significant change on 2 December 2020.
- "! * The Arabic, Chinese, Dutch, Australian English, and Korean voices are now - "! neural instead of concatenative.
- "! * The `ar-AR_OmarVoice` voice is deprecated. Use `ar-MS_OmarVoice` voice - "! instead.
- "! * The `ar-AR` language identifier cannot be used to create a custom model. Use - "! the `ar-MS` identifier instead.
- "! * The standard concatenative voices for the following languages are now - "! deprecated: Brazilian Portuguese, United Kingdom and United States English, - "! French, German, Italian, Japanese, and Spanish (all dialects).
- "! * The features expressive SSML, voice transformation SSML, and use of the - "! `volume` attribute of the `<prosody>` element are deprecated and are not - "! supported with any of the service's neural voices.
- "! * All of the service's voices are now customizable and generally available - "! (GA) for production use.
- "!
- "! The deprecated voices and features will continue to function for at least one - "! year but might be removed at a future date. You are encouraged to migrate to - "! the equivalent neural voices at your earliest convenience. For more information - "! about all voice updates, see the [2 December 2020 service + "! **Note:** Effective **31 March 2022**, all *neural voices* are deprecated. The + "! deprecated voices remain available to existing users until 31 March 2023, when + "! they will be removed from the service and the documentation. *No enhanced + "! neural voices or expressive neural voices are deprecated.* For more + "! information, see the [1 March 2023 service "! update](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-release- - "! notes#December2020) in the release notes. + "! notes#text-to-speech-1march2023) in the release notes. "! "! @parameter I_CREATE_VOICE_MODEL | "! A `CreateCustomModel` object that contains information about the new custom @@ -644,10 +861,10 @@ constants: "!

List custom models

"! Lists metadata such as the name and description for all custom models that are "! owned by an instance of the service. Specify a language to list the custom - "! models for that language only. To see the words in addition to the metadata for - "! a specific custom model, use the **List a custom model** method. You must use - "! credentials for the instance of the service that owns a model to list - "! information about it.
+ "! models for that language only. To see the words and prompts in addition to the + "! metadata for a specific custom model, use the [Get a custom + "! model](#getcustommodel) method. You must use credentials for the instance of + "! the service that owns a model to list information about it.
"!
"! **See also:** [Querying all custom "! models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customMo @@ -721,8 +938,9 @@ constants: "!

Get a custom model

"! Gets all information about a specified custom model. In addition to metadata "! such as the name and description of the custom model, the output includes the - "! words and their translations as defined in the model. To see just the metadata - "! for a model, use the **List custom models** method.
+ "! words and their translations that are defined for the model, as well as any + "! prompts that are defined for the model. To see just the metadata for a model, + "! use the [List custom models](#listcustommodels) method.
"!
"! **See also:** [Querying a custom "! model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customMod @@ -933,6 +1151,390 @@ constants: raising ZCX_IBMC_SERVICE_EXCEPTION . + "!

List custom prompts

+ "! Lists information about all custom prompts that are defined for a custom model. + "! The information includes the prompt ID, prompt text, status, and optional + "! speaker ID for each prompt of the custom model. You must use credentials for + "! the instance of the service that owns the custom model. The same information + "! about all of the prompts for a custom model is also provided by the [Get a + "! custom model](#getcustommodel) method. That method provides complete details + "! about a specified custom model, including its language, owner, custom words, + "! and more. Custom prompts are supported only for use with US English custom + "! models and voices.
+ "!
+ "! **See also:** [Listing custom + "! prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-cus + "! tom-prompts#tbe-custom-prompts-list). + "! + "! @parameter I_CUSTOMIZATION_ID | + "! The customization ID (GUID) of the custom model. You must make the request with + "! credentials for the instance of the service that owns the custom model. + "! @parameter E_RESPONSE | + "! Service return value of type T_PROMPTS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_CUSTOM_PROMPTS + importing + !I_CUSTOMIZATION_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_PROMPTS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Add a custom prompt

+ "! Adds a custom prompt to a custom model. A prompt is defined by the text that is + "! to be spoken, the audio for that text, a unique user-specified ID for the + "! prompt, and an optional speaker ID. The information is used to generate + "! prosodic data that is not visible to the user. This data is used by the service + "! to produce the synthesized audio upon request. You must use credentials for the + "! instance of the service that owns a custom model to add a prompt to it. You can + "! add a maximum of 1000 custom prompts to a single custom model.
+ "!
+ "! You are recommended to assign meaningful values for prompt IDs. For example, use + "! `goodbye` to identify a prompt that speaks a farewell message. Prompt IDs must + "! be unique within a given custom model. You cannot define two prompts with the + "! same name for the same custom model. If you provide the ID of an existing + "! prompt, the previously uploaded prompt is replaced by the new information. The + "! existing prompt is reprocessed by using the new text and audio and, if + "! provided, new speaker model, and the prosody data associated with the prompt is + "! updated.
+ "!
+ "! The quality of a prompt is undefined if the language of a prompt does not match + "! the language of its custom model. This is consistent with any text or SSML that + "! is specified for a speech synthesis request. The service makes a best-effort + "! attempt to render the specified text for the prompt; it does not validate that + "! the language of the text matches the language of the model.
+ "!
+ "! Adding a prompt is an asynchronous operation. Although it accepts less audio + "! than speaker enrollment, the service must align the audio with the provided + "! text. The time that it takes to process a prompt depends on the prompt itself. + "! The processing time for a reasonably sized prompt generally matches the length + "! of the audio (for example, it takes 20 seconds to process a 20-second prompt). + "!
+ "!
+ "! For shorter prompts, you can wait for a reasonable amount of time and then check + "! the status of the prompt with the [Get a custom prompt](#getcustomprompt) + "! method. For longer prompts, consider using that method to poll the service + "! every few seconds to determine when the prompt becomes available. No prompt can + "! be used for speech synthesis if it is in the `processing` or `failed` state. + "! Only prompts that are in the `available` state can be used for speech + "! synthesis.
+ "!
+ "! When it processes a request, the service attempts to align the text and the + "! audio that are provided for the prompt. The text that is passed with a prompt + "! must match the spoken audio as closely as possible. Optimally, the text and + "! audio match exactly. The service does its best to align the specified text with + "! the audio, and it can often compensate for mismatches between the two. But if + "! the service cannot effectively align the text and the audio, possibly because + "! the magnitude of mismatches between the two is too great, processing of the + "! prompt fails.
+ "!
+ "! ### Evaluating a prompt
+ "!
+ "! Always listen to and evaluate a prompt to determine its quality before using it + "! in production. To evaluate a prompt, include only the single prompt in a speech + "! synthesis request by using the following SSML extension, in this case for a + "! prompt whose ID is `goodbye`:
+ "!
+ "! `<ibm:prompt id="goodbye"/>`
+ "!
+ "! In some cases, you might need to rerecord and resubmit a prompt as many as five + "! times to address the following possible problems:
+ "! * The service might fail to detect a mismatch between the prompt’s text and + "! audio. The longer the prompt, the greater the chance for misalignment between + "! its text and audio. Therefore, multiple shorter prompts are preferable to a + "! single long prompt.
+ "! * The text of a prompt might include a word that the service does not recognize. + "! In this case, you can create a custom word and pronunciation pair to tell the + "! service how to pronounce the word. You must then re-create the prompt.
+ "! * The quality of the input audio might be insufficient or the service’s + "! processing of the audio might fail to detect the intended prosody. Submitting + "! new audio for the prompt can correct these issues.
+ "!
+ "! If a prompt that is created without a speaker ID does not adequately reflect the + "! intended prosody, enrolling the speaker and providing a speaker ID for the + "! prompt is one recommended means of potentially improving the quality of the + "! prompt. This is especially important for shorter prompts such as + "! "good-bye" or "thank you," where less audio data makes it + "! more difficult to match the prosody of the speaker. Custom prompts are + "! supported only for use with US English custom models and voices.
+ "!
+ "! **See also:**
+ "! * [Add a custom + "! prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-crea + "! te#tbe-create-add-prompt)
+ "! * [Evaluate a custom + "! prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-crea + "! te#tbe-create-evaluate-prompt)
+ "! * [Rules for creating custom + "! prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-rul + "! es#tbe-rules-prompts) + "! + "! @parameter I_CUSTOMIZATION_ID | + "! The customization ID (GUID) of the custom model. You must make the request with + "! credentials for the instance of the service that owns the custom model. + "! @parameter I_PROMPT_ID | + "! The identifier of the prompt that is to be added to the custom model:
+ "! * Include a maximum of 49 characters in the ID.
+ "! * Include only alphanumeric characters and `_` (underscores) in the ID.
+ "! * Do not include XML sensitive characters (double quotes, single quotes, + "! ampersands, angle brackets, and slashes) in the ID.
+ "! * To add a new prompt, the ID must be unique for the specified custom model. + "! Otherwise, the new information for the prompt overwrites the existing prompt + "! that has that ID. + "! @parameter I_METADATA | + "! Information about the prompt that is to be added to a custom model. The + "! following example of a `PromptMetadata` object includes both the required + "! prompt text and an optional speaker model ID:
+ "!
+ "! `{ "prompt_text": "Thank you and good-bye!", + "! "speaker_id": "823068b2-ed4e-11ea-b6e0-7b6456aa95cc" + "! }`. + "! @parameter I_FILE | + "! An audio file that speaks the text of the prompt with intonation and prosody + "! that matches how you would like the prompt to be spoken.
+ "! * The prompt audio must be in WAV format and must have a minimum sampling rate + "! of 16 kHz. The service accepts audio with higher sampling rates. The service + "! transcodes all audio to 16 kHz before processing it.
+ "! * The length of the prompt audio is limited to 30 seconds. + "! @parameter E_RESPONSE | + "! Service return value of type T_PROMPT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods ADD_CUSTOM_PROMPT + importing + !I_CUSTOMIZATION_ID type STRING + !I_PROMPT_ID type STRING + !I_METADATA type T_PROMPT_METADATA + !I_FILE type FILE + !I_FILE_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL + !I_contenttype type string default 'multipart/form-data' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_PROMPT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get a custom prompt

+ "! Gets information about a specified custom prompt for a specified custom model. + "! The information includes the prompt ID, prompt text, status, and optional + "! speaker ID for each prompt of the custom model. You must use credentials for + "! the instance of the service that owns the custom model. Custom prompts are + "! supported only for use with US English custom models and voices.
+ "!
+ "! **See also:** [Listing custom + "! prompts](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-cus + "! tom-prompts#tbe-custom-prompts-list). + "! + "! @parameter I_CUSTOMIZATION_ID | + "! The customization ID (GUID) of the custom model. You must make the request with + "! credentials for the instance of the service that owns the custom model. + "! @parameter I_PROMPT_ID | + "! The identifier (name) of the prompt. + "! @parameter E_RESPONSE | + "! Service return value of type T_PROMPT + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_CUSTOM_PROMPT + importing + !I_CUSTOMIZATION_ID type STRING + !I_PROMPT_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_PROMPT + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a custom prompt

+ "! Deletes an existing custom prompt from a custom model. The service deletes the + "! prompt with the specified ID. You must use credentials for the instance of the + "! service that owns the custom model from which the prompt is to be deleted. + "!
+ "!
+ "! **Caution:** Deleting a custom prompt elicits a 400 response code from synthesis + "! requests that attempt to use the prompt. Make sure that you do not attempt to + "! use a deleted prompt in a production application. Custom prompts are supported + "! only for use with US English custom models and voices.
+ "!
+ "! **See also:** [Deleting a custom + "! prompt](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-cust + "! om-prompts#tbe-custom-prompts-delete). + "! + "! @parameter I_CUSTOMIZATION_ID | + "! The customization ID (GUID) of the custom model. You must make the request with + "! credentials for the instance of the service that owns the custom model. + "! @parameter I_PROMPT_ID | + "! The identifier (name) of the prompt that is to be deleted. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_CUSTOM_PROMPT + importing + !I_CUSTOMIZATION_ID type STRING + !I_PROMPT_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + + "!

List speaker models

+ "! Lists information about all speaker models that are defined for a service + "! instance. The information includes the speaker ID and speaker name of each + "! defined speaker. You must use credentials for the instance of a service to list + "! its speakers. Speaker models and the custom prompts with which they are used + "! are supported only for use with US English custom models and voices.
+ "!
+ "! **See also:** [Listing speaker + "! models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-spea + "! ker-models#tbe-speaker-models-list). + "! + "! @parameter E_RESPONSE | + "! Service return value of type T_SPEAKERS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods LIST_SPEAKER_MODELS + importing + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SPEAKERS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Create a speaker model

+ "! Creates a new speaker model, which is an optional enrollment token for users who + "! are to add prompts to custom models. A speaker model contains information about + "! a user's voice. The service extracts this information from a WAV audio + "! sample that you pass as the body of the request. Associating a speaker model + "! with a prompt is optional, but the information that is extracted from the + "! speaker model helps the service learn about the speaker's voice.
+ "!
+ "! A speaker model can make an appreciable difference in the quality of prompts, + "! especially short prompts with relatively little audio, that are associated with + "! that speaker. A speaker model can help the service produce a prompt with more + "! confidence; the lack of a speaker model can potentially compromise the quality + "! of a prompt.
+ "!
+ "! The gender of the speaker who creates a speaker model does not need to match the + "! gender of a voice that is used with prompts that are associated with that + "! speaker model. For example, a speaker model that is created by a male speaker + "! can be associated with prompts that are spoken by female voices.
+ "!
+ "! You create a speaker model for a given instance of the service. The new speaker + "! model is owned by the service instance whose credentials are used to create it. + "! That same speaker can then be used to create prompts for all custom models + "! within that service instance. No language is associated with a speaker model, + "! but each custom model has a single specified language. You can add prompts only + "! to US English models.
+ "!
+ "! You specify a name for the speaker when you create it. The name must be unique + "! among all speaker names for the owning service instance. To re-create a speaker + "! model for an existing speaker name, you must first delete the existing speaker + "! model that has that name.
+ "!
+ "! Speaker enrollment is a synchronous operation. Although it accepts more audio + "! data than a prompt, the process of adding a speaker is very fast. The service + "! simply extracts information about the speaker’s voice from the audio. Unlike + "! prompts, speaker models neither need nor accept a transcription of the audio. + "! When the call returns, the audio is fully processed and the speaker enrollment + "! is complete.
+ "!
+ "! The service returns a speaker ID with the request. A speaker ID is globally + "! unique identifier (GUID) that you use to identify the speaker in subsequent + "! requests to the service. Speaker models and the custom prompts with which they + "! are used are supported only for use with US English custom models and voices. + "!
+ "!
+ "! **See also:**
+ "! * [Create a speaker + "! model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-creat + "! e#tbe-create-speaker-model)
+ "! * [Rules for creating speaker + "! models](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-rule + "! s#tbe-rules-speakers) + "! + "! @parameter I_SPEAKER_NAME | + "! The name of the speaker that is to be added to the service instance.
+ "! * Include a maximum of 49 characters in the name.
+ "! * Include only alphanumeric characters and `_` (underscores) in the name.
+ "! * Do not include XML sensitive characters (double quotes, single quotes, + "! ampersands, angle brackets, and slashes) in the name.
+ "! * Do not use the name of an existing speaker that is already defined for the + "! service instance. + "! @parameter I_AUDIO | + "! An enrollment audio file that contains a sample of the speaker’s voice.
+ "! * The enrollment audio must be in WAV format and must have a minimum sampling + "! rate of 16 kHz. The service accepts audio with higher sampling rates. It + "! transcodes all audio to 16 kHz before processing it.
+ "! * The length of the enrollment audio is limited to 1 minute. Speaking one or two + "! paragraphs of text that include five to ten sentences is recommended. + "! @parameter E_RESPONSE | + "! Service return value of type T_SPEAKER_MODEL + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods CREATE_SPEAKER_MODEL + importing + !I_SPEAKER_NAME type STRING + !I_AUDIO type FILE + !I_contenttype type string default 'audio/wav' + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SPEAKER_MODEL + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Get a speaker model

+ "! Gets information about all prompts that are defined by a specified speaker for + "! all custom models that are owned by a service instance. The information is + "! grouped by the customization IDs of the custom models. For each custom model, + "! the information lists information about each prompt that is defined for that + "! custom model by the speaker. You must use credentials for the instance of the + "! service that owns a speaker model to list its prompts. Speaker models and the + "! custom prompts with which they are used are supported only for use with US + "! English custom models and voices.
+ "!
+ "! **See also:** [Listing the custom prompts for a speaker + "! model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-speak + "! er-models#tbe-speaker-models-list-prompts). + "! + "! @parameter I_SPEAKER_ID | + "! The speaker ID (GUID) of the speaker model. You must make the request with + "! service credentials for the instance of the service that owns the speaker + "! model. + "! @parameter E_RESPONSE | + "! Service return value of type T_SPEAKER_CUSTOM_MODELS + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods GET_SPEAKER_MODEL + importing + !I_SPEAKER_ID type STRING + !I_accept type string default 'application/json' + exporting + !E_RESPONSE type T_SPEAKER_CUSTOM_MODELS + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete a speaker model

+ "! Deletes an existing speaker model from the service instance. The service deletes + "! the enrolled speaker with the specified speaker ID. You must use credentials + "! for the instance of the service that owns a speaker model to delete the + "! speaker.
+ "!
+ "! Any prompts that are associated with the deleted speaker are not affected by the + "! speaker's deletion. The prosodic data that defines the quality of a prompt + "! is established when the prompt is created. A prompt is static and remains + "! unaffected by deletion of its associated speaker. However, the prompt cannot be + "! resubmitted or updated with its original speaker once that speaker is deleted. + "! Speaker models and the custom prompts with which they are used are supported + "! only for use with US English custom models and voices.
+ "!
+ "! **See also:** [Deleting a speaker + "! model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-speak + "! er-models#tbe-speaker-models-delete). + "! + "! @parameter I_SPEAKER_ID | + "! The speaker ID (GUID) of the speaker model. You must make the request with + "! service credentials for the instance of the service that owns the speaker + "! model. + "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. + "! + methods DELETE_SPEAKER_MODEL + importing + !I_SPEAKER_ID type STRING + raising + ZCX_IBMC_SERVICE_EXCEPTION . + "!

Delete labeled data

"! Deletes all data that is associated with a specified customer ID. The method "! deletes all data for the customer ID, regardless of the method by which the @@ -1026,7 +1628,7 @@ endmethod. * +-------------------------------------------------------------------------------------- method get_sdk_version_date. - e_sdk_version_date = '20210312144443'. + e_sdk_version_date = '20231212104240'. endmethod. @@ -1147,6 +1749,9 @@ endmethod. * | [--->] I_ACCEPT TYPE STRING (default ='audio/ogg;codecs=opus') * | [--->] I_VOICE TYPE STRING (default ='en-US_MichaelV3Voice') * | [--->] I_CUSTOMIZATION_ID TYPE STRING(optional) +* | [--->] I_SPELL_OUT_MODE TYPE STRING (default ='default') +* | [--->] I_RATE_PERCENTAGE TYPE INTEGER (default =0) +* | [--->] I_PITCH_PERCENTAGE TYPE INTEGER (default =0) * | [--->] I_contenttype TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE FILE * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION @@ -1192,6 +1797,36 @@ method SYNTHESIZE. c_url = ls_request_prop-url ) ##NO_TEXT. endif. + if i_SPELL_OUT_MODE is supplied. + lv_queryparam = escape( val = i_SPELL_OUT_MODE format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `spell_out_mode` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_RATE_PERCENTAGE is supplied. + lv_queryparam = i_RATE_PERCENTAGE. + add_query_parameter( + exporting + i_parameter = `rate_percentage` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + + if i_PITCH_PERCENTAGE is supplied. + lv_queryparam = i_PITCH_PERCENTAGE. + add_query_parameter( + exporting + i_parameter = `pitch_percentage` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + endif. + " process header parameters data: lv_headerparam type string ##NEEDED. @@ -1233,13 +1868,24 @@ method SYNTHESIZE. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1403,13 +2049,24 @@ method CREATE_CUSTOM_MODEL. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1547,13 +2204,24 @@ method UPDATE_CUSTOM_MODEL. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1710,13 +2378,24 @@ method ADD_WORDS. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1835,13 +2514,24 @@ method ADD_WORD. lv_bodyparam = . concatenate lv_body lv_bodyparam into lv_body. endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. + if ls_request_prop-header_content_type cp '*json*'. + if lv_body is initial. + lv_body = '{}'. + elseif lv_body(1) ne '{'. + lv_body = `{` && lv_body && `}`. + endif. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + "replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. + find_regex( + exporting + i_regex = ';\s*charset=utf-8' + i_with = '' + i_ignoring_case = 'X' + changing + c_in = ls_request_prop-header_content_type ). else. ls_request_prop-body = lv_body. endif. @@ -1936,6 +2626,426 @@ method DELETE_WORD. + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->LIST_CUSTOM_PROMPTS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CUSTOMIZATION_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_PROMPTS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_CUSTOM_PROMPTS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/customizations/{customization_id}/prompts'. + replace all occurrences of `{customization_id}` in ls_request_prop-url-path with i_CUSTOMIZATION_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->ADD_CUSTOM_PROMPT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CUSTOMIZATION_ID TYPE STRING +* | [--->] I_PROMPT_ID TYPE STRING +* | [--->] I_METADATA TYPE T_PROMPT_METADATA +* | [--->] I_FILE TYPE FILE +* | [--->] I_FILE_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) +* | [--->] I_contenttype TYPE string (default ='multipart/form-data') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_PROMPT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method ADD_CUSTOM_PROMPT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/customizations/{customization_id}/prompts/{prompt_id}'. + replace all occurrences of `{customization_id}` in ls_request_prop-url-path with i_CUSTOMIZATION_ID ignoring case. + replace all occurrences of `{prompt_id}` in ls_request_prop-url-path with i_PROMPT_ID ignoring case. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + " process form parameters + data: + ls_form_part type ts_form_part, + lt_form_part type tt_form_part, + lv_formdata type string value is initial ##NEEDED, + lv_value type string ##NEEDED, + lv_index(3) type n value '000' ##NEEDED, + lv_keypattern type string ##NEEDED, + lv_base_name type string ##NEEDED, + lv_extension type string ##NEEDED. + + + if not i_METADATA is initial. + clear ls_form_part. + ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT. + ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. + lv_formdata = abap_to_json( i_value = i_METADATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). + ls_form_part-cdata = lv_formdata. + append ls_form_part to lt_form_part. + endif. + + + + if not i_FILE is initial. + lv_extension = get_file_extension( I_FILE_CT ). + lv_value = `form-data; name="file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. + lv_index = lv_index + 1. + clear ls_form_part. + ls_form_part-content_type = I_FILE_CT. + ls_form_part-content_disposition = lv_value. + ls_form_part-xdata = i_FILE. + append ls_form_part to lt_form_part. + endif. + + + " execute HTTP POST request + lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). + + + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->GET_CUSTOM_PROMPT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CUSTOMIZATION_ID TYPE STRING +* | [--->] I_PROMPT_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_PROMPT +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_CUSTOM_PROMPT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/customizations/{customization_id}/prompts/{prompt_id}'. + replace all occurrences of `{customization_id}` in ls_request_prop-url-path with i_CUSTOMIZATION_ID ignoring case. + replace all occurrences of `{prompt_id}` in ls_request_prop-url-path with i_PROMPT_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->DELETE_CUSTOM_PROMPT +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_CUSTOMIZATION_ID TYPE STRING +* | [--->] I_PROMPT_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_CUSTOM_PROMPT. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/customizations/{customization_id}/prompts/{prompt_id}'. + replace all occurrences of `{customization_id}` in ls_request_prop-url-path with i_CUSTOMIZATION_ID ignoring case. + replace all occurrences of `{prompt_id}` in ls_request_prop-url-path with i_PROMPT_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP DELETE request + lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). + + + +endmethod. + + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->LIST_SPEAKER_MODELS +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_SPEAKERS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method LIST_SPEAKER_MODELS. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/speakers'. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->CREATE_SPEAKER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_SPEAKER_NAME TYPE STRING +* | [--->] I_AUDIO TYPE FILE +* | [--->] I_contenttype TYPE string (default ='audio/wav') +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_SPEAKER_MODEL +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method CREATE_SPEAKER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/speakers'. + + " standard headers + ls_request_prop-header_content_type = I_contenttype. + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + " process query parameters + data: + lv_queryparam type string. + + lv_queryparam = escape( val = i_SPEAKER_NAME format = cl_abap_format=>e_uri_full ). + add_query_parameter( + exporting + i_parameter = `speaker_name` + i_value = lv_queryparam + changing + c_url = ls_request_prop-url ) ##NO_TEXT. + + + + + " process body parameters + ls_request_prop-body_bin = i_AUDIO. + + " execute HTTP POST request + lo_response = HTTP_POST( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->GET_SPEAKER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_SPEAKER_ID TYPE STRING +* | [--->] I_accept TYPE string (default ='application/json') +* | [<---] E_RESPONSE TYPE T_SPEAKER_CUSTOM_MODELS +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method GET_SPEAKER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/speakers/{speaker_id}'. + replace all occurrences of `{speaker_id}` in ls_request_prop-url-path with i_SPEAKER_ID ignoring case. + + " standard headers + ls_request_prop-header_accept = I_accept. + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + + " execute HTTP GET request + lo_response = HTTP_GET( i_request_prop = ls_request_prop ). + + + " retrieve JSON data + lv_json = get_response_string( lo_response ). + parse_json( + exporting + i_json = lv_json + i_dictionary = c_abapname_dictionary + changing + c_abap = e_response ). + +endmethod. + +* ---------------------------------------------------------------------------------------+ +* | Instance Public Method ZCL_IBMC_TEXT_TO_SPEECH_V1->DELETE_SPEAKER_MODEL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_SPEAKER_ID TYPE STRING +* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION +* +-------------------------------------------------------------------------------------- +method DELETE_SPEAKER_MODEL. + + data: + ls_request_prop type ts_request_prop, + lv_separator(1) type c ##NEEDED, + lv_sep(1) type c ##NEEDED, + lo_response type to_rest_response, + lv_json type string ##NEEDED. + + ls_request_prop-url-path = '/v1/speakers/{speaker_id}'. + replace all occurrences of `{speaker_id}` in ls_request_prop-url-path with i_SPEAKER_ID ignoring case. + + " standard headers + set_default_query_parameters( + changing + c_url = ls_request_prop-url ). + + + + + + + + " execute HTTP DELETE request lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). diff --git a/src/zcl_ibmc_text_to_speech_v1.clas.xml b/src/zcl_ibmc_text_to_speech_v1.clas.xml index f5187d8..9f35f42 100644 --- a/src/zcl_ibmc_text_to_speech_v1.clas.xml +++ b/src/zcl_ibmc_text_to_speech_v1.clas.xml @@ -12,6 +12,12 @@ X + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + ADD_CUSTOM_PROMPT + E + Add a custom prompt + ZCL_IBMC_TEXT_TO_SPEECH_V1 ADD_WORD @@ -30,12 +36,30 @@ E Create a custom model + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + CREATE_SPEAKER_MODEL + E + Create a speaker model + ZCL_IBMC_TEXT_TO_SPEECH_V1 DELETE_CUSTOM_MODEL E Delete a custom model + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + DELETE_CUSTOM_PROMPT + E + Delete a custom prompt + + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + DELETE_SPEAKER_MODEL + E + Delete a speaker model + ZCL_IBMC_TEXT_TO_SPEECH_V1 DELETE_USER_DATA @@ -54,12 +78,24 @@ E Get a custom model + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + GET_CUSTOM_PROMPT + E + Get a custom prompt + ZCL_IBMC_TEXT_TO_SPEECH_V1 GET_PRONUNCIATION E Get pronunciation + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + GET_SPEAKER_MODEL + E + Get a speaker model + ZCL_IBMC_TEXT_TO_SPEECH_V1 GET_VOICE @@ -78,6 +114,18 @@ E List custom models + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + LIST_CUSTOM_PROMPTS + E + List custom prompts + + + ZCL_IBMC_TEXT_TO_SPEECH_V1 + LIST_SPEAKER_MODELS + E + List speaker models + ZCL_IBMC_TEXT_TO_SPEECH_V1 LIST_VOICES diff --git a/src/zcl_ibmc_tone_analyzer_v3.clas.abap b/src/zcl_ibmc_tone_analyzer_v3.clas.abap deleted file mode 100644 index 659b898..0000000 --- a/src/zcl_ibmc_tone_analyzer_v3.clas.abap +++ /dev/null @@ -1,723 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Tone Analyzer

-"! The IBM Watson™ Tone Analyzer service uses linguistic analysis to detect -"! emotional and language tones in written text. The service can analyze tone at -"! both the document and sentence levels. You can use the service to understand -"! how your written communications are perceived and then to improve the tone of -"! your communications. Businesses can use the service to learn the tone of their -"! customers' communications and to respond to each customer appropriately, -"! or to understand and improve their customer conversations.
-"!
-"! **Note:** Request logging is disabled for the Tone Analyzer service. Regardless -"! of whether you set the `X-Watson-Learning-Opt-Out` request header, the service -"! does not log or retain data from requests and responses.
-class ZCL_IBMC_TONE_ANALYZER_V3 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! The score for a tone from the input content.

- begin of T_TONE_SCORE, - "! The score for the tone.
- "! * **`2017-09-21`:** The score that is returned lies in the range of 0.5 to 1. A - "! score greater than 0.75 indicates a high likelihood that the tone is perceived - "! in the content.
- "! * **`2016-05-19`:** The score that is returned lies in the range of 0 to 1. A - "! score less than 0.5 indicates that the tone is unlikely to be perceived in the - "! content; a score greater than 0.75 indicates a high likelihood that the tone is - "! perceived. - SCORE type DOUBLE, - "! The unique, non-localized identifier of the tone.
- "! * **`2017-09-21`:** The service can return results for the following tone IDs: - "! `anger`, `fear`, `joy`, and `sadness` (emotional tones); `analytical`, - "! `confident`, and `tentative` (language tones). The service returns results only - "! for tones whose scores meet a minimum threshold of 0.5.
- "! * **`2016-05-19`:** The service can return results for the following tone IDs of - "! the different categories: for the `emotion` category: `anger`, `disgust`, - "! `fear`, `joy`, and `sadness`; for the `language` category: `analytical`, - "! `confident`, and `tentative`; for the `social` category: `openness_big5`, - "! `conscientiousness_big5`, `extraversion_big5`, `agreeableness_big5`, and - "! `emotional_range_big5`. The service returns scores for all tones of a category, - "! regardless of their values. - TONE_ID type STRING, - "! The user-visible, localized name of the tone. - TONE_NAME type STRING, - end of T_TONE_SCORE. - types: - "!

- "! The category for a tone from the input content.

- begin of T_TONE_CATEGORY, - "! An array of `ToneScore` objects that provides the results for the tones of the - "! category. - TONES type STANDARD TABLE OF T_TONE_SCORE WITH NON-UNIQUE DEFAULT KEY, - "! The unique, non-localized identifier of the category for the results. The - "! service can return results for the following category IDs: `emotion_tone`, - "! `language_tone`, and `social_tone`. - CATEGORY_ID type STRING, - "! The user-visible, localized name of the category. - CATEGORY_NAME type STRING, - end of T_TONE_CATEGORY. - types: - "!

- "! Input for the general-purpose endpoint.

- begin of T_TONE_INPUT, - "! The input content that the service is to analyze. - TEXT type STRING, - end of T_TONE_INPUT. - types: - "!

- "! The score for an utterance from the input content.

- begin of T_TONE_CHAT_SCORE, - "! The score for the tone in the range of 0.5 to 1. A score greater than 0.75 - "! indicates a high likelihood that the tone is perceived in the utterance. - SCORE type DOUBLE, - "! The unique, non-localized identifier of the tone for the results. The service - "! returns results only for tones whose scores meet a minimum threshold of 0.5. - TONE_ID type STRING, - "! The user-visible, localized name of the tone. - TONE_NAME type STRING, - end of T_TONE_CHAT_SCORE. - types: - "!

- "! An utterance for the input of the general-purpose endpoint.

- begin of T_UTTERANCE, - "! An utterance contributed by a user in the conversation that is to be analyzed. - "! The utterance can contain multiple sentences. - TEXT type STRING, - "! A string that identifies the user who contributed the utterance specified by the - "! `text` parameter. - USER type STRING, - end of T_UTTERANCE. - types: - "!

- "! Input for the customer-engagement endpoint.

- begin of T_TONE_CHAT_INPUT, - "! An array of `Utterance` objects that provides the input content that the service - "! is to analyze. - UTTERANCES type STANDARD TABLE OF T_UTTERANCE WITH NON-UNIQUE DEFAULT KEY, - end of T_TONE_CHAT_INPUT. - types: - "!

- "! The results of the analysis for the individual sentences of

- "! the input content. - begin of T_SENTENCE_ANALYSIS, - "! The unique identifier of a sentence of the input content. The first sentence has - "! ID 0, and the ID of each subsequent sentence is incremented by one. - SENTENCE_ID type INTEGER, - "! The text of the input sentence. - TEXT type STRING, - "! **`2017-09-21`:** An array of `ToneScore` objects that provides the results of - "! the analysis for each qualifying tone of the sentence. The array includes - "! results for any tone whose score is at least 0.5. The array is empty if no tone - "! has a score that meets this threshold. **`2016-05-19`:** Not returned. - TONES type STANDARD TABLE OF T_TONE_SCORE WITH NON-UNIQUE DEFAULT KEY, - "! **`2017-09-21`:** Not returned. **`2016-05-19`:** An array of `ToneCategory` - "! objects that provides the results of the tone analysis for the sentence. The - "! service returns results only for the tones specified with the `tones` parameter - "! of the request. - TONE_CATEGORIES type STANDARD TABLE OF T_TONE_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - "! **`2017-09-21`:** Not returned. **`2016-05-19`:** The offset of the first - "! character of the sentence in the overall input content. - INPUT_FROM type INTEGER, - "! **`2017-09-21`:** Not returned. **`2016-05-19`:** The offset of the last - "! character of the sentence in the overall input content. - INPUT_TO type INTEGER, - end of T_SENTENCE_ANALYSIS. - types: - "!

- "! The results of the analysis for an utterance of the input

- "! content. - begin of T_UTTERANCE_ANALYSIS, - "! The unique identifier of the utterance. The first utterance has ID 0, and the ID - "! of each subsequent utterance is incremented by one. - UTTERANCE_ID type INTEGER, - "! The text of the utterance. - UTTERANCE_TEXT type STRING, - "! An array of `ToneChatScore` objects that provides results for the most prevalent - "! tones of the utterance. The array includes results for any tone whose score is - "! at least 0.5. The array is empty if no tone has a score that meets this - "! threshold. - TONES type STANDARD TABLE OF T_TONE_CHAT_SCORE WITH NON-UNIQUE DEFAULT KEY, - "! **`2017-09-21`:** An error message if the utterance contains more than 500 - "! characters. The service does not analyze the utterance. **`2016-05-19`:** Not - "! returned. - ERROR type STRING, - end of T_UTTERANCE_ANALYSIS. - types: - "!

- "! The results of the analysis for the utterances of the input

- "! content. - begin of T_UTTERANCE_ANALYSES, - "! An array of `UtteranceAnalysis` objects that provides the results for each - "! utterance of the input. - UTTERANCES_TONE type STANDARD TABLE OF T_UTTERANCE_ANALYSIS WITH NON-UNIQUE DEFAULT KEY, - "! **`2017-09-21`:** A warning message if the content contains more than 50 - "! utterances. The service analyzes only the first 50 utterances. - "! **`2016-05-19`:** Not returned. - WARNING type STRING, - end of T_UTTERANCE_ANALYSES. - types: - "!

- "! The error response from a failed request.

- begin of T_ERROR_MODEL, - "! The HTTP status code. - CODE type INTEGER, - "! A service-specific error code. - SUB_CODE type STRING, - "! A description of the error. - ERROR type STRING, - "! A URL to documentation explaining the cause and possibly solutions for the - "! error. - HELP type STRING, - end of T_ERROR_MODEL. - types: - "!

- "! The results of the analysis for the full input content.

- begin of T_DOCUMENT_ANALYSIS, - "! **`2017-09-21`:** An array of `ToneScore` objects that provides the results of - "! the analysis for each qualifying tone of the document. The array includes - "! results for any tone whose score is at least 0.5. The array is empty if no tone - "! has a score that meets this threshold. **`2016-05-19`:** Not returned. - TONES type STANDARD TABLE OF T_TONE_SCORE WITH NON-UNIQUE DEFAULT KEY, - "! **`2017-09-21`:** Not returned. **`2016-05-19`:** An array of `ToneCategory` - "! objects that provides the results of the tone analysis for the full document of - "! the input content. The service returns results only for the tones specified - "! with the `tones` parameter of the request. - TONE_CATEGORIES type STANDARD TABLE OF T_TONE_CATEGORY WITH NON-UNIQUE DEFAULT KEY, - "! **`2017-09-21`:** A warning message if the overall content exceeds 128 KB or - "! contains more than 1000 sentences. The service analyzes only the first 1000 - "! sentences for document-level analysis and the first 100 sentences for - "! sentence-level analysis. **`2016-05-19`:** Not returned. - WARNING type STRING, - end of T_DOCUMENT_ANALYSIS. - types: - "!

- "! The tone analysis results for the input from the

- "! general-purpose endpoint. - begin of T_TONE_ANALYSIS, - "! The results of the analysis for the full input content. - DOCUMENT_TONE type T_DOCUMENT_ANALYSIS, - "! An array of `SentenceAnalysis` objects that provides the results of the analysis - "! for the individual sentences of the input content. The service returns results - "! only for the first 100 sentences of the input. The field is omitted if the - "! `sentences` parameter of the request is set to `false`. - SENTENCES_TONE type STANDARD TABLE OF T_SENTENCE_ANALYSIS WITH NON-UNIQUE DEFAULT KEY, - end of T_TONE_ANALYSIS. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_TONE_SCORE type string value '|SCORE|TONE_ID|TONE_NAME|', - T_TONE_CATEGORY type string value '|TONES|CATEGORY_ID|CATEGORY_NAME|', - T_TONE_INPUT type string value '|TEXT|', - T_TONE_CHAT_SCORE type string value '|SCORE|TONE_ID|TONE_NAME|', - T_UTTERANCE type string value '|TEXT|', - T_TONE_CHAT_INPUT type string value '|UTTERANCES|', - T_SENTENCE_ANALYSIS type string value '|SENTENCE_ID|TEXT|', - T_UTTERANCE_ANALYSIS type string value '|UTTERANCE_ID|UTTERANCE_TEXT|TONES|', - T_UTTERANCE_ANALYSES type string value '|UTTERANCES_TONE|', - T_ERROR_MODEL type string value '|CODE|ERROR|', - T_DOCUMENT_ANALYSIS type string value '|', - T_TONE_ANALYSIS type string value '|DOCUMENT_TONE|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - TEXT type string value 'text', - UTTERANCES type string value 'utterances', - USER type string value 'user', - DOCUMENT_TONE type string value 'document_tone', - SENTENCES_TONE type string value 'sentences_tone', - TONES type string value 'tones', - TONE_CATEGORIES type string value 'tone_categories', - WARNING type string value 'warning', - SENTENCE_ID type string value 'sentence_id', - INPUT_FROM type string value 'input_from', - INPUT_TO type string value 'input_to', - SCORE type string value 'score', - TONE_ID type string value 'tone_id', - TONE_NAME type string value 'tone_name', - CATEGORY_ID type string value 'category_id', - CATEGORY_NAME type string value 'category_name', - UTTERANCES_TONE type string value 'utterances_tone', - UTTERANCE_ID type string value 'utterance_id', - UTTERANCE_TEXT type string value 'utterance_text', - ERROR type string value 'error', - CODE type string value 'code', - SUB_CODE type string value 'sub_code', - HELP type string value 'help', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Analyze general tone

- "! Use the general-purpose endpoint to analyze the tone of your input content. The - "! service analyzes the content for emotional and language tones. The method - "! always analyzes the tone of the full document; by default, it also analyzes the - "! tone of each individual sentence of the content.
- "!
- "! You can submit no more than 128 KB of total input content and no more than 1000 - "! individual sentences in JSON, plain text, or HTML format. The service analyzes - "! the first 1000 sentences for document-level analysis and only the first 100 - "! sentences for sentence-level analysis.
- "!
- "! Per the JSON specification, the default character encoding for JSON content is - "! effectively always UTF-8; per the HTTP specification, the default encoding for - "! plain text and HTML is ISO-8859-1 (effectively, the ASCII character set). When - "! specifying a content type of plain text or HTML, include the `charset` - "! parameter to indicate the character encoding of the input text; for example: - "! `Content-Type: text/plain;charset=utf-8`. For `text/html`, the service removes - "! HTML tags and analyzes only the textual content.
- "!
- "! **See also:** [Using the general-purpose - "! endpoint](https://cloud.ibm.com/docs/tone-analyzer?topic=tone-analyzer-utgpe#ut - "! gpe). - "! - "! @parameter I_TONE_INPUT | - "! JSON, plain text, or HTML input that contains the content to be analyzed. For - "! JSON input, provide an object of type `ToneInput`. - "! @parameter I_CONTENT_TYPE | - "! The type of the input. A character encoding can be specified by including a - "! `charset` parameter. For example, 'text/plain;charset=utf-8'. - "! @parameter I_SENTENCES | - "! Indicates whether the service is to return an analysis of each individual - "! sentence in addition to its analysis of the full document. If `true` (the - "! default), the service returns results for each sentence. - "! @parameter I_TONES | - "! **`2017-09-21`:** Deprecated. The service continues to accept the parameter for - "! backward-compatibility, but the parameter no longer affects the response.
- "!
- "! **`2016-05-19`:** A comma-separated list of tones for which the service is to - "! return its analysis of the input; the indicated tones apply both to the full - "! document and to individual sentences of the document. You can specify one or - "! more of the valid values. Omit the parameter to request results for all three - "! tones. - "! @parameter I_CONTENT_LANGUAGE | - "! The language of the input text for the request: English or French. Regional - "! variants are treated as their parent language; for example, `en-US` is - "! interpreted as `en`. The input content must match the specified language. Do - "! not submit content that contains both languages. You can use different - "! languages for **Content-Language** and **Accept-Language**.
- "! * **`2017-09-21`:** Accepts `en` or `fr`.
- "! * **`2016-05-19`:** Accepts only `en`. - "! @parameter I_ACCEPT_LANGUAGE | - "! The desired language of the response. For two-character arguments, regional - "! variants are treated as their parent language; for example, `en-US` is - "! interpreted as `en`. You can use different languages for **Content-Language** - "! and **Accept-Language**. - "! @parameter E_RESPONSE | - "! Service return value of type T_TONE_ANALYSIS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods TONE - importing - !I_TONE_INPUT type T_TONE_INPUT - !I_CONTENT_TYPE type STRING default 'application/json' - !I_SENTENCES type BOOLEAN default c_boolean_true - !I_TONES type TT_STRING optional - !I_CONTENT_LANGUAGE type STRING default 'en' - !I_ACCEPT_LANGUAGE type STRING default 'en' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TONE_ANALYSIS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Analyze customer-engagement tone

- "! Use the customer-engagement endpoint to analyze the tone of customer service and - "! customer support conversations. For each utterance of a conversation, the - "! method reports the most prevalent subset of the following seven tones: sad, - "! frustrated, satisfied, excited, polite, impolite, and sympathetic.
- "!
- "! If you submit more than 50 utterances, the service returns a warning for the - "! overall content and analyzes only the first 50 utterances. If you submit a - "! single utterance that contains more than 500 characters, the service returns an - "! error for that utterance and does not analyze the utterance. The request fails - "! if all utterances have more than 500 characters. Per the JSON specification, - "! the default character encoding for JSON content is effectively always UTF-8. - "!
- "!
- "! **See also:** [Using the customer-engagement - "! endpoint](https://cloud.ibm.com/docs/tone-analyzer?topic=tone-analyzer-utco#utc - "! o). - "! - "! @parameter I_UTTERANCES | - "! An object that contains the content to be analyzed. - "! @parameter I_CONTENT_LANGUAGE | - "! The language of the input text for the request: English or French. Regional - "! variants are treated as their parent language; for example, `en-US` is - "! interpreted as `en`. The input content must match the specified language. Do - "! not submit content that contains both languages. You can use different - "! languages for **Content-Language** and **Accept-Language**.
- "! * **`2017-09-21`:** Accepts `en` or `fr`.
- "! * **`2016-05-19`:** Accepts only `en`. - "! @parameter I_ACCEPT_LANGUAGE | - "! The desired language of the response. For two-character arguments, regional - "! variants are treated as their parent language; for example, `en-US` is - "! interpreted as `en`. You can use different languages for **Content-Language** - "! and **Accept-Language**. - "! @parameter E_RESPONSE | - "! Service return value of type T_UTTERANCE_ANALYSES - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods TONE_CHAT - importing - !I_UTTERANCES type T_TONE_CHAT_INPUT - !I_CONTENT_LANGUAGE type STRING default 'en' - !I_ACCEPT_LANGUAGE type STRING default 'en' - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_UTTERANCE_ANALYSES - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_TONE_ANALYZER_V3 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_TONE_ANALYZER_V3->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Tone Analyzer'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_TONE_ANALYZER_V3->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.tone-analyzer.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_TONE_ANALYZER_V3->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144444'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_TONE_ANALYZER_V3->TONE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_TONE_INPUT TYPE T_TONE_INPUT -* | [--->] I_CONTENT_TYPE TYPE STRING (default ='application/json') -* | [--->] I_SENTENCES TYPE BOOLEAN (default =c_boolean_true) -* | [--->] I_TONES TYPE TT_STRING(optional) -* | [--->] I_CONTENT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_ACCEPT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TONE_ANALYSIS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method TONE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/tone'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_SENTENCES is supplied. - lv_queryparam = i_SENTENCES. - add_query_parameter( - exporting - i_parameter = `sentences` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_TONES is supplied. - data: - lv_item_TONES type STRING. - clear: lv_queryparam, lv_sep. - loop at i_TONES into lv_item_TONES. - lv_queryparam = lv_queryparam && lv_sep && lv_item_TONES. - lv_sep = ','. - endloop. - lv_queryparam = escape( val = lv_queryparam format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `tones` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_CONTENT_TYPE is supplied. - ls_request_prop-header_content_type = I_CONTENT_TYPE. - endif. - - if i_CONTENT_LANGUAGE is supplied. - lv_headerparam = I_CONTENT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Content-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - if i_ACCEPT_LANGUAGE is supplied. - lv_headerparam = I_ACCEPT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Accept-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_TONE_INPUT ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_TONE_INPUT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'tone_input' i_value = i_TONE_INPUT ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_TONE_INPUT to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_TONE_ANALYZER_V3->TONE_CHAT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_UTTERANCES TYPE T_TONE_CHAT_INPUT -* | [--->] I_CONTENT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_ACCEPT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_UTTERANCE_ANALYSES -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method TONE_CHAT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/tone_chat'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_CONTENT_LANGUAGE is supplied. - lv_headerparam = I_CONTENT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Content-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - if i_ACCEPT_LANGUAGE is supplied. - lv_headerparam = I_ACCEPT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Accept-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_UTTERANCES ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_UTTERANCES i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'utterances' i_value = i_UTTERANCES ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_UTTERANCES to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_tone_analyzer_v3.clas.xml b/src/zcl_ibmc_tone_analyzer_v3.clas.xml deleted file mode 100644 index 44e3d6d..0000000 --- a/src/zcl_ibmc_tone_analyzer_v3.clas.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - ZCL_IBMC_TONE_ANALYZER_V3 - E - Tone Analyzer - 1 - X - X - X - - - - ZCL_IBMC_TONE_ANALYZER_V3 - TONE - E - Analyze general tone - - - ZCL_IBMC_TONE_ANALYZER_V3 - TONE_CHAT - E - Analyze customer-engagement tone - - - - - diff --git a/src/zcl_ibmc_util.clas.abap b/src/zcl_ibmc_util.clas.abap index 980cd02..fab5162 100644 --- a/src/zcl_ibmc_util.clas.abap +++ b/src/zcl_ibmc_util.clas.abap @@ -1,4 +1,4 @@ -* Copyright 2019,2020 IBM Corp. All Rights Reserved. +* Copyright 2019,2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -11,7 +11,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -class ZCL_IBMC_UTIL definition +class ZCL_IBMC_util definition public final create public . @@ -28,14 +28,14 @@ public section. "! @parameter IT_EXCLUDED_FIELDS | Internal table of table fields in I_ITAB that should not occur in result. "! @parameter E_JSON | JSON string. "! - class-methods ITAB_TO_TABLESCHEMA + class-methods itab_to_tableschema importing - !I_ITAB type ANY TABLE - !I_DICTIONARY type ANY optional - !I_LOWER_CASE type ZCL_IBMC_SERVICE=>BOOLEAN default ZCL_IBMC_SERVICE=>C_BOOLEAN_FALSE - !IT_EXCLUDED_FIELDS type ZCL_IBMC_SERVICE=>TT_STRING optional + !i_itab type any table + !i_dictionary type any optional + !i_lower_case type ZCL_IBMC_service=>boolean default ZCL_IBMC_service=>c_boolean_false + !it_excluded_fields type ZCL_IBMC_service=>tt_string optional returning - value(E_JSON) type STRING . + value(e_json) type string . "! Converts a JSON string in table schema format to an internal table. "! E.g.: '{"tableschema_key": {"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}}' "! @@ -43,64 +43,64 @@ public section. "! @parameter I_TABLESCHEMA_KEY | Key in JSON string that holds the table schema. "! @parameter E_ITAB | Internal table containing converted data. "! - class-methods TABLESCHEMA_TO_ITAB + class-methods tableschema_to_itab importing - !I_JSON type STRING - !I_TABLESCHEMA_KEY type STRING optional + !i_json type string + !i_tableschema_key type string optional exporting - !E_ITAB type ANY TABLE . + !e_itab type any table . "! Converts a timestamp in UTC to a timestamp in local time. "! "! @parameter IV_TIMESTAMP | Timestamp (UTC). "! @parameter EV_LOCAL | Timestamp (local time). "! - class-methods CONVERT_TIMESTAMP_TO_LOCAL + class-methods convert_timestamp_to_local importing - !IV_TIMESTAMP type TIMESTAMP + !iv_timestamp type timestamp returning - value(EV_LOCAL) type STRING . + value(ev_local) type string . "! Determine MIME type from a file name, e.g. 'docu.txt' -> 'text_/plain'. "! "! @parameter I_FILENAME | Filename with extension. "! @parameter E_MIMETYPE | MIME type. "! - class-methods GET_MIMETYPE_FROM_EXTENSION + class-methods get_mimetype_from_extension importing - !I_FILENAME type STRING + !i_filename type string returning - value(E_MIMETYPE) type STRING . + value(e_mimetype) type string . "! Converts a timestamp in UTC to a timestamp in another timezone. "! "! @parameter I_TIMESTAMP | Timestamp (UTC). "! @parameter I_TIMEZONE | Time zone "! @parameter E_TIMESTAMP | Timestamp in give time zone. "! - class-methods UTC_TO_TIMEZONE + class-methods utc_to_timezone importing - !I_TIMESTAMP type TIMESTAMP - !I_TIMEZONE type ZIF_IBMC_SERVICE_ARCH=>TY_TIMEZONE optional + !i_timestamp type timestamp + !i_timezone type ZIF_IBMC_service_arch=>ty_timezone optional returning - value(E_TIMESTAMP) type TIMESTAMP . + value(e_timestamp) type timestamp . "! Converts datetime format to a timestamp, i.e. yyyy-mm-ddThh:mm:ssZ -> YYYYMMDDHHMMSS "! "! @parameter I_DATETIME | Input in datetime format. "! @parameter E_TIMESTAMP | Timestamp. "! - class-methods CONVERT_DATETIME_TO_TIMESTAMP + class-methods convert_datetime_to_timestamp importing - !I_DATETIME type ZCL_IBMC_SERVICE=>DATETIME + !i_datetime type ZCL_IBMC_service=>datetime returning - value(E_TIMESTAMP) type TIMESTAMP . + value(e_timestamp) type timestamp . "! Converts a timestamp to datetime format, i.e. YYYYMMDDHHMMSS -> yyyy-mm-ddThh:mm:ssZ "! "! @parameter I_TIMESTAMP | Timestamp. "! @parameter E_DATETIME | Datetime format. "! - class-methods CONVERT_TIMESTAMP_TO_DATETIME + class-methods convert_timestamp_to_datetime importing - !I_TIMESTAMP type TIMESTAMP + !i_timestamp type timestamp returning - value(E_DATETIME) type ZCL_IBMC_SERVICE=>DATETIME . + value(e_datetime) type ZCL_IBMC_service=>datetime . protected section. private section. ENDCLASS. @@ -110,7 +110,13 @@ ENDCLASS. CLASS ZCL_IBMC_UTIL IMPLEMENTATION. - method CONVERT_DATETIME_TO_TIMESTAMP. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>CONVERT_DATETIME_TO_TIMESTAMP +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_DATETIME TYPE ZCL_IBMC_SERVICE=>DATETIME +* | [<-()] E_TIMESTAMP TYPE TIMESTAMP +* +-------------------------------------------------------------------------------------- + method convert_datetime_to_timestamp. constants: c_zero type timestamp value '0'. " avoid conversion at runtime @@ -133,7 +139,13 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. endmethod. - method CONVERT_TIMESTAMP_TO_DATETIME. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>CONVERT_TIMESTAMP_TO_DATETIME +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_TIMESTAMP TYPE TIMESTAMP +* | [<-()] E_DATETIME TYPE ZCL_IBMC_SERVICE=>DATETIME +* +-------------------------------------------------------------------------------------- + method convert_timestamp_to_datetime. data: lv_year(4) type n, @@ -162,17 +174,23 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>CONVERT_TIMESTAMP_TO_LOCAL +* +-------------------------------------------------------------------------------------------------+ +* | [--->] IV_TIMESTAMP TYPE TIMESTAMP +* | [<-()] EV_LOCAL TYPE STRING +* +-------------------------------------------------------------------------------------- method convert_timestamp_to_local. data: lv_dats type d, lv_tims type t, - lv_timezone type zif_ibmc_service_arch=>ty_timezone, + lv_timezone type ZIF_IBMC_service_arch=>ty_timezone, lv_datc(10) type c, lv_timc(8) type c. " split timestamp to date and time according to time zone - lv_timezone = zcl_ibmc_service_arch=>get_timezone( ). + lv_timezone = ZCL_IBMC_service_arch=>get_timezone( ). convert time stamp iv_timestamp time zone lv_timezone into date lv_dats time lv_tims. @@ -184,33 +202,54 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>GET_MIMETYPE_FROM_EXTENSION +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_FILENAME TYPE STRING +* | [<-()] E_MIMETYPE TYPE STRING +* +-------------------------------------------------------------------------------------- method get_mimetype_from_extension. data: l_extension type string. if i_filename is initial. - e_mimetype = zif_ibmc_service_arch=>c_mediatype-all. + e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-all. exit. endif. - find regex '\.([^\.]*)$' in i_filename submatches l_extension. - if sy-subrc <> 0. + "find regex '\.([^\.]*)$' in i_filename submatches l_extension. + data(l_subrc) = zcl_ibmc_service=>find_regex( + exporting + i_regex = '\.([^\.]*)$' + i_in = i_filename + changing + c_submatch1 = l_extension ). + if l_subrc <> 0. l_extension = i_filename. endif. translate l_extension to lower case. case l_extension. - when 'jpg' or 'jpeg'. e_mimetype = zif_ibmc_service_arch=>c_mediatype-image_jpeg. - when 'png'. e_mimetype = zif_ibmc_service_arch=>c_mediatype-image_png. - when 'txt'. e_mimetype = zif_ibmc_service_arch=>c_mediatype-text_plain. - when 'csv'. e_mimetype = zif_ibmc_service_arch=>c_mediatype-text_csv. + when 'jpg' or 'jpeg'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-image_jpeg. + when 'png'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-image_png. + when 'txt'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-text_plain. + when 'csv'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-text_csv. when others. e_mimetype = `application/` && l_extension ##NO_TEXT. endcase. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>ITAB_TO_TABLESCHEMA +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_ITAB TYPE ANY TABLE +* | [--->] I_DICTIONARY TYPE ANY(optional) +* | [--->] I_LOWER_CASE TYPE ZCL_IBMC_SERVICE=>BOOLEAN (default =ZCL_IBMC_SERVICE=>C_BOOLEAN_FALSE) +* | [--->] IT_EXCLUDED_FIELDS TYPE ZCL_IBMC_SERVICE=>TT_STRING(optional) +* | [<-()] E_JSON TYPE STRING +* +-------------------------------------------------------------------------------------- method itab_to_tableschema. " Converts an internal table to a JSON object string with keys "fields" and "values". " Example: I_ITAB = | PET | NUMBER | @@ -223,7 +262,7 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. " PET type string value 'MyPet', " END OF i_dictionary. " --> E_JSON = '{"fields": ["MyPet", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}' - " Field names are translated to lower case, if I_LOWER_CASE = zcl_ibmc_service=>c_boolean_true. + " Field names are translated to lower case, if I_LOWER_CASE = ZCL_IBMC_service=>c_boolean_true. " Field types must be elementary or table of elementary. " Field names in table IT_EXCLUDED_FIELDS are skipped and will not appear in the JSON string. @@ -272,7 +311,7 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. lv_fieldname = . endif. endif. - if i_lower_case eq zcl_ibmc_service=>c_boolean_true. + if i_lower_case eq ZCL_IBMC_service=>c_boolean_true. translate lv_fieldname to lower case. endif. e_json = e_json && lv_sep1 && `"` && lv_fieldname && `"`. @@ -334,6 +373,13 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>TABLESCHEMA_TO_ITAB +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_JSON TYPE STRING +* | [--->] I_TABLESCHEMA_KEY TYPE STRING(optional) +* | [<---] E_ITAB TYPE ANY TABLE +* +-------------------------------------------------------------------------------------- method tableschema_to_itab. data: @@ -387,13 +433,13 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. " parse JSON try. - zcl_ibmc_service=>parse_json( + ZCL_IBMC_service=>parse_json( exporting i_json = lv_json "i_dictionary = c_abapname_dictionary changing c_abap = ). - catch zcx_ibmc_service_exception. + catch ZCX_IBMC_service_exception. return. endtry. assign component lv_tableschema_key of structure to . @@ -538,15 +584,22 @@ CLASS ZCL_IBMC_UTIL IMPLEMENTATION. endmethod. +* ---------------------------------------------------------------------------------------+ +* | Static Public Method ZCL_IBMC_UTIL=>UTC_TO_TIMEZONE +* +-------------------------------------------------------------------------------------------------+ +* | [--->] I_TIMESTAMP TYPE TIMESTAMP +* | [--->] I_TIMEZONE TYPE ZIF_IBMC_SERVICE_ARCH=>TY_TIMEZONE(optional) +* | [<-()] E_TIMESTAMP TYPE TIMESTAMP +* +-------------------------------------------------------------------------------------- method utc_to_timezone. data: - lv_timezone type zif_ibmc_service_arch=>ty_timezone, + lv_timezone type ZIF_IBMC_service_arch=>ty_timezone, lv_date type d, lv_time type t. if i_timezone is initial. - lv_timezone = zcl_ibmc_service_arch=>get_timezone( ). + lv_timezone = ZCL_IBMC_service_arch=>get_timezone( ). else. lv_timezone = i_timezone. endif. diff --git a/src/zcl_ibmc_util.clas.xml b/src/zcl_ibmc_util.clas.xml index 2a1f5db..49a3b0f 100644 --- a/src/zcl_ibmc_util.clas.xml +++ b/src/zcl_ibmc_util.clas.xml @@ -1,60 +1,60 @@ - - - - - - ZCL_IBMC_UTIL - E - Utilities to connect to IBM Watson - 1 - X - X - X - - - - ZCL_IBMC_UTIL - CONVERT_DATETIME_TO_TIMESTAMP - E - Converts a DATETIME String to type TIMESTAMP - - - ZCL_IBMC_UTIL - CONVERT_TIMESTAMP_TO_DATETIME - E - Converts a DATETIME String to type TIMESTAMP - - - ZCL_IBMC_UTIL - CONVERT_TIMESTAMP_TO_LOCAL - E - Converts a UTF timestamp to a local timestamp - - - ZCL_IBMC_UTIL - GET_MIMETYPE_FROM_EXTENSION - E - Returns mime type for a given extension - - - ZCL_IBMC_UTIL - ITAB_TO_TABLESCHEMA - E - Converts an internal table to table schema JSON format - - - ZCL_IBMC_UTIL - TABLESCHEMA_TO_ITAB - E - Converts a JSON string in table schema format to an itab - - - ZCL_IBMC_UTIL - UTC_TO_TIMEZONE - E - Converts an UTC timestamp to the specified timezone - - - - - + + + + + + ZCL_IBMC_UTIL + E + Utilities to connect to IBM Watson + 1 + X + X + X + + + + ZCL_IBMC_UTIL + CONVERT_DATETIME_TO_TIMESTAMP + E + Converts a DATETIME String to type TIMESTAMP + + + ZCL_IBMC_UTIL + CONVERT_TIMESTAMP_TO_DATETIME + E + Converts a DATETIME String to type TIMESTAMP + + + ZCL_IBMC_UTIL + CONVERT_TIMESTAMP_TO_LOCAL + E + Converts a UTF timestamp to a local timestamp + + + ZCL_IBMC_UTIL + GET_MIMETYPE_FROM_EXTENSION + E + Returns mime type for a given extension + + + ZCL_IBMC_UTIL + ITAB_TO_TABLESCHEMA + E + Converts an internal table to table schema JSON format + + + ZCL_IBMC_UTIL + TABLESCHEMA_TO_ITAB + E + Converts a JSON string in table schema format to an itab + + + ZCL_IBMC_UTIL + UTC_TO_TIMEZONE + E + Converts an UTC timestamp to the specified timezone + + + + + \ No newline at end of file diff --git a/src/zcl_ibmc_visual_recognition_v3.clas.abap b/src/zcl_ibmc_visual_recognition_v3.clas.abap deleted file mode 100644 index 92c148d..0000000 --- a/src/zcl_ibmc_visual_recognition_v3.clas.abap +++ /dev/null @@ -1,1335 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Visual Recognition

-"! IBM Watson™ Visual Recognition is discontinued. Existing instances are -"! supported until 1 December 2021, but as of 7 January 2021, you can't -"! create instances. Any instance that is provisioned on 1 December 2021 will be -"! deleted.
-"! {: deprecated}
-"!
-"! The IBM Watson Visual Recognition service uses deep learning algorithms to -"! identify scenes and objects in images that you upload to the service. You can -"! create and train a custom classifier to identify subjects that suit your needs. -"!
-class ZCL_IBMC_VISUAL_RECOGNITION_V3 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! Number of images processed for the API call.

- T_IMAGES_PROCESSED type Integer. - types: - "!

- "! Result of a class within a classifier.

- begin of T_CLASS_RESULT, - "! Name of the class.
- "!
- "! Class names are translated in the language defined by the **Accept-Language** - "! request header for the build-in classifier IDs (`default`, `food`, and - "! `explicit`). Class names of custom classifiers are not translated. The response - "! might not be in the specified language when the requested language is not - "! supported or when there is no translation for the class name. - CLASS type STRING, - "! Confidence score for the property in the range of 0 to 1. A higher score - "! indicates greater likelihood that the class is depicted in the image. The - "! default threshold for returning scores from a classifier is 0.5. - SCORE type FLOAT, - "! Knowledge graph of the property. For example, `/fruit/pome/apple/eating - "! apple/Granny Smith`. Included only if identified. - TYPE_HIERARCHY type STRING, - end of T_CLASS_RESULT. - types: - "!

- "! Classifier and score combination.

- begin of T_CLASSIFIER_RESULT, - "! Name of the classifier. - NAME type STRING, - "! ID of a classifier identified in the image. - CLASSIFIER_ID type STRING, - "! Classes within the classifier. - CLASSES type STANDARD TABLE OF T_CLASS_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFIER_RESULT. - types: - "!

- "! Information about what might have caused a failure, such as

- "! an image that is too large. Not returned when there is no error. - begin of T_ERROR_INFO, - "! HTTP status code. - CODE type INTEGER, - "! Human-readable error description. For example, `File size limit exceeded`. - DESCRIPTION type STRING, - "! Codified error string. For example, `limit_exceeded`. - ERROR_ID type STRING, - end of T_ERROR_INFO. - types: - "!

- "! Results for one image.

- begin of T_CLASSIFIED_IMAGE, - "! Source of the image before any redirects. Not returned when the image is - "! uploaded. - SOURCE_URL type STRING, - "! Fully resolved URL of the image after redirects are followed. Not returned when - "! the image is uploaded. - RESOLVED_URL type STRING, - "! Relative path of the image file if uploaded directly. Not returned when the - "! image is passed by URL. - IMAGE type STRING, - "! Information about what might have caused a failure, such as an image that is too - "! large. Not returned when there is no error. - ERROR type T_ERROR_INFO, - "! The classifiers. - CLASSIFIERS type STANDARD TABLE OF T_CLASSIFIER_RESULT WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFIED_IMAGE. - types: - "!

- "! Information about something that went wrong.

- begin of T_WARNING_INFO, - "! Codified warning string, such as `limit_reached`. - WARNING_ID type STRING, - "! Information about the error. - DESCRIPTION type STRING, - end of T_WARNING_INFO. - types: - "!

- "! Results for all images.

- begin of T_CLASSIFIED_IMAGES, - "! Number of custom classes identified in the images. - CUSTOM_CLASSES type INTEGER, - "! Number of images processed for the API call. - IMAGES_PROCESSED type INTEGER, - "! Classified images. - IMAGES type STANDARD TABLE OF T_CLASSIFIED_IMAGE WITH NON-UNIQUE DEFAULT KEY, - "! Information about what might cause less than optimal output. For example, a - "! request sent with a corrupt .zip file and a list of image URLs will still - "! complete, but does not return the expected output. Not returned when there is - "! no warning. - WARNINGS type STANDARD TABLE OF T_WARNING_INFO WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFIED_IMAGES. - types: - "!

- "! Knowledge graph of the property. For example,

- "! `/fruit/pome/apple/eating apple/Granny Smith`. Included only if identified. - T_TYPE_HIERARCHY type String. - types: - "!

- "! A category within a classifier.

- begin of T_CLASS, - "! The name of the class. - CLASS type STRING, - end of T_CLASS. - types: - "!

- "! Empty object.

- T_EMPTY type JSONOBJECT. - types: - "!

- "! Error information.

- begin of T_ERROR_RESPONSE, - "! HTTP error code. - CODE type INTEGER, - "! Human-readable error string, like 'Invalid image file'. - ERROR type STRING, - end of T_ERROR_RESPONSE. - types: - "! No documentation available. - begin of T_INLINE_OBJECT1, - "! The name of the new classifier. Encode special characters in UTF-8. - NAME type STRING, - "! A .zip file of images that depict the visual subject of a class in the new - "! classifier. You can include more than one positive example file in a call.
- "!
- "! Specify the parameter name by appending `_positive_examples` to the class name. - "! For example, `goldenretriever_positive_examples` creates the class - "! **goldenretriever**. The string cannot contain the following characters: ``$ * - "! - { } \ | / ' " ` [ ]``.
- "!
- "! Include at least 10 images in .jpg or .png format. The minimum recommended image - "! resolution is 32X32 pixels. The maximum number of images is 10,000 images or - "! 100 MB per .zip file.
- "!
- "! Encode special characters in the file name in UTF-8. - POSITIVE_EXAMPLES type FILE, - "! A .zip file of images that do not depict the visual subject of any of the - "! classes of the new classifier. Must contain a minimum of 10 images.
- "!
- "! Encode special characters in the file name in UTF-8. - NEGATIVE_EXAMPLES type FILE, - end of T_INLINE_OBJECT1. - types: - "! No documentation available. - begin of T_INLINE_OBJECT, - "! An image file (.gif, .jpg, .png, .tif) or .zip file with images. Maximum image - "! size is 10 MB. Include no more than 20 images and limit the .zip file to 100 - "! MB. Encode the image and .zip file names in UTF-8 if they contain non-ASCII - "! characters. The service assumes UTF-8 encoding if it encounters non-ASCII - "! characters.
- "!
- "! You can also include an image with the **url** parameter. - IMAGES_FILE type FILE, - "! The URL of an image (.gif, .jpg, .png, .tif) to analyze. The minimum recommended - "! pixel density is 32X32 pixels, but the service tends to perform better with - "! images that are at least 224 x 224 pixels. The maximum image size is 10 - "! MB.
- "!
- "! You can also include images with the **images_file** parameter. - URL type STRING, - "! The minimum score a class must have to be displayed in the response. Set the - "! threshold to `0.0` to return all identified classes. - THRESHOLD type FLOAT, - "! The categories of classifiers to apply. The **classifier_ids** parameter - "! overrides **owners**, so make sure that **classifier_ids** is empty.
- "! - Use `IBM` to classify against the `default` general classifier. You get the - "! same result if both **classifier_ids** and **owners** parameters are - "! empty.
- "! - Use `me` to classify against all your custom classifiers. However, for better - "! performance use **classifier_ids** to specify the specific custom classifiers - "! to apply.
- "! - Use both `IBM` and `me` to analyze the image against both classifier - "! categories. - OWNERS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Which classifiers to apply. Overrides the **owners** parameter. You can specify - "! both custom and built-in classifier IDs. The built-in `default` classifier is - "! used if both **classifier_ids** and **owners** parameters are empty.
- "!
- "! The following built-in classifier IDs require no training:
- "! - `default`: Returns classes from thousands of general tags.
- "! - `food`: Enhances specificity and accuracy for images of food items.
- "! - `explicit`: Evaluates whether the image might be pornographic. - CLASSIFIER_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - end of T_INLINE_OBJECT. - types: - "! No documentation available. - begin of T_INLINE_OBJECT2, - "! A .zip file of images that depict the visual subject of a class in the - "! classifier. The positive examples create or update classes in the classifier. - "! You can include more than one positive example file in a call.
- "!
- "! Specify the parameter name by appending `_positive_examples` to the class name. - "! For example, `goldenretriever_positive_examples` creates the class - "! `goldenretriever`. The string cannot contain the following characters: ``$ * - - "! { } \ | / ' " ` [ ]``.
- "!
- "! Include at least 10 images in .jpg or .png format. The minimum recommended image - "! resolution is 32X32 pixels. The maximum number of images is 10,000 images or - "! 100 MB per .zip file.
- "!
- "! Encode special characters in the file name in UTF-8. - POSITIVE_EXAMPLES type FILE, - "! A .zip file of images that do not depict the visual subject of any of the - "! classes of the new classifier. Must contain a minimum of 10 images.
- "!
- "! Encode special characters in the file name in UTF-8. - NEGATIVE_EXAMPLES type FILE, - end of T_INLINE_OBJECT2. - types: - "!

- "! Information about a classifier.

- begin of T_CLASSIFIER, - "! ID of a classifier identified in the image. - CLASSIFIER_ID type STRING, - "! Name of the classifier. - NAME type STRING, - "! Unique ID of the account who owns the classifier. Might not be returned by some - "! requests. - OWNER type STRING, - "! Training status of classifier. - STATUS type STRING, - "! Whether the classifier can be downloaded as a Core ML model after the training - "! status is `ready`. - CORE_ML_ENABLED type BOOLEAN, - "! If classifier training has failed, this field might explain why. - EXPLANATION type STRING, - "! Date and time in Coordinated Universal Time (UTC) that the classifier was - "! created. - CREATED type DATETIME, - "! Classes that define a classifier. - CLASSES type STANDARD TABLE OF T_CLASS WITH NON-UNIQUE DEFAULT KEY, - "! Date and time in Coordinated Universal Time (UTC) that the classifier was - "! updated. Might not be returned by some requests. Identical to `updated` and - "! retained for backward compatibility. - RETRAINED type DATETIME, - "! Date and time in Coordinated Universal Time (UTC) that the classifier was most - "! recently updated. The field matches either `retrained` or `created`. Might not - "! be returned by some requests. - UPDATED type DATETIME, - end of T_CLASSIFIER. - types: - "!

- "! Number of custom classes identified in the images.

- T_CUSTOM_CLASSES_PROCESSED type Integer. - types: - "!

- "! Confidence score for the property in the range of 0 to 1. A

- "! higher score indicates greater likelihood that the class is depicted in the - "! image. The default threshold for returning scores from a classifier is 0.5. - T_CONFIDENCE_SCORE type Float. - types: - "!

- "! Relative path of the image file if uploaded directly. Not

- "! returned when the image is passed by URL. - T_IMAGE_FILE type String. - types: - "!

- "! Error information.

- begin of T_ERROR_HTML, - "! HTML description of the error. - ERROR1 type STRING, - end of T_ERROR_HTML. - types: - "!

- "! Source of the image before any redirects. Not returned when

- "! the image is uploaded. - T_SOURCE_URL type String. - types: - "!

- "! Fully resolved URL of the image after redirects are

- "! followed. Not returned when the image is uploaded. - T_RESOLVED_URL type String. - types: - "!

- "! A container for the list of classifiers.

- begin of T_CLASSIFIERS, - "! List of classifiers. - CLASSIFIERS type STANDARD TABLE OF T_CLASSIFIER WITH NON-UNIQUE DEFAULT KEY, - end of T_CLASSIFIERS. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_CLASS_RESULT type string value '|CLASS|SCORE|', - T_CLASSIFIER_RESULT type string value '|NAME|CLASSIFIER_ID|CLASSES|', - T_ERROR_INFO type string value '|CODE|DESCRIPTION|ERROR_ID|', - T_CLASSIFIED_IMAGE type string value '|CLASSIFIERS|', - T_WARNING_INFO type string value '|WARNING_ID|DESCRIPTION|', - T_CLASSIFIED_IMAGES type string value '|IMAGES|', - T_CLASS type string value '|CLASS|', - T_ERROR_RESPONSE type string value '|CODE|ERROR|', - T_INLINE_OBJECT1 type string value '|NAME|POSITIVE_EXAMPLES|', - T_INLINE_OBJECT type string value '|', - T_INLINE_OBJECT2 type string value '|', - T_CLASSIFIER type string value '|CLASSIFIER_ID|NAME|', - T_ERROR_HTML type string value '|', - T_CLASSIFIERS type string value '|CLASSIFIERS|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - WARNING_ID type string value 'warning_id', - DESCRIPTION type string value 'description', - CODE type string value 'code', - ERROR_ID type string value 'error_id', - CLASSIFIERS type string value 'classifiers', - CLASSIFIER_ID type string value 'classifier_id', - NAME type string value 'name', - OWNER type string value 'owner', - STATUS type string value 'status', - CORE_ML_ENABLED type string value 'core_ml_enabled', - EXPLANATION type string value 'explanation', - CREATED type string value 'created', - CLASSES type string value 'classes', - RETRAINED type string value 'retrained', - UPDATED type string value 'updated', - CLASS type string value 'class', - SOURCE_URL type string value 'source_url', - RESOLVED_URL type string value 'resolved_url', - IMAGE type string value 'image', - ERROR type string value 'error', - ERROR1 type string value 'Error', - SCORE type string value 'score', - TYPE_HIERARCHY type string value 'type_hierarchy', - CUSTOM_CLASSES type string value 'custom_classes', - IMAGES_PROCESSED type string value 'images_processed', - IMAGES type string value 'images', - WARNINGS type string value 'warnings', - IMAGES_FILE type string value 'images_file', - URL type string value 'url', - THRESHOLD type string value 'threshold', - OWNERS type string value 'owners', - CLASSIFIER_IDS type string value 'classifier_ids', - POSITIVE_EXAMPLES type string value 'positive_examples', - NEGATIVE_EXAMPLES type string value 'negative_examples', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Classify images

- "! Classify images with built-in or custom classifiers. - "! - "! @parameter I_IMAGES_FILE | - "! An image file (.gif, .jpg, .png, .tif) or .zip file with images. Maximum image - "! size is 10 MB. Include no more than 20 images and limit the .zip file to 100 - "! MB. Encode the image and .zip file names in UTF-8 if they contain non-ASCII - "! characters. The service assumes UTF-8 encoding if it encounters non-ASCII - "! characters.
- "!
- "! You can also include an image with the **url** parameter. - "! @parameter I_IMAGES_FILENAME | - "! The filename for imagesFile. - "! @parameter I_IMAGES_FILE_CONTENT_TYPE | - "! The content type of imagesFile. - "! @parameter I_URL | - "! The URL of an image (.gif, .jpg, .png, .tif) to analyze. The minimum recommended - "! pixel density is 32X32 pixels, but the service tends to perform better with - "! images that are at least 224 x 224 pixels. The maximum image size is 10 - "! MB.
- "!
- "! You can also include images with the **images_file** parameter. - "! @parameter I_THRESHOLD | - "! The minimum score a class must have to be displayed in the response. Set the - "! threshold to `0.0` to return all identified classes. - "! @parameter I_OWNERS | - "! The categories of classifiers to apply. The **classifier_ids** parameter - "! overrides **owners**, so make sure that **classifier_ids** is empty.
- "! - Use `IBM` to classify against the `default` general classifier. You get the - "! same result if both **classifier_ids** and **owners** parameters are - "! empty.
- "! - Use `me` to classify against all your custom classifiers. However, for better - "! performance use **classifier_ids** to specify the specific custom classifiers - "! to apply.
- "! - Use both `IBM` and `me` to analyze the image against both classifier - "! categories. - "! @parameter I_CLASSIFIER_IDS | - "! Which classifiers to apply. Overrides the **owners** parameter. You can specify - "! both custom and built-in classifier IDs. The built-in `default` classifier is - "! used if both **classifier_ids** and **owners** parameters are empty.
- "!
- "! The following built-in classifier IDs require no training:
- "! - `default`: Returns classes from thousands of general tags.
- "! - `food`: Enhances specificity and accuracy for images of food items.
- "! - `explicit`: Evaluates whether the image might be pornographic. - "! @parameter I_ACCEPT_LANGUAGE | - "! The desired language of parts of the response. See the response for details. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIED_IMAGES - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CLASSIFY - importing - !I_IMAGES_FILE type FILE optional - !I_IMAGES_FILENAME type STRING optional - !I_IMAGES_FILE_CONTENT_TYPE type STRING optional - !I_URL type STRING optional - !I_THRESHOLD type FLOAT optional - !I_OWNERS type TT_STRING optional - !I_CLASSIFIER_IDS type TT_STRING optional - !I_ACCEPT_LANGUAGE type STRING default 'en' - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIED_IMAGES - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Create a classifier

- "! Train a new multi-faceted classifier on the uploaded image data. Create your - "! custom classifier with positive or negative example training images. Include at - "! least two sets of examples, either two positive example files or one positive - "! and one negative file. You can upload a maximum of 256 MB per call.
- "!
- "! **Tips when creating:**
- "!
- "! - If you set the **X-Watson-Learning-Opt-Out** header parameter to `true` when - "! you create a classifier, the example training images are not stored. Save your - "! training images locally. For more information, see [Data - "! collection](#data-collection).
- "!
- "! - Encode all names in UTF-8 if they contain non-ASCII characters (.zip and image - "! file names, and classifier and class names). The service assumes UTF-8 encoding - "! if it encounters non-ASCII characters. - "! - "! @parameter I_NAME | - "! The name of the new classifier. Encode special characters in UTF-8. - "! @parameter I_POSITIVE_EXAMPLES | - "! A .zip file of images that depict the visual subject of a class in the new - "! classifier. You can include more than one positive example file in a call.
- "!
- "! Specify the parameter name by appending `_positive_examples` to the class name. - "! For example, `goldenretriever_positive_examples` creates the class - "! **goldenretriever**. The string cannot contain the following characters: ``$ * - "! - { } \ | / ' " ` [ ]``.
- "!
- "! Include at least 10 images in .jpg or .png format. The minimum recommended image - "! resolution is 32X32 pixels. The maximum number of images is 10,000 images or - "! 100 MB per .zip file.
- "!
- "! Encode special characters in the file name in UTF-8. - "! @parameter I_NEGATIVE_EXAMPLES | - "! A .zip file of images that do not depict the visual subject of any of the - "! classes of the new classifier. Must contain a minimum of 10 images.
- "!
- "! Encode special characters in the file name in UTF-8. - "! @parameter I_NEGATIVE_EXAMPLES_FILENAME | - "! The filename for negativeExamples. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIER - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_CLASSIFIER - importing - !I_NAME type STRING - !I_POSITIVE_EXAMPLES type TT_MAP_FILE - !I_NEGATIVE_EXAMPLES type FILE optional - !I_NEGATIVE_EXAMPLES_FILENAME type STRING optional - !I_POSITIVE_EXAMPLES_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_NEGATIVE_EXAMPLES_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIER - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Retrieve a list of classifiers

- "! - "! @parameter I_VERBOSE | - "! Specify `true` to return details about the classifiers. Omit this parameter to - "! return a brief list of classifiers. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIERS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_CLASSIFIERS - importing - !I_VERBOSE type BOOLEAN optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIERS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Retrieve classifier details

- "! Retrieve information about a custom classifier. - "! - "! @parameter I_CLASSIFIER_ID | - "! The ID of the classifier. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIER - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_CLASSIFIER - importing - !I_CLASSIFIER_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIER - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update a classifier

- "! Update a custom classifier by adding new positive or negative classes or by - "! adding new images to existing classes. You must supply at least one set of - "! positive or negative examples. For details, see [Updating custom - "! classifiers](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recogni - "! tion-customizing#updating-custom-classifiers).
- "!
- "! Encode all names in UTF-8 if they contain non-ASCII characters (.zip and image - "! file names, and classifier and class names). The service assumes UTF-8 encoding - "! if it encounters non-ASCII characters.
- "!
- "! **Tips about retraining:**
- "!
- "! - You can't update the classifier if the **X-Watson-Learning-Opt-Out** - "! header parameter was set to `true` when the classifier was created. Training - "! images are not stored in that case. Instead, create another classifier. For - "! more information, see [Data collection](#data-collection).
- "!
- "! - Don't make retraining calls on a classifier until the status is ready. - "! When you submit retraining requests in parallel, the last request overwrites - "! the previous requests. The `retrained` property shows the last time the - "! classifier retraining finished. - "! - "! @parameter I_CLASSIFIER_ID | - "! The ID of the classifier. - "! @parameter I_POSITIVE_EXAMPLES | - "! A .zip file of images that depict the visual subject of a class in the - "! classifier. The positive examples create or update classes in the classifier. - "! You can include more than one positive example file in a call.
- "!
- "! Specify the parameter name by appending `_positive_examples` to the class name. - "! For example, `goldenretriever_positive_examples` creates the class - "! `goldenretriever`. The string cannot contain the following characters: ``$ * - - "! { } \ | / ' " ` [ ]``.
- "!
- "! Include at least 10 images in .jpg or .png format. The minimum recommended image - "! resolution is 32X32 pixels. The maximum number of images is 10,000 images or - "! 100 MB per .zip file.
- "!
- "! Encode special characters in the file name in UTF-8. - "! @parameter I_NEGATIVE_EXAMPLES | - "! A .zip file of images that do not depict the visual subject of any of the - "! classes of the new classifier. Must contain a minimum of 10 images.
- "!
- "! Encode special characters in the file name in UTF-8. - "! @parameter I_NEGATIVE_EXAMPLES_FILENAME | - "! The filename for negativeExamples. - "! @parameter E_RESPONSE | - "! Service return value of type T_CLASSIFIER - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_CLASSIFIER - importing - !I_CLASSIFIER_ID type STRING - !I_POSITIVE_EXAMPLES type TT_MAP_FILE optional - !I_NEGATIVE_EXAMPLES type FILE optional - !I_NEGATIVE_EXAMPLES_FILENAME type STRING optional - !I_POSITIVE_EXAMPLES_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_NEGATIVE_EXAMPLES_CT type STRING default ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-ALL - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_CLASSIFIER - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a classifier

- "! - "! @parameter I_CLASSIFIER_ID | - "! The ID of the classifier. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_CLASSIFIER - importing - !I_CLASSIFIER_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Retrieve a Core ML model of a classifier

- "! Download a Core ML model file (.mlmodel) of a custom classifier that returns - "! <tt>"core_ml_enabled": true</tt> in the classifier - "! details. - "! - "! @parameter I_CLASSIFIER_ID | - "! The ID of the classifier. - "! @parameter E_RESPONSE | - "! Service return value of type FILE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_CORE_ML_MODEL - importing - !I_CLASSIFIER_ID type STRING - !I_accept type string default 'application/octet-stream' - exporting - !E_RESPONSE type FILE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Delete labeled data

- "! Deletes all data associated with a specified customer ID. The method has no - "! effect if no data is associated with the customer ID.
- "!
- "! You associate a customer ID with data by passing the `X-Watson-Metadata` header - "! with a request that passes data. For more information about personal data and - "! customer IDs, see [Information - "! security](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recognitio - "! n-information-security). - "! - "! @parameter I_CUSTOMER_ID | - "! The customer ID for which all data is to be deleted. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_USER_DATA - importing - !I_CUSTOMER_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_VISUAL_RECOGNITION_V3 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Visual Recognition'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_VISUAL_RECOGNITION_V3->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.visual-recognition.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144446'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->CLASSIFY -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_IMAGES_FILE TYPE FILE(optional) -* | [--->] I_IMAGES_FILENAME TYPE STRING(optional) -* | [--->] I_IMAGES_FILE_CONTENT_TYPE TYPE STRING(optional) -* | [--->] I_URL TYPE STRING(optional) -* | [--->] I_THRESHOLD TYPE FLOAT(optional) -* | [--->] I_OWNERS TYPE TT_STRING(optional) -* | [--->] I_CLASSIFIER_IDS TYPE TT_STRING(optional) -* | [--->] I_ACCEPT_LANGUAGE TYPE STRING (default ='en') -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIED_IMAGES -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CLASSIFY. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classify'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - " process header parameters - data: - lv_headerparam type string ##NEEDED. - - if i_ACCEPT_LANGUAGE is supplied. - lv_headerparam = I_ACCEPT_LANGUAGE. - add_header_parameter( - exporting - i_parameter = 'Accept-Language' - i_value = lv_headerparam - changing - c_headers = ls_request_prop-headers ) ##NO_TEXT. - endif. - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_URL is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="url"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_URL. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - if not i_THRESHOLD is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="threshold"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. - lv_formdata = abap_to_json( i_value = i_THRESHOLD i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - if not i_OWNERS is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="owners"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - field-symbols: - like line of i_OWNERS. - loop at i_OWNERS assigning . -* ls_form_part-cdata = . -* append ls_form_part to lt_form_part. - if ls_form_part-cdata is initial. - ls_form_part-cdata = . - else. - ls_form_part-cdata = ls_form_part-cdata && `,` && . - endif. - endloop. - append ls_form_part to lt_form_part. - endif. - - if not i_CLASSIFIER_IDS is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="classifier_ids"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - field-symbols: - like line of i_CLASSIFIER_IDS. - loop at i_CLASSIFIER_IDS assigning . -* ls_form_part-cdata = . -* append ls_form_part to lt_form_part. - if ls_form_part-cdata is initial. - ls_form_part-cdata = . - else. - ls_form_part-cdata = ls_form_part-cdata && `,` && . - endif. - - endloop. - append ls_form_part to lt_form_part. - - endif. - - - - if not i_IMAGES_FILE is initial. - if not I_images_filename is initial. - lv_value = `form-data; name="images_file"; filename="` && I_images_filename && `"` ##NO_TEXT. - else. - lv_extension = get_file_extension( I_images_file_content_type ). - lv_value = `form-data; name="images_file"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - endif. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_images_file_content_type. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_IMAGES_FILE. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->CREATE_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_NAME TYPE STRING -* | [--->] I_POSITIVE_EXAMPLES TYPE TT_MAP_FILE -* | [--->] I_NEGATIVE_EXAMPLES TYPE FILE(optional) -* | [--->] I_NEGATIVE_EXAMPLES_FILENAME TYPE STRING(optional) -* | [--->] I_POSITIVE_EXAMPLES_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_NEGATIVE_EXAMPLES_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIER -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classifiers'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_NAME is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="name"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_NAME. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - - - if not i_POSITIVE_EXAMPLES is initial. - lv_extension = get_file_extension( I_POSITIVE_EXAMPLES_CT ). - field-symbols: - type line of TT_MAP_FILE. - find regex '(\{.*\})' in '{{classname}}_positive_examples' submatches lv_keypattern. - loop at i_POSITIVE_EXAMPLES assigning . - lv_base_name = '{{classname}}_positive_examples'. - replace lv_keypattern in lv_base_name with -key. - lv_value = `form-data; name="` && lv_base_name && `"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_POSITIVE_EXAMPLES_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = -data. - append ls_form_part to lt_form_part. - endloop. - endif. - - if not i_NEGATIVE_EXAMPLES is initial. - if not I_negative_examples_filename is initial. - lv_value = `form-data; name="negative_examples"; filename="` && I_negative_examples_filename && `"` ##NO_TEXT. - else. - lv_extension = get_file_extension( I_NEGATIVE_EXAMPLES_CT ). - lv_value = `form-data; name="negative_examples"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - endif. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_NEGATIVE_EXAMPLES_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_NEGATIVE_EXAMPLES. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->LIST_CLASSIFIERS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_VERBOSE TYPE BOOLEAN(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIERS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_CLASSIFIERS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classifiers'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_VERBOSE is supplied. - lv_queryparam = i_VERBOSE. - add_query_parameter( - exporting - i_parameter = `verbose` - i_value = lv_queryparam - i_is_boolean = c_boolean_true - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->GET_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIER -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classifiers/{classifier_id}'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->UPDATE_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_POSITIVE_EXAMPLES TYPE TT_MAP_FILE(optional) -* | [--->] I_NEGATIVE_EXAMPLES TYPE FILE(optional) -* | [--->] I_NEGATIVE_EXAMPLES_FILENAME TYPE STRING(optional) -* | [--->] I_POSITIVE_EXAMPLES_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_NEGATIVE_EXAMPLES_CT TYPE STRING (default = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-all) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_CLASSIFIER -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classifiers/{classifier_id}'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - - - if not i_POSITIVE_EXAMPLES is initial. - lv_extension = get_file_extension( I_POSITIVE_EXAMPLES_CT ). - field-symbols: - type line of TT_MAP_FILE. - find regex '(\{.*\})' in '{{classname}}_positive_examples' submatches lv_keypattern. - loop at i_POSITIVE_EXAMPLES assigning . - lv_base_name = '{{classname}}_positive_examples'. - replace lv_keypattern in lv_base_name with -key. - lv_value = `form-data; name="` && lv_base_name && `"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_POSITIVE_EXAMPLES_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = -data. - append ls_form_part to lt_form_part. - endloop. - endif. - - if not i_NEGATIVE_EXAMPLES is initial. - if not I_negative_examples_filename is initial. - lv_value = `form-data; name="negative_examples"; filename="` && I_negative_examples_filename && `"` ##NO_TEXT. - else. - lv_extension = get_file_extension( I_NEGATIVE_EXAMPLES_CT ). - lv_value = `form-data; name="negative_examples"; filename="file` && lv_index && `.` && lv_extension && `"` ##NO_TEXT. - endif. - lv_index = lv_index + 1. - clear ls_form_part. - ls_form_part-content_type = I_NEGATIVE_EXAMPLES_CT. - ls_form_part-content_disposition = lv_value. - ls_form_part-xdata = i_NEGATIVE_EXAMPLES. - append ls_form_part to lt_form_part. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->DELETE_CLASSIFIER -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_CLASSIFIER. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classifiers/{classifier_id}'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->GET_CORE_ML_MODEL -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CLASSIFIER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/octet-stream') -* | [<---] E_RESPONSE TYPE FILE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_CORE_ML_MODEL. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/classifiers/{classifier_id}/core_ml_model'. - replace all occurrences of `{classifier_id}` in ls_request_prop-url-path with i_CLASSIFIER_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve file data - e_response = get_response_binary( lo_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V3->DELETE_USER_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CUSTOMER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_USER_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v3/user_data'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_CUSTOMER_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `customer_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_visual_recognition_v3.clas.xml b/src/zcl_ibmc_visual_recognition_v3.clas.xml deleted file mode 100644 index 068e9b3..0000000 --- a/src/zcl_ibmc_visual_recognition_v3.clas.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - E - Visual Recognition - 1 - X - X - X - - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - CLASSIFY - E - Classify images - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - CREATE_CLASSIFIER - E - Create a classifier - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - DELETE_CLASSIFIER - E - Delete a classifier - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - DELETE_USER_DATA - E - Delete labeled data - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - GET_CLASSIFIER - E - Retrieve classifier details - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - GET_CORE_ML_MODEL - E - Retrieve a Core ML model of a classifier - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - LIST_CLASSIFIERS - E - Retrieve a list of classifiers - - - ZCL_IBMC_VISUAL_RECOGNITION_V3 - UPDATE_CLASSIFIER - E - Update a classifier - - - - - diff --git a/src/zcl_ibmc_visual_recognition_v4.clas.abap b/src/zcl_ibmc_visual_recognition_v4.clas.abap deleted file mode 100644 index 742b0e5..0000000 --- a/src/zcl_ibmc_visual_recognition_v4.clas.abap +++ /dev/null @@ -1,2431 +0,0 @@ -* Copyright 2019, 2020 IBM Corp. All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -"!

Visual Recognition v4

-"! IBM Watson™ Visual Recognition is discontinued. Existing instances are -"! supported until 1 December 2021, but as of 7 January 2021, you can't -"! create instances. Any instance that is provisioned on 1 December 2021 will be -"! deleted.
-"! {: deprecated}
-"!
-"! Provide images to the IBM Watson Visual Recognition service for analysis. The -"! service detects objects based on a set of images with training data.
-class ZCL_IBMC_VISUAL_RECOGNITION_V4 DEFINITION - public - inheriting from ZCL_IBMC_SERVICE_EXT - create public . - -public section. - types: - "!

- "! Defines the location of the bounding box around the object.

- begin of T_LOCATION, - "! Y-position of top-left pixel of the bounding box. - TOP type INTEGER, - "! X-position of top-left pixel of the bounding box. - LEFT type INTEGER, - "! Width in pixels of of the bounding box. - WIDTH type INTEGER, - "! Height in pixels of the bounding box. - HEIGHT type INTEGER, - end of T_LOCATION. - types: - "!

- "! Training status for the objects in the collection.

- begin of T_OBJECT_TRAINING_STATUS, - "! Whether you can analyze images in the collection with the **objects** feature. - READY type BOOLEAN, - "! Whether training is in progress. - IN_PROGRESS type BOOLEAN, - "! Whether there are changes to the training data since the most recent training. - DATA_CHANGED type BOOLEAN, - "! Whether the most recent training failed. - LATEST_FAILED type BOOLEAN, - "! Whether the model can be downloaded after the training status is `ready`. - RSCNN_READY type BOOLEAN, - "! Details about the training. If training is in progress, includes information - "! about the status. If training is not in progress, includes a success message or - "! information about why training failed. - DESCRIPTION type STRING, - end of T_OBJECT_TRAINING_STATUS. - types: - "!

- "! Training status information for the collection.

- begin of T_TRAINING_STATUS, - "! Training status for the objects in the collection. - OBJECTS type T_OBJECT_TRAINING_STATUS, - end of T_TRAINING_STATUS. - types: - "!

- "! Basic information about an object.

- begin of T_OBJECT_METADATA, - "! The name of the object. - OBJECT type STRING, - "! Number of bounding boxes with this object name in the collection. - COUNT type INTEGER, - end of T_OBJECT_METADATA. - types: - "!

- "! The source type of the image.

- begin of T_IMAGE_SOURCE, - "! The source type of the image. - TYPE type STRING, - "! Name of the image file if uploaded. Not returned when the image is passed by - "! URL. - FILENAME type STRING, - "! Name of the .zip file of images if uploaded. Not returned when the image is - "! passed directly or by URL. - ARCHIVE_FILENAME type STRING, - "! Source of the image before any redirects. Not returned when the image is - "! uploaded. - SOURCE_URL type STRING, - "! Fully resolved URL of the image after redirects are followed. Not returned when - "! the image is uploaded. - RESOLVED_URL type STRING, - end of T_IMAGE_SOURCE. - types: - "!

- "! Details about the training data.

- begin of T_TRAINING_DATA_OBJECT, - "! The name of the object. - OBJECT type STRING, - "! Defines the location of the bounding box around the object. - LOCATION type T_LOCATION, - end of T_TRAINING_DATA_OBJECT. - types: - "!

- "! Training data for all objects.

- begin of T_TRAINING_DATA_OBJECTS, - "! Training data for specific objects. - OBJECTS type STANDARD TABLE OF T_TRAINING_DATA_OBJECT WITH NON-UNIQUE DEFAULT KEY, - end of T_TRAINING_DATA_OBJECTS. - types: - "!

- "! Training status information for the collection.

- begin of T_COLLECTION_TRAINING_STATUS, - "! Training status for the objects in the collection. - OBJECTS type T_OBJECT_TRAINING_STATUS, - end of T_COLLECTION_TRAINING_STATUS. - types: - "!

- "! Details about a collection.

- begin of T_COLLECTION, - "! The identifier of the collection. - COLLECTION_ID type STRING, - "! The name of the collection. - NAME type STRING, - "! The description of the collection. - DESCRIPTION type STRING, - "! Date and time in Coordinated Universal Time (UTC) that the collection was - "! created. - CREATED type DATETIME, - "! Date and time in Coordinated Universal Time (UTC) that the collection was most - "! recently updated. - UPDATED type DATETIME, - "! Number of images in the collection. - IMAGE_COUNT type INTEGER, - "! Training status information for the collection. - TRAINING_STATUS type T_COLLECTION_TRAINING_STATUS, - end of T_COLLECTION. - types: - "!

- "! Height and width of an image.

- begin of T_IMAGE_DIMENSIONS, - "! Height in pixels of the image. - HEIGHT type INTEGER, - "! Width in pixels of the image. - WIDTH type INTEGER, - end of T_IMAGE_DIMENSIONS. - types: - "!

- "! Defines the location of the bounding box around the object.

- begin of T_OBJECT_DETAIL_LOCATION, - "! Y-position of top-left pixel of the bounding box. - TOP type INTEGER, - "! X-position of top-left pixel of the bounding box. - LEFT type INTEGER, - "! Width in pixels of of the bounding box. - WIDTH type INTEGER, - "! Height in pixels of the bounding box. - HEIGHT type INTEGER, - end of T_OBJECT_DETAIL_LOCATION. - types: - "!

- "! Details about the specific area of the problem.

- begin of T_ERROR_TARGET, - "! The parameter or property that is the focus of the problem. - TYPE type STRING, - "! The property that is identified with the problem. - NAME type STRING, - end of T_ERROR_TARGET. - types: - "!

- "! Details about an error.

- begin of T_ERROR, - "! Identifier of the problem. - CODE type STRING, - "! An explanation of the problem with possible solutions. - MESSAGE type STRING, - "! A URL for more information about the solution. - MORE_INFO type STRING, - "! Details about the specific area of the problem. - TARGET type T_ERROR_TARGET, - end of T_ERROR. - types: - "!

- "! A container for the list of request-level problems.

- begin of T_ERROR_RESPONSE, - "! A container for the problems in the request. - ERRORS type STANDARD TABLE OF T_ERROR WITH NON-UNIQUE DEFAULT KEY, - "! A unique identifier of the request. - TRACE type STRING, - end of T_ERROR_RESPONSE. - types: - "!

- "! Details about an object and its location.

- begin of T_BASE_OBJECT, - "! The name of the object. The name can contain alphanumeric, underscore, hyphen, - "! space, and dot characters. It cannot begin with the reserved prefix `sys-`. - OBJECT type STRING, - "! Defines the location of the bounding box around the object. - LOCATION type T_LOCATION, - end of T_BASE_OBJECT. - types: - "! No documentation available. - begin of T_INLINE_OBJECT, - "! The IDs of the collections to analyze. - COLLECTION_IDS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The features to analyze. - FEATURES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! An array of image files (.jpg or .png) or .zip files with images.
- "! - Include a maximum of 20 images in a request.
- "! - Limit the .zip file to 100 MB.
- "! - Limit each image file to 10 MB.
- "!
- "! You can also include an image with the **image_url** parameter. - IMAGES_FILE type STANDARD TABLE OF FILE WITH NON-UNIQUE DEFAULT KEY, - "! An array of URLs of image files (.jpg or .png).
- "! - Include a maximum of 20 images in a request.
- "! - Limit each image file to 10 MB.
- "! - Minimum width and height is 30 pixels, but the service tends to perform better - "! with images that are at least 300 x 300 pixels. Maximum is 5400 pixels for - "! either height or width.
- "!
- "! You can also include images with the **images_file** parameter. - IMAGE_URL type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! The minimum score a feature must have to be returned. - THRESHOLD type FLOAT, - end of T_INLINE_OBJECT. - types: - "!

- "! Details about an object in the collection.

- begin of T_OBJECT_DETAIL, - "! The label for the object. - OBJECT type STRING, - "! Defines the location of the bounding box around the object. - LOCATION type T_OBJECT_DETAIL_LOCATION, - "! Confidence score for the object in the range of 0 to 1. A higher score indicates - "! greater likelihood that the object is depicted at this location in the image. - SCORE type FLOAT, - end of T_OBJECT_DETAIL. - types: - "!

- "! The objects in a collection that are detected in an image.

- begin of T_COLLECTION_OBJECTS, - "! The identifier of the collection. - COLLECTION_ID type STRING, - "! The identified objects in a collection. - OBJECTS type STANDARD TABLE OF T_OBJECT_DETAIL WITH NON-UNIQUE DEFAULT KEY, - end of T_COLLECTION_OBJECTS. - types: - "!

- "! Container for the list of collections that have objects

- "! detected in an image. - begin of T_DETECTED_OBJECTS, - "! The collections with identified objects. - COLLECTIONS type STANDARD TABLE OF T_COLLECTION_OBJECTS WITH NON-UNIQUE DEFAULT KEY, - end of T_DETECTED_OBJECTS. - types: - "!

- "! A file returned in the response.

- T_JPEG_IMAGE type FILE. - types: - "!

- "! A container for the list of collections.

- begin of T_COLLECTIONS_LIST, - "! The collections in this service instance. - COLLECTIONS type STANDARD TABLE OF T_COLLECTION WITH NON-UNIQUE DEFAULT KEY, - end of T_COLLECTIONS_LIST. - types: - "!

- "! Details about the training event.

- begin of T_TRAINING_EVENT, - "! Trained object type. Only `objects` is currently supported. - TYPE type STRING, - "! Identifier of the trained collection. - COLLECTION_ID type STRING, - "! Date and time in Coordinated Universal Time (UTC) that training on the - "! collection finished. - COMPLETION_TIME type DATETIME, - "! Training status of the training event. - STATUS type STRING, - "! The total number of images that were used in training for this training event. - IMAGE_COUNT type INTEGER, - end of T_TRAINING_EVENT. - types: - "!

- "! Details about the training events.

- begin of T_TRAINING_EVENTS, - "! The starting day for the returned training events in Coordinated Universal Time - "! (UTC). If not specified in the request, it identifies the earliest training - "! event. - START_TIME type DATETIME, - "! The ending day for the returned training events in Coordinated Universal Time - "! (UTC). If not specified in the request, it lists the current time. - END_TIME type DATETIME, - "! The total number of training events in the response for the start and end times. - "! - COMPLETED_EVENTS type INTEGER, - "! The total number of images that were used in training for the start and end - "! times. - TRAINED_IMAGES type INTEGER, - "! The completed training events for the start and end time. - EVENTS type STANDARD TABLE OF T_TRAINING_EVENT WITH NON-UNIQUE DEFAULT KEY, - end of T_TRAINING_EVENTS. - types: - "!

- "! Details about an image.

- begin of T_IMAGE_DETAILS, - "! The identifier of the image. - IMAGE_ID type STRING, - "! Date and time in Coordinated Universal Time (UTC) that the image was most - "! recently updated. - UPDATED type DATETIME, - "! Date and time in Coordinated Universal Time (UTC) that the image was created. - CREATED type DATETIME, - "! The source type of the image. - SOURCE type T_IMAGE_SOURCE, - "! Height and width of an image. - DIMENSIONS type T_IMAGE_DIMENSIONS, - "! Details about the errors. - ERRORS type STANDARD TABLE OF T_ERROR WITH NON-UNIQUE DEFAULT KEY, - "! Training data for all objects. - TRAINING_DATA type T_TRAINING_DATA_OBJECTS, - end of T_IMAGE_DETAILS. - types: - "!

- "! Details about a problem.

- begin of T_WARNING, - "! Identifier of the problem. - CODE type STRING, - "! An explanation of the problem with possible solutions. - MESSAGE type STRING, - "! A URL for more information about the solution. - MORE_INFO type STRING, - end of T_WARNING. - types: - "!

- "! List of information about the images.

- begin of T_IMAGE_DETAILS_LIST, - "! The images in the collection. - IMAGES type STANDARD TABLE OF T_IMAGE_DETAILS WITH NON-UNIQUE DEFAULT KEY, - "! Information about what might cause less than optimal output. - WARNINGS type STANDARD TABLE OF T_WARNING WITH NON-UNIQUE DEFAULT KEY, - "! A unique identifier of the request. Included only when an error or warning is - "! returned. - TRACE type STRING, - end of T_IMAGE_DETAILS_LIST. - types: - "!

- "! Empty response.

- T_EMPTY type JSONOBJECT. - types: - "!

- "! Basic information about an image.

- begin of T_IMAGE_SUMMARY, - "! The identifier of the image. - IMAGE_ID type STRING, - "! Date and time in Coordinated Universal Time (UTC) that the image was most - "! recently updated. - UPDATED type DATETIME, - end of T_IMAGE_SUMMARY. - types: - "!

- "! Container for the training data.

- begin of T_BASE_TRAINING_DATA_OBJECTS, - "! Training data for specific objects. - OBJECTS type STANDARD TABLE OF T_TRAINING_DATA_OBJECT WITH NON-UNIQUE DEFAULT KEY, - end of T_BASE_TRAINING_DATA_OBJECTS. - types: - "! No documentation available. - begin of T_INLINE_OBJECT1, - "! An array of image files (.jpg or .png) or .zip files with images.
- "! - Include a maximum of 20 images in a request.
- "! - Limit the .zip file to 100 MB.
- "! - Limit each image file to 10 MB.
- "!
- "! You can also include an image with the **image_url** parameter. - IMAGES_FILE type STANDARD TABLE OF FILE WITH NON-UNIQUE DEFAULT KEY, - "! The array of URLs of image files (.jpg or .png).
- "! - Include a maximum of 20 images in a request.
- "! - Limit each image file to 10 MB.
- "! - Minimum width and height is 30 pixels, but the service tends to perform better - "! with images that are at least 300 x 300 pixels. Maximum is 5400 pixels for - "! either height or width.
- "!
- "! You can also include images with the **images_file** parameter. - IMAGE_URL type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, - "! Training data for a single image. Include training data only if you add one - "! image with the request.
- "!
- "! The `object` property can contain alphanumeric, underscore, hyphen, space, and - "! dot characters. It cannot begin with the reserved prefix `sys-` and must be no - "! longer than 32 characters. - TRAINING_DATA type STRING, - end of T_INLINE_OBJECT1. - types: - "!

- "! List of images.

- begin of T_IMAGE_SUMMARY_LIST, - "! The images in the collection. - IMAGES type STANDARD TABLE OF T_IMAGE_SUMMARY WITH NON-UNIQUE DEFAULT KEY, - end of T_IMAGE_SUMMARY_LIST. - types: - "!

- "! Details about an image.

- begin of T_IMAGE, - "! The source type of the image. - SOURCE type T_IMAGE_SOURCE, - "! Height and width of an image. - DIMENSIONS type T_IMAGE_DIMENSIONS, - "! Container for the list of collections that have objects detected in an image. - OBJECTS type T_DETECTED_OBJECTS, - "! A container for the problems in the request. - ERRORS type STANDARD TABLE OF T_ERROR WITH NON-UNIQUE DEFAULT KEY, - end of T_IMAGE. - types: - "!

- "! Results for all images.

- begin of T_ANALYZE_RESPONSE, - "! Analyzed images. - IMAGES type STANDARD TABLE OF T_IMAGE WITH NON-UNIQUE DEFAULT KEY, - "! Information about what might cause less than optimal output. - WARNINGS type STANDARD TABLE OF T_WARNING WITH NON-UNIQUE DEFAULT KEY, - "! A unique identifier of the request. Included only when an error or warning is - "! returned. - TRACE type STRING, - end of T_ANALYZE_RESPONSE. - types: - "!

- "! Base details about a collection.

- begin of T_BASE_COLLECTION, - "! The identifier of the collection. - COLLECTION_ID type STRING, - "! The name of the collection. The name can contain alphanumeric, underscore, - "! hyphen, and dot characters. It cannot begin with the reserved prefix `sys-`. - NAME type STRING, - "! The description of the collection. - DESCRIPTION type STRING, - "! Date and time in Coordinated Universal Time (UTC) that the collection was - "! created. - CREATED type DATETIME, - "! Date and time in Coordinated Universal Time (UTC) that the collection was most - "! recently updated. - UPDATED type DATETIME, - "! Number of images in the collection. - IMAGE_COUNT type INTEGER, - "! Training status information for the collection. - TRAINING_STATUS type T_TRAINING_STATUS, - end of T_BASE_COLLECTION. - types: - "!

- "! Basic information about an updated object.

- begin of T_UPDATE_OBJECT_METADATA, - "! The updated name of the object. The name can contain alphanumeric, underscore, - "! hyphen, space, and dot characters. It cannot begin with the reserved prefix - "! `sys-`. - OBJECT type STRING, - "! Number of bounding boxes in the collection with the updated object name. - COUNT type INTEGER, - end of T_UPDATE_OBJECT_METADATA. - types: - "!

- "! List of objects.

- begin of T_OBJECT_METADATA_LIST, - "! Number of unique named objects in the collection. - OBJECT_COUNT type INTEGER, - "! The objects in the collection. - OBJECTS type STANDARD TABLE OF T_OBJECT_METADATA WITH NON-UNIQUE DEFAULT KEY, - end of T_OBJECT_METADATA_LIST. - -constants: - "!

List of required fields per type.

- begin of C_REQUIRED_FIELDS, - T_LOCATION type string value '|TOP|LEFT|WIDTH|HEIGHT|', - T_OBJECT_TRAINING_STATUS type string value '|READY|IN_PROGRESS|DATA_CHANGED|LATEST_FAILED|RSCNN_READY|DESCRIPTION|', - T_TRAINING_STATUS type string value '|OBJECTS|', - T_OBJECT_METADATA type string value '|', - T_IMAGE_SOURCE type string value '|TYPE|', - T_TRAINING_DATA_OBJECT type string value '|', - T_TRAINING_DATA_OBJECTS type string value '|', - T_COLLECTION_TRAINING_STATUS type string value '|OBJECTS|', - T_COLLECTION type string value '|COLLECTION_ID|NAME|DESCRIPTION|CREATED|UPDATED|IMAGE_COUNT|TRAINING_STATUS|', - T_IMAGE_DIMENSIONS type string value '|', - T_OBJECT_DETAIL_LOCATION type string value '|TOP|LEFT|WIDTH|HEIGHT|', - T_ERROR_TARGET type string value '|TYPE|NAME|', - T_ERROR type string value '|CODE|MESSAGE|', - T_ERROR_RESPONSE type string value '|ERRORS|TRACE|', - T_BASE_OBJECT type string value '|', - T_INLINE_OBJECT type string value '|COLLECTION_IDS|FEATURES|', - T_OBJECT_DETAIL type string value '|OBJECT|LOCATION|SCORE|', - T_COLLECTION_OBJECTS type string value '|COLLECTION_ID|OBJECTS|', - T_DETECTED_OBJECTS type string value '|', - T_COLLECTIONS_LIST type string value '|COLLECTIONS|', - T_TRAINING_EVENT type string value '|', - T_TRAINING_EVENTS type string value '|', - T_IMAGE_DETAILS type string value '|SOURCE|', - T_WARNING type string value '|CODE|MESSAGE|', - T_IMAGE_DETAILS_LIST type string value '|', - T_IMAGE_SUMMARY type string value '|', - T_BASE_TRAINING_DATA_OBJECTS type string value '|', - T_INLINE_OBJECT1 type string value '|', - T_IMAGE_SUMMARY_LIST type string value '|IMAGES|', - T_IMAGE type string value '|SOURCE|DIMENSIONS|OBJECTS|', - T_ANALYZE_RESPONSE type string value '|IMAGES|', - T_BASE_COLLECTION type string value '|', - T_UPDATE_OBJECT_METADATA type string value '|OBJECT|', - T_OBJECT_METADATA_LIST type string value '|OBJECT_COUNT|', - __DUMMY type string value SPACE, - end of C_REQUIRED_FIELDS . - -constants: - "!

Map ABAP identifiers to service identifiers.

- begin of C_ABAPNAME_DICTIONARY, - CODE type string value 'code', - MESSAGE type string value 'message', - MORE_INFO type string value 'more_info', - TARGET type string value 'target', - TYPE type string value 'type', - NAME type string value 'name', - ERRORS type string value 'errors', - TRACE type string value 'trace', - IMAGES type string value 'images', - WARNINGS type string value 'warnings', - COLLECTION_ID type string value 'collection_id', - DESCRIPTION type string value 'description', - CREATED type string value 'created', - UPDATED type string value 'updated', - IMAGE_COUNT type string value 'image_count', - TRAINING_STATUS type string value 'training_status', - COLLECTIONS type string value 'collections', - START_TIME type string value 'start_time', - END_TIME type string value 'end_time', - COMPLETED_EVENTS type string value 'completed_events', - TRAINED_IMAGES type string value 'trained_images', - EVENTS type string value 'events', - COMPLETION_TIME type string value 'completion_time', - STATUS type string value 'status', - OBJECTS type string value 'objects', - OBJECT_COUNT type string value 'object_count', - OBJECT type string value 'object', - COUNT type string value 'count', - READY type string value 'ready', - IN_PROGRESS type string value 'in_progress', - DATA_CHANGED type string value 'data_changed', - LATEST_FAILED type string value 'latest_failed', - RSCNN_READY type string value 'rscnn_ready', - IMAGE_ID type string value 'image_id', - SOURCE type string value 'source', - DIMENSIONS type string value 'dimensions', - TRAINING_DATA type string value 'training_data', - HEIGHT type string value 'height', - WIDTH type string value 'width', - LOCATION type string value 'location', - FILENAME type string value 'filename', - ARCHIVE_FILENAME type string value 'archive_filename', - SOURCE_URL type string value 'source_url', - RESOLVED_URL type string value 'resolved_url', - SCORE type string value 'score', - TOP type string value 'top', - LEFT type string value 'left', - COLLECTION_IDS type string value 'collection_ids', - FEATURES type string value 'features', - IMAGES_FILE type string value 'images_file', - IMAGE_URL type string value 'image_url', - THRESHOLD type string value 'threshold', - end of C_ABAPNAME_DICTIONARY . - - - methods GET_APPNAME - redefinition . - methods GET_REQUEST_PROP - redefinition . - methods GET_SDK_VERSION_DATE - redefinition . - - - "!

Analyze images

- "! Analyze images by URL, by file, or both against your own collection. Make sure - "! that **training_status.objects.ready** is `true` for the feature before you use - "! a collection to analyze images.
- "!
- "! Encode the image and .zip file names in UTF-8 if they contain non-ASCII - "! characters. The service assumes UTF-8 encoding if it encounters non-ASCII - "! characters. - "! - "! @parameter I_COLLECTION_IDS | - "! The IDs of the collections to analyze. - "! @parameter I_FEATURES | - "! The features to analyze. - "! @parameter I_IMAGES_FILE | - "! An array of image files (.jpg or .png) or .zip files with images.
- "! - Include a maximum of 20 images in a request.
- "! - Limit the .zip file to 100 MB.
- "! - Limit each image file to 10 MB.
- "!
- "! You can also include an image with the **image_url** parameter. - "! @parameter I_IMAGE_URL | - "! An array of URLs of image files (.jpg or .png).
- "! - Include a maximum of 20 images in a request.
- "! - Limit each image file to 10 MB.
- "! - Minimum width and height is 30 pixels, but the service tends to perform better - "! with images that are at least 300 x 300 pixels. Maximum is 5400 pixels for - "! either height or width.
- "!
- "! You can also include images with the **images_file** parameter. - "! @parameter I_THRESHOLD | - "! The minimum score a feature must have to be returned. - "! @parameter E_RESPONSE | - "! Service return value of type T_ANALYZE_RESPONSE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods ANALYZE - importing - !I_COLLECTION_IDS type TT_STRING - !I_FEATURES type TT_STRING - !I_IMAGES_FILE type TT_FILE_WITH_METADATA optional - !I_IMAGE_URL type TT_STRING optional - !I_THRESHOLD type FLOAT optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_ANALYZE_RESPONSE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Create a collection

- "! Create a collection that can be used to store images.
- "!
- "! To create a collection without specifying a name and description, include an - "! empty JSON object in the request body.
- "!
- "! Encode the name and description in UTF-8 if they contain non-ASCII characters. - "! The service assumes UTF-8 encoding if it encounters non-ASCII characters. - "! - "! @parameter I_COLLECTION_INFO | - "! The new collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods CREATE_COLLECTION - importing - !I_COLLECTION_INFO type T_BASE_COLLECTION - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List collections

- "! Retrieves a list of collections for the service instance. - "! - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTIONS_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_COLLECTIONS - importing - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTIONS_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get collection details

- "! Get details of one collection. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_COLLECTION - importing - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update a collection

- "! Update the name or description of a collection.
- "!
- "! Encode the name and description in UTF-8 if they contain non-ASCII characters. - "! The service assumes UTF-8 encoding if it encounters non-ASCII characters. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_COLLECTION_INFO | - "! The updated collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_COLLECTION - importing - !I_COLLECTION_ID type STRING - !I_COLLECTION_INFO type T_BASE_COLLECTION optional - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete a collection

- "! Delete a collection from the service instance. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_COLLECTION - importing - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get a model

- "! Download a model that you can deploy to detect objects in images. The collection - "! must include a generated model, which is indicated in the response for the - "! collection details as `"rscnn_ready": true`. If the value is `false`, - "! train or retrain the collection to generate the model.
- "!
- "! Currently, the model format is specific to Android apps. For more information - "! about how to deploy the model to your app, see the [Watson Visual Recognition - "! on Android](https://github.com/matt-ny/rscnn) project in GitHub. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_FEATURE | - "! The feature for the model. - "! @parameter I_MODEL_FORMAT | - "! The format of the returned model. - "! @parameter E_RESPONSE | - "! Service return value of type FILE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_MODEL_FILE - importing - !I_COLLECTION_ID type STRING - !I_FEATURE type STRING - !I_MODEL_FORMAT type STRING - !I_accept type string default 'application/octet-stream' - exporting - !E_RESPONSE type FILE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Add images

- "! Add images to a collection by URL, by file, or both.
- "!
- "! Encode the image and .zip file names in UTF-8 if they contain non-ASCII - "! characters. The service assumes UTF-8 encoding if it encounters non-ASCII - "! characters. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_IMAGES_FILE | - "! An array of image files (.jpg or .png) or .zip files with images.
- "! - Include a maximum of 20 images in a request.
- "! - Limit the .zip file to 100 MB.
- "! - Limit each image file to 10 MB.
- "!
- "! You can also include an image with the **image_url** parameter. - "! @parameter I_IMAGE_URL | - "! The array of URLs of image files (.jpg or .png).
- "! - Include a maximum of 20 images in a request.
- "! - Limit each image file to 10 MB.
- "! - Minimum width and height is 30 pixels, but the service tends to perform better - "! with images that are at least 300 x 300 pixels. Maximum is 5400 pixels for - "! either height or width.
- "!
- "! You can also include images with the **images_file** parameter. - "! @parameter I_TRAINING_DATA | - "! Training data for a single image. Include training data only if you add one - "! image with the request.
- "!
- "! The `object` property can contain alphanumeric, underscore, hyphen, space, and - "! dot characters. It cannot begin with the reserved prefix `sys-` and must be no - "! longer than 32 characters. - "! @parameter E_RESPONSE | - "! Service return value of type T_IMAGE_DETAILS_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods ADD_IMAGES - importing - !I_COLLECTION_ID type STRING - !I_IMAGES_FILE type TT_FILE_WITH_METADATA optional - !I_IMAGE_URL type TT_STRING optional - !I_TRAINING_DATA type STRING optional - !I_contenttype type string default 'multipart/form-data' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_IMAGE_DETAILS_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

List images

- "! Retrieves a list of images in a collection. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_IMAGE_SUMMARY_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_IMAGES - importing - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_IMAGE_SUMMARY_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get image details

- "! Get the details of an image in a collection. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_IMAGE_ID | - "! The identifier of the image. - "! @parameter E_RESPONSE | - "! Service return value of type T_IMAGE_DETAILS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_IMAGE_DETAILS - importing - !I_COLLECTION_ID type STRING - !I_IMAGE_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_IMAGE_DETAILS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete an image

- "! Delete one image from a collection. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_IMAGE_ID | - "! The identifier of the image. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_IMAGE - importing - !I_COLLECTION_ID type STRING - !I_IMAGE_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get a JPEG file of an image

- "! Download a JPEG representation of an image. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_IMAGE_ID | - "! The identifier of the image. - "! @parameter I_SIZE | - "! The image size. Specify `thumbnail` to return a version that maintains the - "! original aspect ratio but is no larger than 200 pixels in the larger dimension. - "! For example, an original 800 x 1000 image is resized to 160 x 200 pixels. - "! @parameter E_RESPONSE | - "! Service return value of type FILE - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_JPEG_IMAGE - importing - !I_COLLECTION_ID type STRING - !I_IMAGE_ID type STRING - !I_SIZE type STRING default 'full' - !I_accept type string default 'image/jpeg' - exporting - !E_RESPONSE type FILE - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

List object metadata

- "! Retrieves a list of object names in a collection. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_OBJECT_METADATA_LIST - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods LIST_OBJECT_METADATA - importing - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_OBJECT_METADATA_LIST - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Update an object name

- "! Update the name of an object. A successful request updates the training data for - "! all images that use the object. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_OBJECT | - "! The name of the object. - "! @parameter I_UPDATEOBJECTMETADATA | - "! No documentation available. - "! @parameter E_RESPONSE | - "! Service return value of type T_UPDATE_OBJECT_METADATA - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods UPDATE_OBJECT_METADATA - importing - !I_COLLECTION_ID type STRING - !I_OBJECT type STRING - !I_UPDATEOBJECTMETADATA type T_UPDATE_OBJECT_METADATA - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_UPDATE_OBJECT_METADATA - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get object metadata

- "! Get the number of bounding boxes for a single object in a collection. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_OBJECT | - "! The name of the object. - "! @parameter E_RESPONSE | - "! Service return value of type T_OBJECT_METADATA - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_OBJECT_METADATA - importing - !I_COLLECTION_ID type STRING - !I_OBJECT type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_OBJECT_METADATA - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Delete an object

- "! Delete one object from a collection. A successful request deletes the training - "! data from all images that use the object. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_OBJECT | - "! The name of the object. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_OBJECT - importing - !I_COLLECTION_ID type STRING - !I_OBJECT type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Train a collection

- "! Start training on images in a collection. The collection must have enough - "! training data and untrained data (the **training_status.objects.data_changed** - "! is `true`). If training is in progress, the request queues the next training - "! job. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter E_RESPONSE | - "! Service return value of type T_COLLECTION - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods TRAIN - importing - !I_COLLECTION_ID type STRING - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_COLLECTION - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Add training data to an image

- "! Add, update, or delete training data for an image. Encode the object name in - "! UTF-8 if it contains non-ASCII characters. The service assumes UTF-8 encoding - "! if it encounters non-ASCII characters.
- "!
- "! Elements in the request replace the existing elements.
- "!
- "! - To update the training data, provide both the unchanged and the new or changed - "! values.
- "!
- "! - To delete the training data, provide an empty value for the training data. - "! - "! @parameter I_COLLECTION_ID | - "! The identifier of the collection. - "! @parameter I_IMAGE_ID | - "! The identifier of the image. - "! @parameter I_TRAINING_DATA | - "! Training data. Elements in the request replace the existing elements. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_DATA_OBJECTS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods ADD_IMAGE_TRAINING_DATA - importing - !I_COLLECTION_ID type STRING - !I_IMAGE_ID type STRING - !I_TRAINING_DATA type T_BASE_TRAINING_DATA_OBJECTS - !I_contenttype type string default 'application/json' - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_DATA_OBJECTS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - "!

Get training usage

- "! Information about the completed training events. You can use this information to - "! determine how close you are to the training limits for the month. - "! - "! @parameter I_START_TIME | - "! The earliest day to include training events. Specify dates in YYYY-MM-DD format. - "! If empty or not specified, the earliest training event is included. - "! @parameter I_END_TIME | - "! The most recent day to include training events. Specify dates in YYYY-MM-DD - "! format. All events for the day are included. If empty or not specified, the - "! current day is used. Specify the same value as `start_time` to request events - "! for a single day. - "! @parameter E_RESPONSE | - "! Service return value of type T_TRAINING_EVENTS - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods GET_TRAINING_USAGE - importing - !I_START_TIME type DATE optional - !I_END_TIME type DATE optional - !I_accept type string default 'application/json' - exporting - !E_RESPONSE type T_TRAINING_EVENTS - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - "!

Delete labeled data

- "! Deletes all data associated with a specified customer ID. The method has no - "! effect if no data is associated with the customer ID.
- "!
- "! You associate a customer ID with data by passing the `X-Watson-Metadata` header - "! with a request that passes data. For more information about personal data and - "! customer IDs, see [Information - "! security](https://cloud.ibm.com/docs/visual-recognition?topic=visual-recognitio - "! n-information-security). - "! - "! @parameter I_CUSTOMER_ID | - "! The customer ID for which all data is to be deleted. - "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. - "! - methods DELETE_USER_DATA - importing - !I_CUSTOMER_ID type STRING - !I_accept type string default 'application/json' - raising - ZCX_IBMC_SERVICE_EXCEPTION . - - -protected section. - -private section. - -ENDCLASS. - -class ZCL_IBMC_VISUAL_RECOGNITION_V4 IMPLEMENTATION. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_APPNAME -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_APPNAME TYPE STRING -* +-------------------------------------------------------------------------------------- - method GET_APPNAME. - - e_appname = 'Visual Recognition v4'. - - endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Protected Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_REQUEST_PROP -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) -* | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP -* +-------------------------------------------------------------------------------------- -method GET_REQUEST_PROP. - - data: - lv_auth_method type string ##NEEDED. - - e_request_prop = super->get_request_prop( i_auth_method = i_auth_method ). - - lv_auth_method = i_auth_method. - if lv_auth_method eq c_default. - lv_auth_method = 'IAM'. - endif. - if lv_auth_method is initial. - e_request_prop-auth_basic = c_boolean_false. - e_request_prop-auth_oauth = c_boolean_false. - e_request_prop-auth_apikey = c_boolean_false. - elseif lv_auth_method eq 'IAM'. - e_request_prop-auth_name = 'IAM'. - e_request_prop-auth_type = 'apiKey'. - e_request_prop-auth_headername = 'Authorization'. - e_request_prop-auth_query = c_boolean_false. - e_request_prop-auth_header = c_boolean_true. - else. - endif. - - e_request_prop-url-protocol = 'https'. - e_request_prop-url-host = 'api.us-south.visual-recognition.watson.cloud.ibm.com'. - e_request_prop-url-path_base = ''. - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_SDK_VERSION_DATE -* +-------------------------------------------------------------------------------------------------+ -* | [<-()] E_SDK_VERSION_DATE TYPE STRING -* +-------------------------------------------------------------------------------------- - method get_sdk_version_date. - - e_sdk_version_date = '20210312144448'. - - endmethod. - - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->ANALYZE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_IDS TYPE TT_STRING -* | [--->] I_FEATURES TYPE TT_STRING -* | [--->] I_IMAGES_FILE TYPE TT_FILE_WITH_METADATA(optional) -* | [--->] I_IMAGE_URL TYPE TT_STRING(optional) -* | [--->] I_THRESHOLD TYPE FLOAT(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_ANALYZE_RESPONSE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method ANALYZE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/analyze'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_COLLECTION_IDS is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="collection_ids"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - field-symbols: - like line of i_COLLECTION_IDS. - loop at i_COLLECTION_IDS assigning . - ls_form_part-cdata = . - append ls_form_part to lt_form_part. - endloop. - endif. - - if not i_FEATURES is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="features"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - field-symbols: - like line of i_FEATURES. - loop at i_FEATURES assigning . - ls_form_part-cdata = . - append ls_form_part to lt_form_part. - endloop. - endif. - - if not i_IMAGE_URL is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="image_url"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - field-symbols: - like line of i_IMAGE_URL. - loop at i_IMAGE_URL assigning . - ls_form_part-cdata = . - append ls_form_part to lt_form_part. - endloop. - endif. - - if not i_THRESHOLD is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="threshold"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-APPL_JSON. - lv_formdata = abap_to_json( i_value = i_THRESHOLD i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - - - if not i_IMAGES_FILE is initial. - data: - lv_filename type string, - lv_content_type type string. - field-symbols: - like line of i_IMAGES_FILE. - loop at i_IMAGES_FILE assigning . - if not -content_type is initial. - lv_content_type = -content_type. - else. - lv_content_type = 'application/octet-stream' ##NO_TEXT. - endif. - if not -filename is initial. - lv_filename = -filename. - else. - lv_extension = get_file_extension( lv_content_type ). - lv_filename = `file` && lv_index && `.` && lv_extension ##NO_TEXT. - lv_index = lv_index + 1. - endif. - clear ls_form_part. - ls_form_part-content_type = lv_content_type. - ls_form_part-content_disposition = `form-data; name="images_file"; filename="` && lv_filename && `"` ##NO_TEXT. - ls_form_part-xdata = -data. - append ls_form_part to lt_form_part. - endloop. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->CREATE_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_INFO TYPE T_BASE_COLLECTION -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method CREATE_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections'. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_COLLECTION_INFO ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_COLLECTION_INFO i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'collection_info' i_value = i_COLLECTION_INFO ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_COLLECTION_INFO to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->LIST_COLLECTIONS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTIONS_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_COLLECTIONS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->UPDATE_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_COLLECTION_INFO TYPE T_BASE_COLLECTION(optional) -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - if not i_COLLECTION_INFO is initial. - lv_datatype = get_datatype( i_COLLECTION_INFO ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_COLLECTION_INFO i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'collection_info' i_value = i_COLLECTION_INFO ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_COLLECTION_INFO to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->DELETE_COLLECTION -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_COLLECTION. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_MODEL_FILE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_FEATURE TYPE STRING -* | [--->] I_MODEL_FORMAT TYPE STRING -* | [--->] I_accept TYPE string (default ='application/octet-stream') -* | [<---] E_RESPONSE TYPE FILE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_MODEL_FILE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/model'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_FEATURE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `feature` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - lv_queryparam = escape( val = i_MODEL_FORMAT format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `model_format` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve file data - e_response = get_response_binary( lo_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->ADD_IMAGES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_IMAGES_FILE TYPE TT_FILE_WITH_METADATA(optional) -* | [--->] I_IMAGE_URL TYPE TT_STRING(optional) -* | [--->] I_TRAINING_DATA TYPE STRING(optional) -* | [--->] I_contenttype TYPE string (default ='multipart/form-data') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_IMAGE_DETAILS_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method ADD_IMAGES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/images'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - " process form parameters - data: - ls_form_part type ts_form_part, - lt_form_part type tt_form_part, - lv_formdata type string value is initial ##NEEDED, - lv_value type string ##NEEDED, - lv_index(3) type n value '000' ##NEEDED, - lv_keypattern type string ##NEEDED, - lv_base_name type string ##NEEDED, - lv_extension type string ##NEEDED. - - - if not i_IMAGE_URL is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="image_url"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - field-symbols: - like line of i_IMAGE_URL. - loop at i_IMAGE_URL assigning . - ls_form_part-cdata = . - append ls_form_part to lt_form_part. - endloop. - endif. - - if not i_TRAINING_DATA is initial. - clear ls_form_part. - ls_form_part-content_disposition = 'form-data; name="training_data"' ##NO_TEXT. - ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN. - lv_formdata = i_TRAINING_DATA. - ls_form_part-cdata = lv_formdata. - append ls_form_part to lt_form_part. - endif. - - - - if not i_IMAGES_FILE is initial. - data: - lv_filename type string, - lv_content_type type string. - field-symbols: - like line of i_IMAGES_FILE. - loop at i_IMAGES_FILE assigning . - if not -content_type is initial. - lv_content_type = -content_type. - else. - lv_content_type = 'application/octet-stream' ##NO_TEXT. - endif. - if not -filename is initial. - lv_filename = -filename. - else. - lv_extension = get_file_extension( lv_content_type ). - lv_filename = `file` && lv_index && `.` && lv_extension ##NO_TEXT. - lv_index = lv_index + 1. - endif. - clear ls_form_part. - ls_form_part-content_type = lv_content_type. - ls_form_part-content_disposition = `form-data; name="images_file"; filename="` && lv_filename && `"` ##NO_TEXT. - ls_form_part-xdata = -data. - append ls_form_part to lt_form_part. - endloop. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST_MULTIPART( i_request_prop = ls_request_prop it_form_part = lt_form_part ). - - - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->LIST_IMAGES -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_IMAGE_SUMMARY_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_IMAGES. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/images'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_IMAGE_DETAILS -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_IMAGE_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_IMAGE_DETAILS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_IMAGE_DETAILS. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/images/{image_id}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{image_id}` in ls_request_prop-url-path with i_IMAGE_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->DELETE_IMAGE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_IMAGE_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_IMAGE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/images/{image_id}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{image_id}` in ls_request_prop-url-path with i_IMAGE_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_JPEG_IMAGE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_IMAGE_ID TYPE STRING -* | [--->] I_SIZE TYPE STRING (default ='full') -* | [--->] I_accept TYPE string (default ='image/jpeg') -* | [<---] E_RESPONSE TYPE FILE -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_JPEG_IMAGE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/images/{image_id}/jpeg'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{image_id}` in ls_request_prop-url-path with i_IMAGE_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_SIZE is supplied. - lv_queryparam = escape( val = i_SIZE format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `size` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve file data - e_response = get_response_binary( lo_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->LIST_OBJECT_METADATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_OBJECT_METADATA_LIST -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method LIST_OBJECT_METADATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/objects'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->UPDATE_OBJECT_METADATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_OBJECT TYPE STRING -* | [--->] I_UPDATEOBJECTMETADATA TYPE T_UPDATE_OBJECT_METADATA -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_UPDATE_OBJECT_METADATA -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method UPDATE_OBJECT_METADATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/objects/{object}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{object}` in ls_request_prop-url-path with i_OBJECT ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_UPDATEOBJECTMETADATA ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_UPDATEOBJECTMETADATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'UpdateObjectMetadata' i_value = i_UPDATEOBJECTMETADATA ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_UPDATEOBJECTMETADATA to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_OBJECT_METADATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_OBJECT TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_OBJECT_METADATA -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_OBJECT_METADATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/objects/{object}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{object}` in ls_request_prop-url-path with i_OBJECT ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->DELETE_OBJECT -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_OBJECT TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_OBJECT. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/objects/{object}'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{object}` in ls_request_prop-url-path with i_OBJECT ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->TRAIN -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_COLLECTION -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method TRAIN. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/train'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->ADD_IMAGE_TRAINING_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_COLLECTION_ID TYPE STRING -* | [--->] I_IMAGE_ID TYPE STRING -* | [--->] I_TRAINING_DATA TYPE T_BASE_TRAINING_DATA_OBJECTS -* | [--->] I_contenttype TYPE string (default ='application/json') -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_DATA_OBJECTS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method ADD_IMAGE_TRAINING_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/collections/{collection_id}/images/{image_id}/training_data'. - replace all occurrences of `{collection_id}` in ls_request_prop-url-path with i_COLLECTION_ID ignoring case. - replace all occurrences of `{image_id}` in ls_request_prop-url-path with i_IMAGE_ID ignoring case. - - " standard headers - ls_request_prop-header_content_type = I_contenttype. - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - - - - - - " process body parameters - data: - lv_body type string, - lv_bodyparam type string, - lv_datatype type char. - field-symbols: - type any. - lv_separator = ''. - lv_datatype = get_datatype( i_TRAINING_DATA ). - - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or - ls_request_prop-header_content_type cp '*json*'. - if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or - lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. - lv_bodyparam = abap_to_json( i_value = i_TRAINING_DATA i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). - else. - lv_bodyparam = abap_to_json( i_name = 'training_data' i_value = i_TRAINING_DATA ). - endif. - lv_body = lv_body && lv_separator && lv_bodyparam. - else. - assign i_TRAINING_DATA to . - lv_bodyparam = . - concatenate lv_body lv_bodyparam into lv_body. - endif. - if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. - lv_body = `{` && lv_body && `}`. - endif. - - if ls_request_prop-header_content_type cp '*charset=utf-8*'. - ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). - replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. - else. - ls_request_prop-body = lv_body. - endif. - - - " execute HTTP POST request - lo_response = HTTP_POST( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->GET_TRAINING_USAGE -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_START_TIME TYPE DATE(optional) -* | [--->] I_END_TIME TYPE DATE(optional) -* | [--->] I_accept TYPE string (default ='application/json') -* | [<---] E_RESPONSE TYPE T_TRAINING_EVENTS -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method GET_TRAINING_USAGE. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/training_usage'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - if i_START_TIME is supplied. - lv_queryparam = i_START_TIME. - add_query_parameter( - exporting - i_parameter = `start_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - if i_END_TIME is supplied. - lv_queryparam = i_END_TIME. - add_query_parameter( - exporting - i_parameter = `end_time` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - endif. - - - - - - - " execute HTTP GET request - lo_response = HTTP_GET( i_request_prop = ls_request_prop ). - - - " retrieve JSON data - lv_json = get_response_string( lo_response ). - parse_json( - exporting - i_json = lv_json - i_dictionary = c_abapname_dictionary - changing - c_abap = e_response ). - -endmethod. - - -* ---------------------------------------------------------------------------------------+ -* | Instance Public Method ZCL_IBMC_VISUAL_RECOGNITION_V4->DELETE_USER_DATA -* +-------------------------------------------------------------------------------------------------+ -* | [--->] I_CUSTOMER_ID TYPE STRING -* | [--->] I_accept TYPE string (default ='application/json') -* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION -* +-------------------------------------------------------------------------------------- -method DELETE_USER_DATA. - - data: - ls_request_prop type ts_request_prop, - lv_separator(1) type c ##NEEDED, - lv_sep(1) type c ##NEEDED, - lo_response type to_rest_response, - lv_json type string ##NEEDED. - - ls_request_prop-url-path = '/v4/user_data'. - - " standard headers - ls_request_prop-header_accept = I_accept. - set_default_query_parameters( - changing - c_url = ls_request_prop-url ). - - " process query parameters - data: - lv_queryparam type string. - - lv_queryparam = escape( val = i_CUSTOMER_ID format = cl_abap_format=>e_uri_full ). - add_query_parameter( - exporting - i_parameter = `customer_id` - i_value = lv_queryparam - changing - c_url = ls_request_prop-url ) ##NO_TEXT. - - - - - - - " execute HTTP DELETE request - lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). - - - -endmethod. - - -ENDCLASS. diff --git a/src/zcl_ibmc_visual_recognition_v4.clas.xml b/src/zcl_ibmc_visual_recognition_v4.clas.xml deleted file mode 100644 index 29cb66f..0000000 --- a/src/zcl_ibmc_visual_recognition_v4.clas.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - E - Visual Recognition v4 - 1 - X - X - X - - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - ADD_IMAGES - E - Add images - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - ADD_IMAGE_TRAINING_DATA - E - Add training data to an image - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - ANALYZE - E - Analyze images - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - CREATE_COLLECTION - E - Create a collection - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - DELETE_COLLECTION - E - Delete a collection - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - DELETE_IMAGE - E - Delete an image - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - DELETE_OBJECT - E - Delete an object - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - DELETE_USER_DATA - E - Delete labeled data - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - GET_COLLECTION - E - Get collection details - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - GET_IMAGE_DETAILS - E - Get image details - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - GET_JPEG_IMAGE - E - Get a JPEG file of an image - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - GET_MODEL_FILE - E - Get a model - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - GET_OBJECT_METADATA - E - Get object metadata - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - GET_TRAINING_USAGE - E - Get training usage - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - LIST_COLLECTIONS - E - List collections - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - LIST_IMAGES - E - List images - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - LIST_OBJECT_METADATA - E - List object metadata - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - TRAIN - E - Train a collection - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - UPDATE_COLLECTION - E - Update a collection - - - ZCL_IBMC_VISUAL_RECOGNITION_V4 - UPDATE_OBJECT_METADATA - E - Update an object name - - - - - diff --git a/src/zcx_ibmc_service_exception.clas.abap b/src/zcx_ibmc_service_exception.clas.abap index 165fdd7..502caa7 100644 --- a/src/zcx_ibmc_service_exception.clas.abap +++ b/src/zcx_ibmc_service_exception.clas.abap @@ -35,19 +35,18 @@ CLASS ZCX_IBMC_SERVICE_EXCEPTION IMPLEMENTATION. method CONSTRUCTOR. -CALL METHOD SUPER->CONSTRUCTOR -EXPORTING -PREVIOUS = PREVIOUS -. -me->P_MSG_JSON = P_MSG_JSON . -me->P_HTTP_STATUS = P_HTTP_STATUS . -me->P_HTTP_REASON = P_HTTP_REASON . -clear me->textid. -if textid is initial. - IF_T100_MESSAGE~T100KEY = IF_T100_MESSAGE=>DEFAULT_TEXTID. -else. - IF_T100_MESSAGE~T100KEY = TEXTID. -endif. + CALL METHOD SUPER->CONSTRUCTOR + EXPORTING + PREVIOUS = PREVIOUS. + me->P_MSG_JSON = P_MSG_JSON . + me->P_HTTP_STATUS = P_HTTP_STATUS . + me->P_HTTP_REASON = P_HTTP_REASON . + clear me->textid. + if textid is initial. + IF_T100_MESSAGE~T100KEY = IF_T100_MESSAGE=>DEFAULT_TEXTID. + else. + IF_T100_MESSAGE~T100KEY = TEXTID. + endif. endmethod. diff --git a/src/zcx_ibmc_service_exception.clas.xml b/src/zcx_ibmc_service_exception.clas.xml index 14c7bcb..25fb1c7 100644 --- a/src/zcx_ibmc_service_exception.clas.xml +++ b/src/zcx_ibmc_service_exception.clas.xml @@ -1,25 +1,25 @@ - - - - - - ZCX_IBMC_SERVICE_EXCEPTION - E - IBM Cloud Service Exception - 40 - 1 - X - X - X - - - - ZCX_IBMC_SERVICE_EXCEPTION - CONSTRUCTOR - E - CONSTRUCTOR - - - - - + + + + + + ZCX_IBMC_SERVICE_EXCEPTION + E + IBM Cloud Service Exception + 40 + 1 + X + X + X + + + + ZCX_IBMC_SERVICE_EXCEPTION + CONSTRUCTOR + E + CONSTRUCTOR + + + + + \ No newline at end of file diff --git a/src/zif_ibmc_service_arch.intf.abap b/src/zif_ibmc_service_arch.intf.abap index 2891730..f8a9782 100644 --- a/src/zif_ibmc_service_arch.intf.abap +++ b/src/zif_ibmc_service_arch.intf.abap @@ -1,4 +1,4 @@ -* Copyright 2019,2020 IBM Corp. All Rights Reserved. +* Copyright 2019,2023 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,6 +90,7 @@ interface ZIF_IBMC_SERVICE_ARCH constants C_METHOD_GET type CHAR value 'g' ##NO_TEXT. constants C_METHOD_POST type CHAR value 'p' ##NO_TEXT. + constants C_METHOD_PATCH type CHAR value 'm' ##NO_TEXT. constants C_METHOD_CREATE type CHAR value 'c' ##NO_TEXT. constants C_METHOD_PUT type CHAR value 'u' ##NO_TEXT. constants C_METHOD_DELETE type CHAR value 'd' ##NO_TEXT. diff --git a/src/zif_ibmc_service_arch.intf.xml b/src/zif_ibmc_service_arch.intf.xml index 6555753..7dada07 100644 --- a/src/zif_ibmc_service_arch.intf.xml +++ b/src/zif_ibmc_service_arch.intf.xml @@ -1,15 +1,15 @@ - - - - - - ZIF_IBMC_SERVICE_ARCH - E - IBM Watson SDK Platform-specifics - 2 - 1 - X - - - - + + + + + + ZIF_IBMC_SERVICE_ARCH + E + IBM Watson SDK Platform-specifics + 2 + 1 + X + + + + \ No newline at end of file