Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add configurable name for DevCenter security recipe #85

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/io/moderne/organizations/DgsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ public static class DEVCENTERRECIPECARD {
public static class DEVCENTERRECIPE {
public static final String TYPE_NAME = "DevCenterRecipe";

public static final String Name = "name";

public static final String RecipeId = "recipeId";

public static final String Options = "options";
Expand Down
42 changes: 37 additions & 5 deletions src/main/java/io/moderne/organizations/types/DevCenterRecipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,35 @@
import java.util.List;

public class DevCenterRecipe {
/**
* Optional name used for displaying on the DevCenter. Defaults to the recipe display name.
*/
private String name;

private String recipeId;

private List<Option> options;

public DevCenterRecipe() {
}

public DevCenterRecipe(String recipeId, List<Option> options) {
public DevCenterRecipe(String name, String recipeId, List<Option> options) {
this.name = name;
this.recipeId = recipeId;
this.options = options;
}

/**
* Optional name used for displaying on the DevCenter. Defaults to the recipe display name.
*/
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getRecipeId() {
return recipeId;
}
Expand All @@ -36,39 +53,54 @@ public void setOptions(List<Option> options) {

@Override
public String toString() {
return "DevCenterRecipe{" + "recipeId='" + recipeId + "'," +"options='" + options + "'" +"}";
return "DevCenterRecipe{" + "name='" + name + "'," +"recipeId='" + recipeId + "'," +"options='" + options + "'" +"}";
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DevCenterRecipe that = (DevCenterRecipe) o;
return java.util.Objects.equals(recipeId, that.recipeId) &&
return java.util.Objects.equals(name, that.name) &&
java.util.Objects.equals(recipeId, that.recipeId) &&
java.util.Objects.equals(options, that.options);
}

@Override
public int hashCode() {
return java.util.Objects.hash(recipeId, options);
return java.util.Objects.hash(name, recipeId, options);
}

public static io.moderne.organizations.types.DevCenterRecipe.Builder newBuilder() {
return new Builder();
}

public static class Builder {
/**
* Optional name used for displaying on the DevCenter. Defaults to the recipe display name.
*/
private String name;

private String recipeId;

private List<Option> options;

public DevCenterRecipe build() {
io.moderne.organizations.types.DevCenterRecipe result = new io.moderne.organizations.types.DevCenterRecipe();
result.recipeId = this.recipeId;
result.name = this.name;
result.recipeId = this.recipeId;
result.options = this.options;
return result;
}

/**
* Optional name used for displaying on the DevCenter. Defaults to the recipe display name.
*/
public io.moderne.organizations.types.DevCenterRecipe.Builder name(String name) {
this.name = name;
return this;
}

public io.moderne.organizations.types.DevCenterRecipe.Builder recipeId(String recipeId) {
this.recipeId = recipeId;
return this;
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/schema/moderne-organizations.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ type DevCenterRecipeCard {
}

type DevCenterRecipe {
"""
Optional name used for displaying on the DevCenter. Defaults to the recipe display name.
"""
name: String
recipeId: String!
options: [Option!]!
}
Expand Down
Loading