├── .abapgit.xml ├── .gitignore ├── LICENSE ├── MIGRATION-V2.0.0.md ├── README.md ├── docs ├── ABAPDoc │ ├── abapdoc │ │ └── zibmc │ │ │ ├── classes │ │ │ ├── zcl_ibmc_assistant_v1.html │ │ │ ├── zcl_ibmc_assistant_v2.html │ │ │ ├── zcl_ibmc_discovery_v2.html │ │ │ ├── zcl_ibmc_lang_translator_v3.html │ │ │ ├── zcl_ibmc_nat_lang_undrstnd_v1.html │ │ │ ├── zcl_ibmc_service.html │ │ │ ├── zcl_ibmc_service_arch.html │ │ │ ├── zcl_ibmc_service_ext.html │ │ │ ├── zcl_ibmc_speech_to_text_v1.html │ │ │ ├── zcl_ibmc_text_to_speech_v1.html │ │ │ ├── zcl_ibmc_util.html │ │ │ └── zcx_ibmc_service_exception.html │ │ │ └── interfaces │ │ │ └── zif_ibmc_service_arch.html │ ├── htmldesign │ │ └── stylesheet.css │ └── readme.txt └── index.html └── src ├── package.devc.xml ├── zcl_ibmc_assistant_v1.clas.abap ├── zcl_ibmc_assistant_v1.clas.xml ├── zcl_ibmc_assistant_v2.clas.abap ├── zcl_ibmc_assistant_v2.clas.xml ├── zcl_ibmc_discovery_v2.clas.abap ├── zcl_ibmc_discovery_v2.clas.xml ├── zcl_ibmc_lang_translator_v3.clas.abap ├── zcl_ibmc_lang_translator_v3.clas.xml ├── zcl_ibmc_nat_lang_undrstnd_v1.clas.abap ├── zcl_ibmc_nat_lang_undrstnd_v1.clas.xml ├── zcl_ibmc_service.clas.abap ├── zcl_ibmc_service.clas.xml ├── zcl_ibmc_service_arch.clas.abap ├── zcl_ibmc_service_arch.clas.xml ├── zcl_ibmc_service_ext.clas.abap ├── zcl_ibmc_service_ext.clas.xml ├── zcl_ibmc_speech_to_text_v1.clas.abap ├── zcl_ibmc_speech_to_text_v1.clas.xml ├── zcl_ibmc_text_to_speech_v1.clas.abap ├── zcl_ibmc_text_to_speech_v1.clas.xml ├── zcl_ibmc_util.clas.abap ├── zcl_ibmc_util.clas.xml ├── zcx_ibmc_service_exception.clas.abap ├── zcx_ibmc_service_exception.clas.xml ├── zibmc.msag.xml ├── zibmc_config.tabl.xml ├── zibmc_dom_stringvalue.doma.xml ├── zibmc_token.tabl.xml ├── zibmc_ty_instance_uid.dtel.xml ├── zibmc_ty_stringvalue.dtel.xml ├── zif_ibmc_service_arch.intf.abap └── zif_ibmc_service_arch.intf.xml /.abapgit.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | E 6 | /src/ 7 | PREFIX 8 | 9 | /.gitignore 10 | /LICENSE 11 | /README.md 12 | /package.json 13 | /.travis.yml 14 | /.gitlab-ci.yml 15 | /abaplint.json 16 | /MIGRATION-V0.3.0.md 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore .gitignore, target, dist and tmp folders 2 | src/*/.gitignore 3 | src/*/target/ 4 | src/*/dist/ 5 | src/*/coverage/ 6 | /target 7 | /tmp 8 | 9 | # Ignore default target directory for the npm package 'ui5-codecompletion' 10 | .ui5 11 | 12 | # Ignore Eclipse project and settings files 13 | .classpath 14 | .settings 15 | .project 16 | .externalToolBuilders 17 | 18 | # Ignore IntelliJ project and settings files 19 | .idea 20 | *.iml 21 | 22 | # Ignore Mac files 23 | .DS_Store 24 | 25 | # Ignore Visual Studio project and settings files 26 | *.sln 27 | *.suo 28 | web.config 29 | /.user.project.json 30 | /sap-ui-cachebuster-info.json 31 | 32 | # Ignore Visual Studio Code project and settings files 33 | .vscode/ 34 | 35 | # Ignore yarn files 36 | yarn-error.log* 37 | yarn-debug.log* 38 | .yarn-integrity 39 | # Ignore default target directory for the npm package 'ui5-schemas' 40 | .tmp 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /MIGRATION-V2.0.0.md: -------------------------------------------------------------------------------- 1 | # Upgrading to ABAP SDK version 2.0.0 2 | 3 | Note: If migrating from a version less than v1.0.0, also see the 4 | [v1.0.0 migration guide 5 | wiki](https://github.com/watson-developer-cloud/abap-sdk-nwas/blob/1.0.0/MIGRATION-V1.0.0.md). 6 | 7 |
8 | Table of Contents 9 | 10 | - [Breaking changes](#breaking-changes) 11 | - [Breaking changes by service](#breaking-changes-by-service) 12 | - [Watson Assistant V1](#watson-assistant-v1) 13 | - [Watson Assistant V2](#watson-assistant-v2) 14 | - [Language Translator V3](#language-translator-v3) 15 | - [Speech to Text V1](#speech-to-text-v1) 16 | - [New features by service](#new-features-by-service) 17 | - [Watson Assistant V1](#watson-assistant-v1-1) 18 | - [Watson Assistant V2](#watson-assistant-v2-1) 19 | - [Discovery V2](#discovery-v2) 20 | - [Natural Language Understanding V1](#natural-language-understanding-v1) 21 | - [Text to Speech V1](#text-to-speech-v1) 22 | - [Speech to Text V1](#speech-to-text-v1-1) 23 | - [Discontinued services](#discontinued-services) 24 | - [Discontinued services still included in the ABAP SDK in version 2.0.0](#discontinued-services-still-included-in-the-abap-sdk-in-version-200) 25 | - [Language Translator V3](#language-translator-v3-1) 26 | - [Discontinued services removed from the ABAP SDK in version 2.0.0](#discontinued-services-removed-from-the-abap-sdk-in-version-200) 27 | - [Compare and Comply V1](#compare-and-comply-v1) 28 | - [Discovery V1](#discovery-v1) 29 | - [Natural Language Classifier V1](#natural-language-classifier-v1) 30 | - [Personality Insights V3](#personality-insights-v3) 31 | - [Tone Analyzer V3](#tone-analyzer-v3) 32 | - [Visual Recognition V3 and V4](#visual-recognition-v3-and-v4) 33 | 34 |
35 | 36 | ## Breaking changes 37 | 38 | ### Breaking changes by service 39 | 40 | #### Watson Assistant V1 41 | 42 | Component `Text` was removed from structure `t_Output_Data` for method `message`. The returned data is now available in component `Generic`, a standard table of `t_Runtime_Response_Generic`, which results in data of type `JSONOBJECT`. To convert data in a variable of type `JSONOBJECT` to data type string, you can use method `move_data_reference_to_abap`, which is provided in the service class `zcl_ibmc_service`. 43 | 44 | #### Watson Assistant V2 45 | 46 | Data type `t_Dialog_Nodes_Visited` was renamed to `t_Dialog_Node_Visited`. 47 | 48 | #### Language Translator V3 49 | 50 | The following input parameters for method `Create_Model` were renamed: 51 | 52 | | Old name | New name | 53 | |:-----------------------|:---------------------------------| 54 | | `i_Forced_Glossary_ct` | `i_Forced_Glossary_Content_Type` | 55 | | `i_Parallel_Corpus_ct` | `i_Parallel_Corpus_Content_Type` | 56 | 57 | Default values for these parameters are no longer provided. 58 | 59 | #### Speech to Text V1 60 | 61 | - Methods `Recognize` and `Create_Job`: 62 | 63 | - Parameter `i_Customization_Id` was removed - use 64 | parameter `i_Language_Customization_Id` instead. 65 | 66 | - Method `Add_Grammar` 67 | 68 | - Type of parameter `i_Grammar_File` was changed from 69 | `String` to `File`. 70 | 71 | ### New features by service 72 | 73 | #### Watson Assistant V1 74 | 75 | - Support for asynchronous workspace operations - new methods: 76 | 77 | - `Create_Workspace_Async`, `Export_Workspace_Async`, `Update_Workspace_Async` 78 | 79 | #### Watson Assistant V2 80 | 81 | - Support to create and modify assistants, releases, skills and environments - new methods: 82 | 83 | - `Create_Assistant`, `Delete_Assistant`, `List_Assistants` 84 | - `Create_Release`, `Delete_Release`, `Deploy_Release`, `Get_Release`, `List_Releases` 85 | - `Export_Skills`, `Get_Skill`, `Import_Skills`, `Import_Skills_Status`, `Update_Skill` 86 | - `Get_Environment`, `List_Environments`, `Update_Environment` 87 | 88 | #### Discovery V2 89 | 90 | The ABAP SDK includes now interfaces to all Discovery V2 91 | methods. See details on IBM's documentation site 92 | [here](https://cloud.ibm.com/apidocs/discovery-data). 93 | 94 | #### Natural Language Understanding V1 95 | 96 | - Support to create and modify custom models - new methods: 97 | 98 | - `create_categories_model`, `list_categories_models`, `get_categories_model`, `update_categories_model`, `delete_categories_model` 99 | - `create_classifications_model`, `list_classifications_models`, `get_classifications_model`, `update_classifications_model`, `delete_classifications_model` 100 | 101 | #### Text to Speech V1 102 | 103 | - Support for custom prompts and speaker models - new methods: 104 | 105 | - `List_Custom_Prompts`, `Get_Custom_Prompt`, `Add_Custom_Prompt`, `Delete_Custom_Prompt` 106 | - `List_Speaker_Models`, `Get_Speaker_Model`, `Create_Speaker_Model`, `Delete_Speaker_Model` 107 | 108 | - Method `Synthesize`: 109 | 110 | - New optional parameters `i_Spell_Out_Mode`, 111 | `i_Rate_Percentage` and`i_Pitch_Percentage`. 112 | 113 | See details of these new methods and parameters on IBM's 114 | documentation site [here](https://cloud.ibm.com/apidocs/text-to-speech). 115 | 116 | #### Speech to Text V1 117 | 118 | - Methods `Recognize` and `Create_Job`: 119 | 120 | - New optional parameters `i_Low_Latency` and `i_Character_Insertion_Bias`. 121 | 122 | - Methods `Train_Language_Model` and `Train_Acoustic_Model`: 123 | 124 | - New optional parameter `i_strict`. 125 | 126 | See details of these new parameters on IBM's documentation 127 | site [here](https://cloud.ibm.com/apidocs/speech-to-text). 128 | 129 | 130 | ### Discontinued services 131 | 132 | #### Discontinued services still included in the ABAP SDK in version 2.0.0 133 | 134 | The following service is discontinued. New service instances cannot be created anymore. The ABAP SDK still includes interfaces to this service, which cannot be used anymore when IBM support of the corresponding service ends. 135 | 136 | ##### Language Translator V3 137 | 138 | Existing instances are supported until 10 June 2024 and will be deleted afterwards. 139 | 140 | #### Discontinued services removed from the ABAP SDK in version 2.0.0 141 | 142 | The following services are discontinued. New service instances cannot be created anymore. Interfaces to these services have been removed from the ABAP SDK. 143 | 144 | ##### Compare and Comply V1 145 | 146 | Discontinued since 30 November 2021. 147 | 148 | ##### Discovery V1 149 | 150 | Discontinued since 11 July 2023. Migrate to Discovery V2. 151 | 152 | ##### Natural Language Classifier V1 153 | 154 | Discontinued since 9 August 2021. Migrate to Natural Language Understanding V1. 155 | 156 | ##### Personality Insights V3 157 | 158 | Discontinued since 1 December 2021. 159 | 160 | ##### Tone Analyzer V3 161 | 162 | Discontinued since 24 February 2023. Migrate to Natural Language Understanding V1. 163 | 164 | ##### Visual Recognition V3 and V4 165 | 166 | Discontinued since 1 December 2021. 167 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![CLA assistant](https://cla-assistant.io/readme/badge/watson-developer-cloud/abap-sdk-nwas)](https://cla-assistant.io/watson-developer-cloud/abap-sdk-nwas) 2 | 3 | # ABAP SDK for IBM Watson, using SAP NetWeaver 4 | 5 | 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 combined with any SAP Application which is run on SAP NetWeaver 7.50 and above, such as SAP Business Suite or SAP S/4HANA on-premises edition. It is the choice and responsibility of application developers how this Community SDK is used. 6 | 7 | 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). 8 | 9 | # Choose ABAP SDK release for the applicable ABAP Runtime 10 | 11 | | **abap-sdk-nwas** | [abap-sdk-scp](https://github.com/watson-developer-cloud/abap-sdk-scp) | 12 | |---|---| 13 | | for SAP NetWeaver AS ABAP 7.50+ | for SAP Cloud Platform ABAP Environment 2002+ | 14 | | tested on SAP Business Suite and SAP S/4HANA on-premises edition | | 15 | | `this repository` | | 16 | 17 | --- 18 | 19 |
20 | Table of Contents 21 | 22 | - [Announcements](#announcements) 23 | - [Before you begin](#before-you-begin) 24 | - [Installation](#installation) 25 | - [SAP System Configuration](#sap-system-configuration) 26 | - [SAP Profile Parameters](#sap-profile-parameters) 27 | - [Proxy configuration](#proxy-configuration) 28 | - [SSL Certificates](#ssl-certificates) 29 | - [Determine required certificate](#determine-required-certificate) 30 | - [Add an SSL certificate to the PSE](#add-an-ssl-certificate-to-the-pse) 31 | - [Restart the ICM (Internet Communication Manager)](#restart-the-icm-internet-communication-manager) 32 | - [Credentials](#credentials) 33 | - [Configuration table](#configuration-table) 34 | - [IAM Authentication](#iam-authentication) 35 | - [Usage](#usage) 36 | - [API Reference](#api-reference) 37 | - [Questions](#questions) 38 | - [License](#license) 39 | - [Contributors](#contributors) 40 | - [Acknowledgements](#acknowledgements) 41 | 42 |
43 | 44 | ## ANNOUNCEMENTS 45 | ### Major version 2.0.0 released 46 | Version v2.0.0 of the SDK has been released and includes breaking changes - see what's changed in the [migration guide](MIGRATION-V2.0.0.md). 47 | 48 | ## Before you begin 49 | * You need an [IBM Cloud][ibm_cloud_onboarding] account. 50 | 51 | ## Installation 52 | 53 | The client library is provided as ABAP Git Repository. Proceed as follows to clone the ABAP SDK code to your SAP system. 54 | 1. Install [abapGit][abapgit], using the [abapGit Docs][abapgit_docs] 55 | 2. Use abapGit to clone the ABAP SDK Git repository into your SAP system. 56 | 3. Assign the ABAP SDK to the package `ZIBMC` when performing setup of the abapGit repository. 57 | 58 | ## SAP System Configuration 59 | 60 | ### SAP Profile Parameters 61 | The following SAP profile parameter settings are recommended. 62 | ``` 63 | icm/HTTPS/client_sni_enabled = TRUE 64 | ssl/ciphersuites = 135:PFS:HIGH::EC_P256:EC_HIGH 65 | ssl/client_ciphersuites = 150:PFS:HIGH::EC_P256:EC_HIGH 66 | wdisp/ssl_ignore_host_mismatch = TRUE 67 | ``` 68 | 69 | ### Proxy configuration 70 | The client library respects the ABAP proxy settings. If you are using a central proxy server that is not already configured in your SAP system, proceed as follows. 71 | 1. Logon to the SAP system and call transaction SICF. 72 | 2. Click *Execute* (or press F8). 73 | 3. Select menu item *Client* → *Proxy Settings*. 74 | 4. On tab *Global Settings*: Select *Proxy Setting is Active* and *No Proxy Setting for Local Server*. 75 | 5. On tabs *HTTP Protocol* and *HTTPS Protocol* specify the proxy *Host Name* and *Port*. If the proxy server requires logon credentials, also specify *User Name* and *Password*. 76 | 6. Click *Execute (F8)* and *OK*. 77 | 78 | 79 | ### SSL Certificates 80 | 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 on the SAP application server in the Personal Security Environment (PSE). Transaction STRUST is used to maintain the PSE. 81 | 82 | #### Determine required certificate 83 | If a call to an IBM Cloud service failed due to a missing SSL certificate, check the ICM trace file to find the required certificate. To do so, call transaction SMICM and select menu item *Goto* → *Trace File* → *Display End*. Alternatively, call transaction AL11 and navigate to file DIR_HOME/dev_icm. 84 | Find last entry in trace file that indicates error *SSSLERR_PEER_CERT_UNTRUSTED*, as shown in the example below. 85 | ``` 86 | [Thr nn] Peer not trusted 87 | [Thr nn] Certificate: 88 | [Thr nn] Certificate: 89 | [Thr nn] Subject: CN=*.watsonplatform.net, O=INTERNATIONAL BUSINESS MACHINES CORPORATION, L=Armonk, SP=New York, C=US 90 | [Thr nn] Issuer: CN=GeoTrust RSA CA 2018, OU=www.digicert.com, O=DigiCert Inc, C=US 91 | [Thr nn] Serial Number: 05:1C:46:1B:6E:C2:29:48:BD:F0:03:B3:A6:87:1A:5B 92 | [Thr nn] Verification result: 93 | [...] 94 | [Thr nn] SignerCert: 95 | [Thr nn] Certificate: 96 | [Thr nn] Subject: CN=GeoTrust RSA CA 2018, OU=www.digicert.com, O=DigiCert Inc, C=US 97 | [Thr nn] Issuer: CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US 98 | [Thr nn] Serial Number: 05:46:FE:18:23:F7:E1:94:1D:A3:9F:CE:14:C4:61:73 99 | [Thr nn] Verification result: 100 | [...] 101 | [Thr nn] SignerCert: 102 | [Thr nn] Certificate: 103 | [Thr nn] Subject: CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US 104 | [...] 105 | [Thr nn] << ---------- End of Secu-SSL Errorstack ---------- 106 | [Thr nn] Target Hostname="stream.watsonplatform.net" 107 | [Thr nn] SSL NI-hdl 463: local=9.152.20.145:56542 peer=169.48.115.62:443 108 | [Thr nn] <<- ERROR: SapSSLSessionStartNB(sssl_hdl=3fef0000c70)==SSSLERR_PEER_CERT_UNTRUSTED 109 | [Thr nn] *** ERROR => SSL handshake with stream.watsonplatform.net:443 failed: SSSLERR_PEER_CERT_UNTRUSTED (-102) 110 | [Thr nn] The peer's X.509 Certificate (chain) is untrusted 111 | ``` 112 | The SSL error stack shows the SSL certificate chain, which in the example above looks like follows: 113 | 114 | | Certificate Authority Type | Certificate Authority (CA) | 115 | |:--------------------------:|:-------------------------- | 116 | | end-user | *.watsonplatform.net | 117 | | intermediate | GeoTrust RSA CA 2018 | 118 | | root | DigiCert Global Root CA | 119 | 120 | You can install any of these SSL certificates. However, it is recommended to install the root CA certificate.
121 | Download the appropriate SSL certificate from the provider's website, for example https://www.digicert.com/digicert-root-certificates.htm. Store the certificate file on your computer. 122 | 123 | 124 | #### Add an SSL certificate to the PSE 125 | 126 | Proceed as follows to add the downloaded SSL certificate to your SAP system's *Standard SSL Client PSE*. 127 | 1. Logon to the SAP system and call transaction STRUST. 128 | 2. Switch to edit mode (press according tool bar icon). 129 | 3. If a local PSE file does not exist already, create it by right-clicking on `SSL client SSL Client (Standard)` and selecting *Create* from context menu. Keep all default settings in next popup dialog. 130 | 4. In *Certificate* section, click *Import* (alternatively select menu item *Certificate* → *Import*). Choose the certificate file that you have downloaded and import the certificate. 131 | 5. Click button *Add to Certificate List*. 132 | 6. Click *Save (F3)*. 133 | 134 | 135 | #### Restart the ICM (Internet Communication Manager) 136 | 137 | It is recommended to restart the ICM after a new SSL certificate has been applied to the PSE. To do so, proceed as follows. 138 | 1. Logon to the SAP system and call transaction SMICM. 139 | 2. Select menu item *Administration* → *ICM* → *Restart* → *Yes*. 140 | 141 | ## Credentials 142 | 143 | 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. 144 | 145 | 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`. 146 | 147 | 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. 148 | 149 | 150 | ## Configuration table 151 | 152 | 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: 153 | 154 | | Table Key | Description | 155 | |:------------ |:-------------------------------------------------------------------------------------------------------------------------------------- | 156 | | SERVICE | The ABAP class name without prefix ZCL_IBMC_ | 157 | | INSTANCE_UID | ID chosen by application developer that must be provided by application as parameter to method `zcl_ibmc_service_ext=>get_instance()` | 158 | | PARAM | The parameter name | 159 | 160 |
161 | List of configuration parameters in table ZIBMC_CONFIG 162 | 163 | | Parameter Name | Default Value | Description | 164 | |:----------------- |:----------------- |:--------------------------------------------------------------------------- | 165 | | URL | service-dependent | Watson service url | 166 | | APIKEY | | Watson service API keys | 167 | | PROXY_HOST | | Proxy server | 168 | | PROXY_PORT | | Proxy server port | 169 | | AUTH_NAME | service-dependent | Authorization, `IAM` or `basicAuth` | 170 | | SSL_ID | CLIENT | SSL Identity, defines PSE for SSL certificates: `CLIENT` or `ANONYM` | 171 | 172 |
173 | 174 | 175 | ## IAM Authentication 176 | 177 | 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.
178 | 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.
179 | 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: 180 | ```abap 181 | lo_service_class->set_bearer_token( i_bearer_token = '...' ). 182 | ``` 183 | 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. 184 | 185 | 186 | ## Usage 187 | 188 | 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.
189 | The following Watson services are currently supported: 190 | 191 | | Service | ABAP Class Name | 192 | |:------------------------------ |:----------------------------------- | 193 | | Discovery | ZCL_IBMC_DISCOVERY_V2 | 194 | | Language Translator | ZCL_IBMC_LANG_TRANSLATOR_V3 (\*) | 195 | | Natural Language Understanding | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 | 196 | | Speech to Text | ZCL_IBMC_SPEECH_TO_TEXT_V1 | 197 | | Text to Speech | ZCL_IBMC_TEXT_TO_SPEECH_V1 | 198 | | Watson Assistant | ZCL_IBMC_ASSISTANT_V1 | 199 | | | ZCL_IBMC_ASSISTANT_V2 | 200 | 201 | (\*) Deprecated service; will be discontinued in the future. 202 | 203 | Using the client library requires two steps: 204 | 205 | 1. Create an instance of the Watson service wrapper ABAP class by calling method `zcl_ibmc_service_ext=>get_instance`. 206 | ```abap 207 | data: 208 | lo_service_class type . 209 | 210 | zcl_ibmc_service_ext=>get_instance( 211 | exporting 212 | i_url = 213 | i_apikey = 214 | ... 215 | importing 216 | eo_instance = lo_service_class ). 217 | ``` 218 | 219 | 2. Call the Watson service API endpoint by invoking the corresponding class method. 220 | ```abap 221 | try. 222 | lo_service_class->method( 223 | exporting 224 | is_input = ... 225 | importing 226 | es_output = ... ). 227 | catch zcx_ibmc_service_exception into data(lo_service_exception). 228 | ... 229 | endtry. 230 | ``` 231 | 232 |
233 | Text to Speech Example 234 | 235 | ```abap 236 | * List all voices provided by Watson Text to Speech 237 | 238 | " declare variables 239 | data: 240 | lv_apikey type string value '...', 241 | lo_text_to_speech type ref to zcl_ibmc_text_to_speech_v1, 242 | lo_service_exception type ref to zcx_ibmc_service_exception, 243 | ls_voice type zcl_ibmc_text_to_speech_v1=>t_voice, 244 | lt_voices type zcl_ibmc_text_to_speech_v1=>t_voices. 245 | 246 | " get Watson Text-to-Speech service instance 247 | zcl_ibmc_service_ext=>get_instance( 248 | exporting 249 | i_url = 'https://api.kr-seo.text-to-speech.watson.cloud.ibm.com/instances/' 250 | i_apikey = lv_apikey 251 | importing 252 | eo_instance = lo_text_to_speech ). 253 | 254 | " call Watson Text-to-Speech service to retrieve available voices 255 | try. 256 | lo_text_to_speech->list_voices( 257 | importing 258 | e_response = lt_voices ). 259 | 260 | catch zcx_ibmc_service_exception into lo_service_exception. 261 | message lo_service_exception type 'E'. 262 | endtry. 263 | 264 | " evaluate voices 265 | loop at lt_voices-voices into ls_voice. 266 | ... 267 | endloop. 268 | ``` 269 | 270 |
271 | 272 |
273 | Natural Language Understanding Example 274 | 275 | ```abap 276 | * Analyze www.ibm.com using Watson Natural Language Understanding 277 | 278 | " declare variables 279 | data: 280 | lv_apikey type string value '...', 281 | lo_instance type ref to zcl_ibmc_nat_lang_undrstnd_v1, 282 | lo_service_exception type ref to zcx_ibmc_service_exception, 283 | ls_parameter type zcl_ibmc_nat_lang_undrstnd_v1=>t_parameters, 284 | ls_analysis_results type zcl_ibmc_nat_lang_undrstnd_v1=>t_analysis_results. 285 | 286 | " get Watson Natural Language Understanding service instance 287 | zcl_ibmc_service_ext=>get_instance( 288 | exporting 289 | i_url = 'https://api.eu-de.natural-language-understanding.watson.cloud.ibm.com/instances/' 290 | i_apikey = lv_apikey 291 | i_version = '2019-07-12' 292 | importing 293 | eo_instance = lo_instance ). 294 | 295 | " set the input parameters 296 | ls_parameters-url = 'www.ibm.com'. 297 | ls_parameters-return_analyzed_text = zcl_ibmc_service=>c_boolean_true. 298 | ls_parameters-features-entities-emotion = zcl_ibmc_service=>c_boolean_true. 299 | ls_parameters-features-entities-sentiment = zcl_ibmc_service=>c_boolean_true. 300 | ls_parameters-features-keywords-emotion = zcl_ibmc_service=>c_boolean_true. 301 | ls_parameters-features-keywords-sentiment = zcl_ibmc_service=>c_boolean_true. 302 | 303 | " call Watson Natural Language Understanding service to analyze URL www.ibm.com 304 | try. 305 | lo_instance->analyze( 306 | exporting 307 | i_parameters = ls_parameters 308 | importing 309 | e_response = ls_analysis_results ). 310 | 311 | catch zcx_ibmc_service_exception into lo_service_exception. 312 | message lo_service_exception type 'E'. 313 | endtry. 314 | 315 | " retreive analysis results from ls_analysis_results 316 | 317 | ``` 318 | 319 |
320 | 321 |
322 | Language Translator Example 323 | 324 | ```abap 325 | * Translate text from English to German using Watson Language Translator 326 | 327 | " declare variables 328 | data: 329 | lv_apikey type string value '...', 330 | lo_lang_translator type ref to zcl_ibmc_lang_translator_v3, 331 | lo_service_exception type ref to zcx_ibmc_service_exception, 332 | ls_request type zcl_ibmc_lang_translator_v3=>t_translate_request, 333 | lv_text type string, 334 | ls_trans type zcl_ibmc_lang_translator_v3=>t_translation_result. 335 | 336 | " get Watson Language Translator service instance 337 | zcl_ibmc_service_ext=>get_instance( 338 | exporting 339 | i_url = 'https://api.us-south.language-translator.watson.cloud.ibm.com/instances/' 340 | i_apikey = lv_apikey 341 | i_version = '2018-05-01' 342 | importing 343 | eo_instance = lo_lang_translator ). 344 | 345 | " store text to be translated into ls_request and set the languages 346 | lv_text = 'Welcome'. 347 | append lv_text to ls_request-text. 348 | ls_request-model_id = 'en-de'. 349 | ls_request-source = 'EN'. 350 | ls_request-target = 'DE'. 351 | 352 | " call Watson Language Translator service to translate the text in ls_request 353 | try. 354 | lo_lang_translator->translate( 355 | exporting 356 | i_request = ls_request 357 | i_contenttype = 'application/json' 358 | i_accept = 'application/json' 359 | importing 360 | e_response = ls_trans ). 361 | 362 | catch zcx_ibmc_service_exception into lo_service_exception. 363 | message lo_service_exception type 'E'. 364 | endtry. 365 | 366 | " retreive translation results from ls_trans 367 | 368 | ``` 369 | 370 |
371 | 372 | ## API Reference 373 | 374 | GitHub Pages contain the [ABAP Client Library for Watson API Reference](https://watson-developer-cloud.github.io/abap-sdk-nwas/). 375 | 376 | ## Questions 377 | 378 | 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 379 | 380 | If you have questions about the IBM Watson services or are having difficulties using the APIs, please ask a question at [IBM Support Forums](https://www.ibm.com/mysupport/s/forumshome) or [Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-watson-cognitive). 381 | 382 | ## License 383 | 384 | This library is licensed under the [Apache 2.0 license][license]. 385 | 386 | --- 387 | 388 | ## Contributors 389 | 390 | * Christian Bartels 391 | * Joachim Rese 392 | * Jochen Röhrig 393 | * Aleksandar Debelic 394 | * Stefan Diederichs 395 | 396 | ## Acknowledgements 397 | 398 | * Bradley Knapp (Sponsor) 399 | * Devraj Bardhan (Sponsor) 400 | * Sean Freeman (Sponsor) 401 | 402 | In addition, we would like to thank the [abapGit][abapgit] contributors and the SAP Mentors of this team. 403 | 404 | [wdc]: https://cloud.ibm.com/docs?tab=api-docs&category=ai 405 | [ibm_cloud]: https://cloud.ibm.com/ 406 | [ibm_cloud_onboarding]: https://cloud.ibm.com/registration?target=/developer/watson&cm_sp=WatsonPlatform-WatsonServices-_-OnPageNavLink-IBMWatson_SDKs-_-ABAP 407 | [license]: http://www.apache.org/licenses/LICENSE-2.0 408 | [abapgit]: https://github.com/larshp/abapGit 409 | [abapgit_docs]: https://docs.abapgit.org/ 410 | -------------------------------------------------------------------------------- /docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_arch.html: -------------------------------------------------------------------------------- 1 | Class ZCL_IBMC_SERVICE_ARCH

Class ZCL_IBMC_SERVICE_ARCH

public create public

Documentation

IBM Watson SDK Platform-specifics

Interfaces

zif_ibmc_service_arch

Types

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

Methods

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

Decodes base64 encoded data to binary.

2 | 3 |
Parameters
i_base64 Base64-encoded binary 4 |
e_binary Binary data 5 |
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. 6 |
public static
convert_string_to_utf8
importingi_stringtype string
returningvalue(e_utf8)type xstring
raisingzcx_ibmc_service_exception

Converts STRING data to UTF8 encoded XSTRING.

7 | 8 |
Parameters
i_string STRING data 9 |
e_utf8 UTF8-encoded data 10 |
public static
create_client_by_url
importingi_urltype string
i_request_proptype ts_request_prop
exportinge_clienttype ts_client
raisingzcx_ibmc_service_exception

Returns a HTTP/REST client based on an URL.

11 | 12 |
Parameters
i_url URL 13 |
i_request_prop Request parameters 14 |
e_client HTTP/REST client 15 |
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. 16 |
public static
execute
importingi_clienttype ts_client
i_methodtype zif_ibmc_service_arch~char
returningvalue(e_response)type to_rest_response
raisingzcx_ibmc_service_exception

Executes a HTTP request.

17 | 18 |
Parameters
i_client HTTP/REST client 19 |
i_method HTTP method (GET,POST,PUT,DELETE) 20 |
e_response Response of the request 21 |
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. 22 |
public static
get_default_proxy
importingi_urltype ts_url optional
exportinge_proxy_hosttype string
e_proxy_porttype string

Returns the default proxy host and port.

23 | 24 |
Parameters
i_url target URL 25 |
e_proxy_host Proxy host 26 |
e_proxy_port Proxy port 27 |
public static
get_http_status
importingi_rest_responsetype ref to if_web_http_response
returningvalue(e_status)type ts_http_status

Returns the status of a REST response.

28 | 29 |
Parameters
i_rest_response HTTP/REST response 30 |
e_status HTTP status 31 |
public static
get_progname
returningvalue(e_progname)type string

Returns an ABAP module identifier.

32 | 33 |
Parameters
e_progname ABAP module identifier 34 |
public static
get_response_binary
importingi_responsetype ref to if_web_http_response
returningvalue(e_data)type xstring

Reads binary data from a HTTP response.

35 | 36 |
Parameters
i_response HTTP response 37 |
e_data Binary data 38 |
public static
get_response_header
importingi_responsetype to_rest_response
i_header_fieldtype string
returningvalue(e_value)type string

Returns a HTTP response header.

39 | 40 |
Parameters
i_response HTTP/REST response 41 |
i_header_field Header field name 42 |
e_value Header field value 43 |
public static
get_response_string
importingi_responsetype ref to if_web_http_response
returningvalue(e_data)type string

Reads character data from a HTTP response.

44 | 45 |
Parameters
i_response HTTP response 46 |
e_data Character data 47 |
public static
get_timezone
returningvalue(e_timezone)type zif_ibmc_service_arch~ty_timezone

Returns the user's time zone.

48 | 49 |
Parameters
e_timezone user's time zone 50 |
public static
set_authentication_basic
importingi_clienttype ts_client
i_usernametype string
i_passwordtype string

Sets request header for basic authentication.

51 | 52 |
Parameters
i_client HTTP/REST client 53 |
i_username User name 54 |
i_password Password 55 |
public static
set_request_body_cdata
importingi_clienttype ts_client
i_datatype string

Set character data for the body of a HTTP request.

56 | 57 |
Parameters
i_client HTTP/REST client 58 |
i_data Character data 59 |
public static
set_request_body_xdata
importingi_clienttype ts_client
i_datatype xstring

Set binary data for the body of a HTTP request.

60 | 61 |
Parameters
i_client HTTP/REST client 62 |
i_data Binary data 63 |
public static
set_request_header
importingi_clienttype ts_client
i_nametype string
i_valuetype string

Sets a HTTP header.

64 | 65 |
Parameters
i_client HTTP/REST client 66 |
i_name Header field name 67 |
i_value Header field value 68 |
public static
set_request_uri
importingi_clienttype ts_client
i_uritype string

Sets the URI for a HTTP request.

69 | 70 |
Parameters
i_client HTTP/REST client 71 |
i_uri URI 72 |
public instance
add_form_part
importingi_clienttype ts_client
it_form_parttype zif_ibmc_service_arch~tt_form_part
raisingzcx_ibmc_service_exception

Generates a multi-part request body.

73 | 74 |
Parameters
i_client HTTP/REST client 75 |
it_form_part Table of form parts 76 |
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. 77 |
-------------------------------------------------------------------------------- /docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_service_ext.html: -------------------------------------------------------------------------------- 1 | Class ZCL_IBMC_SERVICE_EXT

Class ZCL_IBMC_SERVICE_EXT

public inheriting from zcl_ibmc_service create public

Documentation

Extended REST API service class

Types

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

Constants

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

Attributes

Visibility and LevelNameDocumentation
public instancep_instance_id type ty_instance_id  
public instancep_servicename type ty_servicename  

Methods

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

Factory method to instantiate a service specific wrapper class.

2 | 3 |
Parameters
i_instance_id 4 | Value of field INSTANCE_UID in table ZIBMC_CONFIG. 5 | Service credentials are read from table ZIBMC_CONFIG with key SERVICE = Name of service wrapper class without prefix ZCL_IBMC_ and INSTANCE_UID. 6 |
i_url URL of the service. 7 |
i_host Host of the service. I_URL and I_HOST can be used synonymously. 8 |
i_username User password to authenticate on service. 9 |
i_password User password to authenticate on service. 10 |
i_proxy_host Proxy server, not applicable on SAP Cloud Platform. 11 |
i_proxy_port Proxy server port, not applicable on SAP Cloud Platform. 12 |
i_apikey API key password to authenticate on service. 13 |
i_auth_method Authentication method. Possible values are "IAM", "ICP4D", "basicAuth", "NONE". 14 |
i_oauth_prop Credentials to generate token for OAuth authentication. 15 |
i_token_generation Method for access token refresh:
16 | C_TOKEN_GENERATION_NEVER - Access token is not refreshed. 17 | C_TOKEN_GENERATION_ALWAYS - Access to token is refreshed for each service call. 18 | C_TOKEN_GENERATION_AUTO - Access to token is refreshed just before it expires. 19 |
i_request_headers List of headers sent with every request, format 'Header1=Value1;Header2=Value2'. 20 |
i_version Value of query parameter VERSION. 21 |
public static
get_zipdata
importingit_examplestype any table
iv_field_classtype fieldname default c_field_none
iv_field_filenametype fieldname optional
iv_field_imagetype fieldname optional
iv_image_formattype ty_image_format optional
iv_image_nametype string optional
exportinget_zipdatatype tt_map_file
raisingzcx_ibmc_service_exception

Compresses multiple images from an internal table

to a one or more xstrings in ZIP format. 22 | 23 |
Parameters
it_examples Internal table of images. 24 |
iv_field_class 25 | Field in IT_EXAMPLES that contains the file class. 26 | All records in IT_EXAMPLES with same class will be compress into one ZIP xstring. 27 |
iv_field_filename Field in IT_EXAMPLES that contains the filename for the image. 28 |
iv_field_image Field in IT_EXAMPLES that contains the image. 29 |
iv_image_format Format of the image. Possible values are 30 | C_FORMAT_JPG, C_FORMAT_PNG, C_FORMAT_GIF, C_FORMAT_TIF, C_FORMAT_ALL. 31 |
iv_image_name Name of the image. 32 |
et_zipdata Internal table containing a compressed ZIP xstring for each image class. 33 |
Class-based Exceptions
zcx_ibmc_service_exception Exception being raised in case of an error. 34 |
public instanceget_access_token redefinition 
public instance
get_bearer_token
returningvalue(e_bearer_token)type string

Returns the bearer token, if available.

35 | 36 |
Parameters
e_bearer_token Access token. 37 |
public instance
get_config_value
importingi_defaulttype zibmc_config-value optional
i_paramtype zibmc_config-param
returningvalue(e_value)type zibmc_config-value
raisingzcx_ibmc_service_exception

Retrieves a value of a configuration parameter

from table ZIBMC_CONFIG. 38 | 39 |
Parameters
i_default Default value, if configuration parameter is not found. 40 |
i_param Configuration parameter name. 41 |
public instanceget_request_prop redefinition 
public instance
get_sdk_version_date
returningvalue(e_sdk_version_date)type string

Returns the SDK built date.

42 | 43 |
Parameters
e_sdk_version_date Built data in format YYYYMMDD. 44 |
public instance
set_bearer_token
importingi_bearer_tokentype string

Method for internal use.

45 |
-------------------------------------------------------------------------------- /docs/ABAPDoc/abapdoc/zibmc/classes/zcl_ibmc_util.html: -------------------------------------------------------------------------------- 1 | Class ZCL_IBMC_UTIL

Class ZCL_IBMC_UTIL

public final create public

Documentation

Utilities to connect to IBM Watson

Methods

Visibility and LevelNameDocumentation
public static
convert_datetime_to_timestamp
importingi_datetimetype zcl_ibmc_service=>datetime
returningvalue(e_timestamp)type timestamp
Converts datetime format to a timestamp, i.e. yyyy-mm-ddThh:mm:ssZ -> YYYYMMDDHHMMSS 2 | 3 |
Parameters
i_datetime Input in datetime format. 4 |
e_timestamp Timestamp. 5 |
public static
convert_timestamp_to_datetime
importingi_timestamptype timestamp
returningvalue(e_datetime)type zcl_ibmc_service=>datetime
Converts a timestamp to datetime format, i.e. YYYYMMDDHHMMSS -> yyyy-mm-ddThh:mm:ssZ 6 | 7 |
Parameters
i_timestamp Timestamp. 8 |
e_datetime Datetime format. 9 |
public static
convert_timestamp_to_local
importingiv_timestamptype timestamp
returningvalue(ev_local)type string
Converts a timestamp in UTC to a timestamp in local time. 10 | 11 |
Parameters
iv_timestamp Timestamp (UTC). 12 |
ev_local Timestamp (local time). 13 |
public static
get_mimetype_from_extension
importingi_filenametype string
returningvalue(e_mimetype)type string
Determine MIME type from a file name, e.g. 'docu.txt' -> 'text_/plain'. 14 | 15 |
Parameters
i_filename Filename with extension. 16 |
e_mimetype MIME type. 17 |
public static
itab_to_tableschema
importingi_itabtype any table
i_dictionarytype any optional
i_lower_casetype zcl_ibmc_service=>boolean default zcl_ibmc_service=>c_boolean_false
it_excluded_fieldstype zcl_ibmc_service=>tt_string optional
returningvalue(e_json)type string
Converts an internal table to JSON string in table schema format. 18 | E.g.: '{"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}' 19 | 20 |
Parameters
i_itab Internal table to be converted. 21 |
i_dictionary Dictionary to be used for mapping ABAP identifiers to JSON keys. 22 |
i_lower_case If set to C_BOOLEAN_TRUE all keys in JSON string will be lower case. 23 |
it_excluded_fields Internal table of table fields in I_ITAB that should not occur in result. 24 |
e_json JSON string. 25 |
public static
tableschema_to_itab
importingi_jsontype string
i_tableschema_keytype string optional
exportinge_itabtype any table
Converts a JSON string in table schema format to an internal table. 26 | E.g.: '{"tableschema_key": {"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}}' 27 | 28 |
Parameters
i_json JSON string. 29 |
i_tableschema_key Key in JSON string that holds the table schema. 30 |
e_itab Internal table containing converted data. 31 |
public static
utc_to_timezone
importingi_timestamptype timestamp
i_timezonetype zif_ibmc_service_arch=>ty_timezone optional
returningvalue(e_timestamp)type timestamp
Converts a timestamp in UTC to a timestamp in another timezone. 32 | 33 |
Parameters
i_timestamp Timestamp (UTC). 34 |
i_timezone Time zone 35 |
e_timestamp Timestamp in give time zone. 36 |
-------------------------------------------------------------------------------- /docs/ABAPDoc/abapdoc/zibmc/classes/zcx_ibmc_service_exception.html: -------------------------------------------------------------------------------- 1 | Class ZCX_IBMC_SERVICE_EXCEPTION

Class ZCX_IBMC_SERVICE_EXCEPTION

public inheriting from cx_static_check final create public

Documentation

IBM Cloud Service Exception

Interfaces

if_t100_dyn_msg
if_t100_message

Attributes

Visibility and LevelNameDocumentation
public instancep_http_reason type string  
public instancep_http_status type string  
public instancep_msg_json type string  

Methods

Visibility and LevelNameDocumentation
public instance
constructor
importingtextidlike if_t100_message=>t100key optional
previouslike previous optional
p_msg_jsontype string optional
p_http_statustype string optional
p_http_reasontype string optional
CONSTRUCTOR
public instanceif_message~get_longtext redefinition 
public instanceif_message~get_text redefinition 
-------------------------------------------------------------------------------- /docs/ABAPDoc/abapdoc/zibmc/interfaces/zif_ibmc_service_arch.html: -------------------------------------------------------------------------------- 1 | Interface ZIF_IBMC_SERVICE_ARCH

Interface ZIF_IBMC_SERVICE_ARCH

public

Documentation

IBM Watson SDK Platform-specifics

Types

Visibility and LevelNameDocumentation
publicboolean (typing) 
publicchar (typing) 
publicts_access_token (structured type) 
publicts_form_part (structured type) 
publicts_header (structured type) 
publicts_http_status (structured type) 
publicts_request_prop (structured type) 
publicts_url (structured type) 
publictt_form_part type standard table of ts_form_part with non-unique default key 
publictt_header type standard table of ts_header with non-unique default key 
publictt_string type standard table of string with non-unique default key 
publicty_ssl_id (typing) 
publicty_timezone (typing) 

Constants

Visibility and LevelNameDocumentation
public staticc_datatype (structured type)  
public staticc_header_accept type string value 'Accept' 
public staticc_header_content_disposition type string value 'Content-Disposition' 
public staticc_header_content_type type string value 'Content-Type' 
public staticc_mediatype (structured type)  
public staticc_method_create type char value 'c' 
public staticc_method_delete type char value 'd' 
public staticc_method_get type char value 'g' 
public staticc_method_patch type char value 'm' 
public staticc_method_post type char value 'p' 
public staticc_method_put type char value 'u' 
-------------------------------------------------------------------------------- /docs/ABAPDoc/htmldesign/stylesheet.css: -------------------------------------------------------------------------------- 1 | body { font-family:arial; font-size:13px; background-color: white; margin: 0px; } 2 | table { border: 1px solid black; border-spacing: 0px; border-collapse: collapse; text-align: left; vertical-align: top; width: 100%; } 3 | tr { vertical-align: top; } 4 | th { border: 1px solid black; padding: 4px; background-color: #EBEBEB; text-align: left; } 5 | td { border: 1px solid black; padding: 3px; } 6 | h2 { font-size: 22px; } 7 | h4 { font-size: 18px; } 8 | h5 { font-size: 13px; font-weight: bold; margin-bottom: 5px; } 9 | a { color: darkblue; text-decoration: none} 10 | a:hover { color: blue; text-decoration: underline} 11 | #header { border-bottom: 3px solid grey; background-color: ghostwhite; width: 100%; padding: 4px; padding-left: 8px; } 12 | #headerTitle { padding: 5px; font-size: 22px } 13 | #content { margin: 8px; } 14 | #footer { font-size: 11px; padding-bottom: 8px; padding-left: 8px; } 15 | .identifier { font-weight: bold; text-transform: lowercase; } 16 | .methodSignature { border: 0px; margin: 1px; width: auto; } 17 | .methodSignature tr { text-align: left; vertical-align: top; } 18 | .methodSignature td { border: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 5px; } 19 | .methodParametersDocumentation { border: 0px; margin-left: 5px; width: auto; } 20 | .methodParametersDocumentation td { border: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 5px; } 21 | .parametersTable { border: 0px; } 22 | .fieldName {} 23 | .methodName {} 24 | .typeName {} 25 | .eventName {} 26 | .parameterName {} 27 | .exceptionName {} 28 | .objectName { text-transform: uppercase; } 29 | .className { font-weight: normal; } 30 | .interfaceName { font-weight: normal; } 31 | .exceptions { border: 0px; width: auto; } 32 | .exceptions td { border: 0px; padding: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 5px; } 33 | .abapDocComment p { margin-top: 0px; } 34 | .abapDocLink { font-style: italic } 35 | .shorttext { margin-top: 0px; } -------------------------------------------------------------------------------- /docs/ABAPDoc/readme.txt: -------------------------------------------------------------------------------- 1 | Content of this folder: 2 | 3 | ./abapdoc/ 4 | 5 | Contains the exported documentation for the selected classes and interfaces. Each object is stored in its ABAP package e.g. 6 | 7 | +---package 8 | \---subpackage 9 | \---classes 10 | \---cl_abap_class 11 | 12 | 13 | ./htmldesign/ 14 | 15 | Contains the html stylesheet. It can be used to change the design of the generated documentation. -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reference ABAP SDK for IBM Watson 4 | 5 | 6 | 7 |

ABAP SDK for IBM Watson: API Reference

8 |
9 |
The ABAP SDK is used to consume IBM Watson cognitive services with the SAP Business Suite, S/4HANA and the SAP Cloud ABAP Environment.
10 |
It wraps the IBM Watson service REST API into regular ABAP classes and delivers ABAP data types that exactly fit the IBM Watson interface.
11 |

12 | The table below provides an overview on the supported IBM Watson services. Click the ABAP class name to navigate to the corresponding methods and data types reference. 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
Watson serviceVersionABAP Class Name
Watson AssistantV1ZCL_IBMC_ASSISTANT_V1
Watson AssistantV2ZCL_IBMC_ASSISTANT_V2
DiscoveryV2ZCL_IBMC_DISCOVERY_V2
Language TranslatorV3ZCL_IBMC_LANG_TRANSLATOR_V3
Natural Language UnderstandingV1ZCL_IBMC_NAT_LANG_UNDRSTND_V1
Speech to TextV1ZCL_IBMC_SPEECH_TO_TEXT_V1
Text to SpeechV1ZCL_IBMC_TEXT_TO_SPEECH_V1
24 | 25 | 26 | -------------------------------------------------------------------------------- /src/package.devc.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ABAP SDK for IBM Watson 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/zcl_ibmc_assistant_v1.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_ASSISTANT_V1 7 | E 8 | Watson Assistant v1 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_ASSISTANT_V1 17 | BULK_CLASSIFY 18 | E 19 | Identify intents and entities in multiple user utterances 20 | 21 | 22 | ZCL_IBMC_ASSISTANT_V1 23 | CREATE_COUNTEREXAMPLE 24 | E 25 | Create counterexample 26 | 27 | 28 | ZCL_IBMC_ASSISTANT_V1 29 | CREATE_DIALOG_NODE 30 | E 31 | Create dialog node 32 | 33 | 34 | ZCL_IBMC_ASSISTANT_V1 35 | CREATE_ENTITY 36 | E 37 | Create entity 38 | 39 | 40 | ZCL_IBMC_ASSISTANT_V1 41 | CREATE_EXAMPLE 42 | E 43 | Create user input example 44 | 45 | 46 | ZCL_IBMC_ASSISTANT_V1 47 | CREATE_INTENT 48 | E 49 | Create intent 50 | 51 | 52 | ZCL_IBMC_ASSISTANT_V1 53 | CREATE_SYNONYM 54 | E 55 | Create entity value synonym 56 | 57 | 58 | ZCL_IBMC_ASSISTANT_V1 59 | CREATE_VALUE 60 | E 61 | Create entity value 62 | 63 | 64 | ZCL_IBMC_ASSISTANT_V1 65 | CREATE_WORKSPACE 66 | E 67 | Create workspace 68 | 69 | 70 | ZCL_IBMC_ASSISTANT_V1 71 | CREATE_WORKSPACE_ASYNC 72 | E 73 | Create workspace asynchronously 74 | 75 | 76 | ZCL_IBMC_ASSISTANT_V1 77 | DELETE_COUNTEREXAMPLE 78 | E 79 | Delete counterexample 80 | 81 | 82 | ZCL_IBMC_ASSISTANT_V1 83 | DELETE_DIALOG_NODE 84 | E 85 | Delete dialog node 86 | 87 | 88 | ZCL_IBMC_ASSISTANT_V1 89 | DELETE_ENTITY 90 | E 91 | Delete entity 92 | 93 | 94 | ZCL_IBMC_ASSISTANT_V1 95 | DELETE_EXAMPLE 96 | E 97 | Delete user input example 98 | 99 | 100 | ZCL_IBMC_ASSISTANT_V1 101 | DELETE_INTENT 102 | E 103 | Delete intent 104 | 105 | 106 | ZCL_IBMC_ASSISTANT_V1 107 | DELETE_SYNONYM 108 | E 109 | Delete entity value synonym 110 | 111 | 112 | ZCL_IBMC_ASSISTANT_V1 113 | DELETE_USER_DATA 114 | E 115 | Delete labeled data 116 | 117 | 118 | ZCL_IBMC_ASSISTANT_V1 119 | DELETE_VALUE 120 | E 121 | Delete entity value 122 | 123 | 124 | ZCL_IBMC_ASSISTANT_V1 125 | DELETE_WORKSPACE 126 | E 127 | Delete workspace 128 | 129 | 130 | ZCL_IBMC_ASSISTANT_V1 131 | EXPORT_WORKSPACE_ASYNC 132 | E 133 | Export workspace asynchronously 134 | 135 | 136 | ZCL_IBMC_ASSISTANT_V1 137 | GET_COUNTEREXAMPLE 138 | E 139 | Get counterexample 140 | 141 | 142 | ZCL_IBMC_ASSISTANT_V1 143 | GET_DIALOG_NODE 144 | E 145 | Get dialog node 146 | 147 | 148 | ZCL_IBMC_ASSISTANT_V1 149 | GET_ENTITY 150 | E 151 | Get entity 152 | 153 | 154 | ZCL_IBMC_ASSISTANT_V1 155 | GET_EXAMPLE 156 | E 157 | Get user input example 158 | 159 | 160 | ZCL_IBMC_ASSISTANT_V1 161 | GET_INTENT 162 | E 163 | Get intent 164 | 165 | 166 | ZCL_IBMC_ASSISTANT_V1 167 | GET_SYNONYM 168 | E 169 | Get entity value synonym 170 | 171 | 172 | ZCL_IBMC_ASSISTANT_V1 173 | GET_VALUE 174 | E 175 | Get entity value 176 | 177 | 178 | ZCL_IBMC_ASSISTANT_V1 179 | GET_WORKSPACE 180 | E 181 | Get information about a workspace 182 | 183 | 184 | ZCL_IBMC_ASSISTANT_V1 185 | LIST_ALL_LOGS 186 | E 187 | List log events in all workspaces 188 | 189 | 190 | ZCL_IBMC_ASSISTANT_V1 191 | LIST_COUNTEREXAMPLES 192 | E 193 | List counterexamples 194 | 195 | 196 | ZCL_IBMC_ASSISTANT_V1 197 | LIST_DIALOG_NODES 198 | E 199 | List dialog nodes 200 | 201 | 202 | ZCL_IBMC_ASSISTANT_V1 203 | LIST_ENTITIES 204 | E 205 | List entities 206 | 207 | 208 | ZCL_IBMC_ASSISTANT_V1 209 | LIST_EXAMPLES 210 | E 211 | List user input examples 212 | 213 | 214 | ZCL_IBMC_ASSISTANT_V1 215 | LIST_INTENTS 216 | E 217 | List intents 218 | 219 | 220 | ZCL_IBMC_ASSISTANT_V1 221 | LIST_LOGS 222 | E 223 | List log events in a workspace 224 | 225 | 226 | ZCL_IBMC_ASSISTANT_V1 227 | LIST_MENTIONS 228 | E 229 | List entity mentions 230 | 231 | 232 | ZCL_IBMC_ASSISTANT_V1 233 | LIST_SYNONYMS 234 | E 235 | List entity value synonyms 236 | 237 | 238 | ZCL_IBMC_ASSISTANT_V1 239 | LIST_VALUES 240 | E 241 | List entity values 242 | 243 | 244 | ZCL_IBMC_ASSISTANT_V1 245 | LIST_WORKSPACES 246 | E 247 | List workspaces 248 | 249 | 250 | ZCL_IBMC_ASSISTANT_V1 251 | MESSAGE 252 | E 253 | Get response to user input 254 | 255 | 256 | ZCL_IBMC_ASSISTANT_V1 257 | UPDATE_COUNTEREXAMPLE 258 | E 259 | Update counterexample 260 | 261 | 262 | ZCL_IBMC_ASSISTANT_V1 263 | UPDATE_DIALOG_NODE 264 | E 265 | Update dialog node 266 | 267 | 268 | ZCL_IBMC_ASSISTANT_V1 269 | UPDATE_ENTITY 270 | E 271 | Update entity 272 | 273 | 274 | ZCL_IBMC_ASSISTANT_V1 275 | UPDATE_EXAMPLE 276 | E 277 | Update user input example 278 | 279 | 280 | ZCL_IBMC_ASSISTANT_V1 281 | UPDATE_INTENT 282 | E 283 | Update intent 284 | 285 | 286 | ZCL_IBMC_ASSISTANT_V1 287 | UPDATE_SYNONYM 288 | E 289 | Update entity value synonym 290 | 291 | 292 | ZCL_IBMC_ASSISTANT_V1 293 | UPDATE_VALUE 294 | E 295 | Update entity value 296 | 297 | 298 | ZCL_IBMC_ASSISTANT_V1 299 | UPDATE_WORKSPACE 300 | E 301 | Update workspace 302 | 303 | 304 | ZCL_IBMC_ASSISTANT_V1 305 | UPDATE_WORKSPACE_ASYNC 306 | E 307 | Update workspace asynchronously 308 | 309 | 310 | 311 | 312 | 313 | -------------------------------------------------------------------------------- /src/zcl_ibmc_assistant_v2.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_ASSISTANT_V2 7 | E 8 | Watson Assistant v2 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_ASSISTANT_V2 17 | BULK_CLASSIFY 18 | E 19 | Identify intents and entities in multiple user utterances 20 | 21 | 22 | ZCL_IBMC_ASSISTANT_V2 23 | CREATE_ASSISTANT 24 | E 25 | Create an assistant 26 | 27 | 28 | ZCL_IBMC_ASSISTANT_V2 29 | CREATE_RELEASE 30 | E 31 | Create release 32 | 33 | 34 | ZCL_IBMC_ASSISTANT_V2 35 | CREATE_SESSION 36 | E 37 | Create a session 38 | 39 | 40 | ZCL_IBMC_ASSISTANT_V2 41 | DELETE_ASSISTANT 42 | E 43 | Delete assistant 44 | 45 | 46 | ZCL_IBMC_ASSISTANT_V2 47 | DELETE_RELEASE 48 | E 49 | Delete release 50 | 51 | 52 | ZCL_IBMC_ASSISTANT_V2 53 | DELETE_SESSION 54 | E 55 | Delete session 56 | 57 | 58 | ZCL_IBMC_ASSISTANT_V2 59 | DELETE_USER_DATA 60 | E 61 | Delete labeled data 62 | 63 | 64 | ZCL_IBMC_ASSISTANT_V2 65 | DEPLOY_RELEASE 66 | E 67 | Deploy release 68 | 69 | 70 | ZCL_IBMC_ASSISTANT_V2 71 | EXPORT_SKILLS 72 | E 73 | Export skills 74 | 75 | 76 | ZCL_IBMC_ASSISTANT_V2 77 | GET_ENVIRONMENT 78 | E 79 | Get environment 80 | 81 | 82 | ZCL_IBMC_ASSISTANT_V2 83 | GET_RELEASE 84 | E 85 | Get release 86 | 87 | 88 | ZCL_IBMC_ASSISTANT_V2 89 | GET_SKILL 90 | E 91 | Get skill 92 | 93 | 94 | ZCL_IBMC_ASSISTANT_V2 95 | IMPORT_SKILLS 96 | E 97 | Import skills 98 | 99 | 100 | ZCL_IBMC_ASSISTANT_V2 101 | IMPORT_SKILLS_STATUS 102 | E 103 | Get status of skills import 104 | 105 | 106 | ZCL_IBMC_ASSISTANT_V2 107 | LIST_ASSISTANTS 108 | E 109 | List assistants 110 | 111 | 112 | ZCL_IBMC_ASSISTANT_V2 113 | LIST_ENVIRONMENTS 114 | E 115 | List environments 116 | 117 | 118 | ZCL_IBMC_ASSISTANT_V2 119 | LIST_LOGS 120 | E 121 | List log events for an assistant 122 | 123 | 124 | ZCL_IBMC_ASSISTANT_V2 125 | LIST_RELEASES 126 | E 127 | List releases 128 | 129 | 130 | ZCL_IBMC_ASSISTANT_V2 131 | MESSAGE 132 | E 133 | Send user input to assistant (stateful) 134 | 135 | 136 | ZCL_IBMC_ASSISTANT_V2 137 | MESSAGE_STATELESS 138 | E 139 | Send user input to assistant (stateless) 140 | 141 | 142 | ZCL_IBMC_ASSISTANT_V2 143 | UPDATE_ENVIRONMENT 144 | E 145 | Update environment 146 | 147 | 148 | ZCL_IBMC_ASSISTANT_V2 149 | UPDATE_SKILL 150 | E 151 | Update skill 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /src/zcl_ibmc_discovery_v2.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_DISCOVERY_V2 7 | E 8 | Discovery v2 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_DISCOVERY_V2 17 | ADD_DOCUMENT 18 | E 19 | Add a document 20 | 21 | 22 | ZCL_IBMC_DISCOVERY_V2 23 | ANALYZE_DOCUMENT 24 | E 25 | Analyze a Document 26 | 27 | 28 | ZCL_IBMC_DISCOVERY_V2 29 | CREATE_COLLECTION 30 | E 31 | Create a collection 32 | 33 | 34 | ZCL_IBMC_DISCOVERY_V2 35 | CREATE_DOCUMENT_CLASSIFIER 36 | E 37 | Create a document classifier 38 | 39 | 40 | ZCL_IBMC_DISCOVERY_V2 41 | CREATE_ENRICHMENT 42 | E 43 | Create an enrichment 44 | 45 | 46 | ZCL_IBMC_DISCOVERY_V2 47 | CREATE_EXPANSIONS 48 | E 49 | Create or update an expansion list 50 | 51 | 52 | ZCL_IBMC_DISCOVERY_V2 53 | CREATE_PROJECT 54 | E 55 | Create a project 56 | 57 | 58 | ZCL_IBMC_DISCOVERY_V2 59 | CREATE_STOPWORD_LIST 60 | E 61 | Create a custom stop words list 62 | 63 | 64 | ZCL_IBMC_DISCOVERY_V2 65 | CREATE_TRAINING_QUERY 66 | E 67 | Create training query 68 | 69 | 70 | ZCL_IBMC_DISCOVERY_V2 71 | CRE_DOCUMENT_CLASSIFIER_MODEL 72 | E 73 | Create a document classifier model 74 | 75 | 76 | ZCL_IBMC_DISCOVERY_V2 77 | DELETE_COLLECTION 78 | E 79 | Delete a collection 80 | 81 | 82 | ZCL_IBMC_DISCOVERY_V2 83 | DELETE_DOCUMENT 84 | E 85 | Delete a document 86 | 87 | 88 | ZCL_IBMC_DISCOVERY_V2 89 | DELETE_DOCUMENT_CLASSIFIER 90 | E 91 | Delete a document classifier 92 | 93 | 94 | ZCL_IBMC_DISCOVERY_V2 95 | DELETE_ENRICHMENT 96 | E 97 | Delete an enrichment 98 | 99 | 100 | ZCL_IBMC_DISCOVERY_V2 101 | DELETE_EXPANSIONS 102 | E 103 | Delete the expansion list 104 | 105 | 106 | ZCL_IBMC_DISCOVERY_V2 107 | DELETE_PROJECT 108 | E 109 | Delete a project 110 | 111 | 112 | ZCL_IBMC_DISCOVERY_V2 113 | DELETE_STOPWORD_LIST 114 | E 115 | Delete a custom stop words list 116 | 117 | 118 | ZCL_IBMC_DISCOVERY_V2 119 | DELETE_TRAINING_QUERIES 120 | E 121 | Delete training queries 122 | 123 | 124 | ZCL_IBMC_DISCOVERY_V2 125 | DELETE_TRAINING_QUERY 126 | E 127 | Delete a training data query 128 | 129 | 130 | ZCL_IBMC_DISCOVERY_V2 131 | DELETE_USER_DATA 132 | E 133 | Delete labeled data 134 | 135 | 136 | ZCL_IBMC_DISCOVERY_V2 137 | DEL_DOCUMENT_CLASSIFIER_MODEL 138 | E 139 | Delete a document classifier model 140 | 141 | 142 | ZCL_IBMC_DISCOVERY_V2 143 | GET_AUTOCOMPLETION 144 | E 145 | Get Autocomplete Suggestions 146 | 147 | 148 | ZCL_IBMC_DISCOVERY_V2 149 | GET_COLLECTION 150 | E 151 | Get collection 152 | 153 | 154 | ZCL_IBMC_DISCOVERY_V2 155 | GET_COMPONENT_SETTINGS 156 | E 157 | List component settings 158 | 159 | 160 | ZCL_IBMC_DISCOVERY_V2 161 | GET_DOCUMENT 162 | E 163 | Get document details 164 | 165 | 166 | ZCL_IBMC_DISCOVERY_V2 167 | GET_DOCUMENT_CLASSIFIER 168 | E 169 | Get a document classifier 170 | 171 | 172 | ZCL_IBMC_DISCOVERY_V2 173 | GET_DOCUMENT_CLASSIFIER_MODEL 174 | E 175 | Get a document classifier model 176 | 177 | 178 | ZCL_IBMC_DISCOVERY_V2 179 | GET_ENRICHMENT 180 | E 181 | Get enrichment 182 | 183 | 184 | ZCL_IBMC_DISCOVERY_V2 185 | GET_PROJECT 186 | E 187 | Get project 188 | 189 | 190 | ZCL_IBMC_DISCOVERY_V2 191 | GET_STOPWORD_LIST 192 | E 193 | Get a custom stop words list 194 | 195 | 196 | ZCL_IBMC_DISCOVERY_V2 197 | GET_TRAINING_QUERY 198 | E 199 | Get a training data query 200 | 201 | 202 | ZCL_IBMC_DISCOVERY_V2 203 | LIST_COLLECTIONS 204 | E 205 | List collections 206 | 207 | 208 | ZCL_IBMC_DISCOVERY_V2 209 | LIST_DOCUMENTS 210 | E 211 | List documents 212 | 213 | 214 | ZCL_IBMC_DISCOVERY_V2 215 | LIST_DOCUMENT_CLASSIFIERS 216 | E 217 | List document classifiers 218 | 219 | 220 | ZCL_IBMC_DISCOVERY_V2 221 | LIST_ENRICHMENTS 222 | E 223 | List enrichments 224 | 225 | 226 | ZCL_IBMC_DISCOVERY_V2 227 | LIST_EXPANSIONS 228 | E 229 | Get the expansion list 230 | 231 | 232 | ZCL_IBMC_DISCOVERY_V2 233 | LIST_FIELDS 234 | E 235 | List fields 236 | 237 | 238 | ZCL_IBMC_DISCOVERY_V2 239 | LIST_PROJECTS 240 | E 241 | List projects 242 | 243 | 244 | ZCL_IBMC_DISCOVERY_V2 245 | LIST_TRAINING_QUERIES 246 | E 247 | List training queries 248 | 249 | 250 | ZCL_IBMC_DISCOVERY_V2 251 | LST_DOCUMENT_CLASSIFIER_MODELS 252 | E 253 | List document classifier models 254 | 255 | 256 | ZCL_IBMC_DISCOVERY_V2 257 | QUERY 258 | E 259 | Query a project 260 | 261 | 262 | ZCL_IBMC_DISCOVERY_V2 263 | QUERY_COLLECTION_NOTICES 264 | E 265 | Query collection notices 266 | 267 | 268 | ZCL_IBMC_DISCOVERY_V2 269 | QUERY_NOTICES 270 | E 271 | Query project notices 272 | 273 | 274 | ZCL_IBMC_DISCOVERY_V2 275 | UPDATE_COLLECTION 276 | E 277 | Update a collection 278 | 279 | 280 | ZCL_IBMC_DISCOVERY_V2 281 | UPDATE_DOCUMENT 282 | E 283 | Update a document 284 | 285 | 286 | ZCL_IBMC_DISCOVERY_V2 287 | UPDATE_DOCUMENT_CLASSIFIER 288 | E 289 | Update a document classifier 290 | 291 | 292 | ZCL_IBMC_DISCOVERY_V2 293 | UPDATE_ENRICHMENT 294 | E 295 | Update an enrichment 296 | 297 | 298 | ZCL_IBMC_DISCOVERY_V2 299 | UPDATE_PROJECT 300 | E 301 | Update a project 302 | 303 | 304 | ZCL_IBMC_DISCOVERY_V2 305 | UPDATE_TRAINING_QUERY 306 | E 307 | Update a training query 308 | 309 | 310 | ZCL_IBMC_DISCOVERY_V2 311 | UPD_DOCUMENT_CLASSIFIER_MODEL 312 | E 313 | Update a document classifier model 314 | 315 | 316 | 317 | 318 | 319 | -------------------------------------------------------------------------------- /src/zcl_ibmc_lang_translator_v3.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_LANG_TRANSLATOR_V3 7 | E 8 | Language Translator 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_LANG_TRANSLATOR_V3 17 | CREATE_MODEL 18 | E 19 | Create model 20 | 21 | 22 | ZCL_IBMC_LANG_TRANSLATOR_V3 23 | DELETE_DOCUMENT 24 | E 25 | Delete document 26 | 27 | 28 | ZCL_IBMC_LANG_TRANSLATOR_V3 29 | DELETE_MODEL 30 | E 31 | Delete model 32 | 33 | 34 | ZCL_IBMC_LANG_TRANSLATOR_V3 35 | GET_DOCUMENT_STATUS 36 | E 37 | Get document status 38 | 39 | 40 | ZCL_IBMC_LANG_TRANSLATOR_V3 41 | GET_MODEL 42 | E 43 | Get model details 44 | 45 | 46 | ZCL_IBMC_LANG_TRANSLATOR_V3 47 | GET_TRANSLATED_DOCUMENT 48 | E 49 | Get translated document 50 | 51 | 52 | ZCL_IBMC_LANG_TRANSLATOR_V3 53 | IDENTIFY 54 | E 55 | Identify language 56 | 57 | 58 | ZCL_IBMC_LANG_TRANSLATOR_V3 59 | LIST_DOCUMENTS 60 | E 61 | List documents 62 | 63 | 64 | ZCL_IBMC_LANG_TRANSLATOR_V3 65 | LIST_IDENTIFIABLE_LANGUAGES 66 | E 67 | List identifiable languages 68 | 69 | 70 | ZCL_IBMC_LANG_TRANSLATOR_V3 71 | LIST_LANGUAGES 72 | E 73 | List supported languages 74 | 75 | 76 | ZCL_IBMC_LANG_TRANSLATOR_V3 77 | LIST_MODELS 78 | E 79 | List models 80 | 81 | 82 | ZCL_IBMC_LANG_TRANSLATOR_V3 83 | TRANSLATE 84 | E 85 | Translate 86 | 87 | 88 | ZCL_IBMC_LANG_TRANSLATOR_V3 89 | TRANSLATE_DOCUMENT 90 | E 91 | Translate document 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/zcl_ibmc_nat_lang_undrstnd_v1.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 7 | E 8 | Natural Language Understanding 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 17 | ANALYZE 18 | E 19 | Analyze text 20 | 21 | 22 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 23 | CREATE_CATEGORIES_MODEL 24 | E 25 | Create categories model 26 | 27 | 28 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 29 | CREATE_CLASSIFICATIONS_MODEL 30 | E 31 | Create classifications model 32 | 33 | 34 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 35 | DELETE_CATEGORIES_MODEL 36 | E 37 | Delete categories model 38 | 39 | 40 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 41 | DELETE_CLASSIFICATIONS_MODEL 42 | E 43 | Delete classifications model 44 | 45 | 46 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 47 | DELETE_MODEL 48 | E 49 | Delete model 50 | 51 | 52 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 53 | GET_CATEGORIES_MODEL 54 | E 55 | Get categories model details 56 | 57 | 58 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 59 | GET_CLASSIFICATIONS_MODEL 60 | E 61 | Get classifications model details 62 | 63 | 64 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 65 | LIST_CATEGORIES_MODELS 66 | E 67 | List categories models 68 | 69 | 70 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 71 | LIST_CLASSIFICATIONS_MODELS 72 | E 73 | List classifications models 74 | 75 | 76 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 77 | LIST_MODELS 78 | E 79 | List models 80 | 81 | 82 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 83 | UPDATE_CATEGORIES_MODEL 84 | E 85 | Update categories model 86 | 87 | 88 | ZCL_IBMC_NAT_LANG_UNDRSTND_V1 89 | UPDATE_CLASSIFICATIONS_MODEL 90 | E 91 | Update classifications model 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/zcl_ibmc_service.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_IBMC_SERVICE 7 | E 8 | ABAP SDK for IBM Watson - Service Class 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_SERVICE 17 | ABAP_TO_JSON 18 | E 19 | Extracts a JSON string from an ABAP structure. 20 | 21 | 22 | ZCL_IBMC_SERVICE 23 | ADD_HEADER_PARAMETER 24 | E 25 | Method for internal use. 26 | 27 | 28 | ZCL_IBMC_SERVICE 29 | ADD_QUERY_PARAMETER 30 | E 31 | Method for internal use. 32 | 33 | 34 | ZCL_IBMC_SERVICE 35 | ADJUST_REQUEST_PROP 36 | E 37 | Method for internal use. 38 | 39 | 40 | ZCL_IBMC_SERVICE 41 | CHECK_HTTP_RESPONSE 42 | E 43 | Throws an exception, if HTTP response indicates an error. 44 | 45 | 46 | ZCL_IBMC_SERVICE 47 | CONSTRUCTOR 48 | E 49 | Class constructor. 50 | 51 | 52 | ZCL_IBMC_SERVICE 53 | DATETIME 54 | E 55 | DateTime type, format 2018-10-23T15:18:18.914xxxZ 56 | 57 | 58 | ZCL_IBMC_SERVICE 59 | GET_ACCESS_TOKEN 60 | E 61 | Method for internal use. 62 | 63 | 64 | ZCL_IBMC_SERVICE 65 | GET_APPNAME 66 | E 67 | Returns the service name. 68 | 69 | 70 | ZCL_IBMC_SERVICE 71 | GET_COMPONENTS 72 | E 73 | Returns component names of a given structure. 74 | 75 | 76 | ZCL_IBMC_SERVICE 77 | GET_DATATYPE 78 | E 79 | Returns data type of a given parameter. 80 | 81 | 82 | ZCL_IBMC_SERVICE 83 | GET_FIELD_TYPE 84 | E 85 | Returns field type and length of a given parameter. 86 | 87 | 88 | ZCL_IBMC_SERVICE 89 | GET_FILE_EXTENSION 90 | E 91 | Returns the file extension for a mime type 92 | 93 | 94 | ZCL_IBMC_SERVICE 95 | GET_FULL_URL 96 | E 97 | Method for internal use. 98 | 99 | 100 | ZCL_IBMC_SERVICE 101 | GET_REQUEST_PROP 102 | E 103 | Method for internal use. 104 | 105 | 106 | ZCL_IBMC_SERVICE 107 | GET_REST_CLIENT 108 | E 109 | Method for internal use. 110 | 111 | 112 | ZCL_IBMC_SERVICE 113 | HTTP_DELETE 114 | E 115 | Sends a HTTP DELETE request. 116 | 117 | 118 | ZCL_IBMC_SERVICE 119 | HTTP_GET 120 | E 121 | Sends a HTTP GET request. 122 | 123 | 124 | ZCL_IBMC_SERVICE 125 | HTTP_POST 126 | E 127 | Sends a HTTP POST request. 128 | 129 | 130 | ZCL_IBMC_SERVICE 131 | HTTP_PATCH 132 | E 133 | Sends a HTTP PATCH request. 134 | 135 | 136 | ZCL_IBMC_SERVICE 137 | HTTP_POST_MULTIPART 138 | E 139 | Sends a HTTP POST request with multipart body. 140 | 141 | 142 | ZCL_IBMC_SERVICE 143 | HTTP_PUT 144 | E 145 | Sends a HTTP PUT request. 146 | 147 | 148 | ZCL_IBMC_SERVICE 149 | MERGE_STRUCTURE 150 | E 151 | Method for internal use. 152 | 153 | 154 | ZCL_IBMC_SERVICE 155 | MOVE_DATA_REFERENCE_TO_ABAP 156 | E 157 | Moves a referenced data structure to an ABAP structure. 158 | 159 | 160 | ZCL_IBMC_SERVICE 161 | NORMALIZE_URL 162 | E 163 | Method for internal use. 164 | 165 | 166 | ZCL_IBMC_SERVICE 167 | PARSE_JSON 168 | E 169 | Parses a JSON string into an ABAP structure. 170 | 171 | 172 | ZCL_IBMC_SERVICE 173 | RAISE_EXCEPTION 174 | E 175 | Raises an exception. 176 | 177 | 178 | ZCL_IBMC_SERVICE 179 | SET_ACCESS_TOKEN 180 | E 181 | Sets an access token explicitly. 182 | 183 | 184 | ZCL_IBMC_SERVICE 185 | SET_DEFAULT_QUERY_PARAMETERS 186 | E 187 | Method for internal use. 188 | 189 | 190 | ZCL_IBMC_SERVICE 191 | SET_URI_AND_AUTHORIZATION 192 | E 193 | Method for internal use. 194 | 195 | 196 | ZCL_IBMC_SERVICE 197 | UNESCAPE_UNICODE 198 | E 199 | Unescape unicode codepoints to characters in a string 200 | 201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /src/zcl_ibmc_service_arch.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_SERVICE_ARCH 7 | E 8 | IBM Watson SDK Platform-specifics 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_SERVICE_ARCH 17 | ADD_FORM_PART 18 | E 19 | Generates a multi-part request body. 20 | 21 | 22 | ZCL_IBMC_SERVICE_ARCH 23 | BASE64_DECODE 24 | E 25 | Decodes base64 encoded data to binary. 26 | 27 | 28 | ZCL_IBMC_SERVICE_ARCH 29 | CONVERT_STRING_TO_UTF8 30 | E 31 | Converts STRING data to UTF8 encoded XSTRING. 32 | 33 | 34 | ZCL_IBMC_SERVICE_ARCH 35 | CREATE_CLIENT_BY_URL 36 | E 37 | Returns a HTTP/REST client based on an URL. 38 | 39 | 40 | ZCL_IBMC_SERVICE_ARCH 41 | EXECUTE 42 | E 43 | Executes a HTTP request. 44 | 45 | 46 | ZCL_IBMC_SERVICE_ARCH 47 | FIND_REGEX 48 | E 49 | Finds (and replaces) a regular expression. 50 | 51 | 52 | ZCL_IBMC_SERVICE_ARCH 53 | GET_DEFAULT_PROXY 54 | E 55 | Returns the default proxy host and port. 56 | 57 | 58 | ZCL_IBMC_SERVICE_ARCH 59 | GET_HTTP_STATUS 60 | E 61 | Returns the status of a REST response. 62 | 63 | 64 | ZCL_IBMC_SERVICE_ARCH 65 | GET_PROGNAME 66 | E 67 | Returns an ABAP module identifier. 68 | 69 | 70 | ZCL_IBMC_SERVICE_ARCH 71 | GET_RESPONSE_BINARY 72 | E 73 | Reads binary data from a HTTP response. 74 | 75 | 76 | ZCL_IBMC_SERVICE_ARCH 77 | GET_RESPONSE_HEADER 78 | E 79 | Returns a HTTP response header. 80 | 81 | 82 | ZCL_IBMC_SERVICE_ARCH 83 | GET_RESPONSE_STRING 84 | E 85 | Reads character data from a HTTP response. 86 | 87 | 88 | ZCL_IBMC_SERVICE_ARCH 89 | GET_REST_REQUEST 90 | E 91 | Returns a request object from a HTTP client object. 92 | 93 | 94 | ZCL_IBMC_SERVICE_ARCH 95 | GET_TIMEZONE 96 | E 97 | Returns the user's time zone. 98 | 99 | 100 | ZCL_IBMC_SERVICE_ARCH 101 | SET_AUTHENTICATION_BASIC 102 | E 103 | Sets request header for basic authentication. 104 | 105 | 106 | ZCL_IBMC_SERVICE_ARCH 107 | SET_REQUEST_BODY_CDATA 108 | E 109 | Set character data for the body of a HTTP request. 110 | 111 | 112 | ZCL_IBMC_SERVICE_ARCH 113 | SET_REQUEST_BODY_XDATA 114 | E 115 | Set binary data for the body of a HTTP request. 116 | 117 | 118 | ZCL_IBMC_SERVICE_ARCH 119 | SET_REQUEST_HEADER 120 | E 121 | Sets a HTTP header. 122 | 123 | 124 | ZCL_IBMC_SERVICE_ARCH 125 | SET_REQUEST_URI 126 | E 127 | Sets the URI for a HTTP request. 128 | 129 | 130 | ZCL_IBMC_SERVICE_ARCH 131 | TO_HTTP_CLIENT 132 | E 133 | HTTP Client Control Block 134 | 135 | 136 | ZCL_IBMC_SERVICE_ARCH 137 | TO_REST_CLIENT 138 | E 139 | REST HTTP Client 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /src/zcl_ibmc_service_ext.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_IBMC_SERVICE_EXT 7 | E 8 | Extended REST API service class 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_SERVICE_EXT 17 | ADD_CONFIG_PROP 18 | E 19 | Method for internal use. 20 | 21 | 22 | ZCL_IBMC_SERVICE_EXT 23 | ADD_IMAGE_TO_ZIP 24 | E 25 | Method for internal use. 26 | 27 | 28 | ZCL_IBMC_SERVICE_EXT 29 | C_FIELD_NONE 30 | E 31 | Field Name 32 | 33 | 34 | ZCL_IBMC_SERVICE_EXT 35 | C_FORMAT_ALL 36 | E 37 | Image encoding (jpg, png, ...) 38 | 39 | 40 | ZCL_IBMC_SERVICE_EXT 41 | C_FORMAT_GIF 42 | E 43 | Image encoding (jpg, png, ...) 44 | 45 | 46 | ZCL_IBMC_SERVICE_EXT 47 | C_FORMAT_JPG 48 | E 49 | Image encoding (jpg, png, ...) 50 | 51 | 52 | ZCL_IBMC_SERVICE_EXT 53 | C_FORMAT_PNG 54 | E 55 | Image encoding (jpg, png, ...) 56 | 57 | 58 | ZCL_IBMC_SERVICE_EXT 59 | C_FORMAT_TIF 60 | E 61 | Image encoding (jpg, png, ...) 62 | 63 | 64 | ZCL_IBMC_SERVICE_EXT 65 | C_FORMAT_UNKNOWN 66 | E 67 | Image encoding (jpg, png, ...) 68 | 69 | 70 | ZCL_IBMC_SERVICE_EXT 71 | C_FORMAT_ZIP 72 | E 73 | Image encoding (jpg, png, ...) 74 | 75 | 76 | ZCL_IBMC_SERVICE_EXT 77 | GET_BEARER_TOKEN 78 | E 79 | Returns the bearer token, if available. 80 | 81 | 82 | ZCL_IBMC_SERVICE_EXT 83 | GET_CONFIG_VALUE 84 | E 85 | Retrieves a value of a configuration parameter 86 | 87 | 88 | ZCL_IBMC_SERVICE_EXT 89 | GET_FIELD_DATA 90 | E 91 | Method for internal use. 92 | 93 | 94 | ZCL_IBMC_SERVICE_EXT 95 | GET_INSTANCE 96 | E 97 | Factory method to instantiate a service specific wrapper cla 98 | 99 | 100 | ZCL_IBMC_SERVICE_EXT 101 | GET_SDK_VERSION_DATE 102 | E 103 | Returns the SDK built date. 104 | 105 | 106 | ZCL_IBMC_SERVICE_EXT 107 | GET_ZIPDATA 108 | E 109 | Compresses multiple images from an internal table 110 | 111 | 112 | ZCL_IBMC_SERVICE_EXT 113 | SET_BEARER_TOKEN 114 | E 115 | Method for internal use. 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /src/zcl_ibmc_speech_to_text_v1.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_SPEECH_TO_TEXT_V1 7 | E 8 | Speech to Text 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_SPEECH_TO_TEXT_V1 17 | ADD_AUDIO 18 | E 19 | Add an audio resource 20 | 21 | 22 | ZCL_IBMC_SPEECH_TO_TEXT_V1 23 | ADD_CORPUS 24 | E 25 | Add a corpus 26 | 27 | 28 | ZCL_IBMC_SPEECH_TO_TEXT_V1 29 | ADD_GRAMMAR 30 | E 31 | Add a grammar 32 | 33 | 34 | ZCL_IBMC_SPEECH_TO_TEXT_V1 35 | ADD_WORD 36 | E 37 | Add a custom word 38 | 39 | 40 | ZCL_IBMC_SPEECH_TO_TEXT_V1 41 | ADD_WORDS 42 | E 43 | Add custom words 44 | 45 | 46 | ZCL_IBMC_SPEECH_TO_TEXT_V1 47 | CHECK_JOB 48 | E 49 | Check a job 50 | 51 | 52 | ZCL_IBMC_SPEECH_TO_TEXT_V1 53 | CHECK_JOBS 54 | E 55 | Check jobs 56 | 57 | 58 | ZCL_IBMC_SPEECH_TO_TEXT_V1 59 | CREATE_ACOUSTIC_MODEL 60 | E 61 | Create a custom acoustic model 62 | 63 | 64 | ZCL_IBMC_SPEECH_TO_TEXT_V1 65 | CREATE_JOB 66 | E 67 | Create a job 68 | 69 | 70 | ZCL_IBMC_SPEECH_TO_TEXT_V1 71 | CREATE_LANGUAGE_MODEL 72 | E 73 | Create a custom language model 74 | 75 | 76 | ZCL_IBMC_SPEECH_TO_TEXT_V1 77 | DELETE_ACOUSTIC_MODEL 78 | E 79 | Delete a custom acoustic model 80 | 81 | 82 | ZCL_IBMC_SPEECH_TO_TEXT_V1 83 | DELETE_AUDIO 84 | E 85 | Delete an audio resource 86 | 87 | 88 | ZCL_IBMC_SPEECH_TO_TEXT_V1 89 | DELETE_CORPUS 90 | E 91 | Delete a corpus 92 | 93 | 94 | ZCL_IBMC_SPEECH_TO_TEXT_V1 95 | DELETE_GRAMMAR 96 | E 97 | Delete a grammar 98 | 99 | 100 | ZCL_IBMC_SPEECH_TO_TEXT_V1 101 | DELETE_JOB 102 | E 103 | Delete a job 104 | 105 | 106 | ZCL_IBMC_SPEECH_TO_TEXT_V1 107 | DELETE_LANGUAGE_MODEL 108 | E 109 | Delete a custom language model 110 | 111 | 112 | ZCL_IBMC_SPEECH_TO_TEXT_V1 113 | DELETE_USER_DATA 114 | E 115 | Delete labeled data 116 | 117 | 118 | ZCL_IBMC_SPEECH_TO_TEXT_V1 119 | DELETE_WORD 120 | E 121 | Delete a custom word 122 | 123 | 124 | ZCL_IBMC_SPEECH_TO_TEXT_V1 125 | GET_ACOUSTIC_MODEL 126 | E 127 | Get a custom acoustic model 128 | 129 | 130 | ZCL_IBMC_SPEECH_TO_TEXT_V1 131 | GET_AUDIO 132 | E 133 | Get an audio resource 134 | 135 | 136 | ZCL_IBMC_SPEECH_TO_TEXT_V1 137 | GET_CORPUS 138 | E 139 | Get a corpus 140 | 141 | 142 | ZCL_IBMC_SPEECH_TO_TEXT_V1 143 | GET_GRAMMAR 144 | E 145 | Get a grammar 146 | 147 | 148 | ZCL_IBMC_SPEECH_TO_TEXT_V1 149 | GET_LANGUAGE_MODEL 150 | E 151 | Get a custom language model 152 | 153 | 154 | ZCL_IBMC_SPEECH_TO_TEXT_V1 155 | GET_MODEL 156 | E 157 | Get a model 158 | 159 | 160 | ZCL_IBMC_SPEECH_TO_TEXT_V1 161 | GET_WORD 162 | E 163 | Get a custom word 164 | 165 | 166 | ZCL_IBMC_SPEECH_TO_TEXT_V1 167 | LIST_ACOUSTIC_MODELS 168 | E 169 | List custom acoustic models 170 | 171 | 172 | ZCL_IBMC_SPEECH_TO_TEXT_V1 173 | LIST_AUDIO 174 | E 175 | List audio resources 176 | 177 | 178 | ZCL_IBMC_SPEECH_TO_TEXT_V1 179 | LIST_CORPORA 180 | E 181 | List corpora 182 | 183 | 184 | ZCL_IBMC_SPEECH_TO_TEXT_V1 185 | LIST_GRAMMARS 186 | E 187 | List grammars 188 | 189 | 190 | ZCL_IBMC_SPEECH_TO_TEXT_V1 191 | LIST_LANGUAGE_MODELS 192 | E 193 | List custom language models 194 | 195 | 196 | ZCL_IBMC_SPEECH_TO_TEXT_V1 197 | LIST_MODELS 198 | E 199 | List models 200 | 201 | 202 | ZCL_IBMC_SPEECH_TO_TEXT_V1 203 | LIST_WORDS 204 | E 205 | List custom words 206 | 207 | 208 | ZCL_IBMC_SPEECH_TO_TEXT_V1 209 | RECOGNIZE 210 | E 211 | Recognize audio 212 | 213 | 214 | ZCL_IBMC_SPEECH_TO_TEXT_V1 215 | REGISTER_CALLBACK 216 | E 217 | Register a callback 218 | 219 | 220 | ZCL_IBMC_SPEECH_TO_TEXT_V1 221 | RESET_ACOUSTIC_MODEL 222 | E 223 | Reset a custom acoustic model 224 | 225 | 226 | ZCL_IBMC_SPEECH_TO_TEXT_V1 227 | RESET_LANGUAGE_MODEL 228 | E 229 | Reset a custom language model 230 | 231 | 232 | ZCL_IBMC_SPEECH_TO_TEXT_V1 233 | TRAIN_ACOUSTIC_MODEL 234 | E 235 | Train a custom acoustic model 236 | 237 | 238 | ZCL_IBMC_SPEECH_TO_TEXT_V1 239 | TRAIN_LANGUAGE_MODEL 240 | E 241 | Train a custom language model 242 | 243 | 244 | ZCL_IBMC_SPEECH_TO_TEXT_V1 245 | UNREGISTER_CALLBACK 246 | E 247 | Unregister a callback 248 | 249 | 250 | ZCL_IBMC_SPEECH_TO_TEXT_V1 251 | UPGRADE_ACOUSTIC_MODEL 252 | E 253 | Upgrade a custom acoustic model 254 | 255 | 256 | ZCL_IBMC_SPEECH_TO_TEXT_V1 257 | UPGRADE_LANGUAGE_MODEL 258 | E 259 | Upgrade a custom language model 260 | 261 | 262 | 263 | 264 | 265 | -------------------------------------------------------------------------------- /src/zcl_ibmc_text_to_speech_v1.clas.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZCL_IBMC_TEXT_TO_SPEECH_V1 7 | E 8 | Text to Speech 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_TEXT_TO_SPEECH_V1 17 | ADD_CUSTOM_PROMPT 18 | E 19 | Add a custom prompt 20 | 21 | 22 | ZCL_IBMC_TEXT_TO_SPEECH_V1 23 | ADD_WORD 24 | E 25 | Add a custom word 26 | 27 | 28 | ZCL_IBMC_TEXT_TO_SPEECH_V1 29 | ADD_WORDS 30 | E 31 | Add custom words 32 | 33 | 34 | ZCL_IBMC_TEXT_TO_SPEECH_V1 35 | CREATE_CUSTOM_MODEL 36 | E 37 | Create a custom model 38 | 39 | 40 | ZCL_IBMC_TEXT_TO_SPEECH_V1 41 | CREATE_SPEAKER_MODEL 42 | E 43 | Create a speaker model 44 | 45 | 46 | ZCL_IBMC_TEXT_TO_SPEECH_V1 47 | DELETE_CUSTOM_MODEL 48 | E 49 | Delete a custom model 50 | 51 | 52 | ZCL_IBMC_TEXT_TO_SPEECH_V1 53 | DELETE_CUSTOM_PROMPT 54 | E 55 | Delete a custom prompt 56 | 57 | 58 | ZCL_IBMC_TEXT_TO_SPEECH_V1 59 | DELETE_SPEAKER_MODEL 60 | E 61 | Delete a speaker model 62 | 63 | 64 | ZCL_IBMC_TEXT_TO_SPEECH_V1 65 | DELETE_USER_DATA 66 | E 67 | Delete labeled data 68 | 69 | 70 | ZCL_IBMC_TEXT_TO_SPEECH_V1 71 | DELETE_WORD 72 | E 73 | Delete a custom word 74 | 75 | 76 | ZCL_IBMC_TEXT_TO_SPEECH_V1 77 | GET_CUSTOM_MODEL 78 | E 79 | Get a custom model 80 | 81 | 82 | ZCL_IBMC_TEXT_TO_SPEECH_V1 83 | GET_CUSTOM_PROMPT 84 | E 85 | Get a custom prompt 86 | 87 | 88 | ZCL_IBMC_TEXT_TO_SPEECH_V1 89 | GET_PRONUNCIATION 90 | E 91 | Get pronunciation 92 | 93 | 94 | ZCL_IBMC_TEXT_TO_SPEECH_V1 95 | GET_SPEAKER_MODEL 96 | E 97 | Get a speaker model 98 | 99 | 100 | ZCL_IBMC_TEXT_TO_SPEECH_V1 101 | GET_VOICE 102 | E 103 | Get a voice 104 | 105 | 106 | ZCL_IBMC_TEXT_TO_SPEECH_V1 107 | GET_WORD 108 | E 109 | Get a custom word 110 | 111 | 112 | ZCL_IBMC_TEXT_TO_SPEECH_V1 113 | LIST_CUSTOM_MODELS 114 | E 115 | List custom models 116 | 117 | 118 | ZCL_IBMC_TEXT_TO_SPEECH_V1 119 | LIST_CUSTOM_PROMPTS 120 | E 121 | List custom prompts 122 | 123 | 124 | ZCL_IBMC_TEXT_TO_SPEECH_V1 125 | LIST_SPEAKER_MODELS 126 | E 127 | List speaker models 128 | 129 | 130 | ZCL_IBMC_TEXT_TO_SPEECH_V1 131 | LIST_VOICES 132 | E 133 | List voices 134 | 135 | 136 | ZCL_IBMC_TEXT_TO_SPEECH_V1 137 | LIST_WORDS 138 | E 139 | List custom words 140 | 141 | 142 | ZCL_IBMC_TEXT_TO_SPEECH_V1 143 | SYNTHESIZE 144 | E 145 | Synthesize audio 146 | 147 | 148 | ZCL_IBMC_TEXT_TO_SPEECH_V1 149 | UPDATE_CUSTOM_MODEL 150 | E 151 | Update a custom model 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /src/zcl_ibmc_util.clas.abap: -------------------------------------------------------------------------------- 1 | * Copyright 2019,2023 IBM Corp. All Rights Reserved. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | class ZCL_IBMC_util definition 15 | public 16 | final 17 | create public . 18 | 19 | public section. 20 | 21 | 22 | "! Converts an internal table to JSON string in table schema format. 23 | "! E.g.: '{"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}' 24 | "! 25 | "! @parameter I_ITAB | Internal table to be converted. 26 | "! @parameter I_DICTIONARY | Dictionary to be used for mapping ABAP identifiers to JSON keys. 27 | "! @parameter I_LOWER_CASE | If set to C_BOOLEAN_TRUE all keys in JSON string will be lower case. 28 | "! @parameter IT_EXCLUDED_FIELDS | Internal table of table fields in I_ITAB that should not occur in result. 29 | "! @parameter E_JSON | JSON string. 30 | "! 31 | class-methods itab_to_tableschema 32 | importing 33 | !i_itab type any table 34 | !i_dictionary type any optional 35 | !i_lower_case type ZCL_IBMC_service=>boolean default ZCL_IBMC_service=>c_boolean_false 36 | !it_excluded_fields type ZCL_IBMC_service=>tt_string optional 37 | returning 38 | value(e_json) type string . 39 | "! Converts a JSON string in table schema format to an internal table. 40 | "! E.g.: '{"tableschema_key": {"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}}' 41 | "! 42 | "! @parameter I_JSON | JSON string. 43 | "! @parameter I_TABLESCHEMA_KEY | Key in JSON string that holds the table schema. 44 | "! @parameter E_ITAB | Internal table containing converted data. 45 | "! 46 | class-methods tableschema_to_itab 47 | importing 48 | !i_json type string 49 | !i_tableschema_key type string optional 50 | exporting 51 | !e_itab type any table . 52 | "! Converts a timestamp in UTC to a timestamp in local time. 53 | "! 54 | "! @parameter IV_TIMESTAMP | Timestamp (UTC). 55 | "! @parameter EV_LOCAL | Timestamp (local time). 56 | "! 57 | class-methods convert_timestamp_to_local 58 | importing 59 | !iv_timestamp type timestamp 60 | returning 61 | value(ev_local) type string . 62 | "! Determine MIME type from a file name, e.g. 'docu.txt' -> 'text_/plain'. 63 | "! 64 | "! @parameter I_FILENAME | Filename with extension. 65 | "! @parameter E_MIMETYPE | MIME type. 66 | "! 67 | class-methods get_mimetype_from_extension 68 | importing 69 | !i_filename type string 70 | returning 71 | value(e_mimetype) type string . 72 | "! Converts a timestamp in UTC to a timestamp in another timezone. 73 | "! 74 | "! @parameter I_TIMESTAMP | Timestamp (UTC). 75 | "! @parameter I_TIMEZONE | Time zone 76 | "! @parameter E_TIMESTAMP | Timestamp in give time zone. 77 | "! 78 | class-methods utc_to_timezone 79 | importing 80 | !i_timestamp type timestamp 81 | !i_timezone type ZIF_IBMC_service_arch=>ty_timezone optional 82 | returning 83 | value(e_timestamp) type timestamp . 84 | "! Converts datetime format to a timestamp, i.e. yyyy-mm-ddThh:mm:ssZ -> YYYYMMDDHHMMSS 85 | "! 86 | "! @parameter I_DATETIME | Input in datetime format. 87 | "! @parameter E_TIMESTAMP | Timestamp. 88 | "! 89 | class-methods convert_datetime_to_timestamp 90 | importing 91 | !i_datetime type ZCL_IBMC_service=>datetime 92 | returning 93 | value(e_timestamp) type timestamp . 94 | "! Converts a timestamp to datetime format, i.e. YYYYMMDDHHMMSS -> yyyy-mm-ddThh:mm:ssZ 95 | "! 96 | "! @parameter I_TIMESTAMP | Timestamp. 97 | "! @parameter E_DATETIME | Datetime format. 98 | "! 99 | class-methods convert_timestamp_to_datetime 100 | importing 101 | !i_timestamp type timestamp 102 | returning 103 | value(e_datetime) type ZCL_IBMC_service=>datetime . 104 | protected section. 105 | private section. 106 | ENDCLASS. 107 | 108 | 109 | 110 | CLASS ZCL_IBMC_UTIL IMPLEMENTATION. 111 | 112 | 113 | * ---------------------------------------------------------------------------------------+ 114 | * | Static Public Method ZCL_IBMC_UTIL=>CONVERT_DATETIME_TO_TIMESTAMP 115 | * +-------------------------------------------------------------------------------------------------+ 116 | * | [--->] I_DATETIME TYPE ZCL_IBMC_SERVICE=>DATETIME 117 | * | [<-()] E_TIMESTAMP TYPE TIMESTAMP 118 | * +-------------------------------------------------------------------------------------- 119 | method convert_datetime_to_timestamp. 120 | 121 | constants: 122 | c_zero type timestamp value '0'. " avoid conversion at runtime 123 | 124 | " check if input string applies to schema yyyy-mm-ddThh:mm:ssZ 125 | if i_datetime cp '++++-++-++T++:++:++*'. 126 | try. 127 | e_timestamp = 128 | i_datetime(4) * 10000000000 + i_datetime+5(2) * 100000000 + i_datetime+8(2) * 1000000 + 129 | i_datetime+11(2) * 10000 + i_datetime+14(2) * 100 + i_datetime+17(2). 130 | catch cx_sy_conversion_no_number. 131 | " invalid input 132 | e_timestamp = c_zero. 133 | endtry. 134 | else. 135 | " invalid input 136 | e_timestamp = c_zero. 137 | endif. 138 | 139 | endmethod. 140 | 141 | 142 | * ---------------------------------------------------------------------------------------+ 143 | * | Static Public Method ZCL_IBMC_UTIL=>CONVERT_TIMESTAMP_TO_DATETIME 144 | * +-------------------------------------------------------------------------------------------------+ 145 | * | [--->] I_TIMESTAMP TYPE TIMESTAMP 146 | * | [<-()] E_DATETIME TYPE ZCL_IBMC_SERVICE=>DATETIME 147 | * +-------------------------------------------------------------------------------------- 148 | method convert_timestamp_to_datetime. 149 | 150 | data: 151 | lv_year(4) type n, 152 | lv_month(2) type n, 153 | lv_day(2) type n, 154 | lv_hour(2) type n, 155 | lv_min(2) type n, 156 | lv_sec(2) type n, 157 | lv_rest type timestamp. 158 | 159 | lv_rest = i_timestamp. 160 | lv_year = lv_rest div 10000000000. 161 | lv_rest = lv_rest - ( lv_year * 10000000000 ). 162 | lv_month = lv_rest div 100000000. 163 | lv_rest = lv_rest - ( lv_month * 100000000 ). 164 | lv_day = lv_rest div 1000000. 165 | lv_rest = lv_rest - ( lv_day * 1000000 ). 166 | lv_hour = lv_rest div 10000. 167 | lv_rest = lv_rest - ( lv_hour * 10000 ). 168 | lv_min = lv_rest div 100. 169 | lv_rest = lv_rest - ( lv_min * 100 ). 170 | lv_sec = lv_rest div 1. " type conversion 171 | 172 | concatenate lv_year '-' lv_month '-' lv_day 'T' lv_hour ':' lv_min ':' lv_sec 'Z' into e_datetime. 173 | 174 | endmethod. 175 | 176 | 177 | * ---------------------------------------------------------------------------------------+ 178 | * | Static Public Method ZCL_IBMC_UTIL=>CONVERT_TIMESTAMP_TO_LOCAL 179 | * +-------------------------------------------------------------------------------------------------+ 180 | * | [--->] IV_TIMESTAMP TYPE TIMESTAMP 181 | * | [<-()] EV_LOCAL TYPE STRING 182 | * +-------------------------------------------------------------------------------------- 183 | method convert_timestamp_to_local. 184 | 185 | data: 186 | lv_dats type d, 187 | lv_tims type t, 188 | lv_timezone type ZIF_IBMC_service_arch=>ty_timezone, 189 | lv_datc(10) type c, 190 | lv_timc(8) type c. 191 | 192 | " split timestamp to date and time according to time zone 193 | lv_timezone = ZCL_IBMC_service_arch=>get_timezone( ). 194 | convert time stamp iv_timestamp time zone lv_timezone 195 | into date lv_dats time lv_tims. 196 | 197 | " write date and time to string using local date/time format 198 | lv_datc = conv #( lv_dats ). 199 | lv_timc = conv #( lv_tims ). 200 | concatenate lv_datc lv_timc into ev_local separated by space. 201 | 202 | endmethod. 203 | 204 | 205 | * ---------------------------------------------------------------------------------------+ 206 | * | Static Public Method ZCL_IBMC_UTIL=>GET_MIMETYPE_FROM_EXTENSION 207 | * +-------------------------------------------------------------------------------------------------+ 208 | * | [--->] I_FILENAME TYPE STRING 209 | * | [<-()] E_MIMETYPE TYPE STRING 210 | * +-------------------------------------------------------------------------------------- 211 | method get_mimetype_from_extension. 212 | data: 213 | l_extension type string. 214 | 215 | if i_filename is initial. 216 | e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-all. 217 | exit. 218 | endif. 219 | 220 | "find regex '\.([^\.]*)$' in i_filename submatches l_extension. 221 | data(l_subrc) = zcl_ibmc_service=>find_regex( 222 | exporting 223 | i_regex = '\.([^\.]*)$' 224 | i_in = i_filename 225 | changing 226 | c_submatch1 = l_extension ). 227 | if l_subrc <> 0. 228 | l_extension = i_filename. 229 | endif. 230 | 231 | translate l_extension to lower case. 232 | 233 | case l_extension. 234 | when 'jpg' or 'jpeg'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-image_jpeg. 235 | when 'png'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-image_png. 236 | when 'txt'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-text_plain. 237 | when 'csv'. e_mimetype = ZIF_IBMC_service_arch=>c_mediatype-text_csv. 238 | when others. e_mimetype = `application/` && l_extension ##NO_TEXT. 239 | endcase. 240 | 241 | endmethod. 242 | 243 | 244 | * ---------------------------------------------------------------------------------------+ 245 | * | Static Public Method ZCL_IBMC_UTIL=>ITAB_TO_TABLESCHEMA 246 | * +-------------------------------------------------------------------------------------------------+ 247 | * | [--->] I_ITAB TYPE ANY TABLE 248 | * | [--->] I_DICTIONARY TYPE ANY(optional) 249 | * | [--->] I_LOWER_CASE TYPE ZCL_IBMC_SERVICE=>BOOLEAN (default =ZCL_IBMC_SERVICE=>C_BOOLEAN_FALSE) 250 | * | [--->] IT_EXCLUDED_FIELDS TYPE ZCL_IBMC_SERVICE=>TT_STRING(optional) 251 | * | [<-()] E_JSON TYPE STRING 252 | * +-------------------------------------------------------------------------------------- 253 | method itab_to_tableschema. 254 | " Converts an internal table to a JSON object string with keys "fields" and "values". 255 | " Example: I_ITAB = | PET | NUMBER | 256 | " ------------------- 257 | " | Cat | 5 | 258 | " | Rabbit | 2 | 259 | " --> E_JSON = '{"fields": ["PET", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}' 260 | " Field names are mapped according to I_DICTIONARY. 261 | " Example: BEGIN OF i_dictionary, 262 | " PET type string value 'MyPet', 263 | " END OF i_dictionary. 264 | " --> E_JSON = '{"fields": ["MyPet", "NUMBER"], "values": [["Cat",5],["Rabbit",2]]}' 265 | " Field names are translated to lower case, if I_LOWER_CASE = ZCL_IBMC_service=>c_boolean_true. 266 | " Field types must be elementary or table of elementary. 267 | " Field names in table IT_EXCLUDED_FIELDS are skipped and will not appear in the JSON string. 268 | 269 | data: 270 | lt_comp type cl_abap_structdescr=>component_table, 271 | ls_comp like line of lt_comp, 272 | lo_datadescr type ref to cl_abap_datadescr, 273 | lo_tabledesc type ref to cl_abap_tabledescr, 274 | lo_struct type ref to cl_abap_structdescr, 275 | lv_fieldname type string, 276 | lv_sep1(1) type c, 277 | lv_sep2(1) type c, 278 | lv_sep3(1) type c. 279 | 280 | field-symbols: 281 | type any, 282 | type any, 283 | type any table, 284 | type string. 285 | 286 | " the following data type are character-like, thus the according values must be quoted 287 | data(lc_character_types) = 288 | cl_abap_datadescr=>typekind_char && 289 | cl_abap_datadescr=>typekind_clike && 290 | cl_abap_datadescr=>typekind_csequence && 291 | cl_abap_datadescr=>typekind_string && 292 | cl_abap_datadescr=>typekind_date && 293 | cl_abap_datadescr=>typekind_time && 294 | cl_abap_datadescr=>typekind_num. 295 | 296 | " get internal table fields 297 | lo_tabledesc ?= cl_abap_tabledescr=>describe_by_data( i_itab ). 298 | lo_struct ?= lo_tabledesc->get_table_line_type( ). 299 | lt_comp = lo_struct->get_components( ). 300 | 301 | " append field names to JSON string 302 | e_json = `{"fields": [` ##NO_TEXT. 303 | clear lv_sep1. 304 | loop at lt_comp into ls_comp. 305 | read table it_excluded_fields with key table_line = ls_comp-name transporting no fields. 306 | if sy-subrc = 0. continue. endif. 307 | lv_fieldname = ls_comp-name. 308 | if i_dictionary is supplied. 309 | assign component ls_comp-name of structure i_dictionary to . 310 | if sy-subrc = 0. 311 | lv_fieldname = . 312 | endif. 313 | endif. 314 | if i_lower_case eq ZCL_IBMC_service=>c_boolean_true. 315 | translate lv_fieldname to lower case. 316 | endif. 317 | e_json = e_json && lv_sep1 && `"` && lv_fieldname && `"`. 318 | lv_sep1 = `,`. 319 | endloop. 320 | 321 | " append values to JSON string 322 | e_json = e_json && `], "values": [` ##NO_TEXT. 323 | 324 | clear lv_sep1. 325 | loop at i_itab assigning . " loop on itab records 326 | clear lv_sep2. 327 | e_json = e_json && lv_sep1 && `[`. 328 | loop at lt_comp into ls_comp. " loop on record fields 329 | read table it_excluded_fields with key table_line = ls_comp-name transporting no fields. 330 | if sy-subrc = 0. continue. endif. 331 | 332 | if ls_comp-type->type_kind eq cl_abap_datadescr=>typekind_table. 333 | 334 | " field type is subtable, get line type 335 | assign component ls_comp-name of structure to . 336 | lo_tabledesc ?= cl_abap_tabledescr=>describe_by_data( ). 337 | lo_datadescr = lo_tabledesc->get_table_line_type( ). 338 | 339 | " add field values of subtable to JSON string 340 | clear lv_sep3. 341 | e_json = e_json && lv_sep2 && `[`. 342 | loop at assigning . 343 | if lo_datadescr->type_kind ca lc_character_types. 344 | e_json = e_json && lv_sep3 && `"` && && `"`. 345 | else. 346 | e_json = e_json && lv_sep3 && . 347 | endif. 348 | lv_sep3 = `,`. 349 | endloop. 350 | e_json = e_json && `]`. 351 | 352 | else. 353 | 354 | " field type is elementary, add field value to JSON string 355 | assign component ls_comp-name of structure to . 356 | if ls_comp-type->type_kind ca lc_character_types. 357 | e_json = e_json && lv_sep2 && `"` && && `"`. 358 | else. 359 | e_json = e_json && lv_sep2 && . 360 | endif. 361 | 362 | endif. 363 | 364 | lv_sep2 = `,`. 365 | endloop. 366 | 367 | e_json = e_json && `]`. 368 | lv_sep1 = `,`. 369 | endloop. 370 | 371 | e_json = e_json && `]}` ##NO_TEXT. 372 | 373 | endmethod. 374 | 375 | 376 | * ---------------------------------------------------------------------------------------+ 377 | * | Static Public Method ZCL_IBMC_UTIL=>TABLESCHEMA_TO_ITAB 378 | * +-------------------------------------------------------------------------------------------------+ 379 | * | [--->] I_JSON TYPE STRING 380 | * | [--->] I_TABLESCHEMA_KEY TYPE STRING(optional) 381 | * | [<---] E_ITAB TYPE ANY TABLE 382 | * +-------------------------------------------------------------------------------------- 383 | method tableschema_to_itab. 384 | 385 | data: 386 | lt_comp type cl_abap_structdescr=>component_table, 387 | ls_comp like line of lt_comp, 388 | lv_field type string, 389 | lt_field type standard table of string, 390 | lv_fieldname type string, 391 | lv_tabix type i, 392 | lv_tableschema_key type string, 393 | lo_structdescr type ref to cl_abap_structdescr, 394 | lo_datadescr type ref to cl_abap_datadescr, 395 | lo_tabledescr type ref to cl_abap_tabledescr, 396 | lr_values type ref to data, 397 | lr_comp type ref to data, 398 | lr_data type ref to data, 399 | lv_json type string. 400 | 401 | field-symbols: 402 | type ref to data, 403 | type any table, 404 | type any, 405 | type any, 406 | type any table, 407 | type any, 408 | type any, 409 | type ref to data, 410 | type any table, 411 | type any table, 412 | type any, 413 | type any table, 414 | type any table. 415 | 416 | " dynamically create data structure: 417 | " begin of , 418 | " tableschema_key type ref to data, 419 | " end of . 420 | if i_tableschema_key is initial. 421 | lv_json = `{ "tableschema_key": ` && i_json && ` }` ##NO_TEXT. 422 | lv_tableschema_key = `tableschema_key` ##NO_TEXT. 423 | else. 424 | lv_json = i_json. 425 | lv_tableschema_key = i_tableschema_key. 426 | endif. 427 | ls_comp-name = lv_tableschema_key. 428 | ls_comp-type ?= cl_abap_datadescr=>describe_by_data( lr_data ). 429 | append ls_comp to lt_comp. 430 | lo_structdescr = cl_abap_structdescr=>create( lt_comp ). 431 | create data lr_data type handle lo_structdescr. 432 | assign lr_data->* to . 433 | 434 | " parse JSON 435 | try. 436 | ZCL_IBMC_service=>parse_json( 437 | exporting 438 | i_json = lv_json 439 | "i_dictionary = c_abapname_dictionary 440 | changing 441 | c_abap = ). 442 | catch ZCX_IBMC_service_exception. 443 | return. 444 | endtry. 445 | assign component lv_tableschema_key of structure to . 446 | assign ->* to . 447 | 448 | 449 | 450 | unassign . 451 | assign component 'VALUES' of structure to . 452 | 453 | " I_JSON does not have table schema on highest level, check if any subkey has 454 | " check all components 455 | lo_structdescr ?= cl_abap_structdescr=>describe_by_data( ). 456 | clear lt_comp[]. 457 | lt_comp = lo_structdescr->get_components( ). 458 | 459 | loop at lt_comp into ls_comp. 460 | assign component ls_comp-name of structure to . 461 | lo_datadescr ?= cl_abap_datadescr=>describe_by_data_ref( ). 462 | if lo_datadescr->type_kind eq cl_abap_datadescr=>typekind_table. 463 | assign ->* to . 464 | loop at assigning ##GEN_OK. 465 | exit. 466 | endloop. 467 | endif. 468 | assign ->* to . 469 | assign component 'VALUES' of structure to . 470 | if sy-subrc = 0. 471 | assign to . 472 | exit. 473 | endif. 474 | 475 | endloop. 476 | 477 | 478 | if not is assigned. 479 | return. 480 | endif. 481 | 482 | assign ->* to . 483 | assign component 'FIELDS' of structure to . 484 | if sy-subrc = 0. 485 | assign ->* to . 486 | loop at assigning ##GEN_OK. 487 | assign ->* to . 488 | append to lt_field. 489 | endloop. 490 | else. 491 | data(lv_count) = lines( ). 492 | data(lv_index) = 0. 493 | while lv_index < lv_count. 494 | lv_fieldname = `FIELD` && lv_index. 495 | lv_index = lv_index + 1. 496 | append lv_fieldname to lt_field. 497 | endwhile. 498 | endif. 499 | 500 | 501 | " get data fields; read first values for reference 502 | if lines( ) < 1. return. endif. 503 | loop at into lr_data. 504 | assign lr_data->* to . 505 | exit. 506 | endloop. 507 | 508 | clear lt_comp[]. 509 | loop at into lr_values. 510 | 511 | " field name 512 | lv_tabix = lv_tabix + 1. 513 | read table lt_field index lv_tabix into lv_field. 514 | if sy-subrc <> 0. 515 | lv_field = `C` && lv_tabix. 516 | endif. 517 | ls_comp-name = lv_field. 518 | 519 | " read data type 520 | assign lr_values->* to . 521 | lo_datadescr ?= cl_abap_datadescr=>describe_by_data( ). 522 | 523 | if lo_datadescr->type_kind = cl_abap_structdescr=>typekind_table. 524 | 525 | " data type is internal table (of references) 526 | " -> create new internal table layout w/o references 527 | lo_tabledescr ?= cl_abap_tabledescr=>describe_by_data( ). 528 | lo_datadescr = lo_tabledescr->get_table_line_type( ). 529 | if lo_datadescr->type_kind = cl_abap_datadescr=>typekind_dref. 530 | assign to . 531 | loop at into lr_comp. exit. endloop. " read first table record 532 | lo_datadescr ?= cl_abap_datadescr=>describe_by_data_ref( lr_comp ). 533 | endif. 534 | ls_comp-type = cl_abap_tabledescr=>create( p_line_type = lo_datadescr ). 535 | 536 | else. 537 | ls_comp-type = lo_datadescr. 538 | endif. 539 | 540 | append ls_comp to lt_comp. 541 | endloop. 542 | 543 | " create data structure 544 | lo_structdescr = cl_abap_structdescr=>create( lt_comp ). 545 | create data lr_data type handle lo_structdescr. 546 | assign lr_data->* to . 547 | create data lr_data like table of . 548 | assign lr_data->* to . 549 | 550 | 551 | " populate data structure 552 | loop at into lr_data. 553 | assign lr_data->* to . 554 | if not is assigned. 555 | create data lr_data type handle lo_structdescr. 556 | assign lr_data->* to . 557 | endif. 558 | lv_tabix = 0. 559 | loop at into lr_values. 560 | lv_tabix = lv_tabix + 1. 561 | read table lt_comp index lv_tabix into ls_comp. 562 | case ls_comp-type->type_kind. 563 | when cl_abap_structdescr=>typekind_table. 564 | assign component ls_comp-name of structure to . 565 | assign lr_values->* to . 566 | loop at into lr_data. 567 | assign lr_data->* to . 568 | insert into table . 569 | endloop. 570 | when others. 571 | assign component ls_comp-name of structure to . 572 | assign lr_values->* to . 573 | = . 574 | endcase. 575 | endloop. 576 | 577 | insert into table . 578 | unassign . " force data creation at next loop step 579 | 580 | endloop. 581 | 582 | move-corresponding to e_itab. 583 | 584 | endmethod. 585 | 586 | 587 | * ---------------------------------------------------------------------------------------+ 588 | * | Static Public Method ZCL_IBMC_UTIL=>UTC_TO_TIMEZONE 589 | * +-------------------------------------------------------------------------------------------------+ 590 | * | [--->] I_TIMESTAMP TYPE TIMESTAMP 591 | * | [--->] I_TIMEZONE TYPE ZIF_IBMC_SERVICE_ARCH=>TY_TIMEZONE(optional) 592 | * | [<-()] E_TIMESTAMP TYPE TIMESTAMP 593 | * +-------------------------------------------------------------------------------------- 594 | method utc_to_timezone. 595 | 596 | data: 597 | lv_timezone type ZIF_IBMC_service_arch=>ty_timezone, 598 | lv_date type d, 599 | lv_time type t. 600 | 601 | if i_timezone is initial. 602 | lv_timezone = ZCL_IBMC_service_arch=>get_timezone( ). 603 | else. 604 | lv_timezone = i_timezone. 605 | endif. 606 | 607 | convert time stamp i_timestamp time zone lv_timezone into date lv_date time lv_time. 608 | convert date lv_date time lv_time into time stamp e_timestamp time zone 'UTC'. 609 | 610 | endmethod. 611 | ENDCLASS. 612 | -------------------------------------------------------------------------------- /src/zcl_ibmc_util.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCL_IBMC_UTIL 7 | E 8 | Utilities to connect to IBM Watson 9 | 1 10 | X 11 | X 12 | X 13 | 14 | 15 | 16 | ZCL_IBMC_UTIL 17 | CONVERT_DATETIME_TO_TIMESTAMP 18 | E 19 | Converts a DATETIME String to type TIMESTAMP 20 | 21 | 22 | ZCL_IBMC_UTIL 23 | CONVERT_TIMESTAMP_TO_DATETIME 24 | E 25 | Converts a DATETIME String to type TIMESTAMP 26 | 27 | 28 | ZCL_IBMC_UTIL 29 | CONVERT_TIMESTAMP_TO_LOCAL 30 | E 31 | Converts a UTF timestamp to a local timestamp 32 | 33 | 34 | ZCL_IBMC_UTIL 35 | GET_MIMETYPE_FROM_EXTENSION 36 | E 37 | Returns mime type for a given extension 38 | 39 | 40 | ZCL_IBMC_UTIL 41 | ITAB_TO_TABLESCHEMA 42 | E 43 | Converts an internal table to table schema JSON format 44 | 45 | 46 | ZCL_IBMC_UTIL 47 | TABLESCHEMA_TO_ITAB 48 | E 49 | Converts a JSON string in table schema format to an itab 50 | 51 | 52 | ZCL_IBMC_UTIL 53 | UTC_TO_TIMEZONE 54 | E 55 | Converts an UTC timestamp to the specified timezone 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/zcx_ibmc_service_exception.clas.abap: -------------------------------------------------------------------------------- 1 | class ZCX_IBMC_SERVICE_EXCEPTION definition 2 | public 3 | inheriting from CX_STATIC_CHECK 4 | final 5 | create public . 6 | 7 | public section. 8 | 9 | interfaces IF_T100_DYN_MSG . 10 | interfaces IF_T100_MESSAGE . 11 | 12 | data P_MSG_JSON type STRING . 13 | data P_HTTP_STATUS type STRING . 14 | data P_HTTP_REASON type STRING . 15 | 16 | methods CONSTRUCTOR 17 | importing 18 | !TEXTID like IF_T100_MESSAGE=>T100KEY optional 19 | !PREVIOUS like PREVIOUS optional 20 | !P_MSG_JSON type STRING optional 21 | !P_HTTP_STATUS type STRING optional 22 | !P_HTTP_REASON type STRING optional . 23 | 24 | methods IF_MESSAGE~GET_LONGTEXT 25 | redefinition . 26 | methods IF_MESSAGE~GET_TEXT 27 | redefinition . 28 | protected section. 29 | private section. 30 | ENDCLASS. 31 | 32 | 33 | 34 | CLASS ZCX_IBMC_SERVICE_EXCEPTION IMPLEMENTATION. 35 | 36 | 37 | method CONSTRUCTOR. 38 | CALL METHOD SUPER->CONSTRUCTOR 39 | EXPORTING 40 | PREVIOUS = PREVIOUS. 41 | me->P_MSG_JSON = P_MSG_JSON . 42 | me->P_HTTP_STATUS = P_HTTP_STATUS . 43 | me->P_HTTP_REASON = P_HTTP_REASON . 44 | clear me->textid. 45 | if textid is initial. 46 | IF_T100_MESSAGE~T100KEY = IF_T100_MESSAGE=>DEFAULT_TEXTID. 47 | else. 48 | IF_T100_MESSAGE~T100KEY = TEXTID. 49 | endif. 50 | endmethod. 51 | 52 | 53 | method if_message~get_longtext. 54 | call method super->if_message~get_longtext 55 | exporting 56 | preserve_newlines = preserve_newlines 57 | receiving 58 | result = result. 59 | endmethod. 60 | 61 | 62 | method if_message~get_text. 63 | call method super->if_message~get_text 64 | receiving 65 | result = result. 66 | endmethod. 67 | ENDCLASS. 68 | -------------------------------------------------------------------------------- /src/zcx_ibmc_service_exception.clas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZCX_IBMC_SERVICE_EXCEPTION 7 | E 8 | IBM Cloud Service Exception 9 | 40 10 | 1 11 | X 12 | X 13 | X 14 | 15 | 16 | 17 | ZCX_IBMC_SERVICE_EXCEPTION 18 | CONSTRUCTOR 19 | E 20 | CONSTRUCTOR 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/zibmc.msag.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIBMC 7 | E 8 | 9 | 10 | 11 | E 12 | ZIBMC 13 | 000 14 | &1 15 | 16 | 17 | E 18 | ZIBMC 19 | 001 20 | &1: return code &2 21 | 22 | 23 | E 24 | ZIBMC 25 | 002 26 | An exception has occurred, reason code &1. 27 | 28 | 29 | E 30 | ZIBMC 31 | 003 32 | HTTP Status: &1 (&2) 33 | 34 | 35 | E 36 | ZIBMC 37 | 004 38 | Malformated url: &1 39 | 40 | 41 | E 42 | ZIBMC 43 | 005 44 | HTTP &1 request failed: &2 45 | 46 | 47 | E 48 | ZIBMC 49 | 006 50 | HTTP client cannot be created, return code &1. 51 | 52 | 53 | E 54 | ZIBMC 55 | 007 56 | Parameter &1 not set 57 | 58 | 59 | E 60 | ZIBMC 61 | 008 62 | Either parameter &1 or parameter &2 must be specified. 63 | 64 | 65 | E 66 | ZIBMC 67 | 020 68 | Cannot parse JSON string, see short dump. 69 | 70 | 71 | E 72 | ZIBMC 73 | 030 74 | Decoding of base64 string failed. 75 | 76 | 77 | E 78 | ZIBMC 79 | 040 80 | &1 81 | 82 | 83 | E 84 | ZIBMC 85 | 050 86 | Missing field &1 in input structure. 87 | 88 | 89 | E 90 | ZIBMC 91 | 051 92 | Input image is missing or ambiguous. 93 | 94 | 95 | E 96 | ZIBMC 97 | 052 98 | base64 decoding of image &1 failed with return code &2. 99 | 100 | 101 | E 102 | ZIBMC 103 | 053 104 | Classifier &1 has status &2. Operation terminated. 105 | 106 | 107 | E 108 | ZIBMC 109 | 054 110 | Field &1 is missing or has incompatible type. 111 | 112 | 113 | E 114 | ZIBMC 115 | 055 116 | Input structure meta data is not available. 117 | 118 | 119 | E 120 | ZIBMC 121 | 056 122 | Cannot add image to ZIP file without filename. 123 | 124 | 125 | 126 | 127 | 128 | NA 129 | ZIBMC003 130 | E 131 | E 132 | 0018 133 | X 134 | 00005 135 | 136 | 137 | DOKU 138 | ZIBMC003 139 | NA 140 | E 141 | S_DOCU_SHOW 142 | S_DOCUS1 143 | 00018 144 | 072 145 | 146 | 147 | 148 | AS 149 | The HTTP Request received status "&V1&": "&V2&" 150 | 151 | 152 | U1 153 | &SYSTEM_RESPONSE& 154 | 155 | 156 | AS 157 | Access point: &V3& 158 | 159 | 160 | AS 161 | Detailed Information reported by the service: 162 | 163 | 164 | AS 165 | &V4& 166 | 167 | 168 | U1 169 | &WHAT_TO_DO& 170 | 171 | 172 | AS 173 | ,,Correct the error and restart the process. 174 | 175 | 176 | 177 | 178 | 179 | NA 180 | ZIBMC004 181 | E 182 | E 183 | 0002 184 | X 185 | 00004 186 | 187 | 188 | DOKU 189 | ZIBMC004 190 | NA 191 | E 192 | S_DOCU_SHOW 193 | S_DOCUS1 194 | 00002 195 | 072 196 | 197 | 198 | 199 | U1 200 | &CAUSE& 201 | 202 | 203 | AS 204 | The format of URL "&V1&" is not correct. 205 | 206 | 207 | U1 208 | &SYSTEM_RESPONSE& 209 | 210 | 211 | AS 212 | The request has been terminated. 213 | 214 | 215 | U1 216 | &WHAT_TO_DO& 217 | 218 | 219 | AS 220 | Correct the URL. Format of the URL must comply with schema http(s):// 221 | 222 | 223 | = 224 | <host>/<api path> 225 | 226 | 227 | U1 228 | &SYS_ADMIN& 229 | 230 | 231 | AS 232 | 233 | 234 | 235 | 236 | 237 | NA 238 | ZIBMC040 239 | E 240 | E 241 | 0004 242 | X 243 | 00004 244 | 245 | 246 | DOKU 247 | ZIBMC040 248 | NA 249 | E 250 | S_DOCU_SHOW 251 | S_DOCUS1 252 | 00004 253 | 072 254 | 255 | 256 | 257 | U1 258 | &CAUSE& 259 | 260 | 261 | AS 262 | Error 263 | 264 | 265 | U1 266 | &SYSTEM_RESPONSE& 267 | 268 | 269 | AS 270 | JSON comes here. 271 | 272 | 273 | AS 274 | <(>&<)>1 275 | 276 | 277 | AS 278 | &V1& 279 | 280 | 281 | U1 282 | &WHAT_TO_DO& 283 | 284 | 285 | AS 286 | 287 | 288 | U1 289 | &SYS_ADMIN& 290 | 291 | 292 | AS 293 | 294 | 295 | 296 | 297 | 298 | NA 299 | ZIBMC050 300 | E 301 | E 302 | 0003 303 | X 304 | 00004 305 | 306 | 307 | DOKU 308 | ZIBMC050 309 | NA 310 | E 311 | S_DOCU_SHOW 312 | S_DOCUS1 313 | 00003 314 | 072 315 | 316 | 317 | 318 | U1 319 | &CAUSE& 320 | 321 | 322 | AS 323 | The Watson Machine Learning scoring endpoint requires input field &V1& 324 | 325 | 326 | which is not present in the input structure. 327 | 328 | 329 | U1 330 | &SYSTEM_RESPONSE& 331 | 332 | 333 | AS 334 | Watson Machine Learning refuses the scoring request. 335 | 336 | 337 | U1 338 | &WHAT_TO_DO& 339 | 340 | 341 | AS 342 | Add field &V1& to the input structure. 343 | 344 | 345 | U1 346 | &SYS_ADMIN& 347 | 348 | 349 | AS 350 | 351 | 352 | 353 | 354 | 355 | NA 356 | ZIBMC051 357 | E 358 | E 359 | 0001 360 | X 361 | 00005 362 | 363 | 364 | DOKU 365 | ZIBMC051 366 | NA 367 | E 368 | S_DOCU_SHOW 369 | S_DOCUS1 370 | 00001 371 | 072 372 | 373 | 374 | 375 | U1 376 | &CAUSE& 377 | 378 | 379 | AS 380 | The image to be classified is not specified or its specification is 381 | 382 | 383 | ambiguous. 384 | 385 | 386 | U1 387 | &SYSTEM_RESPONSE& 388 | 389 | 390 | AS 391 | The image is not being classified. 392 | 393 | 394 | U1 395 | &WHAT_TO_DO& 396 | 397 | 398 | AS 399 | Specify the image either as binary data (type XSTRING) or as base64 400 | 401 | 402 | encoded character data (type STRING), but not both. 403 | 404 | 405 | U1 406 | &SYS_ADMIN& 407 | 408 | 409 | AS 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | -------------------------------------------------------------------------------- /src/zibmc_config.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIBMC_CONFIG 7 | E 8 | TRANSP 9 | X 10 | IBM Cloud Service Integration - Configuration 11 | X 12 | C 13 | 1 14 | 15 | 16 | ZIBMC_CONFIG 17 | A 18 | 2 19 | APPL2 20 | X 21 | X 22 | 23 | 24 | 25 | ZIBMC_CONFIG 26 | CLIENT 27 | E 28 | 0001 29 | X 30 | 0 31 | C 32 | 000006 33 | X 34 | CLNT 35 | 000003 36 | CLNT 37 | 38 | 39 | ZIBMC_CONFIG 40 | SERVICE 41 | E 42 | 0002 43 | X 44 | 0 45 | C 46 | 000060 47 | X 48 | CHAR 49 | 000030 50 | CHAR 51 | 52 | 53 | ZIBMC_CONFIG 54 | INSTANCE_UID 55 | 0003 56 | X 57 | ZIBMC_TY_INSTANCE_UID 58 | 0 59 | X 60 | E 61 | 62 | 63 | ZIBMC_CONFIG 64 | PARAM 65 | E 66 | 0004 67 | X 68 | 0 69 | C 70 | 000064 71 | X 72 | CHAR 73 | 000032 74 | CHAR 75 | 76 | 77 | ZIBMC_CONFIG 78 | VALUE 79 | 0005 80 | ZIBMC_TY_STRINGVALUE 81 | 0 82 | E 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /src/zibmc_dom_stringvalue.doma.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIBMC_DOM_STRINGVALUE 7 | E 8 | STRG 9 | X 10 | Case-sensitive string value 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/zibmc_token.tabl.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIBMC_TOKEN 7 | E 8 | TRANSP 9 | X 10 | IAM tokens 11 | X 12 | L 13 | 4 14 | 15 | 16 | ZIBMC_TOKEN 17 | A 18 | 4 19 | APPL2 20 | P 21 | X 22 | 23 | 24 | 25 | ZIBMC_TOKEN 26 | CLIENT 27 | E 28 | 0001 29 | X 30 | 0 31 | C 32 | 000006 33 | X 34 | CLNT 35 | 000003 36 | CLNT 37 | 38 | 39 | ZIBMC_TOKEN 40 | SERVICE 41 | E 42 | 0002 43 | X 44 | 0 45 | C 46 | 000060 47 | X 48 | CHAR 49 | 000030 50 | CHAR 51 | 52 | 53 | ZIBMC_TOKEN 54 | INSTANCE_UID 55 | 0003 56 | X 57 | ZIBMC_TY_INSTANCE_UID 58 | 0 59 | X 60 | E 61 | 62 | 63 | ZIBMC_TOKEN 64 | ACCESS_TOKEN 65 | E 66 | 0004 67 | 0 68 | g 69 | 000008 70 | STRG 71 | STRG 72 | 73 | 74 | ZIBMC_TOKEN 75 | REFRESH_TOKEN 76 | E 77 | 0005 78 | 0 79 | g 80 | 000008 81 | STRG 82 | STRG 83 | 84 | 85 | ZIBMC_TOKEN 86 | TOKEN_TYPE 87 | E 88 | 0006 89 | 0 90 | g 91 | 000008 92 | STRG 93 | STRG 94 | 95 | 96 | ZIBMC_TOKEN 97 | EXPIRES_IN 98 | E 99 | 0007 100 | 0 101 | X 102 | 000004 103 | INT4 104 | 000010 105 | INT4 106 | 107 | 108 | ZIBMC_TOKEN 109 | EXPIRES_TS 110 | 0008 111 | TIMESTAMP 112 | 0 113 | E 114 | 115 | 116 | ZIBMC_TOKEN 117 | EXPIRATION 118 | E 119 | 0009 120 | 0 121 | X 122 | 000004 123 | INT4 124 | 000010 125 | INT4 126 | 127 | 128 | ZIBMC_TOKEN 129 | SCOPE 130 | E 131 | 0010 132 | 0 133 | g 134 | 000008 135 | STRG 136 | STRG 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/zibmc_ty_instance_uid.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIBMC_TY_INSTANCE_UID 7 | E 8 | 55 9 | 10 10 | 20 11 | 40 12 | Instance GUI 13 | Instance UID 14 | Instance 15 | Instance UID 16 | Instance UID 17 | E 18 | CHAR 19 | 000032 20 | 000032 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/zibmc_ty_stringvalue.dtel.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | ZIBMC_TY_STRINGVALUE 7 | E 8 | ZIBMC_DOM_STRINGVALUE 9 | 55 10 | 10 11 | 20 12 | 40 13 | Case-sensitive string value 14 | Value 15 | Value 16 | Value 17 | Value 18 | E 19 | D 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/zif_ibmc_service_arch.intf.abap: -------------------------------------------------------------------------------- 1 | * Copyright 2019,2023 IBM Corp. All Rights Reserved. 2 | * 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | interface ZIF_IBMC_SERVICE_ARCH 15 | public . 16 | 17 | 18 | types: 19 | boolean(1) type c . 20 | types: 21 | char(1) type c . 22 | types: 23 | begin of ts_http_status, 24 | code type string, 25 | reason type string, 26 | json type string, 27 | end of ts_http_status . 28 | types: 29 | begin of ts_header, 30 | name type string, 31 | value type string, 32 | end of ts_header . 33 | types: 34 | tt_header type standard table of ts_header with non-unique default key . 35 | types: 36 | begin of ts_url, 37 | protocol type string, 38 | host type string, 39 | path_base type string, 40 | path type string, 41 | querystring type string, 42 | end of ts_url . 43 | types: 44 | begin of ts_access_token, 45 | access_token type string, 46 | token_type(32) type c, 47 | expires_ts type timestamp, 48 | end of ts_access_token . 49 | types: 50 | ty_timezone(6) type c . 51 | types: 52 | ty_ssl_id(6) type c . 53 | types: 54 | begin of ts_request_prop, 55 | url type ts_url, 56 | proxy_host type string, 57 | proxy_port type string, 58 | auth_name type string, 59 | auth_type type string, 60 | auth_headername type string, 61 | auth_basic type boolean, 62 | auth_oauth type boolean, 63 | auth_apikey type boolean, 64 | auth_query type boolean, 65 | auth_header type boolean, 66 | auth_body type boolean, 67 | header_accept type string, 68 | header_content_type type string, 69 | headers type tt_header, 70 | body type string, 71 | body_bin type xstring, 72 | username type string, 73 | password type string, 74 | apikey type string, 75 | access_token type ts_access_token, 76 | ssl_id type ty_ssl_id, 77 | end of ts_request_prop . 78 | types: 79 | tt_string type standard table of string with non-unique default key . 80 | types: 81 | begin of TS_FORM_PART, 82 | CONTENT_TYPE type STRING, 83 | CONTENT_DISPOSITION type STRING, 84 | CDATA type STRING, 85 | XDATA type XSTRING, 86 | end of TS_FORM_PART . 87 | types: 88 | TT_FORM_PART type standard table of TS_FORM_PART with non-unique default key . 89 | 90 | 91 | constants C_METHOD_GET type CHAR value 'g' ##NO_TEXT. 92 | constants C_METHOD_POST type CHAR value 'p' ##NO_TEXT. 93 | constants C_METHOD_PATCH type CHAR value 'm' ##NO_TEXT. 94 | constants C_METHOD_CREATE type CHAR value 'c' ##NO_TEXT. 95 | constants C_METHOD_PUT type CHAR value 'u' ##NO_TEXT. 96 | constants C_METHOD_DELETE type CHAR value 'd' ##NO_TEXT. 97 | constants C_HEADER_CONTENT_TYPE type STRING value 'Content-Type' ##NO_TEXT. 98 | constants C_HEADER_ACCEPT type STRING value 'Accept' ##NO_TEXT. 99 | constants C_HEADER_CONTENT_DISPOSITION type STRING value 'Content-Disposition' ##NO_TEXT. 100 | constants: 101 | begin of c_mediatype, 102 | all type string value '*/*', 103 | appl_gzip type string value 'application/gzip', 104 | appl_html type string value 'application/html', 105 | appl_json type string value 'application/json', 106 | appl_octet_stream type string value 'application/octet-stream', 107 | appl_pdf type string value 'application/pdf', 108 | appl_www_form_urlencoded type string value 'application/x-www-form-urlencoded', 109 | appl_xml type string value 'application/xml', 110 | appl_xhtml_xml type string value 'application/xhtml+xml', 111 | atom_xml type string value 'application/atom+xml', 112 | appl_zip type string value 'application/zip', 113 | audio_all type string value 'audio/*', 114 | audio_mpeg type string value 'audio/mpeg', 115 | audio_ogg type string value 'audio/ogg', 116 | audio_wav type string value 'audio/wav', 117 | image_all type string value 'image/*', 118 | image_bmp type string value 'image/bmp', 119 | image_gif type string value 'image/gif', 120 | image_jpeg type string value 'image/jpeg', 121 | image_png type string value 'image/png', 122 | image_tiff type string value 'image/tiff', 123 | multipart_all type string value 'multipart/*', 124 | multipart_form_data type string value 'multipart/form-data', 125 | multipart_mixed type string value 'multipart/mixed', 126 | text_all type string value 'text/*', 127 | text_css type string value 'text/css', 128 | text_csv type string value 'text/csv', 129 | text_html type string value 'text/html', 130 | text_javascript type string value 'text/javascript', 131 | text_plain type string value 'text/plain', 132 | video_all type string value 'video/*', 133 | video_mp4 type string value 'video/mp4', 134 | video_mpeg type string value 'video/mpeg', 135 | end of c_mediatype . 136 | constants: 137 | begin of c_datatype, 138 | i type char value 'I', 139 | int8 type char value '8', 140 | p type char value 'P', 141 | f type char value 'F', 142 | c type char value 'C', 143 | n type char value 'N', 144 | string type char value 'g', 145 | x type char value 'X', 146 | xstring type char value 'y', 147 | dataref type char value 'l', 148 | objectref type char value 'r', 149 | struct type char value 'u', 150 | struct_deep type char value 'v', 151 | itab type char value 'h', 152 | end of c_datatype . 153 | endinterface. 154 | -------------------------------------------------------------------------------- /src/zif_ibmc_service_arch.intf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ZIF_IBMC_SERVICE_ARCH 7 | E 8 | IBM Watson SDK Platform-specifics 9 | 2 10 | 1 11 | X 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------