com.spotinst.sdkjava.model.bl.ocean.kubernetes.K8sClusterUpdateRequest Maven / Gradle / Ivy
package com.spotinst.sdkjava.model.bl.ocean.kubernetes;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.spotinst.sdkjava.client.rest.JsonMapper;
import com.spotinst.sdkjava.model.OceanK8sConverter;
import com.spotinst.sdkjava.model.api.ocean.kubernetes.ApiOceanK8sCluster;
import java.util.HashMap;
import java.util.Map;
public class K8sClusterUpdateRequest {
@JsonProperty("cluster")
private OceanK8sCluster cluster;
private K8sClusterUpdateRequest() {
}
//region Getters & Setters
public OceanK8sCluster getCluster() {
return cluster;
}
public void setCluster(OceanK8sCluster cluster) {
this.cluster = cluster;
}
//endregion
//region Builder class
public static class Builder {
private K8sClusterUpdateRequest clusterCreationRequest;
private Builder() {
this.clusterCreationRequest = new K8sClusterUpdateRequest();
}
public static Builder get() {
return new Builder();
}
public Builder setCluster(final OceanK8sCluster oceanK8sCluster) {
clusterCreationRequest.setCluster(oceanK8sCluster);
return this;
}
public K8sClusterUpdateRequest build() {
return clusterCreationRequest;
}
}
//endregion
//region Json methods
public String toJson() {
ApiOceanK8sCluster apiClusterToCreate = OceanK8sConverter.toDal(cluster);
Map clusterRequest = new HashMap<>();
clusterRequest.put("cluster", apiClusterToCreate);
return JsonMapper.toJson(clusterRequest);
}
//endregion
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy