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

com.spotinst.sdkjava.model.requests.ocean.kubernetes.K8sVngUpdateRequest Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import com.spotinst.sdkjava.client.rest.JsonMapper;
import com.spotinst.sdkjava.model.api.ocean.kubernetes.ApiK8sVngSpec;
import com.spotinst.sdkjava.model.bl.ocean.kubernetes.K8sVngSpec;
import com.spotinst.sdkjava.model.converters.K8sVngConverter;

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

public class K8sVngUpdateRequest {

    @JsonProperty("launchSpec")
    private K8sVngSpec launchSpec;

    private K8sVngUpdateRequest() {
    }

    //Getters & Setters
    public K8sVngSpec getVngLaunchSpec() {
        return launchSpec;
    }

    public void setOceanLaunchSpecId(K8sVngSpec launchSpec) {
        this.launchSpec = launchSpec;
    }

    //Builder class
    public static class Builder {
        private K8sVngUpdateRequest k8sVngUpdateRequest;

        private Builder() {
            this.k8sVngUpdateRequest = new K8sVngUpdateRequest();
        }

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

        public Builder setVngLaunchSpec(final K8sVngSpec launchSpec) {
            k8sVngUpdateRequest.setOceanLaunchSpecId(launchSpec);
            return this;
        }

        public K8sVngUpdateRequest build() {
            return k8sVngUpdateRequest;
        }

    }

    //region Json methods
    public String toJson() {
        ApiK8sVngSpec apiVirtualNodeGroupToUpdate = K8sVngConverter.toDal(launchSpec);

        Map virtualNodeGroupRequest = new HashMap<>();
        virtualNodeGroupRequest.put("launchSpec", apiVirtualNodeGroupToUpdate);

        return JsonMapper.toJson(virtualNodeGroupRequest);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy