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

com.spotinst.sdkjava.model.requests.elastigroup.azure.SuspendgroupRequestAzure Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import com.spotinst.sdkjava.client.rest.JsonMapper;
import com.spotinst.sdkjava.model.api.azure.elastiGroup.V3.ApiSuspendgroupProcessesAzure;
import com.spotinst.sdkjava.model.bl.azure.elastiGroup.V3.ElastigroupConverterAzure;
import com.spotinst.sdkjava.model.bl.azure.elastiGroup.V3.SuspendGroupProcessesAzure;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SuspendgroupRequestAzure {

    @JsonProperty("processes")
    private List suspendGroup;
    private String                           groupId;

    private SuspendgroupRequestAzure() {

    }

    public List getSuspendGroup() {
        return suspendGroup;
    }

    public void setSuspendGroup(List suspendGroup) {
        this.suspendGroup = suspendGroup;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public static class Builder {
        private SuspendgroupRequestAzure suspendGroupProcesses;

        private Builder() {
            this.suspendGroupProcesses = new SuspendgroupRequestAzure();
        }

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

        public Builder setSuspendGroup(final List suspendGroup) {
            suspendGroupProcesses.setSuspendGroup(suspendGroup);
            return this;
        }

        public Builder setGroupId(final String groupId) {
            suspendGroupProcesses.setGroupId(groupId);
            return this;
        }

        public SuspendgroupRequestAzure build() {
            return suspendGroupProcesses;
        }
    }

    public String toJson() {
        List apiSuspendGroup = ElastigroupConverterAzure.toDalForSuspendProcess(suspendGroup);
        Map> suspendRequest = new HashMap<>();
        suspendRequest.put("processes", apiSuspendGroup);

        return JsonMapper.toJson(suspendRequest);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy