Skip to content

/AWS1/IF_PPU=>CREATENOTIFYCODECONF()

About CreateNotifyCodeConfiguration

Creates a notify code configuration. A notify code configuration is a reusable policy that defines how one-time passcodes are generated and rendered, including the code type, length, validity period, maximum number of attempts, and channel templates.

Method Signature

METHODS /AWS1/IF_PPU~CREATENOTIFYCODECONF
  IMPORTING
    !IV_NOTIFYCODECONFNAME TYPE /AWS1/PPUNOTIFYCODECONFNAME OPTIONAL
    !IO_CODECONFPARAMETERS TYPE REF TO /AWS1/CL_PPUCODECONFPARAMETERS OPTIONAL
    !IO_CHANNELPARAMETERS TYPE REF TO /AWS1/CL_PPUCHANNELPARAMETERS OPTIONAL
    !IV_DELETIONPROTECTIONENABLED TYPE /AWS1/PPUBOOLEAN OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/PPUCLIENTTOKEN OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_PPUTAG=>TT_TAGLIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ppucrentfycodeconfout
  RAISING
    /AWS1/CX_PPUACCESSDENIEDEX
    /AWS1/CX_PPUCONFLICTEXCEPTION
    /AWS1/CX_PPUINTERNALSERVEREX
    /AWS1/CX_PPUSERVICEQUOTAEXCDEX
    /AWS1/CX_PPUTHROTTLINGEX
    /AWS1/CX_PPUVLDTNEXCEPTION
    /AWS1/CX_PPUCLIENTEXC
    /AWS1/CX_PPUSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_notifycodeconfname TYPE /AWS1/PPUNOTIFYCODECONFNAME /AWS1/PPUNOTIFYCODECONFNAME

The name of the notify code configuration.

Optional arguments:

io_codeconfparameters TYPE REF TO /AWS1/CL_PPUCODECONFPARAMETERS /AWS1/CL_PPUCODECONFPARAMETERS

The passcode policy parameters, including the code type, length, validity period, and maximum number of attempts. Each member is optional. When you omit a member, no value is applied at create time and the default is applied when a passcode is sent.

io_channelparameters TYPE REF TO /AWS1/CL_PPUCHANNELPARAMETERS /AWS1/CL_PPUCHANNELPARAMETERS

The channel-specific parameters used to render and deliver the one-time passcode. Provide parameters for any subset of channels. Each member configures one delivery route, and the route that is selected at send time uses the matching channel.

iv_deletionprotectionenabled TYPE /AWS1/PPUBOOLEAN /AWS1/PPUBOOLEAN

Specifies whether deletion protection is enabled. When enabled, the resource cannot be deleted until deletion protection is turned off.

iv_clienttoken TYPE /AWS1/PPUCLIENTTOKEN /AWS1/PPUCLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, the AWS SDK automatically generates one.

it_tags TYPE /AWS1/CL_PPUTAG=>TT_TAGLIST TT_TAGLIST

An array of key and value pair tags that are associated with the resource.

RETURNING

oo_output TYPE REF TO /aws1/cl_ppucrentfycodeconfout /AWS1/CL_PPUCRENTFYCODECONFOUT

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->createnotifycodeconf(
  io_channelparameters = new /aws1/cl_ppuchannelparameters(
    io_notify = new /aws1/cl_ppunotifyparameters(
      iv_notifytemplateid = |string|
      iv_voiceid = |string|
    )
    io_text = new /aws1/cl_pputextparameters(
      it_dstcountryparameters = VALUE /aws1/cl_ppudstcountryparams_w=>tt_dstcountryparameters(
        (
          VALUE /aws1/cl_ppudstcountryparams_w=>ts_dstcountryparameters_maprow(
            key = |string|
            value = new /aws1/cl_ppudstcountryparams_w( |string| )
          )
        )
      )
      iv_inlinetemplatebody = |string|
    )
    io_voice = new /aws1/cl_ppuvoiceparameters(
      iv_inlinetemplatebody = |string|
      iv_languagecode = |string|
      iv_voiceid = |string|
      iv_voicemessagebodytexttype = |string|
    )
    io_whatsapp = new /aws1/cl_ppuwhatsappparameters(
      iv_languagecode = |string|
      iv_whatsapptemplatename = |string|
    )
  )
  io_codeconfparameters = new /aws1/cl_ppucodeconfparameters(
    iv_codelength = 123
    iv_codetype = |string|
    iv_maxattempts = 123
    iv_validityperiodminutes = 123
  )
  it_tags = VALUE /aws1/cl_pputag=>tt_taglist(
    (
      new /aws1/cl_pputag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_clienttoken = |string|
  iv_deletionprotectionenabled = ABAP_TRUE
  iv_notifycodeconfname = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_notifycodeconfiguration = lo_result->get_notifycodeconfiguration( ).
  IF lo_notifycodeconfiguration IS NOT INITIAL.
    lv_notifycodeconfiguration_1 = lo_notifycodeconfiguration->get_notifycodeconfid( ).
    lv_amazonresourcename = lo_notifycodeconfiguration->get_notifycodeconfarn( ).
    lv_notifycodeconfiguration_2 = lo_notifycodeconfiguration->get_notifycodeconfname( ).
    lo_codeconfigurationparame = lo_notifycodeconfiguration->get_codeconfparameters( ).
    IF lo_codeconfigurationparame IS NOT INITIAL.
      lv_codetype = lo_codeconfigurationparame->get_codetype( ).
      lv_codelength = lo_codeconfigurationparame->get_codelength( ).
      lv_validityperiodminutes = lo_codeconfigurationparame->get_validityperiodminutes( ).
      lv_maxverificationattempts = lo_codeconfigurationparame->get_maxattempts( ).
    ENDIF.
    lo_channelparameters = lo_notifycodeconfiguration->get_channelparameters( ).
    IF lo_channelparameters IS NOT INITIAL.
      lo_textparameters = lo_channelparameters->get_text( ).
      IF lo_textparameters IS NOT INITIAL.
        lv_inlinetemplatebody = lo_textparameters->get_inlinetemplatebody( ).
        LOOP AT lo_textparameters->get_dstcountryparameters( ) into ls_row.
          lv_key = ls_row-key.
          lo_value = ls_row-value.
          IF lo_value IS NOT INITIAL.
            lv_destinationcountryparam = lo_value->get_value( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      lo_voiceparameters = lo_channelparameters->get_voice( ).
      IF lo_voiceparameters IS NOT INITIAL.
        lv_inlinetemplatebody = lo_voiceparameters->get_inlinetemplatebody( ).
        lv_languagecode = lo_voiceparameters->get_languagecode( ).
        lv_voiceid = lo_voiceparameters->get_voiceid( ).
        lv_voicemessagebodytexttyp = lo_voiceparameters->get_voicemessagebodytexttype( ).
      ENDIF.
      lo_notifyparameters = lo_channelparameters->get_notify( ).
      IF lo_notifyparameters IS NOT INITIAL.
        lv_notifytemplateid = lo_notifyparameters->get_notifytemplateid( ).
        lv_voiceid = lo_notifyparameters->get_voiceid( ).
      ENDIF.
      lo_whatsappparameters = lo_channelparameters->get_whatsapp( ).
      IF lo_whatsappparameters IS NOT INITIAL.
        lv_whatsapptemplatename = lo_whatsappparameters->get_whatsapptemplatename( ).
        lv_languagecode = lo_whatsappparameters->get_languagecode( ).
      ENDIF.
    ENDIF.
    lv_boolean = lo_notifycodeconfiguration->get_deletionprtctnenabled( ).
    lv_timestamp = lo_notifycodeconfiguration->get_createdat( ).
    lv_timestamp = lo_notifycodeconfiguration->get_updatedat( ).
  ENDIF.
ENDIF.

Create a notify code configuration

Create a notify code configuration

DATA(lo_result) = lo_client->createnotifycodeconf(
  io_channelparameters = new /aws1/cl_ppuchannelparameters( io_text = new /aws1/cl_pputextparameters( iv_inlinetemplatebody = |Your verification code is {{code}}.| )  )
  io_codeconfparameters = new /aws1/cl_ppucodeconfparameters(
    iv_codelength = 6
    iv_codetype = |NUMERIC|
    iv_maxattempts = 3
    iv_validityperiodminutes = 10
  )
  iv_notifycodeconfname = |SignupOtp|
).