package ${model.packageName};

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
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.KubernetesResource;
import io.dekorate.deps.kubernetes.api.model.KubernetesResourceList;
import io.dekorate.deps.kubernetes.api.model.ListMeta;

import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.Inline;

#set ($version = "unknown")
#set ($annotations = $model.annotations)
#foreach ($annotation in $annotations)
  #if ($annotation.getClassRef().getName().equals("CustomResource"))
    #set ($version =  $annotation.getParameters().get("group") + "/" + $annotation.getParameters().get("version"))
  #end
#end

#set ($spec = $model.name)
#set ($length = $spec.length())
#set ($tindex = $length - 4)
#set ($resource = $spec.substring(0, $tindex))

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"apiVersion",
"kind",
"metadata",
"items"
})
@JsonDeserialize(using = io.dekorate.deps.jackson.databind.JsonDeserializer.None.class)
@Buildable(editableEnabled = false, builderPackage = "io.dekorate.deps.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done"))
public class ${resource}List implements KubernetesResource, KubernetesResourceList {

/**
*
* (Required)
*
*/
@JsonProperty("apiVersion")
private String apiVersion = "$version";
/**
*
*
*/
@JsonProperty("items")
private List<${resource}> items = new ArrayList<${resource}>();
/**
*
* (Required)
*
*/
@JsonProperty("kind")
private String kind = "${resource}List";
/**
*
*
*/
@JsonProperty("metadata")
private ListMeta metadata;

/**
* No args constructor for use in serialization
*
*/
public ${resource}List() {
}

/**
*
* @param metadata
* @param apiVersion
* @param kind
* @param items
*/
public ${resource}List(String apiVersion, List<${resource}> items, String kind, ListMeta metadata) {
this.apiVersion = apiVersion;
this.items = items;
this.kind = kind;
this.metadata = metadata;
}

/**
*
* (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;
}

/**
*
*
* @return
*     The items
*/
@JsonProperty("items")
public List<${resource}> getItems() {
return items;
}

/**
*
*
* @param items
*     The items
*/
@JsonProperty("items")
public void setItems(List<${resource}> items) {
this.items = items;
}

/**
*
* (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 ListMeta getMetadata() {
return metadata;
}

/**
*
*
* @param metadata
*     The metadata
*/
@JsonProperty("metadata")
public void setMetadata(ListMeta metadata) {
this.metadata = metadata;
}
}
