Search in sources :

Example 1 with ListSchemasRequest

use of com.amazonaws.services.personalize.model.ListSchemasRequest in project knime-cloud by knime.

the class AmazonPersonalizeUtils method listAllSchemas.

/**
 * @param personalize the amazon personalize client
 * @return all schemas
 */
public static List<DatasetSchemaSummary> listAllSchemas(final AmazonPersonalize personalize) {
    final ListSchemasRequest request = new ListSchemasRequest().withMaxResults(100);
    ListSchemasResult result = personalize.listSchemas(request);
    List<DatasetSchemaSummary> list = result.getSchemas();
    String nextToken;
    while ((nextToken = result.getNextToken()) != null) {
        result = personalize.listSchemas(request.withNextToken(nextToken));
        list.addAll(result.getSchemas());
    }
    return list;
}
Also used : ListSchemasRequest(com.amazonaws.services.personalize.model.ListSchemasRequest) DatasetSchemaSummary(com.amazonaws.services.personalize.model.DatasetSchemaSummary) ListSchemasResult(com.amazonaws.services.personalize.model.ListSchemasResult)

Aggregations

DatasetSchemaSummary (com.amazonaws.services.personalize.model.DatasetSchemaSummary)1 ListSchemasRequest (com.amazonaws.services.personalize.model.ListSchemasRequest)1 ListSchemasResult (com.amazonaws.services.personalize.model.ListSchemasResult)1