All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aeontronix.enhancedmule.tools.anypoint.api.APISpecList Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha4
Show newest version
/*
 * Copyright (c) Aeontronix 2019
 */

package com.aeontronix.enhancedmule.tools.anypoint.api;

import com.aeontronix.commons.URLBuilder;
import com.aeontronix.enhancedmule.tools.anypoint.Organization;
import com.aeontronix.enhancedmule.tools.util.HttpException;
import com.aeontronix.enhancedmule.tools.util.PaginatedList;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class APISpecList extends PaginatedList {
    private final String filter;

    public APISpecList(Organization organization, String filter) throws HttpException {
        super(organization);
        this.filter = filter;
        limit = 50;
        download();
    }

    @NotNull
    @Override
    protected URLBuilder buildUrl() {
        URLBuilder url = new URLBuilder("/apimanager/xapi/v1/organizations/" + parent.getId() + "/apiSpecs")
                .queryParam("ascending", "true");
        if (filter != null) {
            url.queryParam("searchTerm", filter);
        }
        return url;
    }

    @JsonProperty
    public List getApiDefinitions() {
        return list;
    }

    public void setApiDefinitions(List list) {
        this.list = list;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy