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

com.spotinst.sdkjava.model.requests.azure.statefulNode.StatefulNodeDeletionRequest Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.model.requests.azure.statefulNode;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.spotinst.sdkjava.client.rest.JsonMapper;
import com.spotinst.sdkjava.model.api.azure.statefulNode.ApiStatefulNodeDeallocationConfig;
import com.spotinst.sdkjava.model.bl.azure.statefulNode.StatefulNodeDeallocationConfig;
import com.spotinst.sdkjava.model.converters.azure.statefulNode.StatefulNodeConverter;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class StatefulNodeDeletionRequest {

    @JsonProperty("deallocationConfig")
    private Set                    isSet;
    private StatefulNodeDeallocationConfig deallocationConfig;

    private StatefulNodeDeletionRequest(){

    }

    public Set getIsSet() {
        return isSet;
    }

    public void setIsSet(Set isSet) {
        this.isSet = isSet;
    }

    public StatefulNodeDeallocationConfig getDeallocationConfig() {
        return deallocationConfig;
    }

    public void setDeallocationConfig(StatefulNodeDeallocationConfig deallocationConfig) {
        this.deallocationConfig = deallocationConfig;
    }

    //region Builder class
    public static class Builder {
        private StatefulNodeDeletionRequest nodeDeletionRequest;

        private Builder() {
            this.nodeDeletionRequest = new StatefulNodeDeletionRequest();
        }

        public static Builder get() {
            return new Builder();
        }

        public Builder setDeallocationConfig(final StatefulNodeDeallocationConfig deallocationConfig) {
            nodeDeletionRequest.setDeallocationConfig(deallocationConfig);
            return this;
        }


        public StatefulNodeDeletionRequest build() {
            return nodeDeletionRequest;
        }

    }
    //endregion

    //region Json methods
    public String toJson() {
        ApiStatefulNodeDeallocationConfig apiStatefulNodeToCreate = StatefulNodeConverter.toDal(deallocationConfig);
        Map      nodeRequest             = new HashMap<>();
        nodeRequest.put("deallocationConfig", apiStatefulNodeToCreate);

        return JsonMapper.toJson(nodeRequest);
    }
    //endregion

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy