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

com.aeontronix.enhancedmule.tools.api.APIPortal Maven / Gradle / Ivy

/*
 * Copyright (c) Aeontronix 2019
 */

package com.aeontronix.enhancedmule.tools.api;

import com.aeontronix.enhancedmule.tools.AnypointObject;
import com.aeontronix.enhancedmule.tools.util.HttpException;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

public class APIPortal extends AnypointObject {
    @JsonProperty
    private String id;
    @JsonProperty
    private String name;
    @JsonIgnore
    private API apiVersion;

    public APIPortal() {
    }

    public APIPortal(API apiVersion) {
        super(apiVersion);
        this.apiVersion = apiVersion;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public API getApiVersion() {
        return apiVersion;
    }

    public APIPortal updateName(String name) throws HttpException {
        Map req = jsonHelper.buildJsonMap().set("name", name).set("id", id).toMap();
        String json = client.getHttpHelper().httpPatch(apiVersion.getUriPath() + "/portal", req);
        return jsonHelper.readJson(new APIPortal(parent), json);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy