Skip to content

/AWS1/IF_SAG=>LISTMEMBERSHIPS()

About ListMemberships

Returns a paginated list of membership summaries for the specified agent space within an application.

Method Signature

METHODS /AWS1/IF_SAG~LISTMEMBERSHIPS
  IMPORTING
    !IV_APPLICATIONID TYPE /AWS1/SAGAPPLICATIONID OPTIONAL
    !IV_AGENTSPACEID TYPE /AWS1/SAGAGENTSPACEID OPTIONAL
    !IV_MEMBERTYPE TYPE /AWS1/SAGMEMBERSHIPTYPEFILTER OPTIONAL
    !IV_MAXRESULTS TYPE /AWS1/SAGMAXRESULTS OPTIONAL
    !IV_NEXTTOKEN TYPE /AWS1/SAGNEXTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_saglistmembshpsrsp
  RAISING
    /AWS1/CX_SAGCLIENTEXC
    /AWS1/CX_SAGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_applicationid TYPE /AWS1/SAGAPPLICATIONID /AWS1/SAGAPPLICATIONID

The unique identifier of the application that contains the agent space.

iv_agentspaceid TYPE /AWS1/SAGAGENTSPACEID /AWS1/SAGAGENTSPACEID

The unique identifier of the agent space to list memberships for.

Optional arguments:

iv_membertype TYPE /AWS1/SAGMEMBERSHIPTYPEFILTER /AWS1/SAGMEMBERSHIPTYPEFILTER

Filter memberships by member type.

iv_maxresults TYPE /AWS1/SAGMAXRESULTS /AWS1/SAGMAXRESULTS

The maximum number of results to return in a single call.

iv_nexttoken TYPE /AWS1/SAGNEXTTOKEN /AWS1/SAGNEXTTOKEN

A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.

RETURNING

oo_output TYPE REF TO /aws1/cl_saglistmembshpsrsp /AWS1/CL_SAGLISTMEMBSHPSRSP

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->listmemberships(
  iv_agentspaceid = |string|
  iv_applicationid = |string|
  iv_maxresults = 123
  iv_membertype = |string|
  iv_nexttoken = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_membershipsummaries( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_membershipid = lo_row_1->get_membershipid( ).
      lv_applicationid = lo_row_1->get_applicationid( ).
      lv_agentspaceid = lo_row_1->get_agentspaceid( ).
      lv_membershiptype = lo_row_1->get_membertype( ).
      lo_membershipconfig = lo_row_1->get_config( ).
      IF lo_membershipconfig IS NOT INITIAL.
        lo_userconfig = lo_membershipconfig->get_user( ).
        IF lo_userconfig IS NOT INITIAL.
          lv_userrole = lo_userconfig->get_role( ).
        ENDIF.
      ENDIF.
      lo_membermetadata = lo_row_1->get_metadata( ).
      IF lo_membermetadata IS NOT INITIAL.
        lo_usermetadata = lo_membermetadata->get_user( ).
        IF lo_usermetadata IS NOT INITIAL.
          lv_string = lo_usermetadata->get_username( ).
          lv_sensitiveemail = lo_usermetadata->get_email( ).
        ENDIF.
      ENDIF.
      lv_timestamp = lo_row_1->get_createdat( ).
      lv_timestamp = lo_row_1->get_updatedat( ).
      lv_string = lo_row_1->get_createdby( ).
      lv_string = lo_row_1->get_updatedby( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.