Skip to content

Commit

Permalink
[GENERATE] Java classes from JSON Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dapla-bot[bot] committed Jan 16, 2024
1 parent a865971 commit 11497c9
Show file tree
Hide file tree
Showing 10 changed files with 445 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;


/**
* KubenResource
* <p>
* Base container for Kuben resources
* Base definition of how Kuben resources should be defined.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -38,6 +39,7 @@ public class KubenResource implements Serializable
*
*/
@JsonProperty("version")
@Pattern(regexp = "^[a-z/]*[a-z]/v[0-9]+$")
@NotNull
private String version;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,33 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"team_name",
"name",
"visibility"
})
@Generated("jsonschema2pojo")
public class TeamInfoMetadataSchema implements Serializable
{

/**
* Name of this resource
* The (uniform) name of this team
* (Required)
*
*/
@JsonProperty("team_name")
@JsonPropertyDescription("Name of this resource")
@JsonPropertyDescription("The (uniform) name of this team")
@Size(min = 1)
@NotNull
private String teamName;
/**
* Name of this resource
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Name of this resource")
@Size(min = 1)
@NotNull
private String name;
/**
* Whenever the metadata in this manifest is considered to be exposed in e.g. a portal. Will default to public if not specified
*
Expand All @@ -53,7 +64,7 @@ public class TeamInfoMetadataSchema implements Serializable
@JsonIgnore
@Valid
private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();
private final static long serialVersionUID = 1258206655867380465L;
private final static long serialVersionUID = -6567017345717248345L;

/**
* No args constructor for use in serialization
Expand All @@ -65,13 +76,16 @@ public TeamInfoMetadataSchema() {
/**
*
* @param teamName
* Name of this resource.
* The (uniform) name of this team.
* @param visibility
* Whenever the metadata in this manifest is considered to be exposed in e.g. a portal. Will default to public if not specified.
* @param name
* Name of this resource.
*/
public TeamInfoMetadataSchema(String teamName, TeamInfoMetadataSchema.Visibility visibility) {
public TeamInfoMetadataSchema(String teamName, String name, TeamInfoMetadataSchema.Visibility visibility) {
super();
this.teamName = teamName;
this.name = name;
this.visibility = visibility;
}

Expand All @@ -80,7 +94,7 @@ public static TeamInfoMetadataSchema.TeamInfoMetadataSchemaBuilderBase builder()
}

/**
* Name of this resource
* The (uniform) name of this team
* (Required)
*
*/
Expand All @@ -90,7 +104,7 @@ public String getTeamName() {
}

/**
* Name of this resource
* The (uniform) name of this team
* (Required)
*
*/
Expand All @@ -99,6 +113,26 @@ public void setTeamName(String teamName) {
this.teamName = teamName;
}

/**
* Name of this resource
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}

/**
* Name of this resource
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}

/**
* Whenever the metadata in this manifest is considered to be exposed in e.g. a portal. Will default to public if not specified
*
Expand Down Expand Up @@ -135,6 +169,10 @@ public String toString() {
sb.append('=');
sb.append(((this.teamName == null)?"<null>":this.teamName));
sb.append(',');
sb.append("name");
sb.append('=');
sb.append(((this.name == null)?"<null>":this.name));
sb.append(',');
sb.append("visibility");
sb.append('=');
sb.append(((this.visibility == null)?"<null>":this.visibility));
Expand All @@ -155,6 +193,7 @@ public String toString() {
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.teamName == null)? 0 :this.teamName.hashCode()));
result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.visibility == null)? 0 :this.visibility.hashCode()));
return result;
Expand All @@ -169,7 +208,7 @@ public boolean equals(Object other) {
return false;
}
TeamInfoMetadataSchema rhs = ((TeamInfoMetadataSchema) other);
return ((((this.teamName == rhs.teamName)||((this.teamName!= null)&&this.teamName.equals(rhs.teamName)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.visibility == rhs.visibility)||((this.visibility!= null)&&this.visibility.equals(rhs.visibility))));
return (((((this.teamName == rhs.teamName)||((this.teamName!= null)&&this.teamName.equals(rhs.teamName)))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.visibility == rhs.visibility)||((this.visibility!= null)&&this.visibility.equals(rhs.visibility))));
}

public static class TeamInfoMetadataSchemaBuilder
Expand All @@ -181,8 +220,8 @@ public TeamInfoMetadataSchemaBuilder() {
super();
}

public TeamInfoMetadataSchemaBuilder(String teamName, TeamInfoMetadataSchema.Visibility visibility) {
super(teamName, visibility);
public TeamInfoMetadataSchemaBuilder(String teamName, String name, TeamInfoMetadataSchema.Visibility visibility) {
super(teamName, name, visibility);
}

}
Expand All @@ -200,10 +239,10 @@ public TeamInfoMetadataSchemaBuilderBase() {
}

@SuppressWarnings("unchecked")
public TeamInfoMetadataSchemaBuilderBase(String teamName, TeamInfoMetadataSchema.Visibility visibility) {
public TeamInfoMetadataSchemaBuilderBase(String teamName, String name, TeamInfoMetadataSchema.Visibility visibility) {
// Skip initialization when called from subclass
if (this.getClass().equals(TeamInfoMetadataSchema.TeamInfoMetadataSchemaBuilder.class)) {
this.instance = ((T) new TeamInfoMetadataSchema(teamName, visibility));
this.instance = ((T) new TeamInfoMetadataSchema(teamName, name, visibility));
}
}

Expand All @@ -219,6 +258,11 @@ public TeamInfoMetadataSchema.TeamInfoMetadataSchemaBuilderBase withTeamName(Str
return this;
}

public TeamInfoMetadataSchema.TeamInfoMetadataSchemaBuilderBase withName(String name) {
((TeamInfoMetadataSchema) this.instance).name = name;
return this;
}

public TeamInfoMetadataSchema.TeamInfoMetadataSchemaBuilderBase withVisibility(TeamInfoMetadataSchema.Visibility visibility) {
((TeamInfoMetadataSchema) this.instance).visibility = visibility;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
import com.fasterxml.jackson.annotation.JsonValue;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import no.ssb.dapla.kuben.partials.v1.TeamInfoMetadataSchema;


/**
* AdditionalTeamInfo
* <p>
* Additional fields to express custom team information
* Additional fields to express custom team information Information the team can add without any restrictions on what kind of data is specified. Can be useful in situations where teams want to express or communicate some kind of information without it fitting the defined team info model.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -44,6 +45,7 @@ public class AdditionalTeamInfo implements Serializable
*/
@JsonProperty("version")
@JsonPropertyDescription("The version of this specification")
@Pattern(regexp = "^kuben/v[0-9]+$")
@NotNull
private String version;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
Expand All @@ -20,13 +19,12 @@
/**
* KubenTeamDefinition
* <p>
* The definition of a team inside Kuben
* The definition of a team inside Kuben Fields that are important for the technical configuration of a team
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"uniform_name",
"display_name",
"gcp",
"github",
"atlantis",
Expand All @@ -45,15 +43,6 @@ public class KubenTeamDefinition implements Serializable
@Pattern(regexp = "^[a-z-]*$")
@NotNull
private String uniformName;
/**
*
* (Required)
*
*/
@JsonProperty("display_name")
@JsonPropertyDescription("")
@NotNull
private String displayName;
@JsonProperty("gcp")
@Valid
private Gcp gcp;
Expand All @@ -69,7 +58,7 @@ public class KubenTeamDefinition implements Serializable
@JsonIgnore
@Valid
private Map<String, Object> additionalProperties = new LinkedHashMap<String, Object>();
private final static long serialVersionUID = -2990202222857127942L;
private final static long serialVersionUID = -7746310475788642663L;

/**
* No args constructor for use in serialization
Expand All @@ -78,10 +67,9 @@ public class KubenTeamDefinition implements Serializable
public KubenTeamDefinition() {
}

public KubenTeamDefinition(String uniformName, String displayName, Gcp gcp, Github github, Atlantis atlantis, ArtifactRegistry artifactRegistry) {
public KubenTeamDefinition(String uniformName, Gcp gcp, Github github, Atlantis atlantis, ArtifactRegistry artifactRegistry) {
super();
this.uniformName = uniformName;
this.displayName = displayName;
this.gcp = gcp;
this.github = github;
this.atlantis = atlantis;
Expand Down Expand Up @@ -112,26 +100,6 @@ public void setUniformName(String uniformName) {
this.uniformName = uniformName;
}

/**
*
* (Required)
*
*/
@JsonProperty("display_name")
public String getDisplayName() {
return displayName;
}

/**
*
* (Required)
*
*/
@JsonProperty("display_name")
public void setDisplayName(String displayName) {
this.displayName = displayName;
}

@JsonProperty("gcp")
public Gcp getGcp() {
return gcp;
Expand Down Expand Up @@ -190,10 +158,6 @@ public String toString() {
sb.append('=');
sb.append(((this.uniformName == null)?"<null>":this.uniformName));
sb.append(',');
sb.append("displayName");
sb.append('=');
sb.append(((this.displayName == null)?"<null>":this.displayName));
sb.append(',');
sb.append("gcp");
sb.append('=');
sb.append(((this.gcp == null)?"<null>":this.gcp));
Expand Down Expand Up @@ -229,7 +193,6 @@ public int hashCode() {
result = ((result* 31)+((this.github == null)? 0 :this.github.hashCode()));
result = ((result* 31)+((this.atlantis == null)? 0 :this.atlantis.hashCode()));
result = ((result* 31)+((this.gcp == null)? 0 :this.gcp.hashCode()));
result = ((result* 31)+((this.displayName == null)? 0 :this.displayName.hashCode()));
result = ((result* 31)+((this.artifactRegistry == null)? 0 :this.artifactRegistry.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
return result;
Expand All @@ -244,7 +207,7 @@ public boolean equals(Object other) {
return false;
}
KubenTeamDefinition rhs = ((KubenTeamDefinition) other);
return ((((((((this.uniformName == rhs.uniformName)||((this.uniformName!= null)&&this.uniformName.equals(rhs.uniformName)))&&((this.github == rhs.github)||((this.github!= null)&&this.github.equals(rhs.github))))&&((this.atlantis == rhs.atlantis)||((this.atlantis!= null)&&this.atlantis.equals(rhs.atlantis))))&&((this.gcp == rhs.gcp)||((this.gcp!= null)&&this.gcp.equals(rhs.gcp))))&&((this.displayName == rhs.displayName)||((this.displayName!= null)&&this.displayName.equals(rhs.displayName))))&&((this.artifactRegistry == rhs.artifactRegistry)||((this.artifactRegistry!= null)&&this.artifactRegistry.equals(rhs.artifactRegistry))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))));
return (((((((this.uniformName == rhs.uniformName)||((this.uniformName!= null)&&this.uniformName.equals(rhs.uniformName)))&&((this.github == rhs.github)||((this.github!= null)&&this.github.equals(rhs.github))))&&((this.atlantis == rhs.atlantis)||((this.atlantis!= null)&&this.atlantis.equals(rhs.atlantis))))&&((this.gcp == rhs.gcp)||((this.gcp!= null)&&this.gcp.equals(rhs.gcp))))&&((this.artifactRegistry == rhs.artifactRegistry)||((this.artifactRegistry!= null)&&this.artifactRegistry.equals(rhs.artifactRegistry))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))));
}

public static class KubenTeamDefinitionBuilder
Expand All @@ -256,8 +219,8 @@ public KubenTeamDefinitionBuilder() {
super();
}

public KubenTeamDefinitionBuilder(String uniformName, String displayName, Gcp gcp, Github github, Atlantis atlantis, ArtifactRegistry artifactRegistry) {
super(uniformName, displayName, gcp, github, atlantis, artifactRegistry);
public KubenTeamDefinitionBuilder(String uniformName, Gcp gcp, Github github, Atlantis atlantis, ArtifactRegistry artifactRegistry) {
super(uniformName, gcp, github, atlantis, artifactRegistry);
}

}
Expand All @@ -275,10 +238,10 @@ public KubenTeamDefinitionBuilderBase() {
}

@SuppressWarnings("unchecked")
public KubenTeamDefinitionBuilderBase(String uniformName, String displayName, Gcp gcp, Github github, Atlantis atlantis, ArtifactRegistry artifactRegistry) {
public KubenTeamDefinitionBuilderBase(String uniformName, Gcp gcp, Github github, Atlantis atlantis, ArtifactRegistry artifactRegistry) {
// Skip initialization when called from subclass
if (this.getClass().equals(KubenTeamDefinition.KubenTeamDefinitionBuilder.class)) {
this.instance = ((T) new KubenTeamDefinition(uniformName, displayName, gcp, github, atlantis, artifactRegistry));
this.instance = ((T) new KubenTeamDefinition(uniformName, gcp, github, atlantis, artifactRegistry));
}
}

Expand All @@ -294,11 +257,6 @@ public KubenTeamDefinition.KubenTeamDefinitionBuilderBase withUniformName(String
return this;
}

public KubenTeamDefinition.KubenTeamDefinitionBuilderBase withDisplayName(String displayName) {
((KubenTeamDefinition) this.instance).displayName = displayName;
return this;
}

public KubenTeamDefinition.KubenTeamDefinitionBuilderBase withGcp(Gcp gcp) {
((KubenTeamDefinition) this.instance).gcp = gcp;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
import com.fasterxml.jackson.annotation.JsonValue;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import no.ssb.dapla.kuben.partials.v1.TeamInfoMetadataSchema;


/**
* PlatformManagedTeamInfo
* <p>
* Metadata that the platform team manages on behalf of the team
* Information about the team that the platform team manages.Team information that is not strictly required for configuration of the team
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand All @@ -44,6 +45,7 @@ public class PlatformManagedTeamInfo implements Serializable
*/
@JsonProperty("version")
@JsonPropertyDescription("The version of this specification")
@Pattern(regexp = "^kuben/v[0-9]+$")
@NotNull
private String version;
/**
Expand Down
Loading

0 comments on commit 11497c9

Please sign in to comment.