Skip to content

/AWS1/IF_CGP=>CREATEMANAGEDLOGINBRANDING()

About CreateManagedLoginBranding

Creates a new set of branding settings for a user pool style and associates it with an app client. This operation is the programmatic option for the creation of a new style in the branding editor.

Provides values for UI customization in a Settings JSON object and image files in an Assets array. To send the JSON object Document type parameter in Settings, you might need to update to the most recent version of your Amazon Web Services SDK. To create a new style with default settings, set UseCognitoProvidedValues to true and don't provide values for any other options.

This operation has a 2-megabyte request-size limit and include the CSS settings and image assets for your app client. Your branding settings might exceed 2MB in size. Amazon Cognito doesn't require that you pass all parameters in one request and preserves existing style settings that you don't specify. If your request is larger than 2MB, separate it into multiple requests, each with a size smaller than the limit.

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~CREATEMANAGEDLOGINBRANDING
  IMPORTING
    !IV_USERPOOLID TYPE /AWS1/CGPUSERPOOLIDTYPE OPTIONAL
    !IV_CLIENTID TYPE /AWS1/CGPCLIENTIDTYPE OPTIONAL
    !IV_USECOGNITOPROVIDEDVALUES TYPE /AWS1/CGPBOOLEANTYPE OPTIONAL
    !IO_SETTINGS TYPE REF TO /AWS1/CL_RT_DOCUMENT OPTIONAL
    !IT_ASSETS TYPE /AWS1/CL_CGPASSETTYPE=>TT_ASSETLISTTYPE OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cgpcremanagedloginb01
  RAISING
    /AWS1/CX_CGPCONCURRENTMODEX
    /AWS1/CX_CGPINTERNALERROREX
    /AWS1/CX_CGPINVALIDPARAMETEREX
    /AWS1/CX_CGPLIMITEXCEEDEDEX
    /AWS1/CX_CGPMANAGEDLOGINBRAN00
    /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_userpoolid TYPE /AWS1/CGPUSERPOOLIDTYPE /AWS1/CGPUSERPOOLIDTYPE

The ID of the user pool where you want to create a new branding style.

iv_clientid TYPE /AWS1/CGPCLIENTIDTYPE /AWS1/CGPCLIENTIDTYPE

The app client that you want to create the branding style for. Each style is linked to an app client until you delete it.

Optional arguments:

iv_usecognitoprovidedvalues TYPE /AWS1/CGPBOOLEANTYPE /AWS1/CGPBOOLEANTYPE

When true, applies the default branding style options. These default options are managed by Amazon Cognito. You can modify them later in the branding editor.

When you specify true for this option, you must also omit values for Settings and Assets in the request.

io_settings TYPE REF TO /AWS1/CL_RT_DOCUMENT /AWS1/CL_RT_DOCUMENT

A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

The following components are not currently implemented and reserved for future use:

it_assets TYPE /AWS1/CL_CGPASSETTYPE=>TT_ASSETLISTTYPE TT_ASSETLISTTYPE

An array of image files that you want to apply to functions like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

RETURNING

oo_output TYPE REF TO /aws1/cl_cgpcremanagedloginb01 /AWS1/CL_CGPCREMANAGEDLOGINB01

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->createmanagedloginbranding(
  io_settings = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
  it_assets = VALUE /aws1/cl_cgpassettype=>tt_assetlisttype(
    (
      new /aws1/cl_cgpassettype(
        iv_bytes = '5347567362473873563239796247513D'
        iv_category = |string|
        iv_colormode = |string|
        iv_extension = |string|
        iv_resourceid = |string|
      )
    )
  )
  iv_clientid = |string|
  iv_usecognitoprovidedvalues = ABAP_TRUE
  iv_userpoolid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_managedloginbrandingtyp = lo_result->get_managedloginbranding( ).
  IF lo_managedloginbrandingtyp IS NOT INITIAL.
    lv_managedloginbrandingidt = lo_managedloginbrandingtyp->get_managedloginbrandingid( ).
    lv_userpoolidtype = lo_managedloginbrandingtyp->get_userpoolid( ).
    lv_booleantype = lo_managedloginbrandingtyp->get_usecognitoprovidedvalues( ).
    lo_value = lo_managedloginbrandingtyp->get_settings( ).
    IF lo_value IS NOT INITIAL.
    ENDIF.
    LOOP AT lo_managedloginbrandingtyp->get_assets( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_assetcategorytype = lo_row_1->get_category( ).
        lv_colorschememodetype = lo_row_1->get_colormode( ).
        lv_assetextensiontype = lo_row_1->get_extension( ).
        lv_assetbytestype = lo_row_1->get_bytes( ).
        lv_resourceidtype = lo_row_1->get_resourceid( ).
      ENDIF.
    ENDLOOP.
    lv_datetype = lo_managedloginbrandingtyp->get_creationdate( ).
    lv_datetype = lo_managedloginbrandingtyp->get_lastmodifieddate( ).
  ENDIF.
ENDIF.