Signature

global static List<ResourceList> getFolderContents(
  List<Resource> folders,
  String sortBy,
  String sortOrder,
  String runAs,
  String contentType
)
Parameters
ParameterDescription
folders
List<Resource>
requiredList of Resource objects representing the source folders.
sortBy
String
optionalContent field to sort by. For example, name for alphabetic sorting.
sortOrder
String
optionalSort direction: ascending or descending.
runAs
String
optionalEmail of the user to run the action on behalf of. Supply integrationuser to run as the automation user.
contentType
String
optionalUse null to return everything; use folder to return only folders.

Return Type

List<ResourceList> — one ResourceList per source folder, each holding that folder's contents.

Example

List<cldfs.Resource> folders = new List<cldfs.Resource>{
  new cldfs.Resource(
    '68887db5ef0b3ca7534dbbd5',
    'folder',
    'Leads',
    'cloudfiles',
    'workspace'
  )
};

List<cldfs.ResourceList> outputs = cldfs.Client.getFolderContents(
  folders,
  null,
  null,
  'integrationUser',
  null
);