AWS code-library documentation change
Summary
Added multiple AWS Comprehend code examples for SAP ABAP SDK including CreateDocumentClassifier, DeleteDocumentClassifier, DescribeDocumentClassificationJob, DescribeDocumentClassifier, DescribeTopicsDetectionJob, DetectDominantLanguage, DetectEntities, DetectKeyPhrases, DetectPiiEntities, DetectSentiment, DetectSyntax, ListDocumentClassificationJobs, ListDocumentClassifiers, ListTopicsDetectionJobs, StartDocumentClassificationJob, and StartTopicsDetectionJob. Updated service references at end of file.
Security assessment
The change adds documentation for DetectPiiEntities API which identifies Personally Identifiable Information (PII), a security feature. However, there's no evidence this addresses a specific security vulnerability. Other changes are routine documentation additions for various Comprehend features.
Diff
diff --git a/code-library/latest/ug/sap-abap_1_comprehend_code_examples.md b/code-library/latest/ug/sap-abap_1_comprehend_code_examples.md index 54c4d4562..f330cf86a 100644 --- a//code-library/latest/ug/sap-abap_1_comprehend_code_examples.md +++ b//code-library/latest/ug/sap-abap_1_comprehend_code_examples.md @@ -25,0 +26,297 @@ Each example includes a link to the complete source code, where you can find ins +The following code example shows how to use `CreateDocumentClassifier`. + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cpd#code-examples). + + + TRY. + oo_result = lo_cpd->createdocumentclassifier( + iv_documentclassifiername = iv_classifier_name + iv_languagecode = iv_language_code + io_inputdataconfig = NEW /aws1/cl_cpddocclifierinpdat00( + iv_s3uri = iv_training_s3_uri + ) + iv_dataaccessrolearn = iv_data_access_role_arn + iv_mode = iv_mode + ). + MESSAGE 'Document classifier creation started.' TYPE 'I'. + CATCH /aws1/cx_cpdinvalidrequestex. + MESSAGE 'Invalid request.' TYPE 'E'. + CATCH /aws1/cx_cpdresrclimitexcdex. + MESSAGE 'Resource limit exceeded.' TYPE 'E'. + CATCH /aws1/cx_cpdtoomanyrequestsex. + MESSAGE 'Too many requests.' TYPE 'E'. + CATCH /aws1/cx_cpdtoomanytagsex. + MESSAGE 'Too many tags.' TYPE 'E'. + CATCH /aws1/cx_cpdinternalserverex. + MESSAGE 'Internal server error occurred.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [CreateDocumentClassifier](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + + +The following code example shows how to use `DeleteDocumentClassifier`. + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cpd#code-examples). + + + TRY. + oo_result = lo_cpd->deletedocumentclassifier( + iv_documentclassifierarn = iv_classifier_arn + ). + MESSAGE 'Document classifier deleted.' TYPE 'I'. + CATCH /aws1/cx_cpdinvalidrequestex. + MESSAGE 'Invalid request.' TYPE 'E'. + CATCH /aws1/cx_cpdtoomanyrequestsex. + MESSAGE 'Too many requests.' TYPE 'E'. + CATCH /aws1/cx_cpdresourcenotfoundex. + MESSAGE 'Resource not found.' TYPE 'E'. + CATCH /aws1/cx_cpdresourceinuseex. + MESSAGE 'Resource in use.' TYPE 'E'. + CATCH /aws1/cx_cpdinternalserverex. + MESSAGE 'Internal server error occurred.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [DeleteDocumentClassifier](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + + +The following code example shows how to use `DescribeDocumentClassificationJob`. + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cpd#code-examples). + + + TRY. + oo_result = lo_cpd->describedocclassificationjob( + iv_jobid = iv_job_id + ). + MESSAGE 'Document classification job described.' TYPE 'I'. + CATCH /aws1/cx_cpdinvalidrequestex. + MESSAGE 'Invalid request.' TYPE 'E'. + CATCH /aws1/cx_cpdjobnotfoundex. + MESSAGE 'Job not found.' TYPE 'E'. + CATCH /aws1/cx_cpdtoomanyrequestsex. + MESSAGE 'Too many requests.' TYPE 'E'. + CATCH /aws1/cx_cpdinternalserverex. + MESSAGE 'Internal server error occurred.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [DescribeDocumentClassificationJob](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + + +The following code example shows how to use `DescribeDocumentClassifier`. + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cpd#code-examples). + + + TRY. + oo_result = lo_cpd->describedocumentclassifier( + iv_documentclassifierarn = iv_classifier_arn + ). + MESSAGE 'Document classifier described.' TYPE 'I'. + CATCH /aws1/cx_cpdinvalidrequestex. + MESSAGE 'Invalid request.' TYPE 'E'. + CATCH /aws1/cx_cpdtoomanyrequestsex. + MESSAGE 'Too many requests.' TYPE 'E'. + CATCH /aws1/cx_cpdresourcenotfoundex. + MESSAGE 'Resource not found.' TYPE 'E'. + CATCH /aws1/cx_cpdinternalserverex. + MESSAGE 'Internal server error occurred.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [DescribeDocumentClassifier](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + + +The following code example shows how to use `DescribeTopicsDetectionJob`. + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cpd#code-examples). + + + TRY. + oo_result = lo_cpd->describetopicsdetectionjob( + iv_jobid = iv_job_id + ). + MESSAGE 'Topics detection job described.' TYPE 'I'. + CATCH /aws1/cx_cpdinvalidrequestex. + MESSAGE 'Invalid request.' TYPE 'E'. + CATCH /aws1/cx_cpdjobnotfoundex. + MESSAGE 'Job not found.' TYPE 'E'. + CATCH /aws1/cx_cpdtoomanyrequestsex. + MESSAGE 'Too many requests.' TYPE 'E'. + CATCH /aws1/cx_cpdinternalserverex. + MESSAGE 'Internal server error occurred.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [DescribeTopicsDetectionJob](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + + +The following code example shows how to use `DetectDominantLanguage`. + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cpd#code-examples). + + + TRY. + oo_result = lo_cpd->detectdominantlanguage( iv_text = iv_text ). + MESSAGE 'Languages detected.' TYPE 'I'. + CATCH /aws1/cx_cpdtextsizelmtexcdex. + MESSAGE 'Text size exceeds limit.' TYPE 'E'. + CATCH /aws1/cx_cpdinternalserverex. + MESSAGE 'Internal server error occurred.' TYPE 'E'. + CATCH /aws1/cx_cpdinvalidrequestex. + MESSAGE 'Invalid request.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [DetectDominantLanguage](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. +