/AWS1/IF_CGP=>CREATEGROUP()¶
About CreateGroup¶
Creates a new group in the specified user pool. For more information about user pool groups, see Adding groups to a user pool.
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~CREATEGROUP
IMPORTING
!IV_GROUPNAME TYPE /AWS1/CGPGROUPNAMETYPE OPTIONAL
!IV_USERPOOLID TYPE /AWS1/CGPUSERPOOLIDTYPE OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/CGPDESCRIPTIONTYPE OPTIONAL
!IV_ROLEARN TYPE /AWS1/CGPARNTYPE OPTIONAL
!IV_PRECEDENCE TYPE /AWS1/CGPPRECEDENCETYPE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgpcreategrouprsp
RAISING
/AWS1/CX_CGPGROUPEXISTSEX
/AWS1/CX_CGPINTERNALERROREX
/AWS1/CX_CGPINVALIDPARAMETEREX
/AWS1/CX_CGPLIMITEXCEEDEDEX
/AWS1/CX_CGPNOTAUTHORIZEDEX
/AWS1/CX_CGPRESOURCENOTFOUNDEX
/AWS1/CX_CGPTOOMANYREQUESTSEX
/AWS1/CX_CGPCLIENTEXC
/AWS1/CX_CGPSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_groupname TYPE /AWS1/CGPGROUPNAMETYPE /AWS1/CGPGROUPNAMETYPE¶
A name for the group. This name must be unique in your user pool.
iv_userpoolid TYPE /AWS1/CGPUSERPOOLIDTYPE /AWS1/CGPUSERPOOLIDTYPE¶
The ID of the user pool where you want to create a user group.
Optional arguments:¶
iv_description TYPE /AWS1/CGPDESCRIPTIONTYPE /AWS1/CGPDESCRIPTIONTYPE¶
A description of the group that you're creating.
iv_rolearn TYPE /AWS1/CGPARNTYPE /AWS1/CGPARNTYPE¶
The Amazon Resource Name (ARN) for the IAM role that you want to associate with the group. A group role primarily declares a preferred role for the credentials that you get from an identity pool. Amazon Cognito ID tokens have a
cognito:preferred_roleclaim that presents the highest-precedence group that a user belongs to. Both ID and access tokens also contain acognito:groupsclaim that list all the groups that a user is a member of.
iv_precedence TYPE /AWS1/CGPPRECEDENCETYPE /AWS1/CGPPRECEDENCETYPE¶
A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower
Precedencevalues take precedence over groups with higher or nullPrecedencevalues. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for thecognito:rolesandcognito:preferred_roleclaims.Two groups can have the same
Precedencevalue. If this happens, neither group takes precedence over the other. If two groups with the samePrecedencehave the same role ARN, that role is used in thecognito:preferred_roleclaim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_roleclaim isn't set in users' tokens.The default
Precedencevalue is null. The maximumPrecedencevalue is2^31-1.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cgpcreategrouprsp /AWS1/CL_CGPCREATEGROUPRSP¶
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->creategroup(
iv_description = |string|
iv_groupname = |string|
iv_precedence = 123
iv_rolearn = |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_grouptype = lo_result->get_group( ).
IF lo_grouptype IS NOT INITIAL.
lv_groupnametype = lo_grouptype->get_groupname( ).
lv_userpoolidtype = lo_grouptype->get_userpoolid( ).
lv_descriptiontype = lo_grouptype->get_description( ).
lv_arntype = lo_grouptype->get_rolearn( ).
lv_precedencetype = lo_grouptype->get_precedence( ).
lv_datetype = lo_grouptype->get_lastmodifieddate( ).
lv_datetype = lo_grouptype->get_creationdate( ).
ENDIF.
ENDIF.