alkyon-annotations.0.13.4.source-code.halkyon-resource.vm Maven / Gradle / Ivy
package ${model.packageName};
import java.util.HashMap;
import java.util.Map;
import io.dekorate.deps.jackson.annotation.JsonIgnore;
import io.dekorate.deps.jackson.annotation.JsonInclude;
import io.dekorate.deps.jackson.annotation.JsonProperty;
import io.dekorate.deps.jackson.annotation.JsonPropertyOrder;
import io.dekorate.deps.jackson.databind.annotation.JsonDeserialize;
import io.dekorate.deps.kubernetes.api.model.Doneable;
import io.dekorate.deps.kubernetes.api.model.HasMetadata;
import io.dekorate.deps.kubernetes.api.model.ObjectMeta;
import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.BuildableReference;
import io.sundr.builder.annotations.Inline;
#set ($spec = $model.name)
#set ($length = $spec.length())
#set ($tindex = $length - 4)
#set ($resource = $spec.substring(0, $tindex))
#set ($status = $resource + "Status")
#set ($version = "unknown")
#set ($annotations = $model.annotations)
#set ($kind = "$resource")
#set ($plural = "$kind" + "s")
#foreach ($annotation in $annotations)
#if ($annotation.getClassRef().getName().equals("CustomResource"))
#set ($version = $annotation.getParameters().get("group") + "/" + $annotation.getParameters().get("version"))
#set( $kindFromAnn = $annotation.getParameters().get("kind"))
#set( $pluralFromAnn = $annotation.getParameters().get("plural"))
#if( !$kindFromAnn.isEmpty())
#set ($kind = $kindFromAnn)
#end
#if( !$pluralFromAnn.isEmpty())
#set ($plural = $pluralFromAnn)
#end
#end
#end
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"apiVersion",
"kind",
"metadata",
"spec",
"status"
})
@JsonDeserialize(using = io.dekorate.deps.jackson.databind.JsonDeserializer.None.class)
@Buildable(editableEnabled = false, validationEnabled = false, generateBuilderPackage = false, builderPackage = "io.dekorate.deps.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done"), refs = @BuildableReference(ObjectMeta.class))
public class $resource implements HasMetadata {
/**
* (Required)
*/
@JsonProperty("apiVersion")
private String apiVersion = "$version";
/**
* (Required)
*/
@JsonProperty("kind")
private String kind = "$kind";
/**
*
*/
@JsonProperty("metadata")
private ObjectMeta metadata;
/**
*
*/
@JsonProperty("spec")
private $spec spec;
@JsonProperty("status")
private $status status;
/**
* No args constructor for use in serialization
*/
public $resource() {
}
/**
* @param metadata
* @param apiVersion
* @param kind
* @param spec
*/
public $resource(String apiVersion, String kind, ObjectMeta metadata, $spec spec, $status status) {
this.apiVersion = apiVersion;
this.kind = kind;
this.metadata = metadata;
this.spec = spec;
this.status = status;
}
/**
* (Required)
*
* @return The apiVersion
*/
@JsonProperty("apiVersion")
public String getApiVersion() {
return apiVersion;
}
/**
* (Required)
*
* @param apiVersion The apiVersion
*/
@JsonProperty("apiVersion")
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
/**
* (Required)
*
* @return The kind
*/
@JsonProperty("kind")
public String getKind() {
return kind;
}
/**
* (Required)
*
* @param kind The kind
*/
@JsonProperty("kind")
public void setKind(String kind) {
this.kind = kind;
}
/**
* @return The metadata
*/
@JsonProperty("metadata")
public ObjectMeta getMetadata() {
return metadata;
}
/**
* @param metadata The metadata
*/
@JsonProperty("metadata")
public void setMetadata(ObjectMeta metadata) {
this.metadata = metadata;
}
/**
* @return The spec
*/
@JsonProperty("spec")
public $spec getSpec() {
return spec;
}
/**
* @param spec The spec
*/
@JsonProperty("spec")
public void setSpec($spec spec) {
this.spec = spec;
}
@JsonProperty("status")
public $status getStatus() {
return status;
}
public void setStatus($status status) {
this.status = status;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy