From f9b9ecbd8b29c53a2ba139913990be2f30c0412a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jochen=20R=C3=B6hrig?=
<54274238+jridfe@users.noreply.github.com>
Date: Mon, 10 Feb 2020 22:09:39 +0100
Subject: [PATCH] Release 0.2.0 (#1)
* Release 0.2.0 common parts.
* Release 0.2.0 common parts (not changed in abap-sdk-nwas release 0.2.0).
* Release 0.2.0 platform specific parts.
* Update README.md
---
.abapgit.xml | 19 +
LICENSE | 28 +-
README.md | 335 +-
src/package.devc.xml | 10 +
src/zcl_ibmc_assistant_v1.clas.abap | 7326 +++++++++++++++
src/zcl_ibmc_assistant_v1.clas.xml | 16 +
src/zcl_ibmc_assistant_v2.clas.abap | 1251 +++
src/zcl_ibmc_assistant_v2.clas.xml | 16 +
src/zcl_ibmc_compare_comply_v1.clas.abap | 2851 ++++++
src/zcl_ibmc_compare_comply_v1.clas.xml | 16 +
src/zcl_ibmc_discovery_v1.clas.abap | 8442 ++++++++++++++++++
src/zcl_ibmc_discovery_v1.clas.xml | 16 +
src/zcl_ibmc_lang_translator_v3.clas.abap | 1463 +++
src/zcl_ibmc_lang_translator_v3.clas.xml | 16 +
src/zcl_ibmc_nat_lang_class_v1.clas.abap | 792 ++
src/zcl_ibmc_nat_lang_class_v1.clas.xml | 16 +
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap | 1320 +++
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml | 16 +
src/zcl_ibmc_personal_insights_v3.clas.abap | 825 ++
src/zcl_ibmc_personal_insights_v3.clas.xml | 16 +
src/zcl_ibmc_service.clas.abap | 1539 ++++
src/zcl_ibmc_service.clas.xml | 168 +
src/zcl_ibmc_service_arch.clas.abap | 368 +
src/zcl_ibmc_service_arch.clas.xml | 126 +
src/zcl_ibmc_service_ext.clas.abap | 1023 +++
src/zcl_ibmc_service_ext.clas.xml | 120 +
src/zcl_ibmc_speech_to_text_v1.clas.abap | 5465 ++++++++++++
src/zcl_ibmc_speech_to_text_v1.clas.xml | 16 +
src/zcl_ibmc_text_to_speech_v1.clas.abap | 1627 ++++
src/zcl_ibmc_text_to_speech_v1.clas.xml | 16 +
src/zcl_ibmc_tone_analyzer_v3.clas.abap | 696 ++
src/zcl_ibmc_tone_analyzer_v3.clas.xml | 16 +
src/zcl_ibmc_util.clas.abap | 560 ++
src/zcl_ibmc_util.clas.xml | 60 +
src/zcl_ibmc_visual_recognition_v3.clas.abap | 1281 +++
src/zcl_ibmc_visual_recognition_v3.clas.xml | 16 +
src/zcl_ibmc_visual_recognition_v4.clas.abap | 2239 +++++
src/zcl_ibmc_visual_recognition_v4.clas.xml | 16 +
src/zcx_ibmc_service_exception.clas.abap | 68 +
src/zcx_ibmc_service_exception.clas.xml | 25 +
src/zibmc.msag.xml | 416 +
src/zibmc_config.tabl.xml | 87 +
src/zibmc_dom_stringvalue.doma.xml | 14 +
src/zibmc_token.tabl.xml | 140 +
src/zibmc_ty_instance_uid.dtel.xml | 24 +
src/zibmc_ty_stringvalue.dtel.xml | 23 +
src/zif_ibmc_service_arch.intf.abap | 151 +
src/zif_ibmc_service_arch.intf.xml | 15 +
48 files changed, 41074 insertions(+), 31 deletions(-)
create mode 100644 .abapgit.xml
create mode 100644 src/package.devc.xml
create mode 100644 src/zcl_ibmc_assistant_v1.clas.abap
create mode 100644 src/zcl_ibmc_assistant_v1.clas.xml
create mode 100644 src/zcl_ibmc_assistant_v2.clas.abap
create mode 100644 src/zcl_ibmc_assistant_v2.clas.xml
create mode 100644 src/zcl_ibmc_compare_comply_v1.clas.abap
create mode 100644 src/zcl_ibmc_compare_comply_v1.clas.xml
create mode 100644 src/zcl_ibmc_discovery_v1.clas.abap
create mode 100644 src/zcl_ibmc_discovery_v1.clas.xml
create mode 100644 src/zcl_ibmc_lang_translator_v3.clas.abap
create mode 100644 src/zcl_ibmc_lang_translator_v3.clas.xml
create mode 100644 src/zcl_ibmc_nat_lang_class_v1.clas.abap
create mode 100644 src/zcl_ibmc_nat_lang_class_v1.clas.xml
create mode 100644 src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
create mode 100644 src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml
create mode 100644 src/zcl_ibmc_personal_insights_v3.clas.abap
create mode 100644 src/zcl_ibmc_personal_insights_v3.clas.xml
create mode 100644 src/zcl_ibmc_service.clas.abap
create mode 100644 src/zcl_ibmc_service.clas.xml
create mode 100644 src/zcl_ibmc_service_arch.clas.abap
create mode 100644 src/zcl_ibmc_service_arch.clas.xml
create mode 100644 src/zcl_ibmc_service_ext.clas.abap
create mode 100644 src/zcl_ibmc_service_ext.clas.xml
create mode 100644 src/zcl_ibmc_speech_to_text_v1.clas.abap
create mode 100644 src/zcl_ibmc_speech_to_text_v1.clas.xml
create mode 100644 src/zcl_ibmc_text_to_speech_v1.clas.abap
create mode 100644 src/zcl_ibmc_text_to_speech_v1.clas.xml
create mode 100644 src/zcl_ibmc_tone_analyzer_v3.clas.abap
create mode 100644 src/zcl_ibmc_tone_analyzer_v3.clas.xml
create mode 100644 src/zcl_ibmc_util.clas.abap
create mode 100644 src/zcl_ibmc_util.clas.xml
create mode 100644 src/zcl_ibmc_visual_recognition_v3.clas.abap
create mode 100644 src/zcl_ibmc_visual_recognition_v3.clas.xml
create mode 100644 src/zcl_ibmc_visual_recognition_v4.clas.abap
create mode 100644 src/zcl_ibmc_visual_recognition_v4.clas.xml
create mode 100644 src/zcx_ibmc_service_exception.clas.abap
create mode 100644 src/zcx_ibmc_service_exception.clas.xml
create mode 100644 src/zibmc.msag.xml
create mode 100644 src/zibmc_config.tabl.xml
create mode 100644 src/zibmc_dom_stringvalue.doma.xml
create mode 100644 src/zibmc_token.tabl.xml
create mode 100644 src/zibmc_ty_instance_uid.dtel.xml
create mode 100644 src/zibmc_ty_stringvalue.dtel.xml
create mode 100644 src/zif_ibmc_service_arch.intf.abap
create mode 100644 src/zif_ibmc_service_arch.intf.xml
diff --git a/.abapgit.xml b/.abapgit.xml
new file mode 100644
index 0000000..9727f9c
--- /dev/null
+++ b/.abapgit.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ E
+ /src/
+ PREFIX
+
+ - /.gitignore
+ - /LICENSE
+ - /README.md
+ - /package.json
+ - /.travis.yml
+ - /.gitlab-ci.yml
+ - /abaplint.json
+
+
+
+
diff --git a/LICENSE b/LICENSE
index 261eeb9..4947287 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,4 @@
+
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -173,29 +174,4 @@
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
+ END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/README.md b/README.md
index baf9e30..5f08e2a 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,344 @@
# ABAP SDK for IBM Watson, using SAP Cloud Platform ABAP Environment
-ABAP client library to use the [IBM Watson APIs][wdc]. This is a Community SDK written by ABAPers for the ABAPers in the Open Source community, to provide easy usage of IBM Watson Developer Services in innovation initiatives using SA{ Cloud Platform ABAP Environment combined with any SAP Application which is run on SAP NetWeaver 7.50 and above, such as SAP ECC or SAP S/4HANA. It is the choice and responsibility of application developers how this Community SDK is used.
+ABAP client library to use the [Watson APIs][wdc]. This is a Community SDK written by ABAPers for the ABAPers in the Open Source community, to provide easy usage of IBM Watson Developer Services in innovation initatives using the SAP Cloud Platform ABAP Environment. It is the choice and responsibility of application developers how this Community SDK is used.
-Additionally, as the ABAP SDK is a community release it is not updated with the same schedule as IBM-supported SDKs. Please see more information in [Questions](#questions).
+Additionally, as the ABAP SDK is a community release it is not updated with the same schedule as IBM-supported SDKs. Please see more information in [Questions](#Questions).
# Choose ABAP SDK release for the applicable ABAP Runtime
| [abap-sdk-nwas](https://github.com/watson-developer-cloud/abap-sdk-nwas) | **abap-sdk-scp** |
|---|---|
-| for SAP NetWeaver AS ABAP 7.50+ | for SAP Cloud Platform ABAP Environment 1911+ |
+| for SAP NetWeaver AS ABAP 7.50+ | for SAP Cloud Platform ABAP Environment 2002+ |
| tested on SAP ECC and SAP S/4HANA | |
| | `this repository` |
-| | **coming soon, to be released in conjunction with SCP ABAP 1911 release** |
+
+**Note:** The ABAP SDK is available and will run in the SAP Cloud Platform ABAP Environment. However, at time of release, the SCP ABAP Env Trial has not been upgraded, therefore will not work at this time. The documentation will be updated, when the SCP ABAP Env Trial has been upgraded.
---
+
+ Table of Contents
+
+ * [Before you begin](#before-you-begin)
+ * [Installation](#installation)
+ * [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)
+
+
+## Before you begin
+* You need an [IBM Cloud][ibm_cloud_onboarding] account.
+
+## Installation
+
+The client library is provided as ABAP Git Repository. Proceed as follows to clone the ABAP SDK code to your SAP system.
+1. Install the [abapGit Plug-In][abapgit_plugin] for ADT.
+2. Use abapGit to clone the ABAP SDK Git repository into your SAP system.
+3. Assign the ABAP SDK to the package `ZIBMC` when performing setup of the abapGit repository.
+
+## SSL Certificates
+Communication between SAP and the IBM Cloud is secured by the Transport Layer Security (TLS) protocol, also known as Secure Sockets Layer (SSL). SSL requires certificates that must be stored in the SCP Certificate Trust List, which can be maintained through the SCP ABAP environment dashboard. Ensure that the *DigiCert Global Root CA* certificate is installed.
+
+## Credentials
+
+Before you can access a specific service from your SAP system, you must create a service instance in the IBM Cloud and obtain credentials. The credentials can be shared among multiple end users of the SAP system, but you must ensure that the selected plan is sufficient to support the expected number of calls or the expected data volume. Please note that some plans may have restrictions on the allowed methods, so make sure to select the right plan for your purpose.
+
+All currently supported services support IAM authentication (see below). Service credentials consist of an API Key and a URL. Both the API Key and the URL are character values that can be viewed through the IBM Cloud dashboard and need to be provided as parameters `i_apikey` and `i_url` to method `zcl_ibmc_service_ext=>get_instance`.
+
+You can store the values with your application, but it is suggested to do that in an encrypted format. Using cloud services usually creates costs based on usage for the owner of the service instance, and anyone with the credentials can use the service instance at the owner's expenses. If you want to distribute the costs over multiple cost centers, you need to create a service instance and provide service credentials for each cost center separately.
+
+
+## Configuration table
+
+Service credentials and other parameters that must be specified at Watson service wrapper ABAP class instantiation can also be provided in table `ZIBMC_CONFIG`. This table has three keys:
+
+| Table Key | Description |
+|:------------ |:-------------------------------------------------------------------------------------------------------------------------------------- |
+| SERVICE | The ABAP class name without prefix ZCL_IBMC_ |
+| INSTANCE_UID | ID chosen by application developer that must be provided by application as parameter to method `zcl_ibmc_service_ext=>get_instance()` |
+| PARAM | The parameter name |
+
+
+ List of configuration parameters in table ZIBMC_CONFIG
+
+| Parameter Name | Default Value | Description |
+|:----------------- |:----------------- |:--------------------------------------------------------------------------- |
+| URL | service-dependent | Watson service url |
+| APIKEY | | Watson service API keys |
+| AUTH_NAME | service-dependent | Authorization, `IAM` or `basicAuth` |
+
+
+
+
+## IAM Authentication
+
+Identity and Access Management (IAM) is a bearer-token based authentication method. Token management is either performed by the ABAP SDK or must be implemented by the SDK user.
+If a value for apikey is provided by the caller in method `zcl_ibmc_service_ext=>get_instance()`, the ABAP SDK generates a bearer-token under the cover when needed and refreshes it when it is about to expire.
+If apikey is not provided for method `zcl_ibmc_service_ext=>get_instance()`, the ABAP SDK user must implement an individual token management. Before a service method is called the first time, a valid bearer-token must be provided to the Watson service wrapper ABAP class instance as follows:
+```abap
+ lo_service_class->set_bearer_token( i_bearer_token = '...' ).
+```
+Afterwards, service methods can be called as long as the provided token is valid. When the token has expired, the method above must be called again with a new (refreshed) bearer-token as parameter.
+
+
+## Usage
+
+The client library is delivered as package *ZIBMC*. Once the Git Repository has been cloned to the SAP system, a Watson service instance is wrapped by an ABAP class instance.
+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 |
+| 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 |
+
+Using the client library requires two steps:
+
+1. Create an instance of the Watson service wrapper ABAP class by calling method `zcl_ibmc_service_ext=>get_instance`.
+```abap
+ data:
+ lo_service_class type .
+
+ zcl_ibmc_service_ext=>get_instance(
+ exporting
+ i_url =
+ i_apikey =
+...
+ importing
+ eo_instance = lo_service_class ).
+```
+
+2. Call the Watson service API endpoint by invoking the corresponding class method.
+```abap
+ try.
+ lo_service_class->method(
+ exporting
+ is_input = ...
+ importing
+ es_output = ... ).
+ catch zcx_ibmc_service_exception into data(lo_service_exception).
+ ...
+ endtry.
+```
+
+
+ Text to Speech Example
+
+```abap
+* List all voices provided by Watson Text to Speech
+
+ " declare variables
+ data:
+ 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.
+
+ " get Watson Text-to-Speech service instance
+ zcl_ibmc_service_ext=>get_instance(
+ exporting
+ i_url = 'https://api.kr-seo.text-to-speech.watson.cloud.ibm.com/instances/'
+ i_apikey = lv_apikey
+ importing
+ eo_instance = lo_text_to_speech ).
+
+ " call Watson Text-to-Speech service to retrieve available voices
+ try.
+ lo_text_to_speech->list_voices(
+ importing
+ e_response = lt_voices ).
+
+ catch zcx_ibmc_service_exception into lo_service_exception.
+ message lo_service_exception type 'E'.
+ endtry.
+
+ " evaluate voices
+ loop at lt_voices-voices into ls_voice.
+ ...
+ endloop.
+```
+
+
+
+
+ Natural Language Understanding Example
+
+```abap
+* Analyze www.ibm.com using Watson Natural Language Understanding
+
+ " declare variables
+ data:
+ lv_apikey type string value '...',
+ lo_instance type ref to zcl_ibmc_nat_lang_undrstnd_v1,
+ lo_service_exception type ref to zcx_ibmc_service_exception,
+ ls_parameter type zcl_ibmc_nat_lang_undrstnd_v1=>t_parameters,
+ ls_analysis_results type zcl_ibmc_nat_lang_undrstnd_v1=>t_analysis_results.
+
+ " get Watson Natural Language Understanding service instance
+ zcl_ibmc_service_ext=>get_instance(
+ exporting
+ i_url = 'https://api.eu-de.natural-language-understanding.watson.cloud.ibm.com/instances/'
+ i_apikey = lv_apikey
+ i_version = '2019-07-12'
+ importing
+ eo_instance = lo_instance ).
+
+ " set the input parameters
+ ls_parameters-url = 'www.ibm.com'.
+ ls_parameters-return_analyzed_text = zcl_ibmc_service=>c_boolean_true.
+ ls_parameters-features-entities-emotion = zcl_ibmc_service=>c_boolean_true.
+ ls_parameters-features-entities-sentiment = zcl_ibmc_service=>c_boolean_true.
+ ls_parameters-features-keywords-emotion = zcl_ibmc_service=>c_boolean_true.
+ ls_parameters-features-keywords-sentiment = zcl_ibmc_service=>c_boolean_true.
+
+ " call Watson Natural Language Understanding service to analyze URL www.ibm.com
+ try.
+ lo_instance->analyze(
+ exporting
+ i_parameters = ls_parameters
+ importing
+ e_response = ls_analysis_results ).
+
+ catch zcx_ibmc_service_exception into lo_service_exception.
+ message lo_service_exception type 'E'.
+ endtry.
+
+ " retreive analysis results from ls_analysis_results
+
+```
+
+
+
+
+ Personality Insights Example
+
+```abap
+* Analyze profile using example text using Watson Personality Insights
+
+ " declare variables
+ data:
+ lv_apikey type string value '...',
+ lo_personality_insights type ref to zcl_ibmc_personal_insights_v3,
+ lo_service_exception type ref to zcx_ibmc_service_exception,
+ ls_content_item type zcl_ibmc_personal_insights_v3=>t_content_item,
+ ls_response type zcl_ibmc_personal_insights_v3=>t_profile,
+ ls_content type zcl_ibmc_personal_insights_v3=>t_content,
+ lv_content_language type string value 'en',
+ lv_accept_language type string value 'en',
+ lv_raw_scores type boolean value 'C_BOOLEAN_FALSE',
+ lv_csv_headers type boolean valiue 'C_BOOLEAN_FALSE',
+ lv_consumption_preferences type boolean value 'C_BOOLEAN_FALSE',
+ lv_accept type string value 'text/csv'.
+
+ " get Watson Personality Insights service instance
+ zcl_ibmc_service_ext=>get_instance(
+ exporting
+ i_url = 'https://api.eu-gb.personality-insights.watson.cloud.ibm.com/instances/'
+ i_apikey = lv_apikey
+ i_version = '2018-05-01'
+ importing
+ eo_instance = lo_personality_insights ).
+
+ " store text to be analyzed into ls_content
+ " concatenate ... into ls_content_item-content
+ " append ls_content_item to ls_content-contentitems
+
+ " call Watson Personality Insights service to analyze text in ls_content
+ try.
+ lo_personality_insights->profile(
+ exporting
+ i_content = ls_content
+ i_content_language = lv_content_language
+ i_accept_language = lv_accept_language
+ i_raw_scores = lv_raw_scores
+ i_csv_headers = lv_csv_headers
+ i_consumption_preferences = lv_consumption_preferences
+ importing
+ e_response = ls_response ).
+
+ catch zcx_ibmc_service_exception into lo_service_exception.
+ message lo_service_exception type 'E'.
+ endtry.
+
+ " retreive profile analysis results from ls_response
+
+```
+
+
+
+
+ Language Translator Example
+
+```abap
+* Translate text from English to German using Watson Language Translator
+
+ " declare variables
+ data:
+ lv_apikey type string value '...',
+ lo_lang_translator type ref to zcl_ibmc_lang_translator_v3,
+ 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.
+
+ " get Watson Language Translator service instance
+ zcl_ibmc_service_ext=>get_instance(
+ exporting
+ i_url = 'https://api.us-south.language-translator.watson.cloud.ibm.com/instances/'
+ i_apikey = lv_apikey
+ i_version = '2018-05-01'
+ importing
+ eo_instance = lo_lang_translator ).
+
+ " store text to be translated into ls_request and set the languages
+ lv_text = 'Welcome'.
+ append lv_text to ls_request-text.
+ ls_request-model_id = 'en-de'.
+ ls_request-source = 'EN'.
+ ls_request-target = 'DE'.
+
+ " call Watson Language Translator service to translate the text in ls_request
+ try.
+ lo_lang_translator->translate(
+ exporting
+ i_request = ls_request
+ i_contenttype = 'application/json'
+ i_accept = 'application/json'
+ importing
+ e_response = ls_trans ).
+
+ catch zcx_ibmc_service_exception into lo_service_exception.
+ message lo_service_exception type 'E'.
+ endtry.
+
+ " retreive translation results from ls_trans
+
+```
+
+
+
+## API Reference
+
+GitHub Pages contain the [ABAP Client Library for Watson API Reference](https://watson-developer-cloud.github.io/abap-sdk-nwas/).
+
## Questions
The ABAP SDK is a Community SDK for IBM Watson, created by the IBM Watson development community and SAP's ABAP development community - written by ABAPers from IBM Cloud, IBM Services and IBM Systems. Therefore as a community release it is not updated with the same schedule as IBM-supported SDKs, and does not include support by IBM. For more information on IBM-supported SDKs and the update policy, please see https://cloud.ibm.com/docs/watson?topic=watson-using-sdks
@@ -46,5 +370,6 @@ In addition, we would like to thank the [abapGit][abapgit] contributors and the
[ibm_cloud]: https://cloud.ibm.com/
[ibm_cloud_onboarding]: https://cloud.ibm.com/registration?target=/developer/watson&cm_sp=WatsonPlatform-WatsonServices-_-OnPageNavLink-IBMWatson_SDKs-_-ABAP
[license]: http://www.apache.org/licenses/LICENSE-2.0
-[abapgit]: https://github.com/larshp/abapGit
+[abapgit_plugin]: https://eclipse.abapgit.org/updatesite/
[abapgit_docs]: https://docs.abapgit.org/
+[abapgit]: https://github.com/larshp/abapGit
diff --git a/src/package.devc.xml b/src/package.devc.xml
new file mode 100644
index 0000000..ef268e4
--- /dev/null
+++ b/src/package.devc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+ ABAP SDK for IBM Watson
+
+
+
+
diff --git a/src/zcl_ibmc_assistant_v1.clas.abap b/src/zcl_ibmc_assistant_v1.clas.abap
new file mode 100644
index 0000000..12fa523
--- /dev/null
+++ b/src/zcl_ibmc_assistant_v1.clas.abap
@@ -0,0 +1,7326 @@
+* 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.
+"! 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.
+class ZCL_IBMC_ASSISTANT_V1 DEFINITION
+ public
+ inheriting from ZCL_IBMC_SERVICE_EXT
+ create public .
+
+public section.
+ types:
+ "! Workspace settings related to detection of irrelevant input.
+ begin of T_WS_SYSTEM_SETTINGS_OFF_TOPIC,
+ "! Whether enhanced irrelevance detection is enabled for the workspace.
+ ENABLED type BOOLEAN,
+ end of T_WS_SYSTEM_SETTINGS_OFF_TOPIC.
+ types:
+ "! No documentation available.
+ begin of T_RT_ENTITY_INTERPRETATION,
+ "! The calendar used to represent a recognized date (for example, `Gregorian`).
+ CALENDAR_TYPE type STRING,
+ "! A unique identifier used to associate a recognized 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,
+ "! A recognized numeric value, represented as an integer or double.
+ NUMERIC_VALUE type NUMBER,
+ "! The type of numeric value recognized in the user input (`integer` or
+ "! `rational`).
+ SUBTYPE type STRING,
+ "! A recognized term for a time that was mentioned as a part of the day in the
+ "! user's input (for example, `morning` or `afternoon`).
+ PART_OF_DAY type STRING,
+ "! A recognized mention of a relative hour, represented numerically as an offset
+ "! from the current hour (for example, `3` for `in three hours` or `-1` for `an
+ "! hour ago`).
+ RELATIVE_HOUR type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! minutes from the current time (for example, `5` for `in five minutes` or `-15`
+ "! for `fifteen minutes ago`).
+ RELATIVE_MINUTE type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! seconds from the current time (for example, `10` for `in ten seconds` or `-30`
+ "! for `thirty seconds ago`).
+ RELATIVE_SECOND type NUMBER,
+ "! A recognized specific hour mentioned as part of a time value (for example, `10`
+ "! for `10:15 AM`.).
+ SPECIFIC_HOUR type NUMBER,
+ "! A recognized specific minute mentioned as part of a time value (for example,
+ "! `15` for `10:15 AM`.).
+ SPECIFIC_MINUTE type NUMBER,
+ "! A recognized specific second mentioned as part of a time value (for example,
+ "! `30` for `10:15:30 AM`.).
+ SPECIFIC_SECOND type NUMBER,
+ "! A recognized time zone mentioned as part of a time value (for example, `EST`).
+ TIMEZONE type STRING,
+ end of T_RT_ENTITY_INTERPRETATION.
+ types:
+ "! A key/value pair defining an HTTP header and a value.
+ begin of T_WEBHOOK_HEADER,
+ "! The name of an HTTP header (for example, `Authorization`).
+ NAME type STRING,
+ "! The value of an HTTP header.
+ VALUE type STRING,
+ end of T_WEBHOOK_HEADER.
+ types:
+ "! No documentation available.
+ begin of T_DIALOG_NODE_ACTION,
+ "! The name of the action.
+ NAME type STRING,
+ "! The type of action to invoke.
+ TYPE type STRING,
+ "! A map of key/value pairs to be provided to the action.
+ PARAMETERS type MAP,
+ "! 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:
+ "! Workspace settings related to the disambiguation feature.
+ "!
+ "! **Note:** This feature is available only to Plus and Premium users.
+ begin of T_WS_SYSTM_STTNGS_DSMBGTN,
+ "! The text of the introductory prompt that accompanies disambiguation options
+ "! presented to the user.
+ PROMPT type STRING,
+ "! The user-facing label for the option users can select if none of the suggested
+ "! options is correct. If no value is specified for this property, this option
+ "! does not appear.
+ 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.
+ SENSITIVITY type STRING,
+ "! Whether the order in which disambiguation suggestions are presented should be
+ "! randomized (but still influenced by relative confidence).
+ RANDOMIZE type BOOLEAN,
+ "! The maximum number of disambigation suggestions that can be included in a
+ "! `suggestion` response.
+ MAX_SUGGESTIONS type INTEGER,
+ "! For internal use only.
+ SUGGESTION_TEXT_POLICY type STRING,
+ end of T_WS_SYSTM_STTNGS_DSMBGTN.
+ types:
+ "! Options that modify how specified output is handled.
+ begin of T_DIALOG_NODE_OUTPUT_MODIFIERS,
+ "! Whether values in the output will overwrite output values in an array specified
+ "! by previously executed dialog nodes. If this option is set to `false`, new
+ "! values will be appended to previously specified values.
+ OVERWRITE type BOOLEAN,
+ end of T_DIALOG_NODE_OUTPUT_MODIFIERS.
+ types:
+ "! The next step to execute following this dialog node.
+ begin of T_DIALOG_NODE_NEXT_STEP,
+ "! What happens after the dialog node completes. The valid values depend on the
+ "! node type:
+ "! - The following values are valid for any node:
+ "! - `get_user_input`
+ "! - `skip_user_input`
+ "! - `jump_to`
+ "! - If the node is of type `event_handler` and its parent node is of type `slot`
+ "! or `frame`, additional values are also valid:
+ "! - if **event_name**=`filled` and the type of the parent node is `slot`:
+ "! - `reprompt`
+ "! - `skip_all_slots`
+ "! - if **event_name**=`nomatch` and the type of the parent node is `slot`:
+ "! - `reprompt`
+ "! - `skip_slot`
+ "! - `skip_all_slots`
+ "! - if **event_name**=`generic` and the type of the parent node is `frame`:
+ "! - `reprompt`
+ "! - `skip_slot`
+ "! - `skip_all_slots`
+ "! If you specify `jump_to`, then you must also specify a value for the
+ "! `dialog_node` property.
+ BEHAVIOR type STRING,
+ "! The 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 input object that includes the input text.
+ begin of T_MESSAGE_INPUT,
+ "! The text of the user input. This string cannot contain carriage return, newline,
+ "! or tab characters.
+ TEXT type STRING,
+ end of T_MESSAGE_INPUT.
+ types:
+ "! A recognized capture group for a pattern-based entity.
+ begin of T_CAPTURE_GROUP,
+ "! A recognized capture group for the entity.
+ GROUP type STRING,
+ "! Zero-based character offsets that indicate where the entity value begins and
+ "! ends in the input text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ end of T_CAPTURE_GROUP.
+ types:
+ "! 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.
+ begin of T_RUNTIME_ENTITY_ROLE,
+ "! The relationship of the entity to the range.
+ TYPE type STRING,
+ end of T_RUNTIME_ENTITY_ROLE.
+ types:
+ "! A term from the request that was identified as an entity.
+ begin of T_RUNTIME_ENTITY,
+ "! An entity detected in the input.
+ ENTITY type STRING,
+ "! An array of zero-based character offsets that indicate where the detected entity
+ "! values begin and end in the input text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ "! The entity value that was recognized in the user input.
+ VALUE type STRING,
+ "! 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
+ "! user input. This property is included only if the new system entities are
+ "! enabled for the workspace.
+ "!
+ "! For more information about how the new system entities are interpreted, see the
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-syste
+ "! m-entities).
+ INTERPRETATION type T_RT_ENTITY_INTERPRETATION,
+ "! 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.
+ ROLE type T_RUNTIME_ENTITY_ROLE,
+ end of T_RUNTIME_ENTITY.
+ types:
+ "! An intent identified in the user input.
+ 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.
+ CONFIDENCE type DOUBLE,
+ end of T_RUNTIME_INTENT.
+ types:
+ "! An object defining the message input to be sent to the Watson Assistant service
+ "! if the user selects the corresponding option.
+ begin of T_DIA_ND_OUTPUT_OPT_ELEM_VALUE,
+ "! An input object that includes the input text.
+ INPUT type T_MESSAGE_INPUT,
+ "! An array of intents to be used while processing the input.
+ "!
+ "! **Note:** This property is supported for backward compatibility with
+ "! applications that use the v1 **Get response to user input** method.
+ INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of entities to be used while processing the user input.
+ "!
+ "! **Note:** This property is supported for backward compatibility with
+ "! applications that use the v1 **Get response to user input** method.
+ ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ end of T_DIA_ND_OUTPUT_OPT_ELEM_VALUE.
+ types:
+ "! No documentation available.
+ begin of T_DIA_NODE_OUTPUT_OPT_ELEMENT,
+ "! The user-facing label for the option.
+ LABEL type STRING,
+ "! An object defining the message input to be sent to the Watson Assistant service
+ "! if the user selects the corresponding option.
+ VALUE type T_DIA_ND_OUTPUT_OPT_ELEM_VALUE,
+ end of T_DIA_NODE_OUTPUT_OPT_ELEMENT.
+ types:
+ "! No documentation available.
+ begin of T_DIA_ND_OTPT_TEXT_VALUES_ELEM,
+ "! The text of a response. This string can include newline characters (`\n`),
+ "! Markdown tagging, or other special characters, if supported by the channel.
+ TEXT type STRING,
+ end of T_DIA_ND_OTPT_TEXT_VALUES_ELEM.
+ types:
+ "! No documentation available.
+ begin of T_DIALOG_NODE_OUTPUT_GENERIC,
+ "! The type of response returned by the dialog node. The specified response type
+ "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The **search_skill** response type is available only for Plus and
+ "! Premium users, and is used only by the v2 runtime API.
+ RESPONSE_TYPE type STRING,
+ "! A list of one or more objects defining text responses. Required when
+ "! **response_type**=`text`.
+ VALUES type STANDARD TABLE OF T_DIA_ND_OTPT_TEXT_VALUES_ELEM WITH NON-UNIQUE DEFAULT KEY,
+ "! How a response is selected from the list, if more than one response is
+ "! specified. Valid only when **response_type**=`text`.
+ SELECTION_POLICY type STRING,
+ "! The delimiter to use as a separator between responses when
+ "! `selection_policy`=`multiline`.
+ DELIMITER type STRING,
+ "! How long to pause, in milliseconds. The valid values are from 0 to 10000. Valid
+ "! only when **response_type**=`pause`.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause. Ignored if the
+ "! channel does not support this event. Valid only when **response_type**=`pause`.
+ "!
+ TYPING type BOOLEAN,
+ "! The URL of the image. Required when **response_type**=`image`.
+ SOURCE type STRING,
+ "! An optional title to show before the response. Valid only when
+ "! **response_type**=`image` or `option`.
+ TITLE type STRING,
+ "! An optional description to show with the response. Valid only when
+ "! **response_type**=`image` or `option`.
+ DESCRIPTION type STRING,
+ "! The preferred type of control to display, if supported by the channel. Valid
+ "! only when **response_type**=`option`.
+ PREFERENCE type STRING,
+ "! An array of objects describing the options from which the user can choose. You
+ "! can include up to 20 options. Required when **response_type**=`option`.
+ OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An optional message to be sent to the human agent who will be taking over the
+ "! conversation. Valid only when **reponse_type**=`connect_to_agent`.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ "! The text of the search query. This can be either a natural-language query or a
+ "! query that uses the Discovery query language syntax, depending on the value of
+ "! the **query_type** property. For more information, see the [Discovery service
+ "! documentation](https://cloud.ibm.com/docs/services/discovery/query-operators.ht
+ "! ml#query-operators). Required when **response_type**=`search_skill`.
+ QUERY type STRING,
+ "! The type of the search query. Required when **response_type**=`search_skill`.
+ QUERY_TYPE type STRING,
+ "! An optional filter that narrows the set of documents to be searched. For more
+ "! information, see the [Discovery service documentation]([Discovery service
+ "! documentation](https://cloud.ibm.com/docs/services/discovery/query-parameters.h
+ "! tml#filter).
+ FILTER type STRING,
+ "! The version of the Discovery service API to use for the query.
+ DISCOVERY_VERSION type STRING,
+ end of T_DIALOG_NODE_OUTPUT_GENERIC.
+ types:
+ "! 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).
+ begin of T_DIALOG_NODE_OUTPUT,
+ "! An array of objects describing the output defined for the dialog node.
+ GENERIC type STANDARD TABLE OF T_DIALOG_NODE_OUTPUT_GENERIC WITH NON-UNIQUE DEFAULT KEY,
+ "! Options that modify how specified output is handled.
+ MODIFIERS type T_DIALOG_NODE_OUTPUT_MODIFIERS,
+ end of T_DIALOG_NODE_OUTPUT.
+ 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.
+ DIALOG_NODE type STRING,
+ "! The description of the dialog node. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! 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.
+ PARENT type STRING,
+ "! The 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
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-ove
+ "! rview#dialog-overview-responses).
+ OUTPUT type T_DIALOG_NODE_OUTPUT,
+ "! The context for the dialog node.
+ CONTEXT type MAP,
+ "! The metadata for the dialog node.
+ METADATA type MAP,
+ "! 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.
+ TITLE type STRING,
+ "! How the dialog node is processed.
+ TYPE type STRING,
+ "! How an `event_handler` node is processed.
+ EVENT_NAME type STRING,
+ "! The location in the dialog context where output is stored.
+ VARIABLE type STRING,
+ "! An array of objects describing any actions to be invoked by the dialog node.
+ ACTIONS type STANDARD TABLE OF T_DIALOG_NODE_ACTION WITH NON-UNIQUE DEFAULT KEY,
+ "! Whether this top-level dialog node can be digressed into.
+ DIGRESS_IN type STRING,
+ "! Whether this dialog node can be returned to after a digression.
+ DIGRESS_OUT type STRING,
+ "! 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.
+ USER_LABEL type STRING,
+ "! Whether the dialog node should be excluded from disambiguation suggestions.
+ DISAMBIGUATION_OPT_OUT type BOOLEAN,
+ "! For internal use only.
+ DISABLED type BOOLEAN,
+ "! 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_DIALOG_NODE.
+ types:
+ "! No documentation available.
+ begin of T_VALUE,
+ "! The text of the entity value. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ VALUE type STRING,
+ "! Any metadata related to the entity value.
+ METADATA type MAP,
+ "! Specifies the type of entity value.
+ TYPE type STRING,
+ "! An array of synonyms for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A synonym must conform
+ "! to the following resrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of patterns for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A pattern is a regular
+ "! expression; for more information about how to specify a pattern, see the
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#e
+ "! ntities-create-dictionary-based).
+ PATTERNS type STANDARD TABLE OF STRING 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_VALUE.
+ types:
+ "! 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.
+ begin of T_WEBHOOK,
+ "! The URL for the external service or application to which you want to send HTTP
+ "! POST requests.
+ URL type STRING,
+ "! The name of the webhook. Currently, `main_webhook` is the only supported value.
+ NAME type STRING,
+ "! An optional array of HTTP headers to pass with the HTTP request.
+ HEADERS type STANDARD TABLE OF T_WEBHOOK_HEADER WITH NON-UNIQUE DEFAULT KEY,
+ end of T_WEBHOOK.
+ types:
+ "! Workspace settings related to the behavior of system entities.
+ begin of T_WS_SYSTM_STTNGS_SYSTM_ENTTS,
+ "! Whether the new system entities are enabled for the workspace.
+ ENABLED type BOOLEAN,
+ end of T_WS_SYSTM_STTNGS_SYSTM_ENTTS.
+ types:
+ "! A mention of a contextual entity.
+ begin of T_MENTION,
+ "! The name of the entity.
+ ENTITY type STRING,
+ "! An array of zero-based character offsets that indicate where the entity mentions
+ "! begin and end in the input text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ end of T_MENTION.
+ types:
+ "! No documentation available.
+ begin of T_EXAMPLE,
+ "! The text of a user input example. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ TEXT type STRING,
+ "! An array of contextual entity mentions.
+ MENTIONS type STANDARD TABLE OF T_MENTION 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_EXAMPLE.
+ types:
+ "! No documentation available.
+ begin of T_INTENT,
+ "! The name of the intent. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, hyphen, and dot
+ "! characters.
+ "! - It cannot begin with the reserved prefix `sys-`.
+ INTENT type STRING,
+ "! The description of the intent. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION 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,
+ "! 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 Watson Assistant user interface.
+ begin of T_WS_SYSTEM_SETTINGS_TOOLING,
+ "! Whether the dialog JSON editor displays text responses within the
+ "! `output.generic` object.
+ STORE_GENERIC_RESPONSES type BOOLEAN,
+ end of T_WS_SYSTEM_SETTINGS_TOOLING.
+ types:
+ "! Global settings for the workspace.
+ begin of T_WORKSPACE_SYSTEM_SETTINGS,
+ "! Workspace settings related to the Watson Assistant user interface.
+ TOOLING type T_WS_SYSTEM_SETTINGS_TOOLING,
+ "! Workspace settings related to the disambiguation feature.
+ "!
+ "! **Note:** This feature is available only to Plus and Premium users.
+ DISAMBIGUATION type T_WS_SYSTM_STTNGS_DSMBGTN,
+ "! For internal use only.
+ HUMAN_AGENT_ASSIST type MAP,
+ "! Workspace settings related to the behavior of system entities.
+ 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,
+ end of T_WORKSPACE_SYSTEM_SETTINGS.
+ types:
+ "! No documentation available.
+ begin of T_COUNTEREXAMPLE,
+ "! The text of a user input marked as irrelevant input. This string must conform to
+ "! the following restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ TEXT 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_COUNTEREXAMPLE.
+ types:
+ "! No documentation available.
+ begin of T_ENTITY,
+ "! The name of the entity. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, and hyphen
+ "! characters.
+ "! - If you specify an entity name beginning with the reserved prefix `sys-`, it
+ "! must be the name of a system entity that you want to enable. (Any entity
+ "! content specified with the request is ignored.).
+ ENTITY type STRING,
+ "! The description of the entity. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! Any metadata related to the entity.
+ METADATA type MAP,
+ "! Whether to use fuzzy matching for the entity.
+ FUZZY_MATCH type BOOLEAN,
+ "! The timestamp for creation of the object.
+ CREATED type DATETIME,
+ "! The timestamp for the most recent update to the object.
+ UPDATED type DATETIME,
+ "! An array of objects describing the entity values.
+ VALUES type STANDARD TABLE OF T_VALUE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_ENTITY.
+ types:
+ "! No documentation available.
+ begin of T_WORKSPACE,
+ "! The name of the workspace. This string cannot contain carriage return, newline,
+ "! or tab characters.
+ NAME type STRING,
+ "! The description of the workspace. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! The language of the workspace.
+ LANGUAGE type STRING,
+ "! Any metadata related to the workspace.
+ METADATA type MAP,
+ "! 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 workspace ID of the workspace.
+ WORKSPACE_ID type STRING,
+ "! The current status of the workspace.
+ 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,
+ "! 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 array of objects describing the dialog nodes in the workspace.
+ DIALOG_NODES type STANDARD TABLE OF T_DIALOG_NODE WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of counterexamples.
+ COUNTEREXAMPLES type STANDARD TABLE OF T_COUNTEREXAMPLE WITH NON-UNIQUE DEFAULT KEY,
+ "! No documentation available.
+ WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY,
+ end of T_WORKSPACE.
+ types:
+ "! No documentation available.
+ begin of T_SYNONYM,
+ "! The text of the synonym. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYM 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_SYNONYM.
+ types:
+ "! The pagination data for the returned objects.
+ 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,
+ "! Reserved for future use.
+ 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_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.
+ PAGINATION type T_PAGINATION,
+ end of T_SYNONYM_COLLECTION.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_OPTION,
+ "! 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_RUNTIME_RESPONSE_TYPE_OPTION.
+ types:
+ "! No documentation available.
+ begin of T_DIA_ND_OUTPUT_RESP_TYPE_TEXT,
+ "! A list of one or more objects defining text responses. Required when
+ "! **response_type**=`text`.
+ VALUES type STANDARD TABLE OF T_DIA_ND_OTPT_TEXT_VALUES_ELEM WITH NON-UNIQUE DEFAULT KEY,
+ "! How a response is selected from the list, if more than one response is
+ "! specified. Valid only when **response_type**=`text`.
+ SELECTION_POLICY type STRING,
+ "! The delimiter to use as a separator between responses when
+ "! `selection_policy`=`multiline`.
+ DELIMITER type STRING,
+ end of T_DIA_ND_OUTPUT_RESP_TYPE_TEXT.
+ types:
+ "! No documentation available.
+ begin of T_BASE_WORKSPACE,
+ "! The name of the workspace. This string cannot contain carriage return, newline,
+ "! or tab characters.
+ NAME type STRING,
+ "! The description of the workspace. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! The language of the workspace.
+ LANGUAGE type STRING,
+ "! Any metadata related to the workspace.
+ METADATA type MAP,
+ "! 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 workspace ID of the workspace.
+ WORKSPACE_ID type STRING,
+ "! The current status of the workspace.
+ 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_BASE_WORKSPACE.
+ types:
+ "! No documentation available.
+ begin of T_BASE_ENTITY,
+ "! The name of the entity. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, and hyphen
+ "! characters.
+ "! - It cannot begin with the reserved prefix `sys-`.
+ ENTITY type STRING,
+ "! The description of the entity. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! Any metadata related to the entity.
+ METADATA type MAP,
+ "! Whether to use fuzzy matching for the entity.
+ FUZZY_MATCH type BOOLEAN,
+ "! 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_ENTITY.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_TEXT,
+ "! The text of the response.
+ TEXT type STRING,
+ end of T_RUNTIME_RESPONSE_TYPE_TEXT.
+ types:
+ "! No documentation available.
+ begin of T_RT_ENTTY_INTRPRTTN_SYS_TIME,
+ "! A unique identifier used to associate a recognized 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,
+ "! The precision or duration of a time range specified by a recognized `@sys-time`
+ "! or `@sys-date` entity.
+ GRANULARITY type STRING,
+ "! A recognized term for a time that was mentioned as a part of the day in the
+ "! user's input (for example, `morning` or `afternoon`).
+ PART_OF_DAY 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,
+ "! A recognized mention of a relative hour, represented numerically as an offset
+ "! from the current hour (for example, `3` for `in three hours` or `-1` for `an
+ "! hour ago`).
+ RELATIVE_HOUR type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! minutes from the current time (for example, `5` for `in five minutes` or `-15`
+ "! for `fifteen minutes ago`).
+ RELATIVE_MINUTE type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! seconds from the current time (for example, `10` for `in ten seconds` or `-30`
+ "! for `thirty seconds ago`).
+ RELATIVE_SECOND type NUMBER,
+ "! A recognized specific hour mentioned as part of a time value (for example, `10`
+ "! for `10:15 AM`.).
+ SPECIFIC_HOUR type NUMBER,
+ "! A recognized specific minute mentioned as part of a time value (for example,
+ "! `15` for `10:15 AM`.).
+ SPECIFIC_MINUTE type NUMBER,
+ "! A recognized specific second mentioned as part of a time value (for example,
+ "! `30` for `10:15:30 AM`.).
+ SPECIFIC_SECOND type NUMBER,
+ "! 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_UPDATE_EXAMPLE,
+ "! The text of the user input example. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ TEXT type STRING,
+ "! An array of contextual entity mentions.
+ MENTIONS type STANDARD TABLE OF T_MENTION 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_EXAMPLE.
+ types:
+ "! An object describing a contextual entity mention.
+ begin of T_ENTITY_MENTION,
+ "! The text of the user input example.
+ TEXT type STRING,
+ "! The name of the intent.
+ INTENT type STRING,
+ "! An array of zero-based character offsets that indicate where the entity mentions
+ "! begin and end in the input text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ end of T_ENTITY_MENTION.
+ types:
+ "! No documentation available.
+ begin of T_DIA_ND_OTPT_RESP_TYP_SRCH_S1,
+ "! The text of the search query. This can be either a natural-language query or a
+ "! query that uses the Discovery query language syntax, depending on the value of
+ "! the **query_type** property. For more information, see the [Discovery service
+ "! documentation](https://cloud.ibm.com/docs/services/discovery/query-operators.ht
+ "! ml#query-operators). Required when **response_type**=`search_skill`.
+ QUERY type STRING,
+ "! The type of the search query. Required when **response_type**=`search_skill`.
+ QUERY_TYPE type STRING,
+ "! An optional filter that narrows the set of documents to be searched. For more
+ "! information, see the [Discovery service documentation]([Discovery service
+ "! documentation](https://cloud.ibm.com/docs/services/discovery/query-parameters.h
+ "! tml#filter).
+ FILTER type STRING,
+ "! The version of the Discovery service API to use for the query.
+ DISCOVERY_VERSION type STRING,
+ 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.
+ PAGINATION type T_PAGINATION,
+ end of T_EXAMPLE_COLLECTION.
+ types:
+ "! The pagination data for the returned objects.
+ begin of T_LOG_PAGINATION,
+ "! The URL that will return the next page of results, if any.
+ NEXT_URL type STRING,
+ "! Reserved for future use.
+ MATCHED type INTEGER,
+ "! A token identifying the next page of results.
+ NEXT_CURSOR type STRING,
+ end of T_LOG_PAGINATION.
+ types:
+ "! No documentation available.
+ begin of T_RT_RESP_TYP_CONNECT_TO_AGENT,
+ "! A message to be sent to the human agent who will be taking over the
+ "! conversation.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ "! A label identifying the topic of the conversation, derived from the
+ "! **user_label** property of the relevant node.
+ TOPIC type STRING,
+ "! The 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
+ "! **user_label** property.
+ DIALOG_NODE type STRING,
+ end of T_RT_RESP_TYP_CONNECT_TO_AGENT.
+ types:
+ "! No documentation available.
+ begin of T_CREATE_VALUE,
+ "! The text of the entity value. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ VALUE type STRING,
+ "! Any metadata related to the entity value.
+ METADATA type MAP,
+ "! Specifies the type of entity value.
+ TYPE type STRING,
+ "! An array of synonyms for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A synonym must conform
+ "! to the following resrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of patterns for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A pattern is a regular
+ "! expression; for more information about how to specify a pattern, see the
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#e
+ "! ntities-create-dictionary-based).
+ PATTERNS type STANDARD TABLE OF STRING 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_CREATE_VALUE.
+ types:
+ "! No documentation available.
+ begin of T_DIALOG_NODE_VISITED_DETAILS,
+ "! 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:
+ "! No documentation available.
+ begin of T_DIA_SUGGESTION_RESP_GENERIC,
+ "! The type of response returned by the dialog node. The specified response type
+ "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The **suggestion** response type is part of the disambiguation
+ "! feature, which is only available for Plus and Premium users. The
+ "! **search_skill** response type is available only for Plus and Premium users,
+ "! and is used only by the v2 runtime API.
+ RESPONSE_TYPE type STRING,
+ "! The text of the response.
+ TEXT type STRING,
+ "! How long to pause, in milliseconds.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause.
+ TYPING type BOOLEAN,
+ "! The 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.
+ 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,
+ "! A message to be sent to the human agent who will be taking over the
+ "! conversation.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ "! A label identifying the topic of the conversation, derived from the
+ "! **user_label** property of the relevant node.
+ TOPIC type STRING,
+ "! The 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
+ "! **user_label** property.
+ DIALOG_NODE type STRING,
+ end of T_DIA_SUGGESTION_RESP_GENERIC.
+ 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.
+ begin of T_DIALOG_SUGGESTION_VALUE,
+ "! An input object that includes the input text.
+ INPUT type T_MESSAGE_INPUT,
+ "! An array of intents to be sent along with the user input.
+ INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of entities to be sent along with the user input.
+ ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ end of T_DIALOG_SUGGESTION_VALUE.
+ types:
+ "! The dialog output that will be returned from the Watson Assistant service if the
+ "! user selects the corresponding option.
+ begin of T_DIALOG_SUGGESTION_OUTPUT,
+ "! An array of the nodes that were triggered to create the response, in the order
+ "! in which they were visited. This information is useful for debugging and for
+ "! tracing the path taken through the node tree.
+ NODES_VISITED type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects containing detailed diagnostic information about the nodes
+ "! that were triggered during processing of the input message. Included only if
+ "! **nodes_visited_details** is set to `true` in the message request.
+ NODES_VISITED_DETAILS type STANDARD TABLE OF T_DIALOG_NODE_VISITED_DETAILS 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_DIA_SUGGESTION_RESP_GENERIC WITH NON-UNIQUE DEFAULT KEY,
+ end of T_DIALOG_SUGGESTION_OUTPUT.
+ types:
+ "! 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.
+ 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.
+ 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 T_DIALOG_SUGGESTION_OUTPUT,
+ "! The 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.
+ DIALOG_NODE type STRING,
+ end of T_DIALOG_SUGGESTION.
+ types:
+ "! No documentation available.
+ T_EMPTY_RESPONSE type JSONOBJECT.
+ types:
+ "! No documentation available.
+ begin of T_UPDATE_VALUE,
+ "! The text of the entity value. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ VALUE type STRING,
+ "! Any metadata related to the entity value.
+ METADATA type MAP,
+ "! Specifies the type of entity value.
+ TYPE type STRING,
+ "! An array of synonyms for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A synonym must conform
+ "! to the following resrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of patterns for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A pattern is a regular
+ "! expression; for more information about how to specify a pattern, see the
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#e
+ "! ntities-create-dictionary-based).
+ PATTERNS type STANDARD TABLE OF STRING 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_VALUE.
+ types:
+ "! An alternative value for the recognized entity.
+ begin of T_RUNTIME_ENTITY_ALTERNATIVE,
+ "! The entity value that was recognized in the user input.
+ VALUE type STRING,
+ "! A decimal percentage that represents Watson's confidence in the recognized
+ "! entity.
+ CONFIDENCE type NUMBER,
+ end of T_RUNTIME_ENTITY_ALTERNATIVE.
+ types:
+ "! No documentation available.
+ begin of T_UPDATE_INTENT,
+ "! The name of the intent. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, hyphen, and dot
+ "! characters.
+ "! - It cannot begin with the reserved prefix `sys-`.
+ INTENT type STRING,
+ "! The description of the intent. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION 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,
+ "! An array of user input examples for the intent.
+ EXAMPLES type STANDARD TABLE OF T_EXAMPLE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_UPDATE_INTENT.
+ types:
+ "! No documentation available.
+ 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.
+ PAGINATION type T_PAGINATION,
+ end of T_VALUE_COLLECTION.
+ types:
+ "! Log message details.
+ begin of T_LOG_MESSAGE,
+ "! The severity of the log message.
+ LEVEL type STRING,
+ "! The text of the log message.
+ MSG type STRING,
+ end of T_LOG_MESSAGE.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_GENERIC,
+ "! The type of response returned by the dialog node. The specified response type
+ "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The **suggestion** response type is part of the disambiguation
+ "! feature, which is only available for Plus and Premium users.
+ RESPONSE_TYPE type STRING,
+ "! The text of the response.
+ TEXT type STRING,
+ "! How long to pause, in milliseconds.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause.
+ TYPING type BOOLEAN,
+ "! The 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.
+ 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,
+ "! A message to be sent to the human agent who will be taking over the
+ "! conversation.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ "! A label identifying the topic of the conversation, derived from the
+ "! **user_label** property of the relevant node.
+ TOPIC type STRING,
+ "! The 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
+ "! **user_label** property.
+ DIALOG_NODE type STRING,
+ "! An array of objects describing the possible matching dialog nodes from which the
+ "! user can choose.
+ "!
+ "! **Note:** The **suggestions** property is part of the disambiguation feature,
+ "! which is only available for Plus and Premium users.
+ SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY,
+ end of T_RUNTIME_RESPONSE_GENERIC.
+ types:
+ "! An output object that includes the response to the user, the dialog nodes that
+ "! were triggered, and messages from the log.
+ begin of T_OUTPUT_DATA,
+ "! An array of the nodes that were triggered to create the response, in the order
+ "! in which they were visited. This information is useful for debugging and for
+ "! tracing the path taken through the node tree.
+ NODES_VISITED type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects containing detailed diagnostic information about the nodes
+ "! that were triggered during processing of the input message. Included only if
+ "! **nodes_visited_details** is set to `true` in the message request.
+ 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,
+ end of T_OUTPUT_DATA.
+ types:
+ "! An array of dialog nodes.
+ 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.
+ PAGINATION type T_PAGINATION,
+ end of T_DIALOG_NODE_COLLECTION.
+ types:
+ "! For internal use only.
+ T_SYSTEM_RESPONSE type MAP.
+ types:
+ "! Metadata related to the message.
+ begin of T_MESSAGE_CONTEXT_METADATA,
+ "! A label identifying the deployment environment, used for filtering log data.
+ "! This string cannot contain carriage return, newline, or tab characters.
+ 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
+ "! identify unique users for billing purposes. This string cannot contain carriage
+ "! return, newline, or tab characters.
+ USER_ID type STRING,
+ end of T_MESSAGE_CONTEXT_METADATA.
+ types:
+ "! 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.
+ CONVERSATION_ID type STRING,
+ "! For internal use only.
+ SYSTEM type T_SYSTEM_RESPONSE,
+ "! Metadata related to the message.
+ METADATA type T_MESSAGE_CONTEXT_METADATA,
+ end of T_CONTEXT.
+ types:
+ "! The response sent by the workspace, including the output text, detected intents
+ "! and entities, and context.
+ begin of T_MESSAGE_RESPONSE,
+ "! An input object that includes the input text.
+ INPUT type T_MESSAGE_INPUT,
+ "! An array of intents recognized in the user input, sorted in descending order of
+ "! confidence.
+ INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of entities identified in the user input.
+ ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! Whether to return more than one intent. A value of `true` indicates that all
+ "! matching intents are returned.
+ ALTERNATE_INTENTS type BOOLEAN,
+ "! State information for the conversation. To maintain state, include the context
+ "! from the previous response.
+ CONTEXT type T_CONTEXT,
+ "! An output object that includes the response to the user, the dialog nodes that
+ "! were triggered, and messages from the log.
+ 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,
+ end of T_MESSAGE_RESPONSE.
+ types:
+ "! No documentation available.
+ begin of T_BASE_VALUE,
+ "! The text of the entity value. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ VALUE type STRING,
+ "! Any metadata related to the entity value.
+ METADATA type MAP,
+ "! Specifies the type of entity value.
+ TYPE type STRING,
+ "! An array of synonyms for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A synonym must conform
+ "! to the following resrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYMS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of patterns for the entity value. A value can specify either synonyms
+ "! or patterns (depending on the value type), but not both. A pattern is a regular
+ "! expression; for more information about how to specify a pattern, see the
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#e
+ "! ntities-create-dictionary-based).
+ PATTERNS type STANDARD TABLE OF STRING 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_VALUE.
+ types:
+ "! No documentation available.
+ begin of T_UPDATE_ENTITY,
+ "! The name of the entity. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, and hyphen
+ "! characters.
+ "! - It cannot begin with the reserved prefix `sys-`.
+ ENTITY type STRING,
+ "! The description of the entity. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! Any metadata related to the entity.
+ METADATA type MAP,
+ "! Whether to use fuzzy matching for the entity.
+ FUZZY_MATCH type BOOLEAN,
+ "! The timestamp for creation of the object.
+ CREATED type DATETIME,
+ "! The timestamp for the most recent update to the object.
+ UPDATED type DATETIME,
+ "! An array of objects describing the entity values.
+ VALUES type STANDARD TABLE OF T_CREATE_VALUE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_UPDATE_ENTITY.
+ 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.
+ DIALOG_NODE type STRING,
+ "! The description of the dialog node. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! 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.
+ PARENT type STRING,
+ "! The 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
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-ove
+ "! rview#dialog-overview-responses).
+ OUTPUT type T_DIALOG_NODE_OUTPUT,
+ "! The context for the dialog node.
+ CONTEXT type MAP,
+ "! The metadata for the dialog node.
+ METADATA type MAP,
+ "! 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.
+ TITLE type STRING,
+ "! How the dialog node is processed.
+ TYPE type STRING,
+ "! How an `event_handler` node is processed.
+ EVENT_NAME type STRING,
+ "! The location in the dialog context where output is stored.
+ VARIABLE type STRING,
+ "! An array of objects describing any actions to be invoked by the dialog node.
+ ACTIONS type STANDARD TABLE OF T_DIALOG_NODE_ACTION WITH NON-UNIQUE DEFAULT KEY,
+ "! Whether this top-level dialog node can be digressed into.
+ DIGRESS_IN type STRING,
+ "! Whether this dialog node can be returned to after a digression.
+ DIGRESS_OUT type STRING,
+ "! 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.
+ USER_LABEL type STRING,
+ "! Whether the dialog node should be excluded from disambiguation suggestions.
+ DISAMBIGUATION_OPT_OUT type BOOLEAN,
+ "! For internal use only.
+ DISABLED type BOOLEAN,
+ "! 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_DIALOG_NODE.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_PAUSE,
+ "! How long to pause, in milliseconds.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause.
+ TYPING type BOOLEAN,
+ end of T_RUNTIME_RESPONSE_TYPE_PAUSE.
+ types:
+ "! No documentation available.
+ begin of T_DIA_ND_OTPT_RESP_TYP_CNNCT_1,
+ "! An optional message to be sent to the human agent who will be taking over the
+ "! conversation. Valid only when **reponse_type**=`connect_to_agent`.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ end of T_DIA_ND_OTPT_RESP_TYP_CNNCT_1.
+ 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_CREATE_INTENT,
+ "! The name of the intent. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, hyphen, and dot
+ "! characters.
+ "! - It cannot begin with the reserved prefix `sys-`.
+ INTENT type STRING,
+ "! The description of the intent. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION 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,
+ "! An array of user input examples for the intent.
+ EXAMPLES type STANDARD TABLE OF T_EXAMPLE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_CREATE_INTENT.
+ types:
+ "! No documentation available.
+ begin of T_CREATE_ENTITY,
+ "! The name of the entity. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, and hyphen
+ "! characters.
+ "! - If you specify an entity name beginning with the reserved prefix `sys-`, it
+ "! must be the name of a system entity that you want to enable. (Any entity
+ "! content specified with the request is ignored.).
+ ENTITY type STRING,
+ "! The description of the entity. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! Any metadata related to the entity.
+ METADATA type MAP,
+ "! Whether to use fuzzy matching for the entity.
+ FUZZY_MATCH type BOOLEAN,
+ "! The timestamp for creation of the object.
+ CREATED type DATETIME,
+ "! The timestamp for the most recent update to the object.
+ UPDATED type DATETIME,
+ "! An array of objects describing the entity values.
+ VALUES type STANDARD TABLE OF T_CREATE_VALUE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_CREATE_ENTITY.
+ types:
+ "! No documentation available.
+ begin of T_CREATE_WORKSPACE,
+ "! The name of the workspace. This string cannot contain carriage return, newline,
+ "! or tab characters.
+ NAME type STRING,
+ "! The description of the workspace. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! The language of the workspace.
+ LANGUAGE type STRING,
+ "! Any metadata related to the workspace.
+ METADATA type MAP,
+ "! 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 workspace ID of the workspace.
+ WORKSPACE_ID type STRING,
+ "! The current status of the workspace.
+ 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,
+ "! An array of objects defining the intents for the workspace.
+ INTENTS type STANDARD TABLE OF T_CREATE_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects describing the entities for the workspace.
+ ENTITIES type STANDARD TABLE OF T_CREATE_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects describing the dialog nodes in the workspace.
+ DIALOG_NODES type STANDARD TABLE OF T_DIALOG_NODE WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects defining input examples that have been marked as irrelevant
+ "! input.
+ COUNTEREXAMPLES type STANDARD TABLE OF T_COUNTEREXAMPLE WITH NON-UNIQUE DEFAULT KEY,
+ "! No documentation available.
+ WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY,
+ end of T_CREATE_WORKSPACE.
+ types:
+ "! No documentation available.
+ 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.
+ PAGINATION type T_PAGINATION,
+ end of T_COUNTEREXAMPLE_COLLECTION.
+ types:
+ "! No documentation available.
+ begin of T_BASE_EXAMPLE,
+ "! The text of the user input example. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ TEXT type STRING,
+ "! An array of contextual entity mentions.
+ MENTIONS type STANDARD TABLE OF T_MENTION 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_EXAMPLE.
+ 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_UPDATE_COUNTEREXAMPLE,
+ "! The text of a user input marked as irrelevant input. This string must conform to
+ "! the following restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ TEXT 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_UPDATE_COUNTEREXAMPLE.
+ types:
+ "! An array of objects describing the entities for the workspace.
+ 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.
+ PAGINATION type T_PAGINATION,
+ end of T_ENTITY_COLLECTION.
+ types:
+ "! No documentation available.
+ 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.
+ PAGINATION type T_PAGINATION,
+ end of T_INTENT_COLLECTION.
+ types:
+ "! No documentation available.
+ begin of T_DIA_ND_OTPT_RESP_TYPE_PAUSE,
+ "! How long to pause, in milliseconds. The valid values are from 0 to 10000. Valid
+ "! only when **response_type**=`pause`.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause. Ignored if the
+ "! channel does not support this event. Valid only when **response_type**=`pause`.
+ "!
+ TYPING type BOOLEAN,
+ end of T_DIA_ND_OTPT_RESP_TYPE_PAUSE.
+ types:
+ "! No documentation available.
+ begin of T_DIA_ND_OUTPUT_RESP_TYPE_IMG,
+ "! The URL of the image. Required when **response_type**=`image`.
+ SOURCE type STRING,
+ "! An optional title to show before the response. Valid only when
+ "! **response_type**=`image` or `option`.
+ TITLE type STRING,
+ "! An optional description to show with the response. Valid only when
+ "! **response_type**=`image` or `option`.
+ DESCRIPTION type STRING,
+ end of T_DIA_ND_OUTPUT_RESP_TYPE_IMG.
+ 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:
+ "! No documentation available.
+ begin of T_BASE_MESSAGE,
+ "! An input object that includes the input text.
+ INPUT type T_MESSAGE_INPUT,
+ "! An array of intents recognized in the user input, sorted in descending order of
+ "! confidence.
+ INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of entities identified in the user input.
+ ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! Whether to return more than one intent. A value of `true` indicates that all
+ "! matching intents are returned.
+ ALTERNATE_INTENTS type BOOLEAN,
+ "! State information for the conversation. To maintain state, include the context
+ "! from the previous response.
+ CONTEXT type T_CONTEXT,
+ "! An output object that includes the response to the user, the dialog nodes that
+ "! were triggered, and messages from the log.
+ 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,
+ end of T_BASE_MESSAGE.
+ types:
+ "! No documentation available.
+ begin of T_RT_RESPONSE_TYPE_SUGGESTION,
+ "! 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.
+ "!
+ "! **Note:** The **suggestions** property is part of the disambiguation feature,
+ "! which is only available for Plus and Premium users.
+ SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION 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.
+ PAGINATION type T_PAGINATION,
+ end of T_ENTITY_MENTION_COLLECTION.
+ types:
+ "! No documentation available.
+ begin of T_UPDATE_SYNONYM,
+ "! The text of the synonym. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYM 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_UPDATE_SYNONYM.
+ types:
+ "! No documentation available.
+ begin of T_BASE_INTENT,
+ "! The name of the intent. This string must conform to the following
+ "! restrictions:
+ "! - It can contain only Unicode alphanumeric, underscore, hyphen, and dot
+ "! characters.
+ "! - It cannot begin with the reserved prefix `sys-`.
+ INTENT type STRING,
+ "! The description of the intent. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION 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_BASE_INTENT.
+ 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_DIA_ND_OUTPUT_RESP_TYPE_OPT,
+ "! An optional title to show before the response. Valid only when
+ "! **response_type**=`image` or `option`.
+ TITLE type STRING,
+ "! An optional description to show with the response. Valid only when
+ "! **response_type**=`image` or `option`.
+ DESCRIPTION type STRING,
+ "! The preferred type of control to display, if supported by the channel. Valid
+ "! only when **response_type**=`option`.
+ PREFERENCE type STRING,
+ "! An array of objects describing the options from which the user can choose. You
+ "! can include up to 20 options. Required when **response_type**=`option`.
+ OPTIONS type STANDARD TABLE OF T_DIA_NODE_OUTPUT_OPT_ELEMENT WITH NON-UNIQUE DEFAULT KEY,
+ end of T_DIA_ND_OUTPUT_RESP_TYPE_OPT.
+ types:
+ "! No documentation available.
+ begin of T_BASE_COUNTEREXAMPLE,
+ "! The text of a user input marked as irrelevant input. This string must conform to
+ "! the following restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ TEXT 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_BASE_COUNTEREXAMPLE.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_IMAGE,
+ "! The 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.
+ DESCRIPTION type STRING,
+ end of T_RUNTIME_RESPONSE_TYPE_IMAGE.
+ types:
+ "! No documentation available.
+ begin of T_UPDATE_WORKSPACE,
+ "! The name of the workspace. This string cannot contain carriage return, newline,
+ "! or tab characters.
+ NAME type STRING,
+ "! The description of the workspace. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! The language of the workspace.
+ LANGUAGE type STRING,
+ "! Any metadata related to the workspace.
+ METADATA type MAP,
+ "! 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 workspace ID of the workspace.
+ WORKSPACE_ID type STRING,
+ "! The current status of the workspace.
+ 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,
+ "! An array of objects defining the intents for the workspace.
+ INTENTS type STANDARD TABLE OF T_CREATE_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects describing the entities for the workspace.
+ ENTITIES type STANDARD TABLE OF T_CREATE_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects describing the dialog nodes in the workspace.
+ DIALOG_NODES type STANDARD TABLE OF T_DIALOG_NODE WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects defining input examples that have been marked as irrelevant
+ "! input.
+ COUNTEREXAMPLES type STANDARD TABLE OF T_COUNTEREXAMPLE WITH NON-UNIQUE DEFAULT KEY,
+ "! No documentation available.
+ WEBHOOKS type STANDARD TABLE OF T_WEBHOOK WITH NON-UNIQUE DEFAULT KEY,
+ end of T_UPDATE_WORKSPACE.
+ 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.
+ DIALOG_NODE type STRING,
+ "! The description of the dialog node. This string cannot contain carriage return,
+ "! newline, or tab characters.
+ DESCRIPTION type STRING,
+ "! 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.
+ PARENT type STRING,
+ "! The 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
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-ove
+ "! rview#dialog-overview-responses).
+ OUTPUT type T_DIALOG_NODE_OUTPUT,
+ "! The context for the dialog node.
+ CONTEXT type MAP,
+ "! The metadata for the dialog node.
+ METADATA type MAP,
+ "! 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.
+ TITLE type STRING,
+ "! How the dialog node is processed.
+ TYPE type STRING,
+ "! How an `event_handler` node is processed.
+ EVENT_NAME type STRING,
+ "! The location in the dialog context where output is stored.
+ VARIABLE type STRING,
+ "! An array of objects describing any actions to be invoked by the dialog node.
+ ACTIONS type STANDARD TABLE OF T_DIALOG_NODE_ACTION WITH NON-UNIQUE DEFAULT KEY,
+ "! Whether this top-level dialog node can be digressed into.
+ DIGRESS_IN type STRING,
+ "! Whether this dialog node can be returned to after a digression.
+ DIGRESS_OUT type STRING,
+ "! 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.
+ USER_LABEL type STRING,
+ "! Whether the dialog node should be excluded from disambiguation suggestions.
+ DISAMBIGUATION_OPT_OUT type BOOLEAN,
+ "! For internal use only.
+ DISABLED type BOOLEAN,
+ "! 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_DIALOG_NODE.
+ types:
+ "! A request sent to the workspace, including the user input and context.
+ begin of T_MESSAGE_REQUEST,
+ "! An input object that includes the input text.
+ INPUT type T_MESSAGE_INPUT,
+ "! 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,
+ "! Whether to return more than one intent. A value of `true` indicates that all
+ "! matching intents are returned.
+ ALTERNATE_INTENTS type BOOLEAN,
+ "! State information for the conversation. To maintain state, include the context
+ "! from the previous response.
+ CONTEXT type T_CONTEXT,
+ "! An output object that includes the response to the user, the dialog nodes that
+ "! were triggered, and messages from the log.
+ 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,
+ end of T_MESSAGE_REQUEST.
+ types:
+ "! No documentation available.
+ begin of T_LOG,
+ "! A request sent to the workspace, including the user input and context.
+ REQUEST type T_MESSAGE_REQUEST,
+ "! The response sent by the workspace, including the output text, detected intents
+ "! and entities, and context.
+ RESPONSE type T_MESSAGE_RESPONSE,
+ "! A unique identifier for the logged event.
+ LOG_ID 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 unique identifier of the workspace where the request was made.
+ WORKSPACE_ID type STRING,
+ "! The language of the workspace where the message request was made.
+ LANGUAGE type STRING,
+ end of T_LOG.
+ types:
+ "! An output object that includes the response to the user, the dialog nodes that
+ "! were triggered, and messages from the log.
+ begin of T_BASE_OUTPUT,
+ "! An array of the nodes that were triggered to create the response, in the order
+ "! in which they were visited. This information is useful for debugging and for
+ "! tracing the path taken through the node tree.
+ NODES_VISITED type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of objects containing detailed diagnostic information about the nodes
+ "! that were triggered during processing of the input message. Included only if
+ "! **nodes_visited_details** is set to `true` in the message request.
+ NODES_VISITED_DETAILS type STANDARD TABLE OF T_DIALOG_NODE_VISITED_DETAILS WITH NON-UNIQUE DEFAULT KEY,
+ end of T_BASE_OUTPUT.
+ 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.
+ 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_WORKSPACE_COLLECTION,
+ "! 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.
+ PAGINATION type T_PAGINATION,
+ end of T_WORKSPACE_COLLECTION.
+ types:
+ "! No documentation available.
+ begin of T_BASE_SYNONYM,
+ "! The text of the synonym. This string must conform to the following
+ "! restrictions:
+ "! - It cannot contain carriage return, newline, or tab characters.
+ "! - It cannot consist of only whitespace characters.
+ SYNONYM 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_BASE_SYNONYM.
+
+constants:
+ begin of C_REQUIRED_FIELDS,
+ T_WS_SYSTEM_SETTINGS_OFF_TOPIC type string value '|',
+ T_RT_ENTITY_INTERPRETATION type string value '|',
+ T_WEBHOOK_HEADER type string value '|NAME|VALUE|',
+ T_DIALOG_NODE_ACTION type string value '|NAME|RESULT_VARIABLE|',
+ 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_MESSAGE_INPUT type string value '|',
+ T_CAPTURE_GROUP type string value '|GROUP|',
+ 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_DIA_ND_OUTPUT_OPT_ELEM_VALUE type string value '|',
+ T_DIA_NODE_OUTPUT_OPT_ELEMENT type string value '|LABEL|VALUE|',
+ T_DIA_ND_OTPT_TEXT_VALUES_ELEM type string value '|',
+ T_DIALOG_NODE_OUTPUT_GENERIC type string value '|RESPONSE_TYPE|',
+ T_DIALOG_NODE_OUTPUT type string value '|',
+ T_DIALOG_NODE type string value '|DIALOG_NODE|',
+ T_VALUE type string value '|VALUE|TYPE|',
+ 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_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|LEARNING_OPT_OUT|WORKSPACE_ID|',
+ T_SYNONYM type string value '|SYNONYM|',
+ T_PAGINATION type string value '|REFRESH_URL|',
+ T_SYNONYM_COLLECTION type string value '|SYNONYMS|PAGINATION|',
+ T_RUNTIME_RESPONSE_TYPE_OPTION type string value '|',
+ T_DIA_ND_OUTPUT_RESP_TYPE_TEXT type string value '|',
+ T_BASE_WORKSPACE type string value '|',
+ T_BASE_ENTITY type string value '|',
+ T_RUNTIME_RESPONSE_TYPE_TEXT type string value '|',
+ T_RT_ENTTY_INTRPRTTN_SYS_TIME type string value '|',
+ T_UPDATE_EXAMPLE type string value '|',
+ T_ENTITY_MENTION type string value '|TEXT|INTENT|LOCATION|',
+ T_DIA_ND_OTPT_RESP_TYP_SRCH_S1 type string value '|',
+ T_EXAMPLE_COLLECTION type string value '|EXAMPLES|PAGINATION|',
+ T_LOG_PAGINATION type string value '|',
+ T_RT_RESP_TYP_CONNECT_TO_AGENT type string value '|',
+ T_CREATE_VALUE type string value '|VALUE|',
+ T_DIALOG_NODE_VISITED_DETAILS type string value '|',
+ T_DIA_SUGGESTION_RESP_GENERIC type string value '|RESPONSE_TYPE|',
+ T_DIALOG_SUGGESTION_VALUE type string value '|',
+ T_DIALOG_SUGGESTION_OUTPUT type string value '|TEXT|',
+ T_DIALOG_SUGGESTION type string value '|LABEL|VALUE|',
+ T_UPDATE_VALUE type string value '|',
+ T_RUNTIME_ENTITY_ALTERNATIVE type string value '|',
+ T_UPDATE_INTENT type string value '|',
+ T_VALUE_COLLECTION type string value '|VALUES|PAGINATION|',
+ T_LOG_MESSAGE type string value '|LEVEL|MSG|',
+ T_RUNTIME_RESPONSE_GENERIC type string value '|RESPONSE_TYPE|',
+ T_OUTPUT_DATA type string value '|LOG_MESSAGES|TEXT|',
+ 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_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 '|',
+ T_DIA_ND_OTPT_RESP_TYP_CNNCT_1 type string value '|',
+ T_ERROR_DETAIL type string value '|MESSAGE|',
+ T_CREATE_INTENT type string value '|INTENT|',
+ T_CREATE_ENTITY type string value '|ENTITY|',
+ T_CREATE_WORKSPACE type string value '|',
+ T_COUNTEREXAMPLE_COLLECTION type string value '|COUNTEREXAMPLES|PAGINATION|',
+ T_BASE_EXAMPLE type string value '|',
+ T_RT_ENTTY_INTRPRTTN_SYS_NUM type string value '|',
+ T_UPDATE_COUNTEREXAMPLE type string value '|',
+ T_ENTITY_COLLECTION type string value '|ENTITIES|PAGINATION|',
+ T_INTENT_COLLECTION type string value '|INTENTS|PAGINATION|',
+ T_DIA_ND_OTPT_RESP_TYPE_PAUSE type string value '|',
+ T_DIA_ND_OUTPUT_RESP_TYPE_IMG type string value '|',
+ T_ERROR_RESPONSE type string value '|ERROR|CODE|',
+ T_BASE_MESSAGE type string value '|',
+ T_RT_RESPONSE_TYPE_SUGGESTION type string value '|',
+ T_ENTITY_MENTION_COLLECTION type string value '|EXAMPLES|PAGINATION|',
+ T_UPDATE_SYNONYM type string value '|',
+ T_BASE_INTENT type string value '|',
+ T_RT_ENTTY_INTRPRTTN_SYS_DATE type string value '|',
+ T_DIA_ND_OUTPUT_RESP_TYPE_OPT type string value '|',
+ T_BASE_COUNTEREXAMPLE type string value '|',
+ T_RUNTIME_RESPONSE_TYPE_IMAGE type string value '|',
+ T_UPDATE_WORKSPACE type string value '|',
+ T_BASE_DIALOG_NODE type string value '|',
+ 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_AUDIT_PROPERTIES type string value '|',
+ T_WORKSPACE_COLLECTION type string value '|WORKSPACES|PAGINATION|',
+ T_BASE_SYNONYM type string value '|',
+ __DUMMY type string value SPACE,
+ end of C_REQUIRED_FIELDS .
+
+constants:
+ begin of C_ABAPNAME_DICTIONARY,
+ CREATED type string value 'created',
+ UPDATED type string value 'updated',
+ TEXT type string value 'text',
+ DIALOG_NODE type string value 'dialog_node',
+ DESCRIPTION type string value 'description',
+ CONDITIONS type string value 'conditions',
+ PARENT type string value 'parent',
+ PREVIOUS_SIBLING type string value 'previous_sibling',
+ OUTPUT type string value 'output',
+ CONTEXT type string value 'context',
+ INNER type string value 'inner',
+ METADATA type string value 'metadata',
+ NEXT_STEP type string value 'next_step',
+ TITLE type string value 'title',
+ TYPE type string value 'type',
+ EVENT_NAME type string value 'event_name',
+ VARIABLE type string value 'variable',
+ ACTIONS type string value 'actions',
+ DIGRESS_IN type string value 'digress_in',
+ DIGRESS_OUT type string value 'digress_out',
+ DIGRESS_OUT_SLOTS type string value 'digress_out_slots',
+ USER_LABEL type string value 'user_label',
+ DISAMBIGUATION_OPT_OUT type string value 'disambiguation_opt_out',
+ DISABLED type string value 'disabled',
+ ENTITY type string value 'entity',
+ FUZZY_MATCH type string value 'fuzzy_match',
+ MENTIONS type string value 'mentions',
+ INTENT type string value 'intent',
+ INPUT type string value 'input',
+ INTENTS type string value 'intents',
+ ENTITIES type string value 'entities',
+ ALTERNATE_INTENTS type string value 'alternate_intents',
+ NODES_VISITED type string value 'nodes_visited',
+ NODESVISITED type string value 'nodesVisited',
+ NODES_VISITED_DETAILS type string value 'nodes_visited_details',
+ NODESVISITEDDETAILS type string value 'nodesVisitedDetails',
+ SYNONYM type string value 'synonym',
+ VALUE type string value 'value',
+ SYNONYMS type string value 'synonyms',
+ PATTERNS type string value 'patterns',
+ PATTERN type string value 'pattern',
+ NAME type string value 'name',
+ LANGUAGE type string value 'language',
+ LEARNING_OPT_OUT type string value 'learning_opt_out',
+ SYSTEM_SETTINGS type string value 'system_settings',
+ WORKSPACE_ID type string value 'workspace_id',
+ STATUS type string value 'status',
+ GROUP type string value 'group',
+ LOCATION type string value 'location',
+ CONVERSATION_ID type string value 'conversation_id',
+ SYSTEM type string value 'system',
+ COUNTEREXAMPLES type string value 'counterexamples',
+ PAGINATION type string value 'pagination',
+ VALUES type string value 'values',
+ EXAMPLES type string value 'examples',
+ EXAMPLE type string value 'example',
+ DIALOG_NODES type string value 'dialog_nodes',
+ DIALOGNODE type string value 'dialogNode',
+ COUNTEREXAMPLE type string value 'counterexample',
+ WEBHOOKS type string value 'webhooks',
+ PARAMETERS type string value 'parameters',
+ RESULT_VARIABLE type string value 'result_variable',
+ CREDENTIALS type string value 'credentials',
+ DIALOGNODES type string value 'dialogNodes',
+ BEHAVIOR type string value 'behavior',
+ SELECTOR type string value 'selector',
+ GENERIC type string value 'generic',
+ MODIFIERS type string value 'modifiers',
+ RESPONSE_TYPE type string value 'response_type',
+ SELECTION_POLICY type string value 'selection_policy',
+ DELIMITER type string value 'delimiter',
+ TIME type string value 'time',
+ TYPING type string value 'typing',
+ SOURCE type string value 'source',
+ PREFERENCE type string value 'preference',
+ OPTIONS type string value 'options',
+ MESSAGE_TO_HUMAN_AGENT type string value 'message_to_human_agent',
+ QUERY type string value 'query',
+ QUERY_TYPE type string value 'query_type',
+ FILTER type string value 'filter',
+ DISCOVERY_VERSION type string value 'discovery_version',
+ OVERWRITE type string value 'overwrite',
+ LABEL type string value 'label',
+ TOPIC type string value 'topic',
+ MESSAGE type string value 'message',
+ PATH type string value 'path',
+ ERROR type string value 'error',
+ ERRORS type string value 'errors',
+ CODE type string value 'code',
+ REQUEST type string value 'request',
+ RESPONSE type string value 'response',
+ LOG_ID type string value 'log_id',
+ REQUEST_TIMESTAMP type string value 'request_timestamp',
+ RESPONSE_TIMESTAMP type string value 'response_timestamp',
+ LOGS type string value 'logs',
+ LEVEL type string value 'level',
+ MSG type string value 'msg',
+ NEXT_URL type string value 'next_url',
+ MATCHED type string value 'matched',
+ NEXT_CURSOR type string value 'next_cursor',
+ DEPLOYMENT type string value 'deployment',
+ USER_ID type string value 'user_id',
+ LOG_MESSAGES type string value 'log_messages',
+ LOGMESSAGES type string value 'logMessages',
+ REFRESH_URL type string value 'refresh_url',
+ TOTAL type string value 'total',
+ REFRESH_CURSOR type string value 'refresh_cursor',
+ CONFIDENCE type string value 'confidence',
+ GROUPS type string value 'groups',
+ INTERPRETATION type string value 'interpretation',
+ ROLE type string value 'role',
+ CALENDAR_TYPE type string value 'calendar_type',
+ DATETIME_LINK type string value 'datetime_link',
+ FESTIVAL type string value 'festival',
+ GRANULARITY type string value 'granularity',
+ RANGE_LINK type string value 'range_link',
+ RANGE_MODIFIER type string value 'range_modifier',
+ RELATIVE_DAY type string value 'relative_day',
+ RELATIVE_MONTH type string value 'relative_month',
+ RELATIVE_WEEK type string value 'relative_week',
+ RELATIVE_WEEKEND type string value 'relative_weekend',
+ RELATIVE_YEAR type string value 'relative_year',
+ SPECIFIC_DAY type string value 'specific_day',
+ SPECIFIC_DAY_OF_WEEK type string value 'specific_day_of_week',
+ SPECIFIC_MONTH type string value 'specific_month',
+ SPECIFIC_QUARTER type string value 'specific_quarter',
+ SPECIFIC_YEAR type string value 'specific_year',
+ NUMERIC_VALUE type string value 'numeric_value',
+ SUBTYPE type string value 'subtype',
+ PART_OF_DAY type string value 'part_of_day',
+ RELATIVE_HOUR type string value 'relative_hour',
+ RELATIVE_MINUTE type string value 'relative_minute',
+ RELATIVE_SECOND type string value 'relative_second',
+ SPECIFIC_HOUR type string value 'specific_hour',
+ SPECIFIC_MINUTE type string value 'specific_minute',
+ SPECIFIC_SECOND type string value 'specific_second',
+ TIMEZONE type string value 'timezone',
+ SUGGESTIONS type string value 'suggestions',
+ URL type string value 'url',
+ HEADERS type string value 'headers',
+ WORKSPACES type string value 'workspaces',
+ 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',
+ PROMPT type string value 'prompt',
+ NONE_OF_THE_ABOVE_PROMPT type string value 'none_of_the_above_prompt',
+ ENABLED type string value 'enabled',
+ SENSITIVITY type string value 'sensitivity',
+ RANDOMIZE type string value 'randomize',
+ MAX_SUGGESTIONS type string value 'max_suggestions',
+ SUGGESTION_TEXT_POLICY type string value 'suggestion_text_policy',
+ STORE_GENERIC_RESPONSES type string value 'store_generic_responses',
+ end of C_ABAPNAME_DICTIONARY .
+
+
+ methods GET_APPNAME
+ redefinition .
+ methods GET_REQUEST_PROP
+ redefinition .
+ methods GET_SDK_VERSION_DATE
+ redefinition .
+
+
+ "! Get response to user input.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_BODY |
+ "! The message to be sent. This includes the user's input, along with optional
+ "! intents, entities, and context from the last response.
+ "! @parameter I_NODES_VISITED_DETAILS |
+ "! Whether to include additional diagnostic information about the dialog nodes that
+ "! were visited during processing of the message.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_MESSAGE_RESPONSE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods MESSAGE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_BODY type T_MESSAGE_REQUEST optional
+ !I_NODES_VISITED_DETAILS 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_MESSAGE_RESPONSE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List workspaces.
+ "!
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @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_WORKSPACE_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_WORKSPACES
+ importing
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_WORKSPACE_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create workspace.
+ "!
+ "! @parameter I_BODY |
+ "! The content of the new workspace.
+ "!
+ "! The maximum size for this data is 50MB. If you need to import a larger
+ "! workspace, consider importing the workspace without intents and entities and
+ "! then adding them separately.
+ "! @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_WORKSPACE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_WORKSPACE
+ importing
+ !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'
+ exporting
+ !E_RESPONSE type T_WORKSPACE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get information about a workspace.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @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. This parameter is
+ "! valid only if **export**=`true`. Specify `sort=stable` to sort all workspace
+ "! objects by unique identifier, in ascending alphabetical order.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_WORKSPACE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_WORKSPACE
+ importing
+ !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'
+ exporting
+ !E_RESPONSE type T_WORKSPACE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update workspace.
+ "!
+ "! @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 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_WORKSPACE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_WORKSPACE
+ importing
+ !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'
+ exporting
+ !E_RESPONSE type T_WORKSPACE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete workspace.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_WORKSPACE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List intents.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned intents 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_INTENT_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_INTENTS
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_INTENT_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create intent.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_BODY |
+ "! The content of the new intent.
+ "! @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_INTENT
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_INTENT
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_BODY type T_CREATE_INTENT
+ !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_INTENT
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get intent.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @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_INTENT
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_INTENT
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_INTENT
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update intent.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_BODY |
+ "! The updated content of the intent.
+ "!
+ "! Any elements included in the new data will completely replace the equivalent
+ "! existing elements, including all subelements. (Previously existing subelements
+ "! are not retained unless they are also included in the new data.) For example,
+ "! if you update the user input examples for an intent, the previously existing
+ "! examples are discarded and replaced with the new examples specified in the
+ "! update.
+ "! @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 the intent includes **examples** and **append**=`false`, all
+ "! existing examples for the intent are discarded and replaced with the new
+ "! examples.
+ "!
+ "! 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 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_INTENT
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_INTENT
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_BODY type T_UPDATE_INTENT
+ !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'
+ exporting
+ !E_RESPONSE type T_INTENT
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete intent.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_INTENT
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List user input examples.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned examples 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_EXAMPLE_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_EXAMPLES
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_EXAMPLE_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create user input example.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_BODY |
+ "! The content of the new user input example.
+ "! @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_EXAMPLE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_EXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_BODY type T_EXAMPLE
+ !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_EXAMPLE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get user input example.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_TEXT |
+ "! The text of the user input example.
+ "! @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_EXAMPLE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_EXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_TEXT type STRING
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_EXAMPLE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update user input example.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_TEXT |
+ "! The text of the user input example.
+ "! @parameter I_BODY |
+ "! The new text of the user input example.
+ "! @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_EXAMPLE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_EXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_TEXT type STRING
+ !I_BODY type T_UPDATE_EXAMPLE
+ !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_EXAMPLE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete user input example.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_INTENT |
+ "! The intent name.
+ "! @parameter I_TEXT |
+ "! The text of the user input example.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_EXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_INTENT type STRING
+ !I_TEXT type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List counterexamples.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned counterexamples 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_COUNTEREXAMPLE_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_COUNTEREXAMPLES
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_COUNTEREXAMPLE_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create counterexample.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_BODY |
+ "! The content of the new counterexample.
+ "! @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_COUNTEREXAMPLE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_COUNTEREXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_BODY type T_COUNTEREXAMPLE
+ !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_COUNTEREXAMPLE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get counterexample.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_TEXT |
+ "! The text of a user input counterexample (for example, `What are you wearing?`).
+ "! @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_COUNTEREXAMPLE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_COUNTEREXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_TEXT type STRING
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_COUNTEREXAMPLE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update counterexample.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_TEXT |
+ "! The text of a user input counterexample (for example, `What are you wearing?`).
+ "! @parameter I_BODY |
+ "! The text of the counterexample.
+ "! @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_COUNTEREXAMPLE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_COUNTEREXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_TEXT type STRING
+ !I_BODY type T_UPDATE_COUNTEREXAMPLE
+ !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_COUNTEREXAMPLE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete counterexample.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_TEXT |
+ "! The text of a user input counterexample (for example, `What are you wearing?`).
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_COUNTEREXAMPLE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_TEXT type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List entities.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned entities 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_ENTITY_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_ENTITIES
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_ENTITY_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create entity.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_BODY |
+ "! The content of the new entity.
+ "! @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_ENTITY
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_ENTITY
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_BODY type T_CREATE_ENTITY
+ !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_ENTITY
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get entity.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @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_ENTITY
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_ENTITY
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_ENTITY
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update entity.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_BODY |
+ "! The updated content of the entity. Any elements included in the new data will
+ "! completely replace the equivalent existing elements, including all subelements.
+ "! (Previously existing subelements are not retained unless they are also included
+ "! in the new data.) For example, if you update the values for an entity, the
+ "! previously existing values are discarded and replaced with the new values
+ "! specified in the update.
+ "! @parameter I_APPEND |
+ "! Whether the new data is to be appended to the existing data in the entity. 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 the entity includes **values** and **append**=`false`, all
+ "! existing values for the entity are discarded and replaced with the new
+ "! values.
+ "!
+ "! 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 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_ENTITY
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_ENTITY
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_BODY type T_UPDATE_ENTITY
+ !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'
+ exporting
+ !E_RESPONSE type T_ENTITY
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete entity.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_ENTITY
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List entity mentions.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @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_ENTITY_MENTION_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_MENTIONS
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_ENTITY_MENTION_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List entity values.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned entity values 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_VALUE_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_VALUES
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_VALUE_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create entity value.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_BODY |
+ "! The new entity value.
+ "! @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_VALUE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_VALUE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_BODY type T_CREATE_VALUE
+ !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_VALUE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get entity value.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_EXPORT |
+ "! Whether to include all element content in the returned data. If
+ "! **export**=`false`, the returned data includes only information about the
+ "! element itself. If **export**=`true`, all content, including subelements, is
+ "! included.
+ "! @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_VALUE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_VALUE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_EXPORT type BOOLEAN default c_boolean_false
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_VALUE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update entity value.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_BODY |
+ "! The updated content of the entity value.
+ "!
+ "! Any elements included in the new data will completely replace the equivalent
+ "! existing elements, including all subelements. (Previously existing subelements
+ "! are not retained unless they are also included in the new data.) For example,
+ "! if you update the synonyms for an entity value, the previously existing
+ "! synonyms are discarded and replaced with the new synonyms specified in the
+ "! update.
+ "! @parameter I_APPEND |
+ "! Whether the new data is to be appended to the existing data in the entity value.
+ "! 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 the entity value includes **synonyms** and **append**=`false`, all
+ "! existing synonyms for the entity value are discarded and replaced with the new
+ "! synonyms.
+ "!
+ "! 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 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_VALUE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_VALUE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_BODY type T_UPDATE_VALUE
+ !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'
+ exporting
+ !E_RESPONSE type T_VALUE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete entity value.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_VALUE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List entity value synonyms.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned entity value synonyms 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_SYNONYM_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_SYNONYMS
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_SYNONYM_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create entity value synonym.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_BODY |
+ "! The new synonym.
+ "! @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_SYNONYM
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_SYNONYM
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_BODY type T_SYNONYM
+ !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_SYNONYM
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get entity value synonym.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_SYNONYM |
+ "! The text of the synonym.
+ "! @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_SYNONYM
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_SYNONYM
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_SYNONYM type STRING
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_SYNONYM
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update entity value synonym.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_SYNONYM |
+ "! The text of the synonym.
+ "! @parameter I_BODY |
+ "! The updated entity value synonym.
+ "! @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_SYNONYM
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_SYNONYM
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_SYNONYM type STRING
+ !I_BODY type T_UPDATE_SYNONYM
+ !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_SYNONYM
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete entity value synonym.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_ENTITY |
+ "! The name of the entity.
+ "! @parameter I_VALUE |
+ "! The text of the entity value.
+ "! @parameter I_SYNONYM |
+ "! The text of the synonym.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_SYNONYM
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_ENTITY type STRING
+ !I_VALUE type STRING
+ !I_SYNONYM type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List dialog nodes.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_PAGE_LIMIT |
+ "! The number of records to return in each page of results.
+ "! @parameter I_SORT |
+ "! The attribute by which returned dialog nodes 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_DIALOG_NODE_COLLECTION
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_DIALOG_NODES
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_PAGE_LIMIT type INTEGER optional
+ !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_DIALOG_NODE_COLLECTION
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create dialog node.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_BODY |
+ "! A CreateDialogNode object defining the content of the new dialog node.
+ "! @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_DIALOG_NODE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_DIALOG_NODE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_BODY type T_DIALOG_NODE
+ !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_DIALOG_NODE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get dialog node.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_DIALOG_NODE |
+ "! The dialog node ID (for example, `get_order`).
+ "! @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_DIALOG_NODE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_DIALOG_NODE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_DIALOG_NODE type STRING
+ !I_INCLUDE_AUDIT type BOOLEAN default c_boolean_false
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_DIALOG_NODE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Update dialog node.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_DIALOG_NODE |
+ "! The dialog node ID (for example, `get_order`).
+ "! @parameter I_BODY |
+ "! The updated content of the dialog node.
+ "!
+ "! Any elements included in the new data will completely replace the equivalent
+ "! existing elements, including all subelements. (Previously existing subelements
+ "! are not retained unless they are also included in the new data.) For example,
+ "! if you update the actions for a dialog node, the previously existing actions
+ "! are discarded and replaced with the new actions specified in the update.
+ "! @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_DIALOG_NODE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods UPDATE_DIALOG_NODE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_DIALOG_NODE type STRING
+ !I_BODY type T_UPDATE_DIALOG_NODE
+ !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_DIALOG_NODE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete dialog node.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @parameter I_DIALOG_NODE |
+ "! The dialog node ID (for example, `get_order`).
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_DIALOG_NODE
+ importing
+ !I_WORKSPACE_ID type STRING
+ !I_DIALOG_NODE type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List log events in a workspace.
+ "!
+ "! @parameter I_WORKSPACE_ID |
+ "! Unique identifier of the workspace.
+ "! @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_WORKSPACE_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 in all workspaces.
+ "!
+ "! @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
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-ref
+ "! erence#filter-reference).
+ "! @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_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_ALL_LOGS
+ importing
+ !I_FILTER type STRING
+ !I_SORT 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 .
+
+ "! Delete labeled data.
+ "!
+ "! @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.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+ENDCLASS.
+
+class ZCL_IBMC_ASSISTANT_V1 IMPLEMENTATION.
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->GET_APPNAME
+* +-------------------------------------------------------------------------------------------------+
+* | [<-()] E_APPNAME TYPE STRING
+* +--------------------------------------------------------------------------------------
+ method GET_APPNAME.
+
+ e_appname = 'Watson Assistant v1'.
+
+ endmethod.
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Protected Method ZCL_IBMC_ASSISTANT_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_header = c_boolean_true.
+ elseif lv_auth_method eq 'ICP4D'.
+ e_request_prop-auth_name = 'ICP4D'.
+ e_request_prop-auth_type = 'apiKey'.
+ e_request_prop-auth_headername = 'Authorization'.
+ e_request_prop-auth_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/assistant/api'.
+
+endmethod.
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->GET_SDK_VERSION_DATE
+* +-------------------------------------------------------------------------------------------------+
+* | [<-()] E_SDK_VERSION_DATE TYPE STRING
+* +--------------------------------------------------------------------------------------
+ method get_sdk_version_date.
+
+ e_sdk_version_date = '20200210092810'.
+
+ endmethod.
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_ASSISTANT_V1->MESSAGE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_BODY TYPE T_MESSAGE_REQUEST(optional)
+* | [--->] I_NODES_VISITED_DETAILS 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
+* | [!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 = '/v1/workspaces/{workspace_id}/message'.
+ 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.
+ 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_NODES_VISITED_DETAILS is supplied.
+ lv_queryparam = i_NODES_VISITED_DETAILS.
+ add_query_parameter(
+ exporting
+ i_parameter = `nodes_visited_details`
+ 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*' 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_ASSISTANT_V1->LIST_WORKSPACES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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
+* | [!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_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*' 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_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 GET_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/{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.
+ set_default_query_parameters(
+ changing
+ c_url = ls_request_prop-url ).
+
+ " process query parameters
+ data:
+ lv_queryparam type string.
+
+ 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.
+
+ 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.
+
+
+
+
+
+
+ " 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->UPDATE_WORKSPACE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] 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.
+
+ 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/{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.
+ 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_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(
+ 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*' 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_ASSISTANT_V1->DELETE_WORKSPACE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_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/{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.
+ 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_V1->LIST_INTENTS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_INTENT_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_INTENTS.
+
+ 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/{workspace_id}/intents'.
+ 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.
+ set_default_query_parameters(
+ changing
+ c_url = ls_request_prop-url ).
+
+ " process query parameters
+ data:
+ lv_queryparam type string.
+
+ 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.
+
+ 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_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_INTENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_BODY TYPE T_CREATE_INTENT
+* | [--->] 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_INTENT
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_INTENT.
+
+ 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/{workspace_id}/intents'.
+ 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.
+ 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 = ''.
+ 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_ASSISTANT_V1->GET_INTENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_INTENT
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_INTENT.
+
+ 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/{workspace_id}/intents/{intent}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT 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_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.
+
+ 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->UPDATE_INTENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_INTENT
+* | [--->] 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_INTENT
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_INTENT.
+
+ 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/{workspace_id}/intents/{intent}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT 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 query parameters
+ 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(
+ 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 = ''.
+ 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_ASSISTANT_V1->DELETE_INTENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_INTENT.
+
+ 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/{workspace_id}/intents/{intent}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT 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_V1->LIST_EXAMPLES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_EXAMPLE_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_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/workspaces/{workspace_id}/intents/{intent}/examples'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT 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_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_EXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_BODY TYPE T_EXAMPLE
+* | [--->] 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_EXAMPLE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_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/workspaces/{workspace_id}/intents/{intent}/examples'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT 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 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 = ''.
+ 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_ASSISTANT_V1->GET_EXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_EXAMPLE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_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/workspaces/{workspace_id}/intents/{intent}/examples/{text}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT ignoring case.
+ replace all occurrences of `{text}` in ls_request_prop-url-path with i_TEXT 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_V1->UPDATE_EXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_EXAMPLE
+* | [--->] 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_EXAMPLE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_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/workspaces/{workspace_id}/intents/{intent}/examples/{text}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT ignoring case.
+ replace all occurrences of `{text}` in ls_request_prop-url-path with i_TEXT 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 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 = ''.
+ 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_ASSISTANT_V1->DELETE_EXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_INTENT TYPE STRING
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_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/workspaces/{workspace_id}/intents/{intent}/examples/{text}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{intent}` in ls_request_prop-url-path with i_INTENT ignoring case.
+ replace all occurrences of `{text}` in ls_request_prop-url-path with i_TEXT 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_V1->LIST_COUNTEREXAMPLES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_COUNTEREXAMPLE_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_COUNTEREXAMPLES.
+
+ 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/{workspace_id}/counterexamples'.
+ 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.
+ 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_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_COUNTEREXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_BODY TYPE T_COUNTEREXAMPLE
+* | [--->] 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_COUNTEREXAMPLE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_COUNTEREXAMPLE.
+
+ 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/{workspace_id}/counterexamples'.
+ 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.
+ 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 = ''.
+ 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_ASSISTANT_V1->GET_COUNTEREXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_COUNTEREXAMPLE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_COUNTEREXAMPLE.
+
+ 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/{workspace_id}/counterexamples/{text}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{text}` in ls_request_prop-url-path with i_TEXT 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_V1->UPDATE_COUNTEREXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_COUNTEREXAMPLE
+* | [--->] 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_COUNTEREXAMPLE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_COUNTEREXAMPLE.
+
+ 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/{workspace_id}/counterexamples/{text}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{text}` in ls_request_prop-url-path with i_TEXT 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 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 = ''.
+ 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_ASSISTANT_V1->DELETE_COUNTEREXAMPLE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_COUNTEREXAMPLE.
+
+ 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/{workspace_id}/counterexamples/{text}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{text}` in ls_request_prop-url-path with i_TEXT 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_V1->LIST_ENTITIES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_ENTITY_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_ENTITIES.
+
+ 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/{workspace_id}/entities'.
+ 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.
+ set_default_query_parameters(
+ changing
+ c_url = ls_request_prop-url ).
+
+ " process query parameters
+ data:
+ lv_queryparam type string.
+
+ 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.
+
+ 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_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_ENTITY
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_BODY TYPE T_CREATE_ENTITY
+* | [--->] 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_ENTITY
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_ENTITY.
+
+ 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/{workspace_id}/entities'.
+ 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.
+ 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 = ''.
+ 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_ASSISTANT_V1->GET_ENTITY
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_ENTITY
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_ENTITY.
+
+ 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/{workspace_id}/entities/{entity}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY 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_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.
+
+ 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->UPDATE_ENTITY
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_ENTITY
+* | [--->] 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_ENTITY
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_ENTITY.
+
+ 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/{workspace_id}/entities/{entity}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY 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 query parameters
+ 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(
+ 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 = ''.
+ 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_ASSISTANT_V1->DELETE_ENTITY
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_ENTITY.
+
+ 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/{workspace_id}/entities/{entity}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY 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_V1->LIST_MENTIONS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_ENTITY_MENTION_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_MENTIONS.
+
+ 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/{workspace_id}/entities/{entity}/mentions'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY 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_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.
+
+ 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->LIST_VALUES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_VALUE_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_VALUES.
+
+ 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/{workspace_id}/entities/{entity}/values'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY 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_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.
+
+ 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_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_VALUE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_BODY TYPE T_CREATE_VALUE
+* | [--->] 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_VALUE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_VALUE.
+
+ 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/{workspace_id}/entities/{entity}/values'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY 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 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 = ''.
+ 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_ASSISTANT_V1->GET_VALUE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_EXPORT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_VALUE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_VALUE.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE 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_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.
+
+ 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->UPDATE_VALUE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_VALUE
+* | [--->] 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_VALUE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_VALUE.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE 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 query parameters
+ 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(
+ 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 = ''.
+ 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_ASSISTANT_V1->DELETE_VALUE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_VALUE.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE 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_V1->LIST_SYNONYMS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_SYNONYM_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_SYNONYMS.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}/synonyms'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE 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_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_SYNONYM
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_BODY TYPE T_SYNONYM
+* | [--->] 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_SYNONYM
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_SYNONYM.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}/synonyms'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE 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 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 = ''.
+ 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_ASSISTANT_V1->GET_SYNONYM
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_SYNONYM TYPE STRING
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_SYNONYM
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_SYNONYM.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}/synonyms/{synonym}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE ignoring case.
+ replace all occurrences of `{synonym}` in ls_request_prop-url-path with i_SYNONYM 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_V1->UPDATE_SYNONYM
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_SYNONYM TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_SYNONYM
+* | [--->] 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_SYNONYM
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_SYNONYM.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}/synonyms/{synonym}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE ignoring case.
+ replace all occurrences of `{synonym}` in ls_request_prop-url-path with i_SYNONYM 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 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 = ''.
+ 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_ASSISTANT_V1->DELETE_SYNONYM
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_ENTITY TYPE STRING
+* | [--->] I_VALUE TYPE STRING
+* | [--->] I_SYNONYM TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_SYNONYM.
+
+ 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/{workspace_id}/entities/{entity}/values/{value}/synonyms/{synonym}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{entity}` in ls_request_prop-url-path with i_ENTITY ignoring case.
+ replace all occurrences of `{value}` in ls_request_prop-url-path with i_VALUE ignoring case.
+ replace all occurrences of `{synonym}` in ls_request_prop-url-path with i_SYNONYM 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_V1->LIST_DIALOG_NODES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_DIALOG_NODE_COLLECTION
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_DIALOG_NODES.
+
+ 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/{workspace_id}/dialog_nodes'.
+ 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.
+ 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_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_DIALOG_NODE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_BODY TYPE T_DIALOG_NODE
+* | [--->] 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_DIALOG_NODE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_DIALOG_NODE.
+
+ 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/{workspace_id}/dialog_nodes'.
+ 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.
+ 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 = ''.
+ 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_ASSISTANT_V1->GET_DIALOG_NODE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_DIALOG_NODE TYPE STRING
+* | [--->] I_INCLUDE_AUDIT TYPE BOOLEAN (default =c_boolean_false)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_DIALOG_NODE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_DIALOG_NODE.
+
+ 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/{workspace_id}/dialog_nodes/{dialog_node}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{dialog_node}` in ls_request_prop-url-path with i_DIALOG_NODE 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_V1->UPDATE_DIALOG_NODE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_DIALOG_NODE TYPE STRING
+* | [--->] I_BODY TYPE T_UPDATE_DIALOG_NODE
+* | [--->] 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_DIALOG_NODE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method UPDATE_DIALOG_NODE.
+
+ 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/{workspace_id}/dialog_nodes/{dialog_node}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{dialog_node}` in ls_request_prop-url-path with i_DIALOG_NODE 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 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 = ''.
+ 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_ASSISTANT_V1->DELETE_DIALOG_NODE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_ID TYPE STRING
+* | [--->] I_DIALOG_NODE TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_DIALOG_NODE.
+
+ 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/{workspace_id}/dialog_nodes/{dialog_node}'.
+ replace all occurrences of `{workspace_id}` in ls_request_prop-url-path with i_WORKSPACE_ID ignoring case.
+ replace all occurrences of `{dialog_node}` in ls_request_prop-url-path with i_DIALOG_NODE 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_V1->LIST_LOGS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_WORKSPACE_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')
+* | [<---] 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 = '/v1/workspaces/{workspace_id}/logs'.
+ 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.
+ 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_V1->LIST_ALL_LOGS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_FILTER TYPE STRING
+* | [--->] I_SORT TYPE STRING(optional)
+* | [--->] I_PAGE_LIMIT TYPE INTEGER(optional)
+* | [--->] 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_ALL_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 = '/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.
+
+ 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.
+
+ 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_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_V1->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 = '/v1/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 Private Method ZCL_IBMC_ASSISTANT_V1->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_assistant_v1.clas.xml b/src/zcl_ibmc_assistant_v1.clas.xml
new file mode 100644
index 0000000..d53c171
--- /dev/null
+++ b/src/zcl_ibmc_assistant_v1.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_ASSISTANT_V1
+ E
+ IBM Watson Assistant V1
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_assistant_v2.clas.abap b/src/zcl_ibmc_assistant_v2.clas.abap
new file mode 100644
index 0000000..469d2d8
--- /dev/null
+++ b/src/zcl_ibmc_assistant_v2.clas.abap
@@ -0,0 +1,1251 @@
+* 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.
+"! 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.
+class ZCL_IBMC_ASSISTANT_V2 DEFINITION
+ public
+ inheriting from ZCL_IBMC_SERVICE_EXT
+ create public .
+
+public section.
+ types:
+ "! Dialog log message details.
+ begin of T_DIALOG_LOG_MESSAGE,
+ "! The severity of the log message.
+ LEVEL type STRING,
+ "! The text of the log message.
+ MESSAGE type STRING,
+ 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.
+ 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.
+ 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 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
+ "! `branch_exited_reason` specifies whether the dialog completed by itself or got
+ "! interrupted.
+ BRANCH_EXITED_REASON type STRING,
+ end of T_MESSAGE_OUTPUT_DEBUG.
+ types:
+ "! No documentation available.
+ 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.
+ 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:
+ "! An alternative value for the recognized entity.
+ begin of T_RUNTIME_ENTITY_ALTERNATIVE,
+ "! The entity value that was recognized in the user input.
+ VALUE type STRING,
+ "! A decimal percentage that represents Watson's confidence in the recognized
+ "! entity.
+ CONFIDENCE type NUMBER,
+ end of T_RUNTIME_ENTITY_ALTERNATIVE.
+ types:
+ "! 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.
+ begin of T_RUNTIME_ENTITY_ROLE,
+ "! The relationship of the entity to the range.
+ TYPE type STRING,
+ end of T_RUNTIME_ENTITY_ROLE.
+ types:
+ "! No documentation available.
+ begin of T_RT_ENTITY_INTERPRETATION,
+ "! The calendar used to represent a recognized date (for example, `Gregorian`).
+ CALENDAR_TYPE type STRING,
+ "! A unique identifier used to associate a recognized 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,
+ "! A recognized numeric value, represented as an integer or double.
+ NUMERIC_VALUE type NUMBER,
+ "! The type of numeric value recognized in the user input (`integer` or
+ "! `rational`).
+ SUBTYPE type STRING,
+ "! A recognized term for a time that was mentioned as a part of the day in the
+ "! user's input (for example, `morning` or `afternoon`).
+ PART_OF_DAY type STRING,
+ "! A recognized mention of a relative hour, represented numerically as an offset
+ "! from the current hour (for example, `3` for `in three hours` or `-1` for `an
+ "! hour ago`).
+ RELATIVE_HOUR type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! minutes from the current time (for example, `5` for `in five minutes` or `-15`
+ "! for `fifteen minutes ago`).
+ RELATIVE_MINUTE type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! seconds from the current time (for example, `10` for `in ten seconds` or `-30`
+ "! for `thirty seconds ago`).
+ RELATIVE_SECOND type NUMBER,
+ "! A recognized specific hour mentioned as part of a time value (for example, `10`
+ "! for `10:15 AM`.).
+ SPECIFIC_HOUR type NUMBER,
+ "! A recognized specific minute mentioned as part of a time value (for example,
+ "! `15` for `10:15 AM`.).
+ SPECIFIC_MINUTE type NUMBER,
+ "! A recognized specific second mentioned as part of a time value (for example,
+ "! `30` for `10:15:30 AM`.).
+ SPECIFIC_SECOND type NUMBER,
+ "! A recognized time zone mentioned as part of a time value (for example, `EST`).
+ TIMEZONE type STRING,
+ end of T_RT_ENTITY_INTERPRETATION.
+ types:
+ "! Optional properties that control how the assistant responds.
+ begin of T_MESSAGE_INPUT_OPTIONS,
+ "! Whether to return additional diagnostic information. Set to `true` to return
+ "! additional information under the `output.debug` key.
+ DEBUG type BOOLEAN,
+ "! 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,
+ "! Whether to return session context with the response. If you specify `true`, the
+ "! response will include the `context` property.
+ RETURN_CONTEXT type BOOLEAN,
+ end of T_MESSAGE_INPUT_OPTIONS.
+ types:
+ "! An intent identified in the user input.
+ 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.
+ CONFIDENCE type DOUBLE,
+ end of T_RUNTIME_INTENT.
+ types:
+ "! No documentation available.
+ begin of T_CAPTURE_GROUP,
+ "! A recognized capture group for the entity.
+ GROUP type STRING,
+ "! Zero-based character offsets that indicate where the entity value begins and
+ "! ends in the input text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ end of T_CAPTURE_GROUP.
+ types:
+ "! The entity value that was recognized in the user input.
+ begin of T_RUNTIME_ENTITY,
+ "! An entity detected in the input.
+ ENTITY type STRING,
+ "! An array of zero-based character offsets that indicate where the detected entity
+ "! values begin and end in the input text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ "! The term in the input text that was recognized as an entity value.
+ VALUE type STRING,
+ "! 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
+ "! user input. This property is included only if the new system entities are
+ "! enabled for the skill.
+ "!
+ "! For more information about how the new system entities are interpreted, see the
+ "! [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-syste
+ "! m-entities).
+ INTERPRETATION type T_RT_ENTITY_INTERPRETATION,
+ "! An array of possible alternative values that the user might have intended
+ "! instead of the value returned in the **value** property. This property is
+ "! returned only for `@sys-time` and `@sys-date` entities when the user's input is
+ "! ambiguous.
+ "!
+ "! This property is included only if the new system entities are enabled for the
+ "! skill.
+ ALTERNATIVES type STANDARD TABLE OF T_RUNTIME_ENTITY_ALTERNATIVE WITH NON-UNIQUE DEFAULT KEY,
+ "! 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.
+ ROLE type T_RUNTIME_ENTITY_ROLE,
+ end of T_RUNTIME_ENTITY.
+ 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.
+ MESSAGE_TYPE type STRING,
+ "! The text of the user input. This string cannot contain carriage return, newline,
+ "! or tab characters.
+ TEXT type STRING,
+ "! Optional properties that control how the assistant responds.
+ OPTIONS type T_MESSAGE_INPUT_OPTIONS,
+ "! 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_MESSAGE_INPUT.
+ types:
+ "! An object defining the message input to be sent to the assistant if the user
+ "! selects the corresponding option.
+ begin of T_DIA_ND_OUTPUT_OPT_ELEM_VALUE,
+ "! An input object that includes the input text.
+ INPUT type T_MESSAGE_INPUT,
+ end of T_DIA_ND_OUTPUT_OPT_ELEM_VALUE.
+ types:
+ "! No documentation available.
+ begin of T_DIA_NODE_OUTPUT_OPT_ELEMENT,
+ "! The user-facing label for the option.
+ LABEL type STRING,
+ "! An object defining the message input to be sent to the assistant if the user
+ "! selects the corresponding option.
+ VALUE type T_DIA_ND_OUTPUT_OPT_ELEM_VALUE,
+ end of T_DIA_NODE_OUTPUT_OPT_ELEMENT.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_OPTION,
+ "! 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_RUNTIME_RESPONSE_TYPE_OPTION.
+ 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:
+ "! 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 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.
+ 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.
+ 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 a beta
+ "! feature 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.
+ 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.
+ types:
+ "! 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.
+ 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.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_GENERIC,
+ "! The type of response returned by the dialog node. The specified response type
+ "! must be supported by the client application or channel.
+ "!
+ "! **Note:** The **suggestion** response type is part of the disambiguation
+ "! feature, which is only available for Premium users.
+ RESPONSE_TYPE type STRING,
+ "! The text of the response.
+ TEXT type STRING,
+ "! How long to pause, in milliseconds.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause.
+ TYPING type BOOLEAN,
+ "! The 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.
+ 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,
+ "! A message to be sent to the human agent who will be taking over the
+ "! conversation.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ "! A label identifying the topic of the conversation, derived from the
+ "! **user_label** property of the relevant node.
+ TOPIC type STRING,
+ "! An array of objects describing the possible matching dialog nodes from which the
+ "! user can choose.
+ "!
+ "! **Note:** The **suggestions** property is part of the disambiguation feature,
+ "! which is only available for Premium users.
+ SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY,
+ "! 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 containing search results.
+ RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ end of T_RUNTIME_RESPONSE_GENERIC.
+ 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_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:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_IMAGE,
+ "! 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.
+ DESCRIPTION type STRING,
+ end of T_RUNTIME_RESPONSE_TYPE_IMAGE.
+ types:
+ "! No documentation available.
+ begin of T_DIALOG_NODE_ACTION,
+ "! The name of the action.
+ NAME type STRING,
+ "! The type of action to invoke.
+ TYPE type STRING,
+ "! A map of key/value pairs to be provided to the action.
+ PARAMETERS type MAP,
+ "! 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:
+ "! 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
+ "! 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.
+ "!
+ "! This property is included only if the new system entities are enabled for the
+ "! skill.
+ REFERENCE_TIME type STRING,
+ end of T_MSSG_CONTEXT_GLOBAL_SYSTEM.
+ types:
+ "! Information that is shared by all skills used by 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,
+ end of T_MESSAGE_CONTEXT_GLOBAL.
+ types:
+ "! Information specific to particular skills used by the Assistant.
+ "!
+ "! **Note:** Currently, only a single property named `main skill` is supported.
+ "! This object contains variables that apply to the dialog skill used by the
+ "! assistant.
+ T_MESSAGE_CONTEXT_SKILLS type MAP.
+ types:
+ "! No documentation available.
+ begin of T_MESSAGE_CONTEXT,
+ "! Information 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 property named `main skill` is supported.
+ "! This object contains variables that apply to the dialog skill used by the
+ "! assistant.
+ SKILLS type T_MESSAGE_CONTEXT_SKILLS,
+ end of T_MESSAGE_CONTEXT.
+ types:
+ "! Assistant output to be rendered or processed by the client.
+ begin of T_MESSAGE_OUTPUT,
+ "! 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,
+ "! An array of intents recognized in the user input, sorted in descending order of
+ "! confidence.
+ INTENTS type STANDARD TABLE OF T_RUNTIME_INTENT WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of entities identified in the user input.
+ ENTITIES type STANDARD TABLE OF T_RUNTIME_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! 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,
+ "! Additional detailed information about a message response and how it was
+ "! generated.
+ DEBUG type T_MESSAGE_OUTPUT_DEBUG,
+ "! 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,
+ end of T_MESSAGE_OUTPUT.
+ types:
+ "! A response from the Watson Assistant service.
+ begin of T_MESSAGE_RESPONSE,
+ "! Assistant output to be rendered or processed by the client.
+ OUTPUT type T_MESSAGE_OUTPUT,
+ "! State information for the conversation. The context is stored by the assistant
+ "! on a per-session basis. You can use this property to access context
+ "! variables.
+ "!
+ "! **Note:** The context is included in message responses only if
+ "! **return_context**=`true` in the message request.
+ CONTEXT type T_MESSAGE_CONTEXT,
+ end of T_MESSAGE_RESPONSE.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_TEXT,
+ "! The text of the response.
+ TEXT type STRING,
+ end of T_RUNTIME_RESPONSE_TYPE_TEXT.
+ types:
+ "! No documentation available.
+ begin of T_RT_ENTTY_INTRPRTTN_SYS_TIME,
+ "! A unique identifier used to associate a recognized 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,
+ "! The precision or duration of a time range specified by a recognized `@sys-time`
+ "! or `@sys-date` entity.
+ GRANULARITY type STRING,
+ "! A recognized term for a time that was mentioned as a part of the day in the
+ "! user's input (for example, `morning` or `afternoon`).
+ PART_OF_DAY 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,
+ "! A recognized mention of a relative hour, represented numerically as an offset
+ "! from the current hour (for example, `3` for `in three hours` or `-1` for `an
+ "! hour ago`).
+ RELATIVE_HOUR type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! minutes from the current time (for example, `5` for `in five minutes` or `-15`
+ "! for `fifteen minutes ago`).
+ RELATIVE_MINUTE type NUMBER,
+ "! A recognized mention of a relative time, represented numerically as an offset in
+ "! seconds from the current time (for example, `10` for `in ten seconds` or `-30`
+ "! for `thirty seconds ago`).
+ RELATIVE_SECOND type NUMBER,
+ "! A recognized specific hour mentioned as part of a time value (for example, `10`
+ "! for `10:15 AM`.).
+ SPECIFIC_HOUR type NUMBER,
+ "! A recognized specific minute mentioned as part of a time value (for example,
+ "! `15` for `10:15 AM`.).
+ SPECIFIC_MINUTE type NUMBER,
+ "! A recognized specific second mentioned as part of a time value (for example,
+ "! `30` for `10:15:30 AM`.).
+ SPECIFIC_SECOND type NUMBER,
+ "! 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_RUNTIME_RESPONSE_TYPE_PAUSE,
+ "! How long to pause, in milliseconds.
+ TIME type INTEGER,
+ "! Whether to send a "user is typing" event during the pause.
+ TYPING type BOOLEAN,
+ end of T_RUNTIME_RESPONSE_TYPE_PAUSE.
+ types:
+ "! No documentation available.
+ begin of T_RUNTIME_RESPONSE_TYPE_SEARCH,
+ "! 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 containing search results.
+ RESULTS type STANDARD TABLE OF T_SEARCH_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ end of T_RUNTIME_RESPONSE_TYPE_SEARCH.
+ types:
+ "! No documentation available.
+ begin of T_RT_RESPONSE_TYPE_SUGGESTION,
+ "! 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.
+ "!
+ "! **Note:** The **suggestions** property is part of the disambiguation feature,
+ "! which is only available for Premium users.
+ SUGGESTIONS type STANDARD TABLE OF T_DIALOG_SUGGESTION WITH NON-UNIQUE DEFAULT KEY,
+ end of T_RT_RESPONSE_TYPE_SUGGESTION.
+ types:
+ "! Contains information specific to a particular skill used by the Assistant.
+ begin of T_MESSAGE_CONTEXT_SKILL,
+ "! Arbitrary variables that can be read and written by a particular skill.
+ USER_DEFINED type MAP,
+ "! For internal use only.
+ SYSTEM type MAP,
+ end of T_MESSAGE_CONTEXT_SKILL.
+ types:
+ "! No documentation available.
+ begin of T_RT_RESP_TYP_CONNECT_TO_AGENT,
+ "! A message to be sent to the human agent who will be taking over the
+ "! conversation.
+ MESSAGE_TO_HUMAN_AGENT type STRING,
+ "! A label identifying the topic of the conversation, derived from the
+ "! **user_label** property of the relevant node.
+ TOPIC type STRING,
+ end of T_RT_RESP_TYP_CONNECT_TO_AGENT.
+ types:
+ "! A 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,
+ "! State information for the conversation. The context is stored by the assistant
+ "! on a per-session basis. You can use this property to set or modify context
+ "! variables, which can also be accessed by dialog nodes.
+ CONTEXT type T_MESSAGE_CONTEXT,
+ end of T_MESSAGE_REQUEST.
+
+constants:
+ 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_SESSION_RESPONSE type string value '|SESSION_ID|',
+ T_RT_ENTTY_INTRPRTTN_SYS_NUM type string value '|',
+ T_RUNTIME_ENTITY_ALTERNATIVE type string value '|',
+ T_RUNTIME_ENTITY_ROLE type string value '|',
+ T_RT_ENTITY_INTERPRETATION type string value '|',
+ T_MESSAGE_INPUT_OPTIONS type string value '|',
+ T_RUNTIME_INTENT type string value '|INTENT|CONFIDENCE|',
+ T_CAPTURE_GROUP type string value '|GROUP|',
+ T_RUNTIME_ENTITY type string value '|ENTITY|LOCATION|VALUE|',
+ 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 '|',
+ T_RT_ENTTY_INTRPRTTN_SYS_DATE type string value '|',
+ T_SEARCH_RESULT_HIGHLIGHT type string value '|',
+ T_DIALOG_SUGGESTION_VALUE type string value '|',
+ T_SEARCH_RESULT_METADATA type string value '|',
+ T_SEARCH_RESULT type string value '|ID|RESULT_METADATA|',
+ T_DIALOG_SUGGESTION type string value '|LABEL|VALUE|',
+ T_RUNTIME_RESPONSE_GENERIC type string value '|RESPONSE_TYPE|',
+ T_ERROR_DETAIL type string value '|MESSAGE|',
+ T_ERROR_RESPONSE type string value '|ERROR|CODE|',
+ T_RUNTIME_RESPONSE_TYPE_IMAGE type string value '|',
+ T_DIALOG_NODE_ACTION type string value '|NAME|RESULT_VARIABLE|',
+ T_MSSG_CONTEXT_GLOBAL_SYSTEM type string value '|',
+ T_MESSAGE_CONTEXT_GLOBAL type string value '|',
+ T_MESSAGE_CONTEXT type string value '|',
+ T_MESSAGE_OUTPUT type string value '|',
+ T_MESSAGE_RESPONSE type string value '|OUTPUT|',
+ T_RUNTIME_RESPONSE_TYPE_TEXT type string value '|',
+ T_RT_ENTTY_INTRPRTTN_SYS_TIME type string value '|',
+ T_RUNTIME_RESPONSE_TYPE_PAUSE type string value '|',
+ T_RUNTIME_RESPONSE_TYPE_SEARCH type string value '|',
+ T_RT_RESPONSE_TYPE_SUGGESTION type string value '|',
+ T_MESSAGE_CONTEXT_SKILL type string value '|',
+ T_RT_RESP_TYP_CONNECT_TO_AGENT type string value '|',
+ T_MESSAGE_REQUEST type string value '|',
+ __DUMMY type string value SPACE,
+ end of C_REQUIRED_FIELDS .
+
+constants:
+ begin of C_ABAPNAME_DICTIONARY,
+ DEBUG type string value 'debug',
+ RESTART type string value 'restart',
+ ALTERNATE_INTENTS type string value 'alternate_intents',
+ RETURN_CONTEXT type string value 'return_context',
+ INTENT type string value 'intent',
+ CONFIDENCE type string value 'confidence',
+ ENTITY type string value 'entity',
+ LOCATION type string value 'location',
+ VALUE type string value 'value',
+ METADATA type string value 'metadata',
+ INNER type string value 'inner',
+ GROUPS type string value 'groups',
+ INTERPRETATION type string value 'interpretation',
+ ALTERNATIVES type string value 'alternatives',
+ ROLE type string value 'role',
+ CALENDAR_TYPE type string value 'calendar_type',
+ DATETIME_LINK type string value 'datetime_link',
+ FESTIVAL type string value 'festival',
+ GRANULARITY type string value 'granularity',
+ RANGE_LINK type string value 'range_link',
+ RANGE_MODIFIER type string value 'range_modifier',
+ RELATIVE_DAY type string value 'relative_day',
+ RELATIVE_MONTH type string value 'relative_month',
+ RELATIVE_WEEK type string value 'relative_week',
+ RELATIVE_WEEKEND type string value 'relative_weekend',
+ RELATIVE_YEAR type string value 'relative_year',
+ SPECIFIC_DAY type string value 'specific_day',
+ SPECIFIC_DAY_OF_WEEK type string value 'specific_day_of_week',
+ SPECIFIC_MONTH type string value 'specific_month',
+ SPECIFIC_QUARTER type string value 'specific_quarter',
+ SPECIFIC_YEAR type string value 'specific_year',
+ NUMERIC_VALUE type string value 'numeric_value',
+ SUBTYPE type string value 'subtype',
+ PART_OF_DAY type string value 'part_of_day',
+ RELATIVE_HOUR type string value 'relative_hour',
+ RELATIVE_MINUTE type string value 'relative_minute',
+ RELATIVE_SECOND type string value 'relative_second',
+ SPECIFIC_HOUR type string value 'specific_hour',
+ SPECIFIC_MINUTE type string value 'specific_minute',
+ SPECIFIC_SECOND type string value 'specific_second',
+ TIMEZONE type string value 'timezone',
+ TYPE type string value 'type',
+ MESSAGE_TYPE type string value 'message_type',
+ TEXT type string value 'text',
+ OPTIONS type string value 'options',
+ INTENTS type string value 'intents',
+ ENTITIES type string value 'entities',
+ SUGGESTION_ID type string value 'suggestion_id',
+ 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',
+ SYSTEM type string value 'system',
+ USER_DEFINED type string value 'user_defined',
+ GLOBAL type string value 'global',
+ SKILLS type string value 'skills',
+ INPUT type string value 'input',
+ CONTEXT type string value 'context',
+ LEVEL type string value 'level',
+ MESSAGE type string value 'message',
+ TIME type string value 'time',
+ TYPING type string value 'typing',
+ SOURCE type string value 'source',
+ TITLE type string value 'title',
+ DESCRIPTION type string value 'description',
+ LABEL type string value 'label',
+ PREFERENCE type string value 'preference',
+ MESSAGE_TO_HUMAN_AGENT type string value 'message_to_human_agent',
+ TOPIC type string value 'topic',
+ SUGGESTIONS type string value 'suggestions',
+ OUTPUT type string value 'output',
+ RESPONSE_TYPE type string value 'response_type',
+ HEADER type string value 'header',
+ RESULTS type string value 'results',
+ NAME type string value 'name',
+ PARAMETERS type string value 'parameters',
+ RESULT_VARIABLE type string value 'result_variable',
+ CREDENTIALS type string value 'credentials',
+ NODES_VISITED type string value 'nodes_visited',
+ NODESVISITED type string value 'nodesVisited',
+ LOG_MESSAGES type string value 'log_messages',
+ LOGMESSAGES type string value 'logMessages',
+ BRANCH_EXITED type string value 'branch_exited',
+ BRANCH_EXITED_REASON type string value 'branch_exited_reason',
+ GENERIC type string value 'generic',
+ ACTIONS type string value 'actions',
+ PATH type string value 'path',
+ ERROR type string value 'error',
+ ERRORS type string value 'errors',
+ CODE type string value 'code',
+ BODY type string value 'body',
+ URL type string value 'url',
+ SCORE type string value 'score',
+ ID type string value 'id',
+ RESULT_METADATA type string value 'result_metadata',
+ HIGHLIGHT type string value 'highlight',
+ SESSION_ID type string value 'session_id',
+ GROUP type string value 'group',
+ DIALOG_NODE type string value 'dialog_node',
+ CONDITIONS type string value 'conditions',
+ end of C_ABAPNAME_DICTIONARY .
+
+
+ methods GET_APPNAME
+ redefinition .
+ methods GET_REQUEST_PROP
+ redefinition .
+ methods GET_SDK_VERSION_DATE
+ redefinition .
+
+
+ "! Create a 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).
+ "!
+ "! **Note:** Currently, the v2 API does not support creating assistants.
+ "! @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_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_SESSION_RESPONSE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete 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).
+ "!
+ "! **Note:** Currently, the v2 API does not support creating assistants.
+ "! @parameter I_SESSION_ID |
+ "! Unique identifier of the session.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_SESSION
+ importing
+ !I_ASSISTANT_ID type STRING
+ !I_SESSION_ID type STRING
+ !I_accept type string default 'application/json'
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! Send user input to assistant.
+ "!
+ "! @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_SESSION_ID |
+ "! Unique identifier of the session.
+ "! @parameter I_REQUEST |
+ "! The message to be sent. This includes the user's input, along with optional
+ "! content such as intents and entities.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_MESSAGE_RESPONSE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods MESSAGE
+ importing
+ !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'
+ exporting
+ !E_RESPONSE type T_MESSAGE_RESPONSE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+
+protected section.
+
+private section.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+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_header = c_boolean_true.
+ elseif lv_auth_method eq 'ICP4D'.
+ e_request_prop-auth_name = 'ICP4D'.
+ e_request_prop-auth_type = 'apiKey'.
+ e_request_prop-auth_headername = 'Authorization'.
+ e_request_prop-auth_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/assistant/api'.
+
+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 = '20200210092813'.
+
+ endmethod.
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_ASSISTANT_V2->CREATE_SESSION
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_ASSISTANT_ID TYPE STRING
+* | [--->] 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_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_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*' 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 Private Method ZCL_IBMC_ASSISTANT_V2->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_assistant_v2.clas.xml b/src/zcl_ibmc_assistant_v2.clas.xml
new file mode 100644
index 0000000..a6bf585
--- /dev/null
+++ b/src/zcl_ibmc_assistant_v2.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_ASSISTANT_V2
+ E
+ IBM Watson Assistant V2
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_compare_comply_v1.clas.abap b/src/zcl_ibmc_compare_comply_v1.clas.abap
new file mode 100644
index 0000000..9f9f440
--- /dev/null
+++ b/src/zcl_ibmc_compare_comply_v1.clas.abap
@@ -0,0 +1,2851 @@
+* 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,
+ 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,
+ 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,
+ "! A string identifying the type of modification the feedback entry in the
+ "! `updated_labels` array. Possible values are `added`, `not_changed`, and
+ "! `removed`.
+ MODIFICATION type STRING,
+ 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,
+ "! The type of modification the feedback entry in the `updated_labels` array.
+ "! Possible values are `added`, `not_changed`, and `removed`.
+ MODIFICATION type STRING,
+ 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:
+ 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:
+ 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',
+ EFFECTIVEDATES type string value 'effectiveDates',
+ CONTRACT_AMOUNTS type string value 'contract_amounts',
+ CONTRACTAMOUNTS type string value 'contractAmounts',
+ TERMINATION_DATES type string value 'termination_dates',
+ TERMINATIONDATES type string value 'terminationDates',
+ CONTRACT_TYPES type string value 'contract_types',
+ CONTRACTTYPES type string value 'contractTypes',
+ CONTRACT_TERMS type string value 'contract_terms',
+ CONTRACTTERMS type string value 'contractTerms',
+ PAYMENT_TERMS type string value 'payment_terms',
+ PAYMENTTERMS type string value 'paymentTerms',
+ CONTRACT_CURRENCIES type string value 'contract_currencies',
+ CONTRACTCURRENCIES type string value 'contractCurrencies',
+ TABLES type string value 'tables',
+ DOCUMENT_STRUCTURE type string value 'document_structure',
+ PARTIES type string value 'parties',
+ SECTION_TITLES type string value 'section_titles',
+ SECTIONTITLES type string value 'sectionTitles',
+ LEADING_SENTENCES type string value 'leading_sentences',
+ LEADINGSENTENCES type string value 'leadingSentences',
+ PARAGRAPHS type string value 'paragraphs',
+ DOCUMENTS type string value 'documents',
+ ALIGNED_ELEMENTS type string value 'aligned_elements',
+ ALIGNEDELEMENTS type string value 'alignedElements',
+ UNALIGNED_ELEMENTS type string value 'unaligned_elements',
+ UNALIGNEDELEMENTS type string value 'unalignedElements',
+ ELEMENT_PAIR type string value 'element_pair',
+ ELEMENTPAIR type string value 'elementPair',
+ IDENTICAL_TEXT type string value 'identical_text',
+ PROVENANCE_IDS type string value 'provenance_ids',
+ PROVENANCEIDS type string value 'provenanceIds',
+ 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',
+ 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',
+ TABLEHEADERS type string value 'tableHeaders',
+ ROW_HEADERS type string value 'row_headers',
+ ROWHEADERS type string value 'rowHeaders',
+ COLUMN_HEADERS type string value 'column_headers',
+ COLUMNHEADERS type string value 'columnHeaders',
+ BODY_CELLS type string value 'body_cells',
+ BODYCELLS type string value 'bodyCells',
+ CONTEXTS type string value 'contexts',
+ KEY_VALUE_PAIRS type string value 'key_value_pairs',
+ KEYVALUEPAIRS type string value 'keyValuePairs',
+ LEVEL type string value 'level',
+ ELEMENT_LOCATIONS type string value 'element_locations',
+ ELEMENTLOCATIONS type string value 'elementLocations',
+ 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',
+ ROWHEADERIDS type string value 'rowHeaderIds',
+ ROW_HEADER_TEXTS type string value 'row_header_texts',
+ ROWHEADERTEXTS type string value 'rowHeaderTexts',
+ ROW_HEADER_TEXTS_NORMALIZED type string value 'row_header_texts_normalized',
+ ROWHEADERTEXTSNORMALIZED type string value 'rowHeaderTextsNormalized',
+ COLUMN_HEADER_IDS type string value 'column_header_ids',
+ COLUMNHEADERIDS type string value 'columnHeaderIds',
+ COLUMN_HEADER_TEXTS type string value 'column_header_texts',
+ COLUMNHEADERTEXTS type string value 'columnHeaderTexts',
+ COLUMN_HEADER_TEXTS_NORMALIZED type string value 'column_header_texts_normalized',
+ COLUMNHEADERTEXTSNORMALIZED type string value 'columnHeaderTextsNormalized',
+ 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',
+ MODIFICATION type string value 'modification',
+ 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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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_BEFORE |
+ "! An optional string in the format `YYYY-MM-DD` that filters the output to include
+ "! only feedback that was added before the specified date.
+ "! @parameter I_AFTER |
+ "! An optional string in the format `YYYY-MM-DD` that filters the output to include
+ "! only feedback that was added after the specified date.
+ "! @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_BEFORE type DATE optional
+ !I_AFTER type DATE 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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+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_header = c_boolean_true.
+ elseif lv_auth_method eq 'ICP4D'.
+ e_request_prop-auth_name = 'ICP4D'.
+ e_request_prop-auth_type = 'apiKey'.
+ e_request_prop-auth_headername = 'Authorization'.
+ e_request_prop-auth_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/compare-comply/api'.
+
+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 = '20200210092814'.
+
+ 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_BEFORE TYPE DATE(optional)
+* | [--->] I_AFTER TYPE DATE(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_BEFORE is supplied.
+ lv_queryparam = i_BEFORE.
+ add_query_parameter(
+ exporting
+ i_parameter = `before`
+ i_value = lv_queryparam
+ changing
+ c_url = ls_request_prop-url ) ##NO_TEXT.
+ endif.
+
+ if i_AFTER is supplied.
+ lv_queryparam = i_AFTER.
+ add_query_parameter(
+ exporting
+ i_parameter = `after`
+ 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_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="input_bucket_location"' ##NO_TEXT.
+ 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_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="input_bucket_name"' ##NO_TEXT.
+ 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_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="output_bucket_location"' ##NO_TEXT.
+ 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_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="output_bucket_name"' ##NO_TEXT.
+ 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.
+
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Private Method ZCL_IBMC_COMPARE_COMPLY_V1->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_compare_comply_v1.clas.xml b/src/zcl_ibmc_compare_comply_v1.clas.xml
new file mode 100644
index 0000000..ad98c9c
--- /dev/null
+++ b/src/zcl_ibmc_compare_comply_v1.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_COMPARE_COMPLY_V1
+ E
+ IBM Watson Compare and Comply
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_discovery_v1.clas.abap b/src/zcl_ibmc_discovery_v1.clas.abap
new file mode 100644
index 0000000..5a479bf
--- /dev/null
+++ b/src/zcl_ibmc_discovery_v1.clas.abap
@@ -0,0 +1,8442 @@
+* 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 that indicates the Categories enrichment will be applied to the
+ "! specified field.
+ T_NLU_ENRICHMENT_CATEGORIES type MAP.
+ 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 T_NLU_ENRICHMENT_CATEGORIES,
+ "! 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:
+ "! 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/services/cloud-object-storage?topic=c
+ "! loud-object-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/services/cloud-object-storage?topic=c
+ "! loud-object-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.
+ INDEXED 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/services/discovery?topic=discovery-el
+ "! ement-classification#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:
+ 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:
+ 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',
+ INDEXED type string value 'indexed',
+ 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',
+ FONTSETTING type string value 'fontSetting',
+ STYLES type string value 'styles',
+ WORDSTYLE type string value 'wordStyle',
+ LEVEL type string value 'level',
+ NAMES type string value 'names',
+ EXCLUDE_TAGS_COMPLETELY type string value 'exclude_tags_completely',
+ EXCLUDETAGSCOMPLETELY type string value 'excludeTagsCompletely',
+ EXCLUDE_TAGS_KEEP_CONTENT type string value 'exclude_tags_keep_content',
+ EXCLUDETAGSKEEPCONTENT type string value 'excludeTagsKeepContent',
+ KEEP_CONTENT type string value 'keep_content',
+ EXCLUDE_CONTENT type string value 'exclude_content',
+ KEEP_TAG_ATTRIBUTES type string value 'keep_tag_attributes',
+ KEEPTAGATTRIBUTES type string value 'keepTagAttributes',
+ EXCLUDE_TAG_ATTRIBUTES type string value 'exclude_tag_attributes',
+ EXCLUDETAGATTRIBUTES type string value 'excludeTagAttributes',
+ ENABLED type string value 'enabled',
+ SELECTOR_TAGS type string value 'selector_tags',
+ SELECTORTAGS type string value 'selectorTags',
+ ANNOTATED_FIELDS type string value 'annotated_fields',
+ ANNOTATEDFIELDS type string value 'annotatedFields',
+ 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',
+ INPUTTERMS type string value 'inputTerms',
+ EXPANDED_TERMS type string value 'expanded_terms',
+ EXPANDEDTERMS type string value 'expandedTerms',
+ 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',
+ SITECOLLECTIONS type string value 'siteCollections',
+ 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',
+ TOKENIZATIONRULES type string value 'tokenizationRules',
+ 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',
+ SOURCE_CRAWL type string value 'source_crawl',
+ DEFINED type string value 'defined',
+ 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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+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_header = c_boolean_true.
+ elseif lv_auth_method eq 'ICP4D'.
+ e_request_prop-auth_name = 'ICP4D'.
+ e_request_prop-auth_type = 'apiKey'.
+ e_request_prop-auth_headername = 'Authorization'.
+ e_request_prop-auth_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/discovery/api'.
+
+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 = '20200210092816'.
+
+ 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_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT.
+ 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_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="metadata"' ##NO_TEXT.
+ 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.
+
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Private Method ZCL_IBMC_DISCOVERY_V1->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_discovery_v1.clas.xml b/src/zcl_ibmc_discovery_v1.clas.xml
new file mode 100644
index 0000000..9387c1e
--- /dev/null
+++ b/src/zcl_ibmc_discovery_v1.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_DISCOVERY_V1
+ E
+ Watson Discovery V1
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_lang_translator_v3.clas.abap b/src/zcl_ibmc_lang_translator_v3.clas.abap
new file mode 100644
index 0000000..08e1991
--- /dev/null
+++ b/src/zcl_ibmc_lang_translator_v3.clas.abap
@@ -0,0 +1,1463 @@
+* 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.
+"! 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.
+class ZCL_IBMC_LANG_TRANSLATOR_V3 DEFINITION
+ public
+ inheriting from ZCL_IBMC_SERVICE_EXT
+ create public .
+
+public section.
+ types:
+ "! A globally unique string that identifies the underlying model that is used for
+ "! translation.
+ T_MODEL_ID type String.
+ types:
+ "! No documentation available.
+ begin of T_IDENTIFIABLE_LANGUAGE,
+ "! The language code for an identifiable language.
+ LANGUAGE type STRING,
+ "! The name of the identifiable language.
+ NAME type STRING,
+ end of T_IDENTIFIABLE_LANGUAGE.
+ types:
+ "! No documentation available.
+ begin of T_IDENTIFIABLE_LANGUAGES,
+ "! A list of all languages that the service can identify.
+ LANGUAGES type STANDARD TABLE OF T_IDENTIFIABLE_LANGUAGE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_IDENTIFIABLE_LANGUAGES.
+ types:
+ "! No documentation available.
+ begin of T_TRANSLATION,
+ "! Translation output in UTF-8.
+ TRANSLATION type STRING,
+ end of T_TRANSLATION.
+ types:
+ "! No documentation available.
+ begin of T_TRANSLATION_RESULT,
+ "! An estimate of the number of words in the input text.
+ WORD_COUNT type INTEGER,
+ "! Number of characters in the input text.
+ CHARACTER_COUNT type INTEGER,
+ "! List of translation output in UTF-8, corresponding to the input text entries.
+ TRANSLATIONS type STANDARD TABLE OF T_TRANSLATION WITH NON-UNIQUE DEFAULT KEY,
+ end of T_TRANSLATION_RESULT.
+ types:
+ "! No documentation available.
+ begin of T_IDENTIFIED_LANGUAGE,
+ "! The language code for an identified language.
+ LANGUAGE type STRING,
+ "! The confidence score for the identified language.
+ CONFIDENCE type DOUBLE,
+ end of T_IDENTIFIED_LANGUAGE.
+ types:
+ "! No documentation available.
+ begin of T_IDENTIFIED_LANGUAGES,
+ "! A ranking of identified languages with confidence scores.
+ LANGUAGES type STANDARD TABLE OF T_IDENTIFIED_LANGUAGE WITH NON-UNIQUE DEFAULT KEY,
+ end of T_IDENTIFIED_LANGUAGES.
+ types:
+ "! Translation target language code.
+ T_TARGET type String.
+ types:
+ "! The status of the translation job associated with a submitted document.
+ T_TRANSLATION_STATUS type String.
+ types:
+ "! Document information, including translation status.
+ begin of T_DOCUMENT_STATUS,
+ "! System generated ID identifying a document being translated using one specific
+ "! translation model.
+ DOCUMENT_ID type STRING,
+ "! filename from the submission (if it was missing in the multipart-form,
+ "! 'noname.<ext matching content type>' is used.
+ FILENAME type STRING,
+ "! The status of the translation job associated with a submitted document.
+ STATUS type STRING,
+ "! A globally unique string that identifies the underlying model that is used for
+ "! translation.
+ 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.
+ BASE_MODEL_ID type STRING,
+ "! Translation source language code.
+ SOURCE type STRING,
+ "! Translation target language code.
+ TARGET type STRING,
+ "! The time when the document was submitted.
+ CREATED type DATETIME,
+ "! The time when the translation completed.
+ COMPLETED type DATETIME,
+ "! An estimate of the number of words in the source document. Returned only if
+ "! `status` is `available`.
+ WORD_COUNT type INTEGER,
+ "! The number of characters in the source document, present only if
+ "! status=available.
+ CHARACTER_COUNT type INTEGER,
+ end of T_DOCUMENT_STATUS.
+ types:
+ "! No documentation available.
+ begin of T_ERROR_RESPONSE,
+ "! The http error code.
+ CODE type INTEGER,
+ "! A short description of the error.
+ ERROR type STRING,
+ end of T_ERROR_RESPONSE.
+ types:
+ "! Translation source language code.
+ T_SOURCE type String.
+ types:
+ "! No documentation available.
+ begin of T_INLINE_OBJECT1,
+ "! The model to use for translation. `model_id` or both `source` and `target` are
+ "! required.
+ MODEL_ID type STRING,
+ "! Language code that specifies the language of the source document.
+ SOURCE type STRING,
+ "! Language code that specifies the target language for translation.
+ TARGET type STRING,
+ "! To use a previously submitted document as the source for a new translation,
+ "! enter the `document_id` of the document.
+ DOCUMENT_ID type STRING,
+ "! The contents of the source file to translate.
+ "!
+ "! [Supported file
+ "! types](https://cloud.ibm.com/docs/services/language-translator?topic=language-t
+ "! ranslator-document-translator-tutorial#supported-file-formats)
+ "!
+ "! Maximum file size: **20 MB**.
+ FILE type FILE,
+ end of T_INLINE_OBJECT1.
+ types:
+ "! No documentation available.
+ begin of T_INLINE_OBJECT,
+ "! A TMX file with your customizations. The customizations in the file completely
+ "! overwrite the domain translaton data, including high frequency or high
+ "! confidence phrase translations. You can upload only one glossary with a file
+ "! size less than 10 MB per call. A forced glossary should contain single words or
+ "! short phrases.
+ FORCED_GLOSSARY type FILE,
+ "! A TMX file with parallel sentences for source and target language. You can
+ "! upload multiple parallel_corpus files in one request. All uploaded
+ "! parallel_corpus files combined, your parallel corpus must contain at least
+ "! 5,000 parallel sentences to train successfully.
+ PARALLEL_CORPUS type FILE,
+ end of T_INLINE_OBJECT.
+ types:
+ "! Response payload for models.
+ begin of T_TRANSLATION_MODEL,
+ "! A globally unique string that identifies the underlying model that is used for
+ "! translation.
+ MODEL_ID type STRING,
+ "! Optional name that can be specified when the model is created.
+ NAME type STRING,
+ "! Translation source language code.
+ SOURCE type STRING,
+ "! Translation target language code.
+ TARGET 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 an empty string.
+ BASE_MODEL_ID type STRING,
+ "! The domain of the translation model.
+ DOMAIN type STRING,
+ "! Whether this model can be used as a base for customization. Customized models
+ "! are not further customizable, and some base models are not customizable.
+ CUSTOMIZABLE type BOOLEAN,
+ "! Whether or not the model is a default model. A default model is the model for a
+ "! given language pair that will be used when that language pair is specified in
+ "! the source and target parameters.
+ DEFAULT_MODEL type BOOLEAN,
+ "! Either an empty string, indicating the model is not a custom model, or the ID of
+ "! the service instance that created the model.
+ OWNER type STRING,
+ "! Availability of a model.
+ STATUS type STRING,
+ end of T_TRANSLATION_MODEL.
+ types:
+ "! The response type for listing existing translation models.
+ begin of T_TRANSLATION_MODELS,
+ "! An array of available models.
+ MODELS type STANDARD TABLE OF T_TRANSLATION_MODEL WITH NON-UNIQUE DEFAULT KEY,
+ end of T_TRANSLATION_MODELS.
+ types:
+ "! 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.
+ T_BASE_MODEL_ID type String.
+ types:
+ "! System generated ID identifying a document being translated using one specific
+ "! translation model.
+ T_DOCUMENT_ID type String.
+ types:
+ "! No documentation available.
+ begin of T_TRANSLATE_REQUEST,
+ "! Input text in UTF-8 encoding. Multiple entries will result in multiple
+ "! translations in the response.
+ TEXT type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ "! A globally unique string that identifies the underlying model that is used for
+ "! translation.
+ MODEL_ID type STRING,
+ "! Translation source language code.
+ SOURCE type STRING,
+ "! Translation target language code.
+ TARGET type STRING,
+ end of T_TRANSLATE_REQUEST.
+ types:
+ "! No documentation available.
+ begin of T_DELETE_MODEL_RESULT,
+ "! "OK" indicates that the model was successfully deleted.
+ STATUS type STRING,
+ end of T_DELETE_MODEL_RESULT.
+ types:
+ "! No documentation available.
+ begin of T_DOCUMENT_LIST,
+ "! An array of all previously submitted documents.
+ DOCUMENTS type STANDARD TABLE OF T_DOCUMENT_STATUS WITH NON-UNIQUE DEFAULT KEY,
+ end of T_DOCUMENT_LIST.
+
+constants:
+ begin of C_REQUIRED_FIELDS,
+ T_IDENTIFIABLE_LANGUAGE type string value '|LANGUAGE|NAME|',
+ T_IDENTIFIABLE_LANGUAGES type string value '|LANGUAGES|',
+ T_TRANSLATION type string value '|TRANSLATION|',
+ T_TRANSLATION_RESULT type string value '|WORD_COUNT|CHARACTER_COUNT|TRANSLATIONS|',
+ T_IDENTIFIED_LANGUAGE type string value '|LANGUAGE|CONFIDENCE|',
+ T_IDENTIFIED_LANGUAGES type string value '|LANGUAGES|',
+ T_DOCUMENT_STATUS type string value '|DOCUMENT_ID|FILENAME|STATUS|MODEL_ID|SOURCE|TARGET|CREATED|',
+ T_ERROR_RESPONSE type string value '|CODE|ERROR|',
+ T_INLINE_OBJECT1 type string value '|FILE|',
+ T_INLINE_OBJECT type string value '|',
+ T_TRANSLATION_MODEL type string value '|MODEL_ID|',
+ T_TRANSLATION_MODELS type string value '|MODELS|',
+ T_TRANSLATE_REQUEST type string value '|TEXT|',
+ T_DELETE_MODEL_RESULT type string value '|STATUS|',
+ T_DOCUMENT_LIST type string value '|DOCUMENTS|',
+ __DUMMY type string value SPACE,
+ end of C_REQUIRED_FIELDS .
+
+constants:
+ begin of C_ABAPNAME_DICTIONARY,
+ DOCUMENTS type string value 'documents',
+ DOCUMENT_ID type string value 'document_id',
+ FILENAME type string value 'filename',
+ STATUS type string value 'status',
+ MODEL_ID type string value 'model_id',
+ BASE_MODEL_ID type string value 'base_model_id',
+ SOURCE type string value 'source',
+ TARGET type string value 'target',
+ CREATED type string value 'created',
+ COMPLETED type string value 'completed',
+ WORD_COUNT type string value 'word_count',
+ CHARACTER_COUNT type string value 'character_count',
+ MODELS type string value 'models',
+ NAME type string value 'name',
+ DOMAIN type string value 'domain',
+ CUSTOMIZABLE type string value 'customizable',
+ DEFAULT_MODEL type string value 'default_model',
+ OWNER type string value 'owner',
+ TEXT type string value 'text',
+ TRANSLATIONS type string value 'translations',
+ TRANSLATION type string value 'translation',
+ LANGUAGES type string value 'languages',
+ LANGUAGE type string value 'language',
+ CONFIDENCE type string value 'confidence',
+ CODE type string value 'code',
+ ERROR type string value 'error',
+ FORCED_GLOSSARY type string value 'forced_glossary',
+ PARALLEL_CORPUS type string value 'parallel_corpus',
+ FILE type string value 'file',
+ end of C_ABAPNAME_DICTIONARY .
+
+
+ methods GET_APPNAME
+ redefinition .
+ methods GET_REQUEST_PROP
+ redefinition .
+ methods GET_SDK_VERSION_DATE
+ redefinition .
+
+
+ "! Translate.
+ "!
+ "! @parameter I_REQUEST |
+ "! The translate request containing the text, and either a model ID or source and
+ "! target language pair.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_TRANSLATION_RESULT
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods TRANSLATE
+ importing
+ !I_REQUEST type T_TRANSLATE_REQUEST
+ !I_contenttype type string default 'application/json'
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_TRANSLATION_RESULT
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List identifiable languages.
+ "!
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_IDENTIFIABLE_LANGUAGES
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_IDENTIFIABLE_LANGUAGES
+ importing
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_IDENTIFIABLE_LANGUAGES
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Identify language.
+ "!
+ "! @parameter I_TEXT |
+ "! Input text in UTF-8 format.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_IDENTIFIED_LANGUAGES
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods IDENTIFY
+ importing
+ !I_TEXT type STRING
+ !I_contenttype type string default 'text/plain'
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_IDENTIFIED_LANGUAGES
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List models.
+ "!
+ "! @parameter I_SOURCE |
+ "! Specify a language code to filter results by source language.
+ "! @parameter I_TARGET |
+ "! Specify a language code to filter results by target language.
+ "! @parameter I_DEFAULT |
+ "! If the default parameter isn't specified, the service will return all models
+ "! (default and non-default) for each language pair. To return only default
+ "! models, set this to `true`. To return only non-default models, set this to
+ "! `false`. There is exactly one default model per language pair, the IBM provided
+ "! base model.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_TRANSLATION_MODELS
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_MODELS
+ importing
+ !I_SOURCE type STRING optional
+ !I_TARGET type STRING optional
+ !I_DEFAULT type BOOLEAN optional
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_TRANSLATION_MODELS
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Create model.
+ "!
+ "! @parameter I_BASE_MODEL_ID |
+ "! The model ID of the model to use as the base for customization. To see available
+ "! models, use the `List models` method. Usually all IBM provided models are
+ "! customizable. In addition, all your models that have been created via parallel
+ "! corpus customization, can be further customized with a forced glossary.
+ "! @parameter I_FORCED_GLOSSARY |
+ "! A TMX file with your customizations. The customizations in the file completely
+ "! overwrite the domain translaton data, including high frequency or high
+ "! confidence phrase translations. You can upload only one glossary with a file
+ "! size less than 10 MB per call. A forced glossary should contain single words or
+ "! short phrases.
+ "! @parameter I_PARALLEL_CORPUS |
+ "! A TMX file with parallel sentences for source and target language. You can
+ "! upload multiple parallel_corpus files in one request. All uploaded
+ "! parallel_corpus files combined, your parallel corpus must contain at least
+ "! 5,000 parallel sentences to train successfully.
+ "! @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
+ "! length is 32 characters.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_TRANSLATION_MODEL
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods CREATE_MODEL
+ importing
+ !I_BASE_MODEL_ID type STRING
+ !I_FORCED_GLOSSARY type FILE optional
+ !I_PARALLEL_CORPUS type FILE 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
+ !E_RESPONSE type T_TRANSLATION_MODEL
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete model.
+ "!
+ "! @parameter I_MODEL_ID |
+ "! Model ID of the model to delete.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_DELETE_MODEL_RESULT
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_MODEL
+ importing
+ !I_MODEL_ID type STRING
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_DELETE_MODEL_RESULT
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get model details.
+ "!
+ "! @parameter I_MODEL_ID |
+ "! Model ID of the model to get.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_TRANSLATION_MODEL
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_MODEL
+ importing
+ !I_MODEL_ID type STRING
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_TRANSLATION_MODEL
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List documents.
+ "!
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_DOCUMENT_LIST
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_DOCUMENTS
+ importing
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_DOCUMENT_LIST
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Translate document.
+ "!
+ "! @parameter I_FILE |
+ "! The contents of the source file to translate.
+ "!
+ "! [Supported file
+ "! types](https://cloud.ibm.com/docs/services/language-translator?topic=language-t
+ "! ranslator-document-translator-tutorial#supported-file-formats)
+ "!
+ "! Maximum file size: **20 MB**.
+ "! @parameter I_FILENAME |
+ "! The filename for file.
+ "! @parameter I_FILE_CONTENT_TYPE |
+ "! The content type of file.
+ "! @parameter I_MODEL_ID |
+ "! The model to use for translation. `model_id` or both `source` and `target` are
+ "! required.
+ "! @parameter I_SOURCE |
+ "! Language code that specifies the language of the source document.
+ "! @parameter I_TARGET |
+ "! Language code that specifies the target language for translation.
+ "! @parameter I_DOCUMENT_ID |
+ "! To use a previously submitted document as the source for a new translation,
+ "! enter the `document_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 TRANSLATE_DOCUMENT
+ importing
+ !I_FILE type FILE
+ !I_FILENAME type STRING
+ !I_FILE_CONTENT_TYPE type STRING optional
+ !I_MODEL_ID type STRING optional
+ !I_SOURCE type STRING optional
+ !I_TARGET type STRING optional
+ !I_DOCUMENT_ID type STRING optional
+ !I_contenttype type string default 'multipart/form-data'
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_DOCUMENT_STATUS
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get document status.
+ "!
+ "! @parameter I_DOCUMENT_ID |
+ "! The document 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_DOCUMENT_ID type STRING
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_DOCUMENT_STATUS
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete document.
+ "!
+ "! @parameter I_DOCUMENT_ID |
+ "! Document ID of the document to delete.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods DELETE_DOCUMENT
+ importing
+ !I_DOCUMENT_ID type STRING
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Get translated document.
+ "!
+ "! @parameter I_DOCUMENT_ID |
+ "! The document ID of the document that was submitted for translation.
+ "! @parameter I_ACCEPT |
+ "! The type of the response: application/powerpoint, application/mspowerpoint,
+ "! application/x-rtf, application/json, application/xml, application/vnd.ms-excel,
+ "! application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
+ "! application/vnd.ms-powerpoint,
+ "! application/vnd.openxmlformats-officedocument.presentationml.presentation,
+ "! application/msword,
+ "! application/vnd.openxmlformats-officedocument.wordprocessingml.document,
+ "! application/vnd.oasis.opendocument.spreadsheet,
+ "! application/vnd.oasis.opendocument.presentation,
+ "! application/vnd.oasis.opendocument.text, application/pdf, application/rtf,
+ "! text/html, text/json, text/plain, text/richtext, text/rtf, or text/xml. A
+ "! character encoding can be specified by including a `charset` parameter. For
+ "! example, 'text/html;charset=utf-8'.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type FILE
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods GET_TRANSLATED_DOCUMENT
+ importing
+ !I_DOCUMENT_ID type STRING
+ !I_ACCEPT type STRING optional
+ exporting
+ !E_RESPONSE type FILE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+
+protected section.
+
+private section.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+ENDCLASS.
+
+class ZCL_IBMC_LANG_TRANSLATOR_V3 IMPLEMENTATION.
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_LANG_TRANSLATOR_V3->GET_APPNAME
+* +-------------------------------------------------------------------------------------------------+
+* | [<-()] E_APPNAME TYPE STRING
+* +--------------------------------------------------------------------------------------
+ method GET_APPNAME.
+
+ e_appname = 'Language Translator'.
+
+ endmethod.
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Protected Method ZCL_IBMC_LANG_TRANSLATOR_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_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/language-translator/api'.
+
+endmethod.
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_LANG_TRANSLATOR_V3->GET_SDK_VERSION_DATE
+* +-------------------------------------------------------------------------------------------------+
+* | [<-()] E_SDK_VERSION_DATE TYPE STRING
+* +--------------------------------------------------------------------------------------
+ method get_sdk_version_date.
+
+ e_sdk_version_date = '20200210092819'.
+
+ endmethod.
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_LANG_TRANSLATOR_V3->TRANSLATE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_REQUEST TYPE T_TRANSLATE_REQUEST
+* | [--->] I_contenttype TYPE string (default ='application/json')
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_TRANSLATION_RESULT
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method TRANSLATE.
+
+ 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/translate'.
+
+ " 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*' 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_LANG_TRANSLATOR_V3->LIST_IDENTIFIABLE_LANGUAGES
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_IDENTIFIABLE_LANGUAGES
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_IDENTIFIABLE_LANGUAGES.
+
+ 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/identifiable_languages'.
+
+ " 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_LANG_TRANSLATOR_V3->IDENTIFY
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_TEXT TYPE STRING
+* | [--->] I_contenttype TYPE string (default ='text/plain')
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_IDENTIFIED_LANGUAGES
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method IDENTIFY.
+
+ 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/identify'.
+
+ " 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_TEXT ).
+
+ 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_TEXT i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ).
+ else.
+ lv_bodyparam = abap_to_json( i_name = 'text' i_value = i_TEXT ).
+ endif.
+ lv_body = lv_body && lv_separator && lv_bodyparam.
+ else.
+ assign i_TEXT 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_LANG_TRANSLATOR_V3->LIST_MODELS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_SOURCE TYPE STRING(optional)
+* | [--->] I_TARGET TYPE STRING(optional)
+* | [--->] I_DEFAULT TYPE BOOLEAN(optional)
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_TRANSLATION_MODELS
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_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 = '/v3/models'.
+
+ " 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_SOURCE is supplied.
+ lv_queryparam = escape( val = i_SOURCE format = cl_abap_format=>e_uri_full ).
+ add_query_parameter(
+ exporting
+ i_parameter = `source`
+ i_value = lv_queryparam
+ changing
+ c_url = ls_request_prop-url ) ##NO_TEXT.
+ endif.
+
+ if i_TARGET is supplied.
+ lv_queryparam = escape( val = i_TARGET format = cl_abap_format=>e_uri_full ).
+ add_query_parameter(
+ exporting
+ i_parameter = `target`
+ i_value = lv_queryparam
+ changing
+ c_url = ls_request_prop-url ) ##NO_TEXT.
+ endif.
+
+ if i_DEFAULT is supplied.
+ lv_queryparam = i_DEFAULT.
+ add_query_parameter(
+ exporting
+ i_parameter = `default`
+ 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_LANG_TRANSLATOR_V3->CREATE_MODEL
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_BASE_MODEL_ID TYPE STRING
+* | [--->] I_FORCED_GLOSSARY TYPE FILE(optional)
+* | [--->] I_PARALLEL_CORPUS TYPE FILE(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
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method CREATE_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/models'.
+
+ " 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_BASE_MODEL_ID format = cl_abap_format=>e_uri_full ).
+ add_query_parameter(
+ exporting
+ i_parameter = `base_model_id`
+ i_value = lv_queryparam
+ changing
+ c_url = ls_request_prop-url ) ##NO_TEXT.
+
+ 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.
+
+
+
+ " 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_FORCED_GLOSSARY is initial.
+ lv_extension = get_file_extension( I_FORCED_GLOSSARY_CT ).
+ 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_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_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_disposition = lv_value.
+ ls_form_part-xdata = i_PARALLEL_CORPUS.
+ 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_LANG_TRANSLATOR_V3->DELETE_MODEL
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_MODEL_ID TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_DELETE_MODEL_RESULT
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method DELETE_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/models/{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_LANG_TRANSLATOR_V3->GET_MODEL
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_MODEL_ID TYPE STRING
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_TRANSLATION_MODEL
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_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/models/{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_LANG_TRANSLATOR_V3->LIST_DOCUMENTS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_DOCUMENT_LIST
+* | [!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 = '/v3/documents'.
+
+ " 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_LANG_TRANSLATOR_V3->TRANSLATE_DOCUMENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_FILE TYPE FILE
+* | [--->] I_FILENAME TYPE STRING
+* | [--->] I_FILE_CONTENT_TYPE TYPE STRING(optional)
+* | [--->] I_MODEL_ID TYPE STRING(optional)
+* | [--->] I_SOURCE TYPE STRING(optional)
+* | [--->] I_TARGET TYPE STRING(optional)
+* | [--->] I_DOCUMENT_ID TYPE STRING(optional)
+* | [--->] I_contenttype TYPE string (default ='multipart/form-data')
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_DOCUMENT_STATUS
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method TRANSLATE_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 = '/v3/documents'.
+
+ " 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_MODEL_ID is initial.
+ clear ls_form_part.
+ ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="model_id"' ##NO_TEXT.
+ lv_formdata = i_MODEL_ID.
+ ls_form_part-cdata = lv_formdata.
+ append ls_form_part to lt_form_part.
+ endif.
+
+ if not i_SOURCE is initial.
+ clear ls_form_part.
+ ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="source"' ##NO_TEXT.
+ lv_formdata = i_SOURCE.
+ ls_form_part-cdata = lv_formdata.
+ append ls_form_part to lt_form_part.
+ endif.
+
+ if not i_TARGET is initial.
+ clear ls_form_part.
+ ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="target"' ##NO_TEXT.
+ lv_formdata = i_TARGET.
+ ls_form_part-cdata = lv_formdata.
+ append ls_form_part to lt_form_part.
+ endif.
+
+ if not i_DOCUMENT_ID is initial.
+ clear ls_form_part.
+ ls_form_part-content_type = ZIF_IBMC_SERVICE_ARCH~C_MEDIATYPE-TEXT_PLAIN.
+ ls_form_part-content_disposition = 'form-data; name="document_id"' ##NO_TEXT.
+ lv_formdata = i_DOCUMENT_ID.
+ 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_LANG_TRANSLATOR_V3->GET_DOCUMENT_STATUS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] 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 = '/v3/documents/{document_id}'.
+ 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_LANG_TRANSLATOR_V3->DELETE_DOCUMENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_DOCUMENT_ID TYPE STRING
+* | [!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 = '/v3/documents/{document_id}'.
+ replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_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_LANG_TRANSLATOR_V3->GET_TRANSLATED_DOCUMENT
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_DOCUMENT_ID TYPE STRING
+* | [--->] I_ACCEPT TYPE STRING(optional)
+* | [<---] E_RESPONSE TYPE FILE
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method GET_TRANSLATED_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 = '/v3/documents/{document_id}/translated_document'.
+ replace all occurrences of `{document_id}` in ls_request_prop-url-path with i_DOCUMENT_ID ignoring case.
+
+ " standard headers
+ set_default_query_parameters(
+ changing
+ c_url = ls_request_prop-url ).
+
+
+
+ " process header parameters
+ data:
+ lv_headerparam type string ##NEEDED.
+
+ if i_ACCEPT is supplied.
+ lv_headerparam = I_ACCEPT.
+ add_header_parameter(
+ exporting
+ i_parameter = 'Accept'
+ i_value = lv_headerparam
+ changing
+ c_headers = ls_request_prop-headers ) ##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 Private Method ZCL_IBMC_LANG_TRANSLATOR_V3->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_lang_translator_v3.clas.xml b/src/zcl_ibmc_lang_translator_v3.clas.xml
new file mode 100644
index 0000000..6f47e3f
--- /dev/null
+++ b/src/zcl_ibmc_lang_translator_v3.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_LANG_TRANSLATOR_V3
+ E
+ IBM Watson Language Translator
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_nat_lang_class_v1.clas.abap b/src/zcl_ibmc_nat_lang_class_v1.clas.abap
new file mode 100644
index 0000000..b1cc5d2
--- /dev/null
+++ b/src/zcl_ibmc_nat_lang_class_v1.clas.abap
@@ -0,0 +1,792 @@
+* 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:
+ 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:
+ 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',
+ CLASSIFYINPUT type string value 'classifyInput',
+ 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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+ "!
+ "! @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.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+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_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/natural-language-classifier/api'.
+
+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 = '20200210092820'.
+
+ 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.
+
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Private Method ZCL_IBMC_NAT_LANG_CLASS_V1->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_nat_lang_class_v1.clas.xml b/src/zcl_ibmc_nat_lang_class_v1.clas.xml
new file mode 100644
index 0000000..16dc6d9
--- /dev/null
+++ b/src/zcl_ibmc_nat_lang_class_v1.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_NAT_LANG_CLASS_V1
+ E
+ IBM Watson Natural Language Classifier
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
new file mode 100644
index 0000000..ff67b55
--- /dev/null
+++ b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
@@ -0,0 +1,1320 @@
+* 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 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
+"! by default, so the results can ignore most advertisements and other unwanted
+"! content.
+"!
+"! You can create [custom
+"! models](https://cloud.ibm.com/docs/services/natural-language-understanding?topi
+"! c=natural-language-understanding-customizing) with Watson Knowledge Studio to
+"! detect custom entities and relations in Natural Language Understanding.
+class ZCL_IBMC_NAT_LANG_UNDRSTND_V1 DEFINITION
+ public
+ inheriting from ZCL_IBMC_SERVICE_EXT
+ create public .
+
+public section.
+ types:
+ "! No documentation available.
+ begin of T_SEMANTIC_ROLES_ENTITY,
+ "! Entity type.
+ TYPE type STRING,
+ "! The entity text.
+ TEXT type STRING,
+ end of T_SEMANTIC_ROLES_ENTITY.
+ types:
+ "! No documentation available.
+ begin of T_SEMANTIC_ROLES_KEYWORD,
+ "! The keyword text.
+ TEXT type STRING,
+ end of T_SEMANTIC_ROLES_KEYWORD.
+ types:
+ "! The extracted subject from the sentence.
+ begin of T_SMNTC_ROLES_RESULT_SUBJECT,
+ "! Text that corresponds to the subject role.
+ TEXT type STRING,
+ "! An array of extracted entities.
+ ENTITIES type STANDARD TABLE OF T_SEMANTIC_ROLES_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! An array of extracted keywords.
+ KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SMNTC_ROLES_RESULT_SUBJECT.
+ types:
+ "! The extracted object from the sentence.
+ begin of T_SEMANTIC_ROLES_RESULT_OBJECT,
+ "! Object text.
+ TEXT type STRING,
+ "! An array of extracted keywords.
+ KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SEMANTIC_ROLES_RESULT_OBJECT.
+ types:
+ "! No documentation available.
+ begin of T_SEMANTIC_ROLES_VERB,
+ "! The keyword text.
+ TEXT type STRING,
+ "! Verb tense.
+ TENSE type STRING,
+ end of T_SEMANTIC_ROLES_VERB.
+ types:
+ "! The extracted action from the sentence.
+ begin of T_SEMANTIC_ROLES_RESULT_ACTION,
+ "! Analyzed text that corresponds to the action.
+ TEXT type STRING,
+ "! normalized version of the action.
+ NORMALIZED type STRING,
+ "! No documentation available.
+ VERB type T_SEMANTIC_ROLES_VERB,
+ end of T_SEMANTIC_ROLES_RESULT_ACTION.
+ types:
+ "! The object containing the actions and the objects the actions act upon.
+ begin of T_SEMANTIC_ROLES_RESULT,
+ "! Sentence from the source that contains the subject, action, and object.
+ SENTENCE type STRING,
+ "! The extracted subject from the sentence.
+ SUBJECT type T_SMNTC_ROLES_RESULT_SUBJECT,
+ "! The extracted action from the sentence.
+ ACTION type T_SEMANTIC_ROLES_RESULT_ACTION,
+ "! The extracted object from the sentence.
+ OBJECT type T_SEMANTIC_ROLES_RESULT_OBJECT,
+ end of T_SEMANTIC_ROLES_RESULT.
+ types:
+ "! Parses sentences into subject, action, and object form.
+ "!
+ "! Supported languages: English, German, Japanese, Korean, Spanish.
+ begin of T_SEMANTIC_ROLES_OPTIONS,
+ "! Maximum number of semantic_roles results to return.
+ LIMIT type INTEGER,
+ "! Set this to `true` to return keyword information for subjects and objects.
+ KEYWORDS type BOOLEAN,
+ "! Set this to `true` to return entity information for subjects and objects.
+ ENTITIES type BOOLEAN,
+ end of T_SEMANTIC_ROLES_OPTIONS.
+ types:
+ "! Metadata associated with this custom model.
+ begin of T_MODEL_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 MAP,
+ "! The language code of this model.
+ LANGUAGE type STRING,
+ "! An optional description of the model.
+ DESCRIPTION type STRING,
+ "! An optional version string.
+ 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:
+ "! An entity that corresponds with an argument in a relation.
+ begin of T_RELATION_ENTITY,
+ "! Text that corresponds to the entity.
+ TEXT type STRING,
+ "! Entity type.
+ TYPE type STRING,
+ end of T_RELATION_ENTITY.
+ types:
+ "! No documentation available.
+ begin of T_RELATION_ARGUMENT,
+ "! An array of extracted entities.
+ ENTITIES type STANDARD TABLE OF T_RELATION_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! Character offsets indicating the beginning and end of the mention in the
+ "! analyzed text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ "! Text that corresponds to the argument.
+ TEXT type STRING,
+ end of T_RELATION_ARGUMENT.
+ types:
+ "! The relations between entities found in the content.
+ begin of T_RELATIONS_RESULT,
+ "! Confidence score for the relation. Higher values indicate greater confidence.
+ SCORE type DOUBLE,
+ "! The sentence that contains the relation.
+ SENTENCE type STRING,
+ "! The type of the relation.
+ TYPE type STRING,
+ "! Entity mentions that are involved in the relation.
+ ARGUMENTS type STANDARD TABLE OF T_RELATION_ARGUMENT WITH NON-UNIQUE DEFAULT KEY,
+ end of T_RELATIONS_RESULT.
+ types:
+ "! No documentation available.
+ begin of T_MODEL,
+ "! When the status is `available`, the model is ready to use.
+ STATUS type STRING,
+ "! Unique model ID.
+ MODEL_ID type STRING,
+ "! ISO 639-1 code indicating the language of the model.
+ LANGUAGE type STRING,
+ "! Model description.
+ DESCRIPTION type STRING,
+ "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural
+ "! Language Understanding.
+ WORKSPACE_ID type STRING,
+ "! The model version, if it was manually provided in Watson Knowledge Studio.
+ VERSION type STRING,
+ "! The description of the version, if it was manually provided in Watson Knowledge
+ "! Studio.
+ VERSION_DESCRIPTION type STRING,
+ "! A dateTime indicating when the model was created.
+ CREATED type DATETIME,
+ end of T_MODEL.
+ types:
+ "! No documentation available.
+ begin of T_FEATURE_SENTIMENT_RESULTS,
+ "! Sentiment score from -1 (negative) to 1 (positive).
+ SCORE type DOUBLE,
+ end of T_FEATURE_SENTIMENT_RESULTS.
+ types:
+ "! No documentation available.
+ begin of T_EMOTION_SCORES,
+ "! Anger score from 0 to 1. A higher score means that the text is more likely to
+ "! convey anger.
+ ANGER type DOUBLE,
+ "! Disgust score from 0 to 1. A higher score means that the text is more likely to
+ "! convey disgust.
+ DISGUST type DOUBLE,
+ "! Fear score from 0 to 1. A higher score means that the text is more likely to
+ "! convey fear.
+ FEAR type DOUBLE,
+ "! Joy score from 0 to 1. A higher score means that the text is more likely to
+ "! convey joy.
+ JOY type DOUBLE,
+ "! Sadness score from 0 to 1. A higher score means that the text is more likely to
+ "! convey sadness.
+ SADNESS type DOUBLE,
+ end of T_EMOTION_SCORES.
+ types:
+ "! The author of the analyzed content.
+ begin of T_AUTHOR,
+ "! Name of the author.
+ NAME type STRING,
+ end of T_AUTHOR.
+ types:
+ "! RSS or ATOM feed found on the webpage.
+ begin of T_FEED,
+ "! URL of the RSS or ATOM feed.
+ LINK type STRING,
+ end of T_FEED.
+ types:
+ "! Webpage metadata, such as the author and the title of the page.
+ begin of T_FEATURES_RESULTS_METADATA,
+ "! The authors of the document.
+ AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY,
+ "! The publication date in the format ISO 8601.
+ PUBLICATION_DATE type STRING,
+ "! The title of the document.
+ TITLE type STRING,
+ "! URL of a prominent image on the webpage.
+ IMAGE type STRING,
+ "! RSS/ATOM feeds found on the webpage.
+ FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY,
+ end of T_FEATURES_RESULTS_METADATA.
+ types:
+ "! No documentation available.
+ begin of T_ENTITY_MENTION,
+ "! Entity mention text.
+ TEXT type STRING,
+ "! Character offsets indicating the beginning and end of the mention in the
+ "! analyzed text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ "! Confidence in the entity identification from 0 to 1. Higher values indicate
+ "! higher confidence. In standard entities requests, confidence is returned only
+ "! for English text. All entities requests that use custom models return the
+ "! confidence score.
+ CONFIDENCE type DOUBLE,
+ end of T_ENTITY_MENTION.
+ types:
+ "! Disambiguation information for the entity.
+ begin of T_DISAMBIGUATION_RESULT,
+ "! Common entity name.
+ NAME type STRING,
+ "! Link to the corresponding DBpedia resource.
+ DBPEDIA_RESOURCE type STRING,
+ "! Entity subtype information.
+ SUBTYPE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ end of T_DISAMBIGUATION_RESULT.
+ types:
+ "! The important people, places, geopolitical entities and other types of entities
+ "! in your content.
+ begin of T_ENTITIES_RESULT,
+ "! Entity type.
+ TYPE type STRING,
+ "! The name of the entity.
+ TEXT type STRING,
+ "! Relevance score from 0 to 1. Higher values indicate greater relevance.
+ RELEVANCE type DOUBLE,
+ "! Confidence in the entity identification from 0 to 1. Higher values indicate
+ "! higher confidence. In standard entities requests, confidence is returned only
+ "! for English text. All entities requests that use custom models return the
+ "! confidence score.
+ CONFIDENCE type DOUBLE,
+ "! Entity mentions and locations.
+ MENTIONS type STANDARD TABLE OF T_ENTITY_MENTION WITH NON-UNIQUE DEFAULT KEY,
+ "! How many times the entity was mentioned in the text.
+ COUNT type INTEGER,
+ "! Emotion analysis results for the entity, enabled with the `emotion` option.
+ EMOTION type T_EMOTION_SCORES,
+ "! Sentiment analysis results for the entity, enabled with the `sentiment` option.
+ SENTIMENT type T_FEATURE_SENTIMENT_RESULTS,
+ "! Disambiguation information for the entity.
+ DISAMBIGUATION type T_DISAMBIGUATION_RESULT,
+ end of T_ENTITIES_RESULT.
+ types:
+ "! Emotion results for a specified target.
+ begin of T_TARGETED_EMOTION_RESULTS,
+ "! Targeted text.
+ TEXT type STRING,
+ "! The emotion results for the target.
+ EMOTION type T_EMOTION_SCORES,
+ end of T_TARGETED_EMOTION_RESULTS.
+ types:
+ "! The important keywords in the content, organized by relevance.
+ begin of T_KEYWORDS_RESULT,
+ "! Number of times the keyword appears in the analyzed text.
+ COUNT type INTEGER,
+ "! Relevance score from 0 to 1. Higher values indicate greater relevance.
+ RELEVANCE type DOUBLE,
+ "! The keyword text.
+ TEXT type STRING,
+ "! Emotion analysis results for the keyword, enabled with the `emotion` option.
+ EMOTION type T_EMOTION_SCORES,
+ "! Sentiment analysis results for the keyword, enabled with the `sentiment` option.
+ "!
+ SENTIMENT type T_FEATURE_SENTIMENT_RESULTS,
+ end of T_KEYWORDS_RESULT.
+ types:
+ "! No documentation available.
+ begin of T_TARGETED_SENTIMENT_RESULTS,
+ "! Targeted text.
+ TEXT type STRING,
+ "! Sentiment score from -1 (negative) to 1 (positive).
+ SCORE type DOUBLE,
+ end of T_TARGETED_SENTIMENT_RESULTS.
+ types:
+ "! Relevant text that contributed to the categorization.
+ begin of T_CATEGORIES_RELEVANT_TEXT,
+ "! Text from the analyzed source that supports the categorization.
+ TEXT type STRING,
+ end of T_CATEGORIES_RELEVANT_TEXT.
+ types:
+ "! Emotion results for the document as a whole.
+ begin of T_DOCUMENT_EMOTION_RESULTS,
+ "! Emotion results for the document as a whole.
+ EMOTION type T_EMOTION_SCORES,
+ end of T_DOCUMENT_EMOTION_RESULTS.
+ types:
+ "! No documentation available.
+ begin of T_DOCUMENT_SENTIMENT_RESULTS,
+ "! Indicates whether the sentiment is positive, neutral, or negative.
+ LABEL type STRING,
+ "! Sentiment score from -1 (negative) to 1 (positive).
+ SCORE type DOUBLE,
+ end of T_DOCUMENT_SENTIMENT_RESULTS.
+ types:
+ "! The sentiment of the content.
+ begin of T_SENTIMENT_RESULT,
+ "! The document level sentiment.
+ DOCUMENT type T_DOCUMENT_SENTIMENT_RESULTS,
+ "! The targeted sentiment to analyze.
+ TARGETS type STANDARD TABLE OF T_TARGETED_SENTIMENT_RESULTS WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SENTIMENT_RESULT.
+ types:
+ "! No documentation available.
+ begin of T_TOKEN_RESULT,
+ "! The token as it appears in the analyzed text.
+ TEXT type STRING,
+ "! The part of speech of the token. For descriptions of the values, see [Universal
+ "! Dependencies POS tags](https://universaldependencies.org/u/pos/).
+ PART_OF_SPEECH type STRING,
+ "! Character offsets indicating the beginning and end of the token in the analyzed
+ "! text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ "! The [lemma](https://wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
+ LEMMA type STRING,
+ end of T_TOKEN_RESULT.
+ types:
+ "! No documentation available.
+ begin of T_SENTENCE_RESULT,
+ "! The sentence.
+ TEXT type STRING,
+ "! Character offsets indicating the beginning and end of the sentence in the
+ "! analyzed text.
+ LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SENTENCE_RESULT.
+ types:
+ "! Tokens and sentences returned from syntax analysis.
+ begin of T_SYNTAX_RESULT,
+ "! No documentation available.
+ TOKENS type STANDARD TABLE OF T_TOKEN_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! No documentation available.
+ SENTENCES type STANDARD TABLE OF T_SENTENCE_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SYNTAX_RESULT.
+ types:
+ "! The general concepts referenced or alluded to in the analyzed text.
+ begin of T_CONCEPTS_RESULT,
+ "! Name of the concept.
+ TEXT type STRING,
+ "! Relevance score between 0 and 1. Higher scores indicate greater relevance.
+ RELEVANCE type DOUBLE,
+ "! Link to the corresponding DBpedia resource.
+ DBPEDIA_RESOURCE type STRING,
+ end of T_CONCEPTS_RESULT.
+ types:
+ "! Information that helps to explain what contributed to the categories result.
+ begin of T_CTGRS_RESULT_EXPLANATION,
+ "! An array of relevant text from the source that contributed to the
+ "! categorization. The sorted array begins with the phrase that contributed most
+ "! significantly to the result, followed by phrases that were less and less
+ "! impactful.
+ RELEVANT_TEXT type STANDARD TABLE OF T_CATEGORIES_RELEVANT_TEXT WITH NON-UNIQUE DEFAULT KEY,
+ end of T_CTGRS_RESULT_EXPLANATION.
+ types:
+ "! A categorization of the analyzed text.
+ begin of T_CATEGORIES_RESULT,
+ "! The path to the category through the 5-level taxonomy hierarchy. For the
+ "! complete list of categories, see the [Categories
+ "! hierarchy](https://cloud.ibm.com/docs/services/natural-language-understanding?t
+ "! opic=natural-language-understanding-categories#categories-hierarchy)
+ "! documentation.
+ LABEL type STRING,
+ "! Confidence score for the category classification. Higher values indicate greater
+ "! confidence.
+ SCORE type DOUBLE,
+ "! Information that helps to explain what contributed to the categories result.
+ EXPLANATION type T_CTGRS_RESULT_EXPLANATION,
+ end of T_CATEGORIES_RESULT.
+ types:
+ "! 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.
+ begin of T_EMOTION_RESULT,
+ "! Emotion results for the document as a whole.
+ DOCUMENT type T_DOCUMENT_EMOTION_RESULTS,
+ "! Emotion results for specified targets.
+ TARGETS type STANDARD TABLE OF T_TARGETED_EMOTION_RESULTS WITH NON-UNIQUE DEFAULT KEY,
+ end of T_EMOTION_RESULT.
+ types:
+ "! Analysis results for each requested feature.
+ begin of T_FEATURES_RESULTS,
+ "! The general concepts referenced or alluded to in the analyzed text.
+ CONCEPTS type STANDARD TABLE OF T_CONCEPTS_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! The entities detected in the analyzed text.
+ ENTITIES type STANDARD TABLE OF T_ENTITIES_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! The keywords from the analyzed text.
+ 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 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.
+ METADATA type T_FEATURES_RESULTS_METADATA,
+ "! The relationships between entities in the content.
+ RELATIONS type STANDARD TABLE OF T_RELATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! Sentences parsed into `subject`, `action`, and `object` form.
+ SEMANTIC_ROLES type STANDARD TABLE OF T_SEMANTIC_ROLES_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! The sentiment of the content.
+ SENTIMENT type T_SENTIMENT_RESULT,
+ "! Tokens and sentences returned from syntax analysis.
+ SYNTAX type T_SYNTAX_RESULT,
+ end of T_FEATURES_RESULTS.
+ types:
+ "! The authors, publication date, title, prominent page image, and RSS/ATOM feeds
+ "! of the webpage. Supports URL and HTML input types.
+ begin of T_METADATA_RESULT,
+ "! The authors of the document.
+ AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY,
+ "! The publication date in the format ISO 8601.
+ PUBLICATION_DATE type STRING,
+ "! The title of the document.
+ TITLE type STRING,
+ "! URL of a prominent image on the webpage.
+ IMAGE type STRING,
+ "! RSS/ATOM feeds found on the webpage.
+ FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY,
+ end of T_METADATA_RESULT.
+ 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:
+ "! 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.
+ begin of T_EMOTION_OPTIONS,
+ "! Set this to `false` to hide document-level emotion results.
+ DOCUMENT type BOOLEAN,
+ "! Emotion results will be returned for each target string that is found in the
+ "! document.
+ TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ end of T_EMOTION_OPTIONS.
+ types:
+ "! Usage information.
+ begin of T_USAGE,
+ "! Number of features used in the API call.
+ FEATURES type INTEGER,
+ "! Number of text characters processed.
+ TEXT_CHARACTERS type INTEGER,
+ "! Number of 10,000-character units processed.
+ TEXT_UNITS type INTEGER,
+ end of T_USAGE.
+ types:
+ "! 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.
+ begin of T_SENTIMENT_OPTIONS,
+ "! Set this to `false` to hide document-level sentiment results.
+ DOCUMENT type BOOLEAN,
+ "! Sentiment results will be returned for each target string that is found in the
+ "! document.
+ TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SENTIMENT_OPTIONS.
+ types:
+ "! No documentation available.
+ begin of T_SEMANTIC_ROLES_ACTION,
+ "! Analyzed text that corresponds to the action.
+ TEXT type STRING,
+ "! normalized version of the action.
+ NORMALIZED type STRING,
+ "! No documentation available.
+ VERB type T_SEMANTIC_ROLES_VERB,
+ end of T_SEMANTIC_ROLES_ACTION.
+ types:
+ "! Tokenization options.
+ begin of T_SYNTAX_OPTIONS_TOKENS,
+ "! Set this to `true` to return the lemma for each token.
+ LEMMA type BOOLEAN,
+ "! Set this to `true` to return the part of speech for each token.
+ PART_OF_SPEECH type BOOLEAN,
+ end of T_SYNTAX_OPTIONS_TOKENS.
+ types:
+ "! Returns important keywords in the content.
+ "!
+ "! Supported languages: English, French, German, Italian, Japanese, Korean,
+ "! Portuguese, Russian, Spanish, Swedish.
+ begin of T_KEYWORDS_OPTIONS,
+ "! Maximum number of keywords to return.
+ LIMIT type INTEGER,
+ "! Set this to `true` to return sentiment information for detected keywords.
+ SENTIMENT type BOOLEAN,
+ "! Set this to `true` to analyze emotion for detected keywords.
+ EMOTION type BOOLEAN,
+ end of T_KEYWORDS_OPTIONS.
+ types:
+ "! 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". See [Relation
+ "! types](https://cloud.ibm.com/docs/services/natural-language-understanding?topic
+ "! =natural-language-understanding-relations).
+ "!
+ "! Supported languages: Arabic, English, German, Japanese, Korean, Spanish.
+ "! Chinese, Dutch, French, Italian, and Portuguese custom models are also
+ "! supported.
+ begin of T_RELATIONS_OPTIONS,
+ "! Enter a [custom
+ "! model](https://cloud.ibm.com/docs/services/natural-language-understanding?topic
+ "! =natural-language-understanding-customizing) ID to override the default model.
+ MODEL type STRING,
+ end of T_RELATIONS_OPTIONS.
+ types:
+ "! Identifies people, cities, organizations, and other entities in the content. See
+ "! [Entity types and
+ "! subtypes](https://cloud.ibm.com/docs/services/natural-language-understanding?to
+ "! pic=natural-language-understanding-entity-types).
+ "!
+ "! Supported languages: English, French, German, Italian, Japanese, Korean,
+ "! Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported
+ "! only through custom models.
+ begin of T_ENTITIES_OPTIONS,
+ "! Maximum number of entities to return.
+ LIMIT type INTEGER,
+ "! Set this to `true` to return locations of entity mentions.
+ MENTIONS type BOOLEAN,
+ "! Enter a [custom
+ "! model](https://cloud.ibm.com/docs/services/natural-language-understanding?topic
+ "! =natural-language-understanding-customizing) ID to override the standard entity
+ "! detection model.
+ MODEL type STRING,
+ "! Set this to `true` to return sentiment information for detected entities.
+ SENTIMENT type BOOLEAN,
+ "! Set this to `true` to analyze emotion for detected keywords.
+ EMOTION type BOOLEAN,
+ end of T_ENTITIES_OPTIONS.
+ types:
+ "! 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.
+ begin of T_CONCEPTS_OPTIONS,
+ "! Maximum number of concepts to return.
+ LIMIT type INTEGER,
+ end of T_CONCEPTS_OPTIONS.
+ types:
+ "! 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.
+ T_METADATA_OPTIONS type JSONOBJECT.
+ types:
+ "! Returns tokens and sentences from the input text.
+ begin of T_SYNTAX_OPTIONS,
+ "! Tokenization options.
+ TOKENS type T_SYNTAX_OPTIONS_TOKENS,
+ "! Set this to `true` to return sentence information.
+ SENTENCES type BOOLEAN,
+ end of T_SYNTAX_OPTIONS.
+ types:
+ "! Returns a five-level taxonomy of the content. The top three categories are
+ "! returned.
+ "!
+ "! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean,
+ "! Portuguese, Spanish.
+ begin of T_CATEGORIES_OPTIONS,
+ "! Set this to `true` to return explanations for each categorization. **This is
+ "! available only for English categories.**.
+ EXPLANATION type BOOLEAN,
+ "! Maximum number of categories to return.
+ LIMIT type INTEGER,
+ "! Enter a [custom
+ "! model](https://cloud.ibm.com/docs/services/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 type STRING,
+ end of T_CATEGORIES_OPTIONS.
+ types:
+ "! Analysis features and options.
+ begin of T_FEATURES,
+ "! 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.
+ CONCEPTS type T_CONCEPTS_OPTIONS,
+ "! 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.
+ EMOTION type T_EMOTION_OPTIONS,
+ "! Identifies people, cities, organizations, and other entities in the content. See
+ "! [Entity types and
+ "! subtypes](https://cloud.ibm.com/docs/services/natural-language-understanding?to
+ "! pic=natural-language-understanding-entity-types).
+ "!
+ "! Supported languages: English, French, German, Italian, Japanese, Korean,
+ "! Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported
+ "! only through custom models.
+ ENTITIES type T_ENTITIES_OPTIONS,
+ "! Returns important keywords in the content.
+ "!
+ "! Supported languages: English, French, German, Italian, Japanese, Korean,
+ "! Portuguese, Russian, Spanish, Swedish.
+ KEYWORDS type T_KEYWORDS_OPTIONS,
+ "! 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.
+ METADATA type T_METADATA_OPTIONS,
+ "! 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". See [Relation
+ "! types](https://cloud.ibm.com/docs/services/natural-language-understanding?topic
+ "! =natural-language-understanding-relations).
+ "!
+ "! Supported languages: Arabic, English, German, Japanese, Korean, Spanish.
+ "! Chinese, Dutch, French, Italian, and Portuguese custom models are also
+ "! supported.
+ RELATIONS type T_RELATIONS_OPTIONS,
+ "! Parses sentences into subject, action, and object form.
+ "!
+ "! Supported languages: English, German, Japanese, Korean, Spanish.
+ SEMANTIC_ROLES type T_SEMANTIC_ROLES_OPTIONS,
+ "! 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.
+ SENTIMENT type T_SENTIMENT_OPTIONS,
+ "! Returns a five-level taxonomy of the content. The top three categories are
+ "! returned.
+ "!
+ "! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean,
+ "! Portuguese, Spanish.
+ CATEGORIES type T_CATEGORIES_OPTIONS,
+ "! Returns tokens and sentences from the input text.
+ SYNTAX type T_SYNTAX_OPTIONS,
+ end of T_FEATURES.
+ types:
+ "! Webpage metadata, such as the author and the title of the page.
+ begin of T_ANALYSIS_RESULTS_METADATA,
+ "! The authors of the document.
+ AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY,
+ "! The publication date in the format ISO 8601.
+ PUBLICATION_DATE type STRING,
+ "! The title of the document.
+ TITLE type STRING,
+ "! URL of a prominent image on the webpage.
+ IMAGE type STRING,
+ "! RSS/ATOM feeds found on the webpage.
+ FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY,
+ end of T_ANALYSIS_RESULTS_METADATA.
+ types:
+ "! API usage information for the request.
+ begin of T_ANALYSIS_RESULTS_USAGE,
+ "! Number of features used in the API call.
+ FEATURES type INTEGER,
+ "! Number of text characters processed.
+ TEXT_CHARACTERS type INTEGER,
+ "! Number of 10,000-character units processed.
+ TEXT_UNITS type INTEGER,
+ end of T_ANALYSIS_RESULTS_USAGE.
+ types:
+ "! Results of the analysis, organized by feature.
+ begin of T_ANALYSIS_RESULTS,
+ "! Language used to analyze the text.
+ LANGUAGE type STRING,
+ "! Text that was used in the analysis.
+ ANALYZED_TEXT type STRING,
+ "! URL of the webpage that was analyzed.
+ RETRIEVED_URL type STRING,
+ "! API usage information for the request.
+ USAGE type T_ANALYSIS_RESULTS_USAGE,
+ "! The general concepts referenced or alluded to in the analyzed text.
+ CONCEPTS type STANDARD TABLE OF T_CONCEPTS_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! The entities detected in the analyzed text.
+ ENTITIES type STANDARD TABLE OF T_ENTITIES_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! The keywords from the analyzed text.
+ 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 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.
+ METADATA type T_ANALYSIS_RESULTS_METADATA,
+ "! The relationships between entities in the content.
+ RELATIONS type STANDARD TABLE OF T_RELATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! Sentences parsed into `subject`, `action`, and `object` form.
+ SEMANTIC_ROLES type STANDARD TABLE OF T_SEMANTIC_ROLES_RESULT WITH NON-UNIQUE DEFAULT KEY,
+ "! The sentiment of the content.
+ SENTIMENT type T_SENTIMENT_RESULT,
+ "! Tokens and sentences returned from syntax analysis.
+ SYNTAX type T_SYNTAX_RESULT,
+ end of T_ANALYSIS_RESULTS.
+ types:
+ "! No documentation available.
+ begin of T_SEMANTIC_ROLES_SUBJECT,
+ "! Text that corresponds to the subject role.
+ TEXT type STRING,
+ "! An array of extracted entities.
+ ENTITIES type STANDARD TABLE OF T_SEMANTIC_ROLES_ENTITY WITH NON-UNIQUE DEFAULT KEY,
+ "! 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:
+ "! Custom models that are available for entities and relations.
+ begin of T_LIST_MODELS_RESULTS,
+ "! An array of available models.
+ MODELS type STANDARD TABLE OF T_MODEL WITH NON-UNIQUE DEFAULT KEY,
+ end of T_LIST_MODELS_RESULTS.
+ types:
+ "! No documentation available.
+ begin of T_SEMANTIC_ROLES_OBJECT,
+ "! Object text.
+ TEXT type STRING,
+ "! An array of extracted keywords.
+ KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY,
+ end of T_SEMANTIC_ROLES_OBJECT.
+ types:
+ "! An object containing request parameters.
+ begin of T_PARAMETERS,
+ "! The plain text to analyze. One of the `text`, `html`, or `url` parameters is
+ "! required.
+ TEXT type STRING,
+ "! The HTML file to analyze. One of the `text`, `html`, or `url` parameters is
+ "! required.
+ HTML type STRING,
+ "! The webpage to analyze. One of the `text`, `html`, or `url` parameters is
+ "! required.
+ URL type STRING,
+ "! Specific features to analyze the document for.
+ FEATURES type T_FEATURES,
+ "! Set this to `false` to disable webpage cleaning. To learn more about webpage
+ "! cleaning, see the [Analyzing
+ "! webpages](https://cloud.ibm.com/docs/services/natural-language-understanding?to
+ "! pic=natural-language-understanding-analyzing-webpages) documentation.
+ CLEAN type BOOLEAN,
+ "! An [XPath
+ "! query](https://cloud.ibm.com/docs/services/natural-language-understanding?topic
+ "! =natural-language-understanding-analyzing-webpages#xpath) to perform on `html`
+ "! or `url` input. Results of the query will be appended to the cleaned webpage
+ "! text before it is analyzed. To analyze only the results of the XPath query, set
+ "! the `clean` parameter to `false`.
+ XPATH type STRING,
+ "! Whether to use raw HTML content if text cleaning fails.
+ FALLBACK_TO_RAW type BOOLEAN,
+ "! Whether or not to return the analyzed text.
+ RETURN_ANALYZED_TEXT type BOOLEAN,
+ "! ISO 639-1 code that specifies the language of your text. This overrides
+ "! automatic language detection. Language support differs depending on the
+ "! features you include in your analysis. See [Language
+ "! support](https://cloud.ibm.com/docs/services/natural-language-understanding?top
+ "! ic=natural-language-understanding-language-support) for more information.
+ LANGUAGE type STRING,
+ "! Sets the maximum number of characters that are processed by the service.
+ LIMIT_TEXT_CHARACTERS type INTEGER,
+ end of T_PARAMETERS.
+ types:
+ "! Link to the corresponding DBpedia resource.
+ T_DBPEDIA_RESOURCE type String.
+ types:
+ "! Metadata associated with this custom model.
+ begin of T_MODEL_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 MAP,
+ "! The language code of this model.
+ LANGUAGE type STRING,
+ "! An optional description of the model.
+ DESCRIPTION type STRING,
+ "! An optional version string.
+ 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,
+ "! No documentation available.
+ FILE type FILE,
+ end of T_MODEL_FILE_AND_METADATA.
+ types:
+ "! Delete model results.
+ begin of T_DELETE_MODEL_RESULTS,
+ "! model_id of the deleted model.
+ DELETED type STRING,
+ end of T_DELETE_MODEL_RESULTS.
+
+constants:
+ begin of C_REQUIRED_FIELDS,
+ T_SEMANTIC_ROLES_ENTITY type string value '|',
+ T_SEMANTIC_ROLES_KEYWORD type string value '|',
+ T_SMNTC_ROLES_RESULT_SUBJECT type string value '|',
+ T_SEMANTIC_ROLES_RESULT_OBJECT type string value '|',
+ T_SEMANTIC_ROLES_VERB type string value '|',
+ T_SEMANTIC_ROLES_RESULT_ACTION type string value '|',
+ T_SEMANTIC_ROLES_RESULT type string value '|',
+ T_SEMANTIC_ROLES_OPTIONS type string value '|',
+ T_MODEL_METADATA type string value '|LANGUAGE|',
+ T_RELATION_ENTITY type string value '|',
+ T_RELATION_ARGUMENT type string value '|',
+ T_RELATIONS_RESULT type string value '|',
+ T_MODEL type string value '|',
+ T_FEATURE_SENTIMENT_RESULTS type string value '|',
+ T_EMOTION_SCORES type string value '|',
+ T_AUTHOR type string value '|',
+ T_FEED type string value '|',
+ T_FEATURES_RESULTS_METADATA type string value '|',
+ T_ENTITY_MENTION type string value '|',
+ T_DISAMBIGUATION_RESULT type string value '|',
+ T_ENTITIES_RESULT type string value '|',
+ T_TARGETED_EMOTION_RESULTS type string value '|',
+ T_KEYWORDS_RESULT type string value '|',
+ T_TARGETED_SENTIMENT_RESULTS type string value '|',
+ T_CATEGORIES_RELEVANT_TEXT type string value '|',
+ T_DOCUMENT_EMOTION_RESULTS type string value '|',
+ T_DOCUMENT_SENTIMENT_RESULTS type string value '|',
+ T_SENTIMENT_RESULT type string value '|',
+ T_TOKEN_RESULT type string value '|',
+ T_SENTENCE_RESULT type string value '|',
+ T_SYNTAX_RESULT type string value '|',
+ T_CONCEPTS_RESULT type string value '|',
+ T_CTGRS_RESULT_EXPLANATION type string value '|',
+ T_CATEGORIES_RESULT type string value '|',
+ T_EMOTION_RESULT type string value '|',
+ T_FEATURES_RESULTS type string value '|',
+ T_METADATA_RESULT type string value '|',
+ T_ERROR_RESPONSE type string value '|CODE|ERROR|',
+ T_EMOTION_OPTIONS type string value '|',
+ T_USAGE type string value '|',
+ T_SENTIMENT_OPTIONS type string value '|',
+ T_SEMANTIC_ROLES_ACTION type string value '|',
+ T_SYNTAX_OPTIONS_TOKENS 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_CATEGORIES_OPTIONS type string value '|',
+ T_FEATURES type string value '|',
+ T_ANALYSIS_RESULTS_METADATA type string value '|',
+ T_ANALYSIS_RESULTS_USAGE type string value '|',
+ T_ANALYSIS_RESULTS type string value '|',
+ T_SEMANTIC_ROLES_SUBJECT type string value '|',
+ T_LIST_MODELS_RESULTS type string value '|',
+ T_SEMANTIC_ROLES_OBJECT type string value '|',
+ T_PARAMETERS type string value '|FEATURES|',
+ T_MODEL_FILE_AND_METADATA type string value '|LANGUAGE|FILE|',
+ T_DELETE_MODEL_RESULTS type string value '|',
+ __DUMMY type string value SPACE,
+ end of C_REQUIRED_FIELDS .
+
+constants:
+ begin of C_ABAPNAME_DICTIONARY,
+ TEXT type string value 'text',
+ HTML type string value 'html',
+ URL type string value 'url',
+ FEATURES type string value 'features',
+ CLEAN type string value 'clean',
+ XPATH type string value 'xpath',
+ FALLBACK_TO_RAW type string value 'fallback_to_raw',
+ RETURN_ANALYZED_TEXT type string value 'return_analyzed_text',
+ LANGUAGE type string value 'language',
+ LIMIT_TEXT_CHARACTERS type string value 'limit_text_characters',
+ CONCEPTS type string value 'concepts',
+ EMOTION type string value 'emotion',
+ ENTITIES type string value 'entities',
+ KEYWORDS type string value 'keywords',
+ METADATA type string value 'metadata',
+ RELATIONS type string value 'relations',
+ SEMANTIC_ROLES type string value 'semantic_roles',
+ SENTIMENT type string value 'sentiment',
+ CATEGORIES type string value 'categories',
+ SYNTAX type string value 'syntax',
+ MODELS type string value 'models',
+ DELETED type string value 'deleted',
+ STATUS type string value 'status',
+ MODEL_ID type string value 'model_id',
+ DESCRIPTION type string value 'description',
+ WORKSPACE_ID type string value 'workspace_id',
+ VERSION type string value 'version',
+ VERSION_DESCRIPTION type string value 'version_description',
+ CREATED type string value 'created',
+ NAME type string value 'name',
+ USER_METADATA type string value 'user_metadata',
+ INNER type string value 'inner',
+ FILE type string value 'file',
+ ANALYZED_TEXT type string value 'analyzed_text',
+ RETRIEVED_URL type string value 'retrieved_url',
+ USAGE type string value 'usage',
+ SEMANTICROLES type string value 'semanticRoles',
+ TEXT_CHARACTERS type string value 'text_characters',
+ TEXT_UNITS type string value 'text_units',
+ RELEVANCE type string value 'relevance',
+ DBPEDIA_RESOURCE type string value 'dbpedia_resource',
+ SUBTYPE type string value 'subtype',
+ TYPE type string value 'type',
+ CONFIDENCE type string value 'confidence',
+ MENTIONS type string value 'mentions',
+ COUNT type string value 'count',
+ DISAMBIGUATION type string value 'disambiguation',
+ LOCATION type string value 'location',
+ LABEL type string value 'label',
+ SCORE type string value 'score',
+ EXPLANATION type string value 'explanation',
+ DOCUMENT type string value 'document',
+ TARGETS type string value 'targets',
+ ANGER type string value 'anger',
+ DISGUST type string value 'disgust',
+ FEAR type string value 'fear',
+ JOY type string value 'joy',
+ SADNESS type string value 'sadness',
+ AUTHORS type string value 'authors',
+ PUBLICATION_DATE type string value 'publication_date',
+ TITLE type string value 'title',
+ IMAGE type string value 'image',
+ FEEDS type string value 'feeds',
+ LINK type string value 'link',
+ SENTENCE type string value 'sentence',
+ ARGUMENTS type string value 'arguments',
+ SUBJECT type string value 'subject',
+ ACTION type string value 'action',
+ OBJECT type string value 'object',
+ NORMALIZED type string value 'normalized',
+ VERB type string value 'verb',
+ TENSE type string value 'tense',
+ TOKENS type string value 'tokens',
+ SENTENCES type string value 'sentences',
+ PART_OF_SPEECH type string value 'part_of_speech',
+ LEMMA type string value 'lemma',
+ LIMIT type string value 'limit',
+ MODEL type string value 'model',
+ CODE type string value 'code',
+ ERROR type string value 'error',
+ RELEVANT_TEXT type string value 'relevant_text',
+ RELEVANTTEXT type string value 'relevantText',
+ end of C_ABAPNAME_DICTIONARY .
+
+
+ methods GET_APPNAME
+ redefinition .
+ methods GET_REQUEST_PROP
+ redefinition .
+ methods GET_SDK_VERSION_DATE
+ redefinition .
+
+
+ "! Analyze text.
+ "!
+ "! @parameter I_PARAMETERS |
+ "! An object containing request parameters. The `features` object and one of the
+ "! `text`, `html`, or `url` attributes are required.
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_ANALYSIS_RESULTS
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods ANALYZE
+ importing
+ !I_PARAMETERS type T_PARAMETERS
+ !I_contenttype type string default 'application/json'
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_ANALYSIS_RESULTS
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ "! List models.
+ "!
+ "! @parameter E_RESPONSE |
+ "! Service return value of type T_LIST_MODELS_RESULTS
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods LIST_MODELS
+ importing
+ !I_accept type string default 'application/json'
+ exporting
+ !E_RESPONSE type T_LIST_MODELS_RESULTS
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Delete model.
+ "!
+ "! @parameter I_MODEL_ID |
+ "! Model ID of the model to delete.
+ "! @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_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.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+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.
+
+ 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_header = c_boolean_true.
+ elseif lv_auth_method eq 'ICP4D'.
+ e_request_prop-auth_name = 'ICP4D'.
+ e_request_prop-auth_type = 'apiKey'.
+ e_request_prop-auth_headername = 'Authorization'.
+ e_request_prop-auth_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/natural-language-understanding/api'.
+
+endmethod.
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_SDK_VERSION_DATE
+* +-------------------------------------------------------------------------------------------------+
+* | [<-()] E_SDK_VERSION_DATE TYPE STRING
+* +--------------------------------------------------------------------------------------
+ method get_sdk_version_date.
+
+ e_sdk_version_date = '20200210092822'.
+
+ endmethod.
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->ANALYZE
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_PARAMETERS TYPE T_PARAMETERS
+* | [--->] I_contenttype TYPE string (default ='application/json')
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_ANALYSIS_RESULTS
+* | [!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 = '/v1/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 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_PARAMETERS ).
+
+ 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_PARAMETERS i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ).
+ else.
+ lv_bodyparam = abap_to_json( i_name = 'parameters' i_value = i_PARAMETERS ).
+ endif.
+ lv_body = lv_body && lv_separator && lv_bodyparam.
+ else.
+ assign i_PARAMETERS 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_UNDRSTND_V1->LIST_MODELS
+* +-------------------------------------------------------------------------------------------------+
+* | [--->] I_accept TYPE string (default ='application/json')
+* | [<---] E_RESPONSE TYPE T_LIST_MODELS_RESULTS
+* | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION
+* +--------------------------------------------------------------------------------------
+method LIST_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'.
+
+ " 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->DELETE_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_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/{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 Private Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml
new file mode 100644
index 0000000..97d7dfc
--- /dev/null
+++ b/src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_NAT_LANG_UNDRSTND_V1
+ E
+ IBM Watson Natural Language Understanding
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_personal_insights_v3.clas.abap b/src/zcl_ibmc_personal_insights_v3.clas.abap
new file mode 100644
index 0000000..c892aae
--- /dev/null
+++ b/src/zcl_ibmc_personal_insights_v3.clas.abap
@@ -0,0 +1,825 @@
+* 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
+"! 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/services/personality-insights?topic=personal
+"! ity-insights-models#models).
+"! * For information about the meaning of the consumption preferences, see
+"! [Consumption
+"! preferences](https://cloud.ibm.com/docs/services/personality-insights?topic=per
+"! sonality-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:
+ 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:
+ 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',
+ CONSUMPTIONPREFERENCES type string value 'consumptionPreferences',
+ 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',
+ CONTENTITEM type string value 'contentItem',
+ 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.
+ "!
+ "! @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/services/personality-insights?topic=personali
+ "! ty-insights-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.
+ "!
+ "! @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/services/personality-insights?topic=personali
+ "! ty-insights-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.
+
+ methods SET_DEFAULT_QUERY_PARAMETERS
+ changing
+ !C_URL type TS_URL .
+
+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_header = c_boolean_true.
+ elseif lv_auth_method eq 'basicAuth'.
+ e_request_prop-auth_name = 'basicAuth'.
+ e_request_prop-auth_type = 'http'.
+ e_request_prop-auth_basic = c_boolean_true.
+ else.
+ endif.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-url-host = 'localhost'.
+ e_request_prop-url-path_base = '/personality-insights/api'.
+
+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 = '20200210092823'.
+
+ 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.
+
+
+
+
+* ---------------------------------------------------------------------------------------+
+* | Instance Private Method ZCL_IBMC_PERSONAL_INSIGHTS_V3->SET_DEFAULT_QUERY_PARAMETERS
+* +-------------------------------------------------------------------------------------------------+
+* | [<-->] C_URL TYPE TS_URL
+* +--------------------------------------------------------------------------------------
+ method set_default_query_parameters.
+ if not p_version is initial.
+ add_query_parameter(
+ exporting
+ i_parameter = `version`
+ i_value = p_version
+ changing
+ c_url = c_url ).
+ endif.
+ endmethod.
+
+ENDCLASS.
diff --git a/src/zcl_ibmc_personal_insights_v3.clas.xml b/src/zcl_ibmc_personal_insights_v3.clas.xml
new file mode 100644
index 0000000..7368b46
--- /dev/null
+++ b/src/zcl_ibmc_personal_insights_v3.clas.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ ZCL_IBMC_PERSONAL_INSIGHTS_V3
+ E
+ Watson Personal Insights
+ 1
+ X
+ X
+ X
+
+
+
+
diff --git a/src/zcl_ibmc_service.clas.abap b/src/zcl_ibmc_service.clas.abap
new file mode 100644
index 0000000..0767c32
--- /dev/null
+++ b/src/zcl_ibmc_service.clas.abap
@@ -0,0 +1,1539 @@
+* 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.
+class ZCL_IBMC_SERVICE definition
+ public
+ inheriting from ZCL_IBMC_SERVICE_ARCH
+ create public .
+
+public section.
+
+ 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 .
+ types:
+ "! DateTime type, format 2018-10-23T15:18:18.914xxxZ
+ 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 .
+ types:
+ 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 .
+ types:
+ 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 .
+ types:
+ 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 .
+ types:
+ 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 .
+ types:
+ 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 .
+ types:
+ 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.
+ constants:
+ 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 .
+
+ "! Raises an exception
+ "!
+ "! @parameter I_MSGNO | Message number.
+ "! @parameter I_MSGV1 | Substitution for 1st placeholder in message.
+ "! @parameter I_MSGV2 | Substitution for 2nd placeholder in message.
+ "! @parameter I_MSGV3 | Substitution for 3rd placeholder in message.
+ "! @parameter I_MSGV4 | Substitution for 4th placeholder in message.
+ "! @parameter I_TEXT | Message text; specify if message number is not specified.
+ "! @parameter I_SUBRC | Return code being returned.
+ "! @parameter I_PREVIOUS | Exception that has been captured before.
+ "! @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
+ 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
+ raising
+ 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.
+ "! @parameter E_TECHNICAL_TYPE | Technical type (= base type) of I_FIELD.
+ "! @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
+ importing
+ !I_FIELD type ANY
+ exporting
+ !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
+ importing
+ !I_STRUCTURE type ANY
+ exporting
+ value(E_COMPONENTS) type ZIF_IBMC_SERVICE_ARCH~TT_STRING .
+ "! Parses a JSON string into an ABAP structure
+ "!
+ "! @parameter I_JSON | JSON string.
+ "! @parameter I_DICTIONARY | Dictionary for mapping of identifier names.
+ "! @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
+ importing
+ !I_JSON type STRING
+ !I_DICTIONARY type ANY optional
+ changing
+ value(C_ABAP) type ANY
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Method for internal use.
+ "!
+ methods GET_REQUEST_PROP
+ importing
+ !I_AUTH_METHOD type STRING default C_DEFAULT
+ returning
+ 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
+ importing
+ !I_FIELD type ANY
+ returning
+ 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
+ importing
+ !I_IN type STRING
+ returning
+ 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
+ importing
+ value(I_MIME_TYPE) type STRING
+ returning
+ 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
+ importing
+ !I_DATA_REFERENCE type DATA_REFERENCE
+ exporting
+ value(E_ABAP) type ANY
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Method for internal use.
+ "!
+ class-methods ADD_QUERY_PARAMETER
+ importing
+ !I_PARAMETER type STRING
+ !I_VALUE type STRING
+ !I_IS_BOOLEAN type BOOLEAN default C_BOOLEAN_FALSE
+ changing
+ !C_URL type TS_URL .
+ "! Method for internal use.
+ "!
+ class-methods ADD_HEADER_PARAMETER
+ importing
+ !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 .
+ "! Method for internal use.
+ "!
+ class-methods GET_FULL_URL
+ importing
+ !I_URL type TS_URL
+ returning
+ value(E_URL) type STRING .
+ "! Returns the service name.
+ "!
+ "! @parameter E_APPNAME | Name of the service.
+ "!
+ methods GET_APPNAME
+ returning
+ value(E_APPNAME) type STRING .
+ "! Method for internal use.
+ "!
+ class-methods NORMALIZE_URL
+ changing
+ !C_URL type TS_URL .
+ "! Extracts a JSON string from an ABAP structure.
+ "!
+ "! @parameter I_NAME | Name of component to be extracted.
+ "! @parameter I_VALUE | ABAP structure to be converted to JSON string.
+ "! @parameter I_DICTIONARY | Dictionary to be used for mapping ABAP identifiers to JSON keys.
+ "! @parameter I_REQUIRED_FIELDS |
+ "! Dictionary of required fields.
+ "! If a field is required, an initial value appears as initial value in JSON structure.
+ "! Otherwise it is omitted in JSON string.
+ "! @parameter I_LOWER_CASE | If set to C_BOOLEAN_TRUE all keys in JSON string will be lower case.
+ "! @parameter E_JSON | JSON string.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ 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
+ returning
+ value(E_JSON) type STRING .
+ methods CHECK_HTTP_RESPONSE
+ importing
+ !I_RESPONSE type TO_REST_RESPONSE optional
+ !I_URL type TS_URL optional
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Class constructor.
+ "!
+ "! @parameter I_URL | URL of the service.
+ "! @parameter I_HOST | Host of the service. I_URL and I_HOST can be used synonymously.
+ "! @parameter I_PROXY_HOST | Proxy server, not applicable on SAP Cloud Platform.
+ "! @parameter I_PROXY_PORT | Proxy server port, not applicable on SAP Cloud Platform.
+ "! @parameter I_USERNAME | User name to authenticate on service.
+ "! @parameter I_PASSWORD | User password to authenticate on service.
+ "! @parameter I_APIKEY | API key password to authenticate on service.
+ "! @parameter I_ACCESS_TOKEN | Access token to authenticate on service.
+ "! @parameter I_SSL_ID | ID of PSE, not applicable on SAP Cloud Platform.
+ "! @parameter I_DEBUG_MODE | not used.
+ "!
+ 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 .
+ "! Method for internal use.
+ "!
+ methods GET_REST_CLIENT
+ importing
+ !I_REQUEST_PROP type TS_REQUEST_PROP
+ returning
+ value(E_CLIENT) type TS_CLIENT
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Method for internal use.
+ "!
+ methods GET_ACCESS_TOKEN
+ importing
+ !I_REQUEST_PROP type TS_REQUEST_PROP optional
+ returning
+ value(E_ACCESS_TOKEN) type TS_ACCESS_TOKEN
+ raising
+ 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
+ importing
+ !I_REQUEST_PROP type TS_REQUEST_PROP
+ returning
+ value(E_RESPONSE) type TO_REST_RESPONSE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Sets an access token explicitly.
+ "!
+ "! @parameter I_ACCESS_TOKEN | Access token.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods SET_ACCESS_TOKEN
+ importing
+ !I_ACCESS_TOKEN type TS_ACCESS_TOKEN
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! 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
+ 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.
+ "!
+ "! @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
+ 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.
+ "! @parameter IT_FORM_PART | Internal table of form parts in request body.
+ "! @parameter E_RESPONSE | Response returned by service.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ methods HTTP_POST_MULTIPART
+ importing
+ !I_REQUEST_PROP type TS_REQUEST_PROP
+ !IT_FORM_PART type TT_FORM_PART
+ returning
+ value(E_RESPONSE) type TO_REST_RESPONSE
+ raising
+ 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
+ importing
+ !I_REQUEST_PROP type TS_REQUEST_PROP
+ returning
+ value(E_RESPONSE) type TO_REST_RESPONSE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+protected section.
+
+ methods ADJUST_REQUEST_PROP
+ changing
+ !C_REQUEST_PROP type TS_REQUEST_PROP .
+ class-methods MERGE_STRUCTURE
+ importing
+ !I_ALTERNATIVE type ANY
+ changing
+ !C_BASE type ANY .
+ methods SET_URI_AND_AUTHORIZATION
+ importing
+ !I_CLIENT type TS_CLIENT
+ !I_REQUEST_PROP type TS_REQUEST_PROP
+ returning
+ value(E_URI) type STRING
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+private section.
+ENDCLASS.
+
+
+
+CLASS ZCL_IBMC_SERVICE IMPLEMENTATION.
+
+
+ method abap_to_json.
+
+ data:
+ lv_json type string,
+ lv_json_comp type string,
+ lv_json_num(24) type c,
+ lv_sep(1) type c,
+ lv_name type string,
+ lv_name_uc type string,
+ lv_type type char,
+ lt_compname type tt_string,
+ lv_name_in_dict type boolean,
+ lv_relative_type type string,
+ lv_pattern type string,
+ lv_str type string.
+ field-symbols:
+ type any,
+ type string,
+ type any,
+ type i,
+ type int8,
+ type f,
+ type any table,
+ type string,
+ type string.
+
+
+ get_field_type(
+ exporting
+ i_field = i_value
+ 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 i_value is initial.
+ return.
+ endif.
+ assign i_value->* to .
+ get_field_type(
+ exporting
+ i_field =
+ importing
+ e_technical_type = lv_type
+ e_relative_type = lv_relative_type ).
+ else.
+ assign i_value to .
+ 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.
+ " simple type
+
+ if lv_type eq 'C' or lv_type eq 'N' or lv_type eq 'g'.
+ lv_str = .
+ if lv_str eq c_blank.
+ " parameter is blank, not initial (i.e. null)
+ lv_str = ''.
+ else.
+ 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'.
+ endif.
+
+ " quote value unless it is a boolean
+ if lv_relative_type eq 'BOOLEAN'.
+ if lv_str eq c_boolean_true.
+ lv_json = `true`.
+ elseif lv_str eq c_boolean_false.
+ lv_json = `false`.
+ else.
+ lv_json = lv_str.
+ endif.
+ else.
+ lv_json = `"` && lv_str && `"`.
+ endif.
+ else.
+ do 1 times. " to allow exit command
+
+ " special handling for optional parameters explicitly set to initial
+ if lv_type eq 'I'.
+ assign to .
+ if = c_i_zero.
+ lv_json_num = '0'.
+ exit.
+ endif.
+ elseif lv_type eq '8'.
+ assign to .
+ if = c_i8_zero.
+ lv_json_num = '0'.
+ exit.
+ endif.
+ elseif lv_type eq 'F'.
+ assign to .
+ if = c_f_zero.
+ lv_json_num = '0'.
+ exit.
+ endif.
+ endif.
+
+ lv_json_num = conv #( ).
+ condense lv_json_num no-gaps.
+ enddo.
+ 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.
+ " structure
+
+ get_components(
+ exporting
+ i_structure =
+ importing
+ e_components = lt_compname ).
+ clear lv_sep.
+ lv_json = lv_json && `{`.
+ loop at lt_compname assigning .
+ assign component of structure to .
+ if sy-subrc <> 0.
+ continue.
+ endif.
+
+ " do not add property if not required and corresponding abap field is initial
+ if is initial and not i_required_fields is initial.
+ assign component lv_relative_type of structure i_required_fields to .
+ if sy-subrc <> 0.
+ continue.
+ endif.
+ lv_pattern = `*|` && && `|*`.
+ if not cp lv_pattern.
+ continue.
+ endif.
+ endif.
+
+ lv_name = .
+
+ " check if key name exists in abap names dictionary
+ lv_name_in_dict = c_boolean_false.
+ try.
+ assign component lv_name of structure i_dictionary to .
+ if sy-subrc = 0.
+ lv_name = .
+ lv_name_in_dict = c_boolean_true.
+ endif.
+ catch cx_sy_assign_cast_illegal_cast cx_sy_assign_cast_unknown_type cx_sy_assign_out_of_range.
+ endtry.
+
+ if lv_name_in_dict eq c_boolean_false and i_lower_case eq c_boolean_true.
+ " convert name to lower case
+ translate lv_name to lower case.
+ endif.
+ " add property (recursively)
+ lv_json_comp = abap_to_json( i_name = lv_name i_value = i_lower_case = i_lower_case i_dictionary = i_dictionary i_required_fields = i_required_fields ).
+ lv_json = lv_json && lv_sep && lv_json_comp.
+ lv_sep = ','.
+ endloop.
+ lv_json = lv_json && `}`.
+
+ elseif lv_type eq zif_ibmc_service_arch~c_datatype-itab.
+ " internal table
+
+ lv_json = lv_json && `[`.
+ clear lv_sep.
+ assign to .
+ loop at assigning .
+ lv_json_comp = abap_to_json( i_value = i_lower_case = i_lower_case i_dictionary = i_dictionary i_required_fields = i_required_fields ).
+ lv_json = lv_json && lv_sep && lv_json_comp.
+ lv_sep = ','.
+ endloop.
+ lv_json = lv_json && `]`.
+
+ endif.
+
+ if not i_name is initial.
+ lv_name_in_dict = c_boolean_false.
+ lv_name = i_name.
+ if not i_dictionary is initial.
+ assign component i_name of structure i_dictionary to .
+ if sy-subrc = 0.
+ lv_name = .
+ lv_name_in_dict = c_boolean_true.
+ endif.
+ endif.
+ if lv_name_in_dict eq c_boolean_false and i_lower_case eq c_boolean_true.
+ " convert name to lower case
+ translate lv_name to lower case.
+ endif.
+ e_json = `"` && lv_name && `": ` && lv_json.
+ else.
+ e_json = lv_json.
+ endif.
+
+ endmethod.
+
+
+ method add_header_parameter.
+
+ data:
+ 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.
+ if i_value eq c_boolean_true.
+ lv_value = 'true'.
+ else.
+ lv_value = 'false'.
+ endif.
+ else.
+ lv_value = i_value.
+ endif.
+ condense lv_value. " remove trailing spaces
+
+ ls_header-name = i_parameter.
+ ls_header-value = lv_value.
+ append ls_header to c_headers.
+
+ endmethod.
+
+
+ method add_query_parameter.
+
+ data:
+ lv_param type string.
+
+ if i_is_boolean eq c_boolean_true.
+ if i_value eq c_boolean_true.
+ lv_param = 'true'.
+ else.
+ lv_param = 'false'.
+ endif.
+ else.
+ lv_param = i_value.
+ endif.
+ condense lv_param. " remove trailing spaces
+ lv_param = i_parameter && `=` && lv_param.
+
+ if c_url-querystring is initial.
+ c_url-querystring = lv_param.
+ else.
+ c_url-querystring = c_url-querystring && `&` && lv_param.
+ endif.
+
+ endmethod.
+
+
+ method adjust_request_prop.
+
+ data:
+ ls_request_prop_openapi type ts_request_prop.
+
+ merge_structure(
+ exporting
+ i_alternative = p_request_prop_default
+ changing
+ c_base = c_request_prop ).
+
+ " Separate protocol, host and path in url
+ normalize_url(
+ changing
+ c_url = c_request_prop-url ).
+
+ " Set defaults for some unspecified properties
+ if c_request_prop-url-protocol is initial.
+ c_request_prop-url-protocol = 'http' ##NO_TEXT.
+ endif.
+ if c_request_prop-auth_headername is initial.
+ c_request_prop-auth_headername = 'Authorization' ##NO_TEXT.
+ endif.
+
+ " Allow basic authentication with apikey
+ if c_request_prop-auth_basic eq c_boolean_true.
+ if c_request_prop-username is initial and c_request_prop-password is initial and not c_request_prop-apikey is initial.
+ c_request_prop-username = 'apikey' ##NO_TEXT.
+ c_request_prop-password = c_request_prop-apikey.
+ endif.
+ endif.
+
+ " Correct authentication location
+ if ( c_request_prop-auth_basic ne c_boolean_false or
+ c_request_prop-auth_oauth ne c_boolean_false or
+ c_request_prop-auth_apikey ne c_boolean_false ) and
+ not ( c_request_prop-auth_header eq c_boolean_true or
+ c_request_prop-auth_query eq c_boolean_true or
+ c_request_prop-auth_body eq c_boolean_true ).
+ c_request_prop-auth_header = c_boolean_true.
+ endif.
+
+ endmethod.
+
+
+ method check_http_response.
+
+ data:
+ lv_http_status type ts_http_status,
+ lv_full_url type string,
+ ls_url type ts_url,
+ lv_strlen type i,
+ lv_code type string,
+ 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.
+ shift lv_code left deleting leading space.
+ if lv_code ne '200' and " ok
+ lv_code ne '201' and " ok with response
+ lv_code ne '202' and " Accepted (asynchronous function call)
+ lv_code ne '204'. " Deleted
+
+ ls_url = i_url.
+ merge_structure(
+ exporting
+ i_alternative = p_request_prop_default-url
+ changing
+ c_base = ls_url ).
+ lv_full_url = get_full_url( ls_url ).
+
+ try.
+ raise_exception(
+ i_msgno = '003' " HTTP Status: &1 (&2)
+ i_msgv1 = lv_code
+ 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.
+ lo_service_exception->p_msg_json = lv_http_status-json.
+ endtry.
+
+ raise exception lo_service_exception.
+ endif.
+
+ endmethod.
+
+
+ method constructor.
+
+ data:
+ lv_host type string.
+
+ super->constructor( ).
+
+ " use i_url and i_host synonymously
+ if not i_url is initial.
+ lv_host = i_url.
+ else.
+ lv_host = i_host.
+ endif.
+
+ p_request_prop_default-url-host = lv_host.
+ p_request_prop_default-username = i_username.
+ p_request_prop_default-password = i_password.
+ p_request_prop_default-apikey = i_apikey.
+ p_request_prop_default-access_token = i_access_token.
+
+ p_debug_mode = i_debug_mode.
+
+ normalize_url(
+ changing
+ c_url = p_request_prop_default-url ).
+
+ if not i_proxy_host is supplied.
+
+ get_default_proxy(
+ exporting
+ i_url = p_request_prop_default-url
+ importing
+ e_proxy_host = p_request_prop_default-proxy_host
+ e_proxy_port = p_request_prop_default-proxy_port ).
+
+ else.
+ p_request_prop_default-proxy_host = i_proxy_host.
+ if not i_proxy_port is initial.
+ p_request_prop_default-proxy_port = i_proxy_port.
+ else.
+ p_request_prop_default-proxy_port = '8080'.
+ endif.
+ endif.
+
+
+ endmethod.
+
+
+ method get_access_token.
+
+ e_access_token = p_request_prop_default-access_token.
+
+ endmethod.
+
+
+ method get_appname.
+ endmethod.
+
+
+ method get_components.
+
+ data:
+ lo_abap_struc type ref to cl_abap_structdescr,
+ lt_comp type cl_abap_structdescr=>component_table.
+
+ field-symbols:
+ type line of cl_abap_structdescr=>component_table.
+
+ lo_abap_struc ?= cl_abap_structdescr=>describe_by_data( i_structure ).
+ lt_comp = lo_abap_struc->get_components( ).
+
+ clear e_components[].
+ loop at lt_comp assigning .
+ append -name to e_components.
+ endloop.
+
+ endmethod.
+
+
+ method get_datatype.
+
+ get_field_type(
+ exporting
+ i_field = i_field
+ importing
+ e_technical_type = e_datatype ).
+
+ endmethod.
+
+
+ method get_field_type.
+ data:
+ lo_abap_type type ref to cl_abap_typedescr,
+ lo_typedescr type ref to cl_abap_typedescr.
+
+ call method cl_abap_typedescr=>describe_by_data
+ exporting
+ p_data = i_field
+ receiving
+ p_descr_ref = lo_typedescr.
+
+ 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.
+ 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( ).
+ else.
+ lo_abap_type = cl_abap_typedescr=>describe_by_data( i_field ).
+ endif.
+ e_relative_type = lo_abap_type->get_relative_name( ).
+ 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.
+ e_length = lo_typedescr->length.
+ else.
+ e_length = 0.
+ endif.
+ endif.
+
+ endmethod.
+
+
+ method get_file_extension.
+
+ data:
+ lv_mime_type type string,
+ lv_ext type string,
+ lv_len type i.
+
+ translate i_mime_type to lower case.
+
+ case i_mime_type.
+ when 'text/plain'. e_extension = 'txt'.
+ when 'image/jpeg'. e_extension = 'jpg'.
+ 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.
+ lv_len = strlen( lv_ext ).
+ if lv_len >= 2 and lv_len <= 4.
+ e_extension = lv_ext.
+ endif.
+ endif.
+ endcase.
+
+ endmethod.
+
+
+ method get_full_url.
+
+ data:
+ lv_url type string.
+
+ if not i_url-host cp 'http*'.
+ if i_url-protocol is initial.
+ lv_url = 'http://'.
+ else.
+ lv_url = i_url-protocol && `://`.
+ endif.
+ endif.
+
+ lv_url = lv_url && i_url-host && i_url-path_base && i_url-path.
+
+ if not i_url-querystring is initial.
+ lv_url = lv_url && `?` && i_url-querystring.
+ endif.
+
+ e_url = lv_url.
+
+ endmethod.
+
+
+ method get_request_prop.
+
+ e_request_prop-url-protocol = 'http'.
+ e_request_prop-auth_headername = ''.
+ e_request_prop-auth_basic = c_boolean_false.
+ e_request_prop-auth_oauth = c_boolean_false.
+ e_request_prop-auth_apikey = c_boolean_false.
+ e_request_prop-auth_query = c_boolean_false.
+ e_request_prop-auth_header = c_boolean_false.
+
+ endmethod.
+
+
+ method get_rest_client.
+
+ data:
+ ls_header type ts_header,
+ ls_request_prop type ts_request_prop,
+ lv_url type string.
+
+ ls_request_prop = i_request_prop.
+ adjust_request_prop(
+ changing
+ c_request_prop = ls_request_prop ).
+
+ " create http client instance
+ lv_url = ls_request_prop-url-protocol && `://` && ls_request_prop-url-host.
+ create_client_by_url(
+ exporting
+ i_url = lv_url
+ i_request_prop = ls_request_prop
+ importing
+ e_client = e_client ).
+
+ " set URI and authorization
+ lv_url = set_uri_and_authorization( i_client = e_client i_request_prop = ls_request_prop ).
+
+ " set request uri
+ set_request_uri( i_client = e_client i_uri = lv_url ).
+
+ " 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 ).
+ 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 ).
+ endif.
+
+ " set additional headers
+ if not ls_request_prop-headers is initial.
+ loop at ls_request_prop-headers into ls_header.
+ set_request_header( i_client = e_client i_name = ls_header-name i_value = ls_header-value ).
+ endloop.
+ endif.
+
+ endmethod.
+
+
+ method http_delete.
+
+ data:
+ lo_client type ts_client.
+
+ " create REST client
+ 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 ).
+
+ " check response
+ check_http_response(
+ i_response = e_response
+ i_url = i_request_prop-url ).
+
+ endmethod.
+
+
+ method http_get.
+
+ data:
+ lo_client type ts_client.
+
+ " create REST client
+ 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 ).
+
+ " check response
+ check_http_response(
+ i_response = e_response
+ i_url = i_request_prop-url ).
+
+ endmethod.
+
+
+ method http_post.
+
+ 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.
+
+ " error: querystring of a POST request is not sent to server if the request body is empty
+ " 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 ).
+ endif.
+
+ " execute POST request
+ e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_post ).
+
+ " check response
+ check_http_response(
+ i_response = e_response
+ i_url = i_request_prop-url ).
+
+ endmethod.
+
+
+ method HTTP_POST_MULTIPART.
+
+ data:
+ lo_client type ts_client.
+
+ " create REST client
+ lo_client = get_rest_client( i_request_prop = i_request_prop ).
+
+ " set request body (multipart)
+ 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 ).
+
+ " check response
+ check_http_response(
+ i_response = e_response
+ i_url = i_request_prop-url ).
+
+ endmethod.
+
+
+ method http_put.
+
+ 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 PUT request
+ e_response = execute( i_client = lo_client i_method = zif_ibmc_service_arch~c_method_put ).
+
+ " check response
+ check_http_response(
+ i_response = e_response
+ i_url = i_request_prop-url ).
+
+ endmethod.
+
+
+ method merge_structure.
+
+ data:
+ lv_type type char,
+ lt_compname type tt_string.
+
+ field-symbols:
+ type any,
+ type any,
+ type standard table,
+ type standard table,
+ type string.
+
+ get_components(
+ exporting
+ i_structure = c_base
+ importing
+ e_components = lt_compname ).
+
+ loop at lt_compname assigning .
+ assign component of structure c_base to .
+ check sy-subrc = 0.
+ get_field_type(
+ exporting
+ 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.
+ assign component of structure i_alternative to .
+ check sy-subrc = 0.
+ merge_structure(
+ exporting
+ i_alternative =
+ changing
+ c_base = ).
+ else.
+ if is initial.
+ 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 .
+ check sy-subrc = 0.
+ if not is initial.
+ append lines of to .
+ endif.
+ else.
+ assign component of structure i_alternative to .
+ check sy-subrc = 0.
+ = .
+ endif.
+ endif.
+ endif.
+ endloop.
+
+ endmethod.
+
+
+ method move_data_reference_to_abap.
+
+ data:
+ lt_compname type tt_string,
+ lv_compname type string,
+ lv_index type i,
+ begin of ls_stack,
+ name type string,
+ ref type ref to data,
+ struct type ref to data,
+ type type char,
+ end of ls_stack,
+ ls_stack_new like ls_stack,
+ lt_stack like standard table of ls_stack.
+ field-symbols:
+ type data,
+ type any,
+ type any,
+ type ref to data,
+ type any.
+
+
+ clear ls_stack-name.
+ ls_stack-ref = i_data_reference.
+ ls_stack-struct = ref #( e_abap ).
+ get_field_type(
+ exporting
+ i_field = e_abap
+ importing
+ e_technical_type = ls_stack-type ).
+ append ls_stack to lt_stack.
+
+ do.
+ lv_index = lines( lt_stack ).
+ if lv_index <= 0. exit. endif.
+ read table lt_stack into ls_stack index lv_index.
+
+ assign ls_stack-ref->* to .
+ assign ls_stack-struct->* to .
+ if ls_stack-name is initial.
+ assign e_abap to .
+ else.
+ assign component ls_stack-name of structure to .
+ endif.
+ if ls_stack-type eq 'u' or ls_stack-type eq 'v'. " structure
+ get_components(
+ exporting
+ i_structure =
+ importing
+ e_components = lt_compname ).
+ loop at lt_compname into lv_compname.
+ ls_stack_new-name = lv_compname.
+ ls_stack_new-struct = ref #( ).
+ assign component lv_compname of structure to .
+ if sy-subrc = 0.
+ ls_stack_new-ref = .
+ assign component lv_compname of structure to .
+ get_field_type(
+ exporting
+ i_field =
+ importing
+ e_technical_type = ls_stack_new-type ).
+ append ls_stack_new to lt_stack.
+ endif.
+ endloop.
+
+ else.
+ if not ls_stack-name is initial.
+ assign ls_stack-struct->* to .
+ assign component ls_stack-name of structure to .
+ endif.
+ if ls_stack-type eq 'l' or ls_stack-type eq 'r'. " reference
+ = ls_stack-ref.
+ else.
+ = .
+ endif.
+ endif.
+
+ delete lt_stack index lv_index.
+
+ enddo.
+
+
+ endmethod.
+
+
+ method normalize_url.
+
+ check not c_url is initial.
+
+ data(lv_protocol) = c_url-protocol.
+ if not lv_protocol is initial and lv_protocol np '*://'.
+ lv_protocol = lv_protocol && '://'.
+ endif.
+
+ data(lv_host) = c_url-host.
+ if c_url-host cp 'http:*' or c_url-host cp 'https:*'.
+ clear lv_protocol.
+ endif.
+ shift lv_host right deleting trailing '/'.
+ if not c_url-path_base is initial.
+ shift c_url-path_base left deleting leading '/'.
+ lv_host = lv_host && '/' && c_url-path_base.
+ shift lv_host right deleting trailing '/'.
+ endif.
+ shift lv_host left deleting leading space.
+
+ data(lv_path) = c_url-path.
+ if not lv_path is initial.
+ if lv_path np '/*'.
+ lv_path = '/' && lv_path.
+ endif.
+ endif.
+
+ data(lv_url_full) = lv_protocol && lv_host && lv_path.
+ shift lv_url_full right deleting trailing '/'.
+ 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.
+
+ shift c_url-protocol right deleting trailing '/'.
+ shift c_url-protocol right deleting trailing ':'.
+ shift c_url-protocol left deleting leading space.
+
+ " split path into base_path and path
+ if not lv_host is initial.
+ find lv_host in lv_url_full match offset data(lv_offset) match length data(lv_length).
+ if sy-subrc = 0.
+ data(lv_strlen_url) = strlen( lv_url_full ).
+ data(lv_strlen_path) = strlen( c_url-path ).
+ data(lv_splitpoint) = lv_strlen_path - ( lv_strlen_url - lv_offset - lv_length ).
+ c_url-path_base = c_url-path+0(lv_splitpoint).
+ c_url-path = c_url-path+lv_splitpoint.
+ endif.
+ endif.
+
+ return.
+
+ endmethod.
+
+
+ method PARSE_JSON.
+
+ data:
+ lv_json type string,
+ lt_dictionary type zif_ibmc_service_arch~tt_string,
+ lv_dictionary type string,
+ lv_orgname type string,
+ lv_abapname type string,
+ lv_regex type string,
+ lo_json type ref to /ui2/cl_json,
+ lv_msg type string,
+ lr_exception type ref to cx_sy_move_cast_error.
+ field-symbols:
+ type string.
+
+ if not i_json is initial.
+
+ lv_json = i_json.
+
+ if i_dictionary is supplied.
+ get_components(
+ exporting
+ i_structure = i_dictionary
+ importing
+ e_components = lt_dictionary ).
+
+ loop at lt_dictionary into lv_dictionary.
+ assign component lv_dictionary of structure i_dictionary to .
+ lv_orgname = .
+ translate lv_orgname to upper case.
+ 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.
+ endif.
+ endloop.
+
+ endif.
+
+ " copy code to execute /ui2/cl_json=>deserialize( exporting json = lv_json changing data = c_abap ) and catch exception
+ create object lo_json.
+ 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(
+ exporting
+ i_msgno = 20 ).
+ endtry.
+
+ endif.
+
+ endmethod.
+
+
+ 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.
+
+ ls_msg-msgid = c_msgid.
+
+ if not i_msgno is initial.
+ ls_msg-msgno = i_msgno.
+ ls_msg-attr1 = i_msgv1.
+ ls_msg-attr2 = i_msgv2.
+ ls_msg-attr3 = i_msgv3.
+ ls_msg-attr4 = i_msgv4.
+ else.
+ if not i_text is initial.
+ if i_subrc <> c_subrc_unknown.
+ lv_charval = conv #( i_subrc ).
+ ls_msg-attr2 = lv_charval.
+ ls_msg-msgno = '001'. " &1: return code &2
+ else.
+ ls_msg-msgno = '000'. " &1
+ endif.
+ ls_msg-attr1 = i_text.
+ else.
+ ls_msg-msgno = '002'. " An exception has occurred, reason code &1.
+ lv_charval = conv #( i_subrc ).
+ ls_msg-attr1 = lv_charval.
+ endif.
+ endif.
+
+ if ls_msg-attr4 is initial and not i_http_status-json is initial.
+ data:
+ begin of ls_error,
+ error type string,
+ description type string,
+ end of ls_error.
+ parse_json(
+ exporting
+ i_json = i_http_status-json
+ changing
+ c_abap = ls_error ).
+ if not ls_error-error is initial.
+ ls_msg-attr4 = unescape_unicode( ls_error-error ).
+ elseif not ls_error-description is initial.
+ ls_msg-attr4 = unescape_unicode( ls_error-description ).
+ else.
+ ls_msg-attr4 = unescape_unicode( i_http_status-json ).
+ endif.
+ endif.
+
+ 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.
+
+
+ method set_access_token.
+
+ p_request_prop_default-access_token = i_access_token.
+
+ endmethod.
+
+
+ method set_uri_and_authorization.
+
+ data:
+ ls_url type ts_url,
+ lv_url type string.
+
+ ls_url = i_request_prop-url.
+
+ " OAuth authorization
+ if i_request_prop-auth_oauth eq c_boolean_true. " = not ( c_boolean_false or c_tribool_false )
+ data:
+ ls_access_token type ts_access_token,
+ lv_full_token type string.
+ ls_access_token = get_access_token( i_request_prop = i_request_prop ).
+ if not ls_access_token-token_type is initial.
+ concatenate ls_access_token-token_type ls_access_token-access_token into lv_full_token separated by space.
+ else.
+ lv_full_token = ls_access_token-access_token.
+ endif.
+ if i_request_prop-auth_header eq c_boolean_true.
+ set_request_header( i_client = i_client i_name = i_request_prop-auth_headername i_value = lv_full_token ).
+ endif.
+
+ " Basic authentication
+ elseif i_request_prop-auth_basic eq c_boolean_true or i_request_prop-auth_apikey eq c_boolean_true.
+ data:
+ lv_username type string,
+ lv_password type string.
+ if i_request_prop-auth_apikey eq c_boolean_true.
+ lv_username = 'apikey' ##NO_TEXT.
+ lv_password = i_request_prop-apikey.
+ else.
+ lv_username = i_request_prop-username.
+ lv_password = i_request_prop-password.
+ endif.
+ if i_request_prop-auth_header eq c_boolean_true.
+ set_authentication_basic( i_client = i_client i_username = lv_username i_password = lv_password ).
+ elseif i_request_prop-auth_query eq c_boolean_true.
+ if i_request_prop-auth_apikey eq c_boolean_true.
+ add_query_parameter(
+ exporting
+ i_parameter = 'apikey' ##NO_TEXT
+ i_value = lv_password
+ changing
+ c_url = ls_url ).
+ else.
+ add_query_parameter(
+ exporting
+ i_parameter = 'username' ##NO_TEXT
+ i_value = lv_username
+ changing
+ c_url = ls_url ).
+ add_query_parameter(
+ exporting
+ i_parameter = 'password' ##NO_TEXT
+ i_value = lv_password
+ changing
+ c_url = ls_url ).
+ endif.
+ elseif i_request_prop-auth_body eq c_boolean_true.
+ data:
+ lv_body type string.
+ if i_request_prop-auth_apikey eq c_boolean_true.
+ lv_body = `{ "userid": "apikey", "password": "` && i_request_prop-apikey && `" }` ##NO_TEXT.
+ else.
+ 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 ).
+ endif.
+ endif.
+
+ e_uri = get_full_url( ls_url ).
+
+ endmethod.
+
+
+ method unescape_unicode.
+
+ data:
+ lv_match type string,
+ lv_cp_str type string,
+ lv_cp_hex(4) type x,
+ lv_ucchar(1) type c.
+
+ field-symbols:
+ like lv_ucchar.
+
+ 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.
+ exit.
+ endif.
+
+ lv_cp_str = lv_match+2.
+ translate lv_cp_str to upper case.
+ lv_cp_hex = lv_cp_str.
+
+ assign lv_cp_hex to CASTING.
+ lv_ucchar = .
+
+ replace all occurrences of lv_match in e_out with lv_ucchar.
+
+ enddo.
+
+ endmethod.
+ENDCLASS.
diff --git a/src/zcl_ibmc_service.clas.xml b/src/zcl_ibmc_service.clas.xml
new file mode 100644
index 0000000..ededc14
--- /dev/null
+++ b/src/zcl_ibmc_service.clas.xml
@@ -0,0 +1,168 @@
+
+
+
+
+
+ ZCL_IBMC_SERVICE
+ E
+ ABAP SDK for IBM Watson - Service Class
+ 1
+ X
+ X
+ X
+
+
+
+ ZCL_IBMC_SERVICE
+ ABAP_TO_JSON
+ E
+ Generates a JSON string from any ABAP structure
+
+
+ ZCL_IBMC_SERVICE
+ ADD_HEADER_PARAMETER
+ E
+ Adds a HTTP header parameter
+
+
+ ZCL_IBMC_SERVICE
+ ADD_QUERY_PARAMETER
+ E
+ Adds a REST query parameter
+
+
+ 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
+ GET_ACCESS_TOKEN
+ E
+ Reads or generates an authorization token
+
+
+ ZCL_IBMC_SERVICE
+ GET_APPNAME
+ E
+ Returns the API or service name, resp.
+
+
+ ZCL_IBMC_SERVICE
+ GET_COMPONENTS
+ E
+ Returns the component names of a given structure
+
+
+ ZCL_IBMC_SERVICE
+ GET_DATATYPE
+ E
+ Returns data type of a variable
+
+
+ ZCL_IBMC_SERVICE
+ GET_FIELD_TYPE
+ E
+ Returns the absolute type of a field
+
+
+ ZCL_IBMC_SERVICE
+ GET_FILE_EXTENSION
+ E
+ Returns file extension for given mime type
+
+
+ ZCL_IBMC_SERVICE
+ GET_FULL_URL
+ E
+ Returns complete URL string
+
+
+ ZCL_IBMC_SERVICE
+ GET_REQUEST_PROP
+ E
+ Returns default request properties
+
+
+ ZCL_IBMC_SERVICE
+ GET_REST_CLIENT
+ E
+ Creates a REST client instance
+
+
+ ZCL_IBMC_SERVICE
+ HTTP_DELETE
+ E
+ Performs a http DELETE request
+
+
+ ZCL_IBMC_SERVICE
+ HTTP_GET
+ E
+ Performs a http GET request
+
+
+ ZCL_IBMC_SERVICE
+ HTTP_POST
+ E
+ Performs a http POST request
+
+
+ ZCL_IBMC_SERVICE
+ HTTP_POST_MULTIPART
+ E
+ Performs a HTTP POST request with multipart body
+
+
+ ZCL_IBMC_SERVICE
+ HTTP_PUT
+ E
+ Performs a http PUT request
+
+
+ ZCL_IBMC_SERVICE
+ MOVE_DATA_REFERENCE_TO_ABAP
+ E
+ Moves type DATA_REFERENCE to ABAP structure
+
+
+ ZCL_IBMC_SERVICE
+ NORMALIZE_URL
+ E
+ Normalize URL in structure of type TS_URL
+
+
+ ZCL_IBMC_SERVICE
+ PARSE_JSON
+ E
+ Parses a JSON string into an ABAP structure
+
+
+ ZCL_IBMC_SERVICE
+ RAISE_EXCEPTION
+ E
+ Throws an exception of type ZCX_IBMC_SERVICE_EXCEPTION
+
+
+ ZCL_IBMC_SERVICE
+ SET_ACCESS_TOKEN
+ E
+ Sets an authorization token explicitly
+
+
+ ZCL_IBMC_SERVICE
+ UNESCAPE_UNICODE
+ E
+ Unescapes unicode codepoints
+
+
+
+
+
diff --git a/src/zcl_ibmc_service_arch.clas.abap b/src/zcl_ibmc_service_arch.clas.abap
new file mode 100644
index 0000000..db0ec46
--- /dev/null
+++ b/src/zcl_ibmc_service_arch.clas.abap
@@ -0,0 +1,368 @@
+* 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.
+CLASS zcl_ibmc_service_arch DEFINITION
+ PUBLIC
+ CREATE PUBLIC .
+
+ PUBLIC SECTION.
+
+ INTERFACES zif_ibmc_service_arch .
+
+ TYPES to_http_client TYPE REF TO if_web_http_client .
+ TYPES to_rest_request TYPE REF TO if_web_http_request .
+ TYPES to_rest_response TYPE REF TO if_web_http_response .
+ TYPES to_form_part TYPE REF TO if_web_http_request .
+ TYPES:
+ BEGIN OF ts_client,
+ http TYPE to_http_client,
+ request TYPE to_rest_request,
+ END OF ts_client .
+ TYPES:
+ BEGIN OF ts_http_stat,
+ code TYPE i,
+ reason TYPE string,
+ END OF ts_http_stat .
+ TYPES:
+ BEGIN OF ts_http_status,
+ code TYPE n LENGTH 3,
+ reason TYPE string,
+ json TYPE string,
+ END OF 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 .
+
+ CLASS-METHODS get_timezone
+ RETURNING
+ VALUE(e_timezone) TYPE zif_ibmc_service_arch~ty_timezone .
+ CLASS-METHODS get_progname
+ RETURNING
+ VALUE(e_progname) TYPE string .
+ CLASS-METHODS base64_decode
+ IMPORTING
+ !i_base64 TYPE string
+ RETURNING
+ VALUE(e_binary) TYPE xstring
+ RAISING
+ zcx_ibmc_service_exception .
+ CLASS-METHODS create_client_by_url
+ IMPORTING
+ !i_url TYPE string
+ !i_request_prop TYPE ts_request_prop
+ EXPORTING
+ !e_client TYPE ts_client
+ RAISING
+ zcx_ibmc_service_exception .
+ CLASS-METHODS get_default_proxy
+ IMPORTING
+ !i_url TYPE ts_url OPTIONAL
+ EXPORTING
+ !e_proxy_host TYPE string
+ !e_proxy_port TYPE string .
+ CLASS-METHODS set_authentication_basic
+ IMPORTING
+ !i_client TYPE ts_client
+ !i_username TYPE string
+ !i_password TYPE string .
+ CLASS-METHODS set_request_header
+ IMPORTING
+ !i_client TYPE ts_client
+ !i_name TYPE string
+ !i_value TYPE string .
+ CLASS-METHODS set_request_uri
+ IMPORTING
+ !i_client TYPE ts_client
+ !i_uri TYPE string .
+ METHODS add_form_part
+ IMPORTING
+ !i_client TYPE ts_client
+ !it_form_part TYPE zif_ibmc_service_arch~tt_form_part
+ RAISING
+ zcx_ibmc_service_exception .
+ CLASS-METHODS execute
+ IMPORTING
+ !i_client TYPE ts_client
+ !i_method TYPE zif_ibmc_service_arch~char
+ RETURNING
+ VALUE(e_response) TYPE to_rest_response
+ RAISING
+ zcx_ibmc_service_exception .
+ CLASS-METHODS get_response_string
+ IMPORTING
+ !i_response TYPE REF TO if_web_http_response
+ RETURNING
+ VALUE(e_data) TYPE string .
+ CLASS-METHODS set_request_body_cdata
+ IMPORTING
+ !i_client TYPE ts_client
+ !i_data TYPE string .
+ CLASS-METHODS set_request_body_xdata
+ IMPORTING
+ !i_client TYPE ts_client
+ !i_data TYPE xstring .
+ CLASS-METHODS get_response_binary
+ IMPORTING
+ !i_response TYPE REF TO if_web_http_response
+ RETURNING
+ VALUE(e_data) TYPE xstring .
+ CLASS-METHODS get_http_status
+ IMPORTING
+ !i_rest_response TYPE REF TO if_web_http_response
+ RETURNING
+ VALUE(e_status) TYPE ts_http_status .
+ CLASS-METHODS convert_string_to_utf8
+ IMPORTING
+ !i_string TYPE string
+ RETURNING
+ VALUE(e_utf8) TYPE xstring
+ RAISING
+ zcx_ibmc_service_exception .
+ PROTECTED SECTION.
+ PRIVATE SECTION.
+ENDCLASS.
+
+
+
+CLASS zcl_ibmc_service_arch IMPLEMENTATION.
+
+
+ METHOD base64_decode.
+
+ e_binary = cl_web_http_utility=>decode_x_base64( i_base64 ).
+
+* if sy-subrc <> 0.
+* zcl_ibmc_service=>raise_exception( i_msgno = '030' ). " Decoding of base64 string failed
+* endif.
+
+ ENDMETHOD.
+
+
+ METHOD convert_string_to_utf8.
+
+ CALL METHOD cl_web_http_utility=>encode_utf8
+ EXPORTING
+ unencoded = i_string
+ RECEIVING
+ encoded = e_utf8
+ EXCEPTIONS
+ OTHERS = 1.
+ IF sy-subrc <> 0.
+ zcl_ibmc_service=>raise_exception( i_text = 'Cannot convert string to UTF-8' ) ##NO_TEXT.
+ ENDIF.
+
+ ENDMETHOD.
+
+
+ METHOD create_client_by_url.
+
+ DATA:
+ lv_text TYPE string.
+
+ TRY.
+ "create http destination by url
+ DATA(lo_http_destination) =
+ cl_http_destination_provider=>create_by_url( i_url ).
+ CATCH cx_http_dest_provider_error.
+ ENDTRY.
+
+ "create HTTP client by destination
+ TRY.
+ e_client-http = cl_web_http_client_manager=>create_by_http_destination( lo_http_destination ) .
+ CATCH cx_web_http_client_error.
+ lv_text = `HTTP client cannot be created: ` && lv_text ##NO_TEXT.
+ zcl_ibmc_service=>raise_exception( i_text = lv_text ).
+ ENDTRY.
+
+ e_client-request = e_client-http->get_http_request( ).
+
+ ENDMETHOD.
+
+
+ METHOD execute.
+
+ DATA:
+ lo_request TYPE REF TO if_web_http_request,
+ lv_method TYPE string,
+ lv_text TYPE string,
+ lo_exception TYPE REF TO cx_web_http_client_error.
+
+ TRY.
+ CASE i_method.
+ WHEN zif_ibmc_service_arch~c_method_get.
+ lv_method = 'GET'.
+ e_response = i_client-http->execute( if_web_http_client=>get ).
+ WHEN zif_ibmc_service_arch~c_method_post.
+ lv_method = 'POST'.
+ e_response = i_client-http->execute( if_web_http_client=>post ).
+ WHEN zif_ibmc_service_arch~c_method_put.
+ lv_method = 'PUT'.
+ e_response = i_client-http->execute( if_web_http_client=>put ).
+ WHEN zif_ibmc_service_arch~c_method_delete.
+ lv_method = 'DELETE'.
+ e_response = i_client-http->execute( if_web_http_client=>delete ).
+ ENDCASE.
+
+ CATCH cx_web_http_client_error INTO lo_exception.
+ lv_text = lo_exception->get_text( ).
+ lv_text = `HTTP ` && lv_method && ` request failed: ` && lv_text ##NO_TEXT.
+ zcl_ibmc_service=>raise_exception( i_text = lv_text i_previous = lo_exception ).
+ ENDTRY.
+
+
+ ENDMETHOD.
+
+
+ METHOD add_form_part.
+
+ CONSTANTS:
+ lc_boundary TYPE string VALUE `--------------------------f530e26f981510ab` ##NO_TEXT.
+
+ DATA:
+ ls_form_part TYPE zif_ibmc_service_arch~ts_form_part,
+ lx_data TYPE xstring,
+ lv_header TYPE string,
+ lx_header TYPE xstring,
+ lx_body TYPE xstring,
+ lx_crlf TYPE xstring VALUE '0D0A',
+ lx_dash2 TYPE xstring VALUE '2D2D'.
+
+ DATA(lx_boundary) = convert_string_to_utf8( lc_boundary ).
+
+ lx_body = lx_crlf.
+
+ LOOP AT it_form_part INTO ls_form_part.
+
+ lx_body = lx_body && lx_dash2 && lx_boundary && lx_crlf.
+
+ IF NOT ls_form_part-content_type IS INITIAL.
+ lv_header = `Content-Type: ` && ls_form_part-content_type.
+ lx_header = convert_string_to_utf8( lv_header ).
+ lx_body = lx_body && lx_header && lx_crlf.
+ ENDIF.
+ IF NOT ls_form_part-content_disposition IS INITIAL.
+ lv_header = `Content-Disposition: ` && ls_form_part-content_disposition ##NO_TEXT.
+ ELSE.
+ lv_header = `Content-Disposition: form-data; name="unnamed"` ##NO_TEXT.
+ ENDIF.
+ lx_header = convert_string_to_utf8( lv_header ).
+ lx_body = lx_body && lx_header && lx_crlf && lx_crlf.
+ IF NOT ls_form_part-xdata IS INITIAL.
+ lx_body = lx_body && ls_form_part-xdata && lx_crlf.
+ DATA(lc_data) = cl_web_http_utility=>encode_x_base64( unencoded = ls_form_part-xdata ).
+ ENDIF.
+ IF NOT ls_form_part-cdata IS INITIAL.
+ lx_data = convert_string_to_utf8( ls_form_part-cdata ).
+ lx_body = lx_body && lx_data && lx_crlf.
+ ENDIF.
+
+ ENDLOOP.
+ lx_body = lx_body && lx_dash2 && lx_boundary && lx_dash2 && lx_crlf.
+
+ set_request_header( i_client = i_client i_name = `Content-Type` i_value = `multipart/form-data; boundary=` && lc_boundary && `; charset=utf-8` ) ##NO_TEXT.
+ set_request_body_xdata( i_client = i_client i_data = lx_body ).
+
+ ENDMETHOD.
+
+
+ METHOD get_default_proxy.
+
+ ENDMETHOD.
+
+
+ METHOD get_http_status.
+ DATA: ls_status TYPE ts_http_stat.
+
+ ls_status = i_rest_response->get_status( ).
+ e_status-code = ls_status-code.
+ e_status-reason = ls_status-reason.
+ TRY.
+ e_status-json = i_rest_response->get_text( ).
+ CATCH cx_web_message_error.
+ " response may be binary -> ignore
+ e_status-json = ''.
+ ENDTRY.
+ ENDMETHOD.
+
+
+ METHOD get_progname.
+
+* e_progname = sy-cprog.
+
+ ENDMETHOD.
+
+
+ METHOD get_response_binary.
+
+ e_data = i_response->get_binary( ).
+
+ ENDMETHOD.
+
+
+ METHOD get_response_string.
+
+ e_data = i_response->get_text( ).
+
+ ENDMETHOD.
+
+
+ METHOD get_timezone.
+
+* e_timezone = sy-zonlo.
+
+ ENDMETHOD.
+
+
+ METHOD set_authentication_basic.
+
+ i_client-request->set_authorization_basic(
+ EXPORTING
+ i_username = i_username
+ i_password = i_password
+ ).
+
+ ENDMETHOD.
+
+
+ METHOD set_request_body_cdata.
+
+ i_client-request->set_text( i_text = i_data ).
+
+ ENDMETHOD.
+
+
+ METHOD set_request_body_xdata.
+
+ i_client-request->set_binary( i_data = i_data ).
+
+ ENDMETHOD.
+
+
+ METHOD set_request_header.
+
+ i_client-request->set_header_field( i_name = i_name i_value = i_value ) .
+
+ ENDMETHOD.
+
+
+ METHOD set_request_uri.
+
+ DATA:
+ lo_request TYPE REF TO if_web_http_request.
+
+ i_client-request->set_uri_path( i_uri_path = i_uri ).
+
+ ENDMETHOD.
+ENDCLASS.
diff --git a/src/zcl_ibmc_service_arch.clas.xml b/src/zcl_ibmc_service_arch.clas.xml
new file mode 100644
index 0000000..348dddf
--- /dev/null
+++ b/src/zcl_ibmc_service_arch.clas.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+ ZCL_IBMC_SERVICE_ARCH
+ E
+ IBM Watson SDK Platform-specifics
+ 1
+ X
+ X
+ X
+
+
+
+ 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 (GET, POST or DELETE)
+
+
+ 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 http response
+
+
+ ZCL_IBMC_SERVICE_ARCH
+ GET_PROGNAME
+ E
+ Returns the ABAP program name
+
+
+ ZCL_IBMC_SERVICE_ARCH
+ GET_RESPONSE_BINARY
+ E
+ Reads string data from response
+
+
+ ZCL_IBMC_SERVICE_ARCH
+ GET_RESPONSE_STRING
+ E
+ Reads string data from 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
+ Sets the body of a HTTP request object
+
+
+ ZCL_IBMC_SERVICE_ARCH
+ SET_REQUEST_BODY_XDATA
+ E
+ Sets the body of a HTTP request object
+
+
+ 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
+
+
+
+
+
diff --git a/src/zcl_ibmc_service_ext.clas.abap b/src/zcl_ibmc_service_ext.clas.abap
new file mode 100644
index 0000000..da380b1
--- /dev/null
+++ b/src/zcl_ibmc_service_ext.clas.abap
@@ -0,0 +1,1023 @@
+* 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.
+class ZCL_IBMC_SERVICE_EXT definition
+ public
+ inheriting from ZCL_IBMC_SERVICE
+ create public .
+
+public section.
+
+ types:
+ ty_instance_id(32) type c .
+ types:
+ ty_servicename(30) type c .
+ types:
+ ty_image_format(3) type c .
+ types TY_IMAGE_CLASS type STRING .
+ types:
+ begin of ts_oauth_prop,
+ url type ts_url,
+ username type string,
+ password type string,
+ apikey type string,
+ end of ts_oauth_prop .
+
+ constants C_FIELD_NONE type FIELDNAME value '###' ##NO_TEXT.
+ constants C_FORMAT_JPG type TY_IMAGE_FORMAT value 'jpg' ##NO_TEXT.
+ constants C_FORMAT_PNG type TY_IMAGE_FORMAT value 'png' ##NO_TEXT.
+ constants C_FORMAT_GIF type TY_IMAGE_FORMAT value 'gif' ##NO_TEXT.
+ constants C_FORMAT_TIF type TY_IMAGE_FORMAT value 'tif' ##NO_TEXT.
+ constants C_FORMAT_ZIP type TY_IMAGE_FORMAT value 'zip' ##NO_TEXT.
+ constants C_FORMAT_ALL type TY_IMAGE_FORMAT value '*' ##NO_TEXT.
+ constants C_FORMAT_UNKNOWN type TY_IMAGE_FORMAT value '###' ##NO_TEXT.
+ constants C_TOKEN_GENERATION_NEVER type CHAR value 'N' ##NO_TEXT.
+ constants C_TOKEN_GENERATION_ALWAYS type CHAR value 'A' ##NO_TEXT.
+ constants C_TOKEN_GENERATION_AUTO type CHAR value SPACE ##NO_TEXT.
+ constants C_IAM_TOKEN_HOST type STRING value 'iam.cloud.ibm.com' ##NO_TEXT.
+ constants C_IAM_TOKEN_PATH type STRING value '/identity/token' ##NO_TEXT.
+ data P_INSTANCE_ID type TY_INSTANCE_ID .
+ data P_SERVICENAME type TY_SERVICENAME .
+
+ "! 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 GET_BEARER_TOKEN
+ returning
+ value(E_BEARER_TOKEN) type STRING .
+ "! Returns the SDK built date.
+ "!
+ "! @parameter E_SDK_VERSION_DATE | Built data in format YYYYMMDD.
+ "!
+ methods GET_SDK_VERSION_DATE
+ returning
+ value(E_SDK_VERSION_DATE) type STRING .
+ "! Method for internal use.
+ "!
+ methods SET_BEARER_TOKEN
+ importing
+ !I_BEARER_TOKEN type STRING .
+ "! Retrieves a value of a configuration parameter from table ZIBMC_CONFIG.
+ "!
+ "! @parameter I_DEFUALT | Default value, if configuration parameter is not found.
+ "! @parameter I_PARAM | Configuration parameter name.
+ "!
+ methods GET_CONFIG_VALUE
+ importing
+ !I_DEFAULT type ZIBMC_CONFIG-VALUE optional
+ !I_PARAM type ZIBMC_CONFIG-PARAM
+ returning
+ value(E_VALUE) type ZIBMC_CONFIG-VALUE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Factory method to instantiate a service specific wrapper class.
+ "!
+ "! @parameter I_INSTANCE_ID |
+ "! Value of field INSTANCE_UID in table ZIBMC_CONFIG.
+ "! Service credentials are read from table ZIBMC_CONFIG with key SERVICE = Name of service wrapper class without prefix ZCL_IBMC_ and INSTANCE_UID.
+ "! @parameter I_URL | URL of the service.
+ "! @parameter I_HOST | Host of the service. I_URL and I_HOST can be used synonymously.
+ "! @parameter I_USERNAME | User password to authenticate on service.
+ "! @parameter I_PASSWORD | User password to authenticate on service.
+ "! @parameter I_PROXY_HOST | Proxy server, not applicable on SAP Cloud Platform.
+ "! @parameter I_PROXY_PORT | Proxy server port, not applicable on SAP Cloud Platform.
+ "! @parameter I_APIKEY | API key password to authenticate on service.
+ "! @parameter I_AUTH_METHOD | Authentication method. Possible values are "IAM", "ICP4D", "basicAuth", "NONE".
+ "! @parameter I_I_OAUTH_PROP | Credentials to generate token for OAuth authentication.
+ "! @parameter I_TOKEN_GENERATION | Method for access token refresh:
+ "! C_TOKEN_GENERATION_NEVER - Access token is not refreshed.
+ "! C_TOKEN_GENERATION_ALWAYS - Access to token is refreshed for each service call.
+ "! C_TOKEN_GENERATION_AUTO - Access to token is refreshed just before it expires.
+ "! @parameter I_REQUEST_HEADERS | List of headers sent with every request, format 'Header1=Value1;Header2=Value2'.
+ "! @parameter I_VERSION | Value of query parameter VERSION.
+ "!
+ class-methods GET_INSTANCE
+ importing
+ !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_SERVICE 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_TOKEN_GENERATION type CHAR default C_TOKEN_GENERATION_AUTO
+ !I_REQUEST_HEADERS type STRING optional
+ !I_VERSION type STRING optional
+ exporting
+ value(EO_INSTANCE) type ANY .
+ "! Compresses multiple images from an internal table to a one or more xstrings in ZIP format.
+ "!
+ "! @parameter IT_EXAMPLES | Internal table of images.
+ "! @parameter IV_FIELD_CLASS |
+ "! Field in IT_EXAMPLES that contains the file class.
+ "! All records in IT_EXAMPLES with same class will be compress into one ZIP xstring.
+ "! @parameter IV_FIELD_FILENAME | Field in IT_EXAMPLES that contains the filename for the image.
+ "! @parameter IV_FIELD_IMAGE | Field in IT_EXAMPLES that contains the image.
+ "! @parameter IV_IMAGE_FORMAT | Format of the image. Possible values are
+ "! C_FORMAT_JPG, C_FORMAT_PNG, C_FORMAT_GIF, C_FORMAT_TIF, C_FORMAT_ALL.
+ "! @parameter IV_IMAGE_NAME | Name of the image.
+ "! @parameter ET_ZIPDATA | Internal table containing a compressed ZIP xstring for each image class.
+ "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error.
+ "!
+ class-methods GET_ZIPDATA
+ importing
+ !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
+ exporting
+ !ET_ZIPDATA type TT_MAP_FILE
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+
+ methods GET_ACCESS_TOKEN
+ redefinition .
+ methods GET_REQUEST_PROP
+ redefinition .
+ methods SET_ACCESS_TOKEN
+ redefinition .
+protected section.
+private section.
+
+ data P_OAUTH_PROP type TS_OAUTH_PROP .
+ data P_TOKEN_GENERATION type CHAR .
+ data P_TOKEN_SAVED type ZIBMC_TOKEN .
+
+ "! Method for internal use.
+ "!
+ class-methods ADD_CONFIG_PROP
+ importing
+ !I_SERVICENAME type TY_SERVICENAME
+ !I_INSTANCE_ID type TY_INSTANCE_ID optional
+ changing
+ !C_REQUEST_PROP type ANY .
+ "! Method for internal use.
+ "!
+ class-methods ADD_IMAGE_TO_ZIP
+ importing
+ !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
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ "! Method for internal use.
+ "!
+ class-methods GET_FIELD_DATA
+ importing
+ !IS_TABLELINE type ANY
+ !IV_FIELD_CLASS type FIELDNAME optional
+ !IV_FIELD_FILENAME type FIELDNAME optional
+ !IV_FIELD_IMAGE type FIELDNAME optional
+ exporting
+ !EV_FIELD_CLASS type FIELDNAME
+ !EV_FIELD_FILENAME type FIELDNAME
+ !EV_FIELD_IMAGE type FIELDNAME
+ !EV_FIELD_IMAGE_BASE64 type FIELDNAME
+ raising
+ ZCX_IBMC_SERVICE_EXCEPTION .
+ENDCLASS.
+
+
+
+CLASS ZCL_IBMC_SERVICE_EXT IMPLEMENTATION.
+
+
+ method add_config_prop.
+
+ data:
+ lt_compname type tt_string,
+ lv_type type char,
+ ls_config type zibmc_config,
+ lt_config type standard table of zibmc_config,
+ lt_ref type standard table of ref to data,
+ lr_data type ref to data,
+ lv_index type i value 0,
+ ls_url type ts_url value is initial.
+
+ field-symbols:
+ type any,
+ type any,
+ type string,
+ type any.
+
+ " read config table
+ if not i_instance_id is initial.
+ select *
+ from zibmc_config
+ where service = @i_servicename and
+ instance_uid = @i_instance_id
+ into table @lt_config.
+ else.
+ select *
+ from zibmc_config
+ where service = @i_servicename and
+ instance_uid = @space
+ into table @lt_config.
+ endif.
+
+ " quit, if no relevant entry in config table exists
+ check sy-subrc = 0.
+
+ " change config parameter "URL" to "HOST"
+ ls_config-param = 'HOST'.
+ modify lt_config from ls_config transporting param where param = 'URL'.
+
+ " perform breadth-first search on c_request_prop to allow setting values on deeper levels,
+ " e.g. HOST -> c_request_prop-url-host
+ lr_data = ref #( c_request_prop ).
+ append lr_data to lt_ref.
+
+ do.
+ lv_index = lv_index + 1.
+ read table lt_ref into lr_data index lv_index.
+ if sy-subrc <> 0.
+ exit.
+ endif.
+ assign lr_data->* to .
+
+ get_components(
+ exporting
+ i_structure =
+ importing
+ e_components = lt_compname ).
+
+ loop at lt_compname assigning .
+ assign component of structure to .
+ check sy-subrc = 0.
+ get_field_type(
+ exporting
+ 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.
+ lr_data = ref #( ).
+ append lr_data to lt_ref.
+ else.
+ if is initial.
+ read table lt_config into ls_config with key param = ##WARN_OK.
+ if sy-subrc = 0.
+ condense ls_config-value.
+ = ls_config-value.
+ endif.
+ endif.
+ endif.
+ endloop.
+
+ enddo.
+
+ endmethod.
+
+
+ method add_image_to_zip.
+ data:
+ lx_image type xstring,
+ lv_filename type string.
+ field-symbols:
+ type any,
+ type any.
+
+ if not iv_filename is initial.
+ lv_filename = iv_filename.
+ else.
+ assign component iv_field_filename of structure is_tableline to .
+ lv_filename = conv #( ). " type conversion
+ if lv_filename is initial.
+ raise_exception( i_msgno = '056' ).
+ endif.
+ endif.
+
+ assign component iv_field_image of structure is_tableline to .
+
+ if iv_base64 eq c_boolean_true.
+
+ lx_image = base64_decode( i_base64 =