Example usage for com.amazonaws.services.apigateway.model GetRestApisRequest setPosition

List of usage examples for com.amazonaws.services.apigateway.model GetRestApisRequest setPosition

Introduction

In this page you can find the example usage for com.amazonaws.services.apigateway.model GetRestApisRequest setPosition.

Prototype


public void setPosition(String position) 

Source Link

Document

The current pagination position in the paged result set.

Usage

From source file:br.com.ingenieux.mojo.apigateway.AbstractAPIGatewayMojo.java

License:Apache License

protected void lookupIds() throws Exception {
    GetRestApisRequest req = new GetRestApisRequest();
    String position = "";

    do {/*from  w ww  . ja  va  2  s .  c  o m*/
        final GetRestApisResult apiList = getService().getRestApis(req);

        final Optional<RestApi> api = apiList.getItems().stream()
                .filter(restApi -> restApi.getName().equals(restApiName)).findFirst();

        if (api.isPresent()) {
            getLog().info("Using api: " + api.get());

            this.restApiId = api.get().getId();

            break;
        }

        position = apiList.getPosition();

        req.setPosition(position);
    } while (isNotBlank(position));

    if (isBlank(restApiId))
        return;

    updateEndpoint();
}