/AWS1/IF_CGP=>CREATETERMS()¶
About CreateTerms¶
Creates terms documents for the requested app client. When Terms and conditions and Privacy policy documents are configured, the app client displays links to them in the sign-up page of managed login for the app client.
You can provide URLs for terms documents in the languages that are supported by managed login localization. Amazon Cognito directs users to the terms documents for
their current language, with fallback to default if no document exists for
the language.
Each request accepts one type of terms document and a map of language-to-link for that document type. You must provide both types of terms documents in at least one language before Amazon Cognito displays your terms documents. Supply each type in separate requests.
For more information, see Terms documents.
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
Method Signature¶
METHODS /AWS1/IF_CGP~CREATETERMS
IMPORTING
!IV_USERPOOLID TYPE /AWS1/CGPUSERPOOLIDTYPE OPTIONAL
!IV_CLIENTID TYPE /AWS1/CGPCLIENTIDTYPE OPTIONAL
!IV_TERMSNAME TYPE /AWS1/CGPTERMSNAMETYPE OPTIONAL
!IV_TERMSSOURCE TYPE /AWS1/CGPTERMSSOURCETYPE OPTIONAL
!IV_ENFORCEMENT TYPE /AWS1/CGPTERMSENFORCEMENTTYPE OPTIONAL
!IT_LINKS TYPE /AWS1/CL_CGPLINKSTYPE_W=>TT_LINKSTYPE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgpcreatetermsrsp
RAISING
/AWS1/CX_CGPCONCURRENTMODEX
/AWS1/CX_CGPINTERNALERROREX
/AWS1/CX_CGPINVALIDPARAMETEREX
/AWS1/CX_CGPLIMITEXCEEDEDEX
/AWS1/CX_CGPNOTAUTHORIZEDEX
/AWS1/CX_CGPRESOURCENOTFOUNDEX
/AWS1/CX_CGPTERMSEXISTSEX
/AWS1/CX_CGPTOOMANYREQUESTSEX
/AWS1/CX_CGPCLIENTEXC
/AWS1/CX_CGPSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_userpoolid TYPE /AWS1/CGPUSERPOOLIDTYPE /AWS1/CGPUSERPOOLIDTYPE¶
The ID of the user pool where you want to create terms documents.
iv_clientid TYPE /AWS1/CGPCLIENTIDTYPE /AWS1/CGPCLIENTIDTYPE¶
The ID of the app client where you want to create terms documents. Must be an app client in the requested user pool.
iv_termsname TYPE /AWS1/CGPTERMSNAMETYPE /AWS1/CGPTERMSNAMETYPE¶
A friendly name for the document that you want to create in the current request. Must begin with
terms-of-useorprivacy-policyas identification of the document type. Provide URLs for bothterms-of-useandprivacy-policyin separate requests.
iv_termssource TYPE /AWS1/CGPTERMSSOURCETYPE /AWS1/CGPTERMSSOURCETYPE¶
This parameter is reserved for future use and currently accepts only one value.
iv_enforcement TYPE /AWS1/CGPTERMSENFORCEMENTTYPE /AWS1/CGPTERMSENFORCEMENTTYPE¶
This parameter is reserved for future use and currently accepts only one value.
Optional arguments:¶
it_links TYPE /AWS1/CL_CGPLINKSTYPE_W=>TT_LINKSTYPE TT_LINKSTYPE¶
A map of URLs to languages. For each localized language that will view the requested
TermsName, assign a URL. A selection ofcognito:defaultdisplays for all languages that don't have a language-specific URL.For example,
"cognito:default": "https://terms.example.com", "cognito:spanish": "https://terms.example.com/es".
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cgpcreatetermsrsp /AWS1/CL_CGPCREATETERMSRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createterms(
it_links = VALUE /aws1/cl_cgplinkstype_w=>tt_linkstype(
(
VALUE /aws1/cl_cgplinkstype_w=>ts_linkstype_maprow(
key = |string|
value = new /aws1/cl_cgplinkstype_w( |string| )
)
)
)
iv_clientid = |string|
iv_enforcement = |string|
iv_termsname = |string|
iv_termssource = |string|
iv_userpoolid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_termstype = lo_result->get_terms( ).
IF lo_termstype IS NOT INITIAL.
lv_termsidtype = lo_termstype->get_termsid( ).
lv_userpoolidtype = lo_termstype->get_userpoolid( ).
lv_clientidtype = lo_termstype->get_clientid( ).
lv_termsnametype = lo_termstype->get_termsname( ).
lv_termssourcetype = lo_termstype->get_termssource( ).
lv_termsenforcementtype = lo_termstype->get_enforcement( ).
LOOP AT lo_termstype->get_links( ) into ls_row.
lv_key = ls_row-key.
lo_value = ls_row-value.
IF lo_value IS NOT INITIAL.
lv_linkurltype = lo_value->get_value( ).
ENDIF.
ENDLOOP.
lv_datetype = lo_termstype->get_creationdate( ).
lv_datetype = lo_termstype->get_lastmodifieddate( ).
ENDIF.
ENDIF.