|
25 | 25 | @NoArgsConstructor |
26 | 26 | public class InjectOutput { |
27 | 27 |
|
28 | | - @JsonProperty("inject_id") |
29 | | - @NotBlank |
30 | | - @Schema(description = "ID of the inject") |
31 | | - private String id; |
32 | | - |
33 | | - @JsonProperty("inject_title") |
34 | | - @NotBlank |
35 | | - @Schema(description = "Title of the inject") |
36 | | - private String title; |
37 | | - |
38 | | - @JsonProperty("inject_enabled") |
39 | | - @Schema(description = "Enabled state of the inject") |
40 | | - private boolean enabled; |
41 | | - |
42 | | - @JsonProperty("inject_exercise") |
43 | | - @JsonSerialize(using = MonoIdDeserializer.class) |
44 | | - @Schema(description = "Simulation ID of the inject") |
45 | | - private Exercise exercise; |
46 | | - |
47 | | - @JsonProperty("inject_scenario") |
48 | | - @JsonSerialize(using = MonoIdDeserializer.class) |
49 | | - @Schema(description = "Scenario ID of the inject") |
50 | | - private Scenario scenario; |
51 | | - |
52 | | - @JsonProperty("inject_depends_duration") |
53 | | - @NotNull |
54 | | - @Min(value = 0L, message = "The value must be positive") |
55 | | - @Schema(description = "Depend duration of the inject") |
56 | | - private Long dependsDuration; |
57 | | - |
58 | | - @JsonProperty("inject_depends_on") |
59 | | - @ArraySchema(schema = @Schema(description = "Inject dependencies of the inject")) |
60 | | - private List<InjectDependency> dependsOn; |
61 | | - |
62 | | - @JsonProperty("inject_injector_contract") |
63 | | - @Schema(description = "Injector contract of the inject") |
64 | | - private InjectorContract injectorContract; |
65 | | - |
66 | | - @JsonProperty("inject_tags") |
67 | | - @JsonSerialize(using = MultiIdSetDeserializer.class) |
68 | | - @ArraySchema(schema = @Schema(description = "Tags of the inject")) |
69 | | - private Set<Tag> tags; |
70 | | - |
71 | | - @JsonProperty("inject_type") |
72 | | - @Schema(description = "Type of the inject") |
73 | | - public String injectType; |
74 | | - |
75 | | - @JsonProperty("inject_teams") |
76 | | - @JsonSerialize(using = MultiIdListDeserializer.class) |
77 | | - @ArraySchema(schema = @Schema(description = "Teams of the inject")) |
78 | | - private List<Team> teams; |
79 | | - |
80 | | - @JsonProperty("inject_assets") |
81 | | - @JsonSerialize(using = MultiIdListDeserializer.class) |
82 | | - @ArraySchema(schema = @Schema(description = "Assets of the inject")) |
83 | | - private List<Asset> assets; |
84 | | - |
85 | | - @JsonProperty("inject_asset_groups") |
86 | | - @JsonSerialize(using = MultiIdListDeserializer.class) |
87 | | - @ArraySchema(schema = @Schema(description = "Asset groups of the inject")) |
88 | | - private List<AssetGroup> assetGroups; |
89 | | - |
90 | | - @JsonProperty("inject_content") |
91 | | - @Schema(description = "Content of the inject") |
92 | | - private ObjectNode content; |
93 | | - |
94 | | - @JsonProperty("inject_ready") |
95 | | - @Schema(description = "Ready state of the inject") |
96 | | - public boolean isReady() { |
97 | | - return healthchecks.isEmpty() |
98 | | - || healthchecks.stream() |
99 | | - .noneMatch( |
100 | | - healthcheck -> |
101 | | - HealthCheck.Detail.MANDATORY_CONTENT.equals(healthcheck.getDetail())); |
102 | | - } |
103 | | - |
104 | | - @JsonProperty("inject_healthchecks") |
105 | | - @ArraySchema(schema = @Schema(description = "Healthchecks of the inject")) |
106 | | - private List<HealthCheck> healthchecks = new ArrayList<>(); |
107 | | - |
108 | | - @JsonProperty("inject_testable") |
109 | | - @Schema(description = "Testable state of the inject") |
110 | | - public boolean canBeTested() { |
111 | | - return EmailContract.TYPE.equals(this.getInjectType()) |
112 | | - || OvhSmsContract.TYPE.equals(this.getInjectType()); |
113 | | - } |
| 28 | + @JsonProperty("inject_id") |
| 29 | + @NotBlank |
| 30 | + @Schema(description = "ID of the inject") |
| 31 | + private String id; |
| 32 | + |
| 33 | + @JsonProperty("inject_title") |
| 34 | + @NotBlank |
| 35 | + @Schema(description = "Title of the inject") |
| 36 | + private String title; |
| 37 | + |
| 38 | + @JsonProperty("inject_enabled") |
| 39 | + @Schema(description = "Enabled state of the inject") |
| 40 | + private boolean enabled; |
| 41 | + |
| 42 | + @JsonProperty("inject_exercise") |
| 43 | + @JsonSerialize(using = MonoIdDeserializer.class) |
| 44 | + @Schema(description = "Simulation ID of the inject") |
| 45 | + private Exercise exercise; |
| 46 | + |
| 47 | + @JsonProperty("inject_scenario") |
| 48 | + @JsonSerialize(using = MonoIdDeserializer.class) |
| 49 | + @Schema(description = "Scenario ID of the inject") |
| 50 | + private Scenario scenario; |
| 51 | + |
| 52 | + @JsonProperty("inject_depends_duration") |
| 53 | + @NotNull |
| 54 | + @Min(value = 0L, message = "The value must be positive") |
| 55 | + @Schema(description = "Depend duration of the inject") |
| 56 | + private Long dependsDuration; |
| 57 | + |
| 58 | + @JsonProperty("inject_depends_on") |
| 59 | + @ArraySchema(schema = @Schema(description = "Inject dependencies of the inject")) |
| 60 | + private List<InjectDependency> dependsOn; |
| 61 | + |
| 62 | + @JsonProperty("inject_injector_contract") |
| 63 | + @Schema(description = "Injector contract of the inject") |
| 64 | + private InjectorContract injectorContract; |
| 65 | + |
| 66 | + @JsonProperty("inject_tags") |
| 67 | + @JsonSerialize(using = MultiIdSetDeserializer.class) |
| 68 | + @ArraySchema(schema = @Schema(description = "Tags of the inject")) |
| 69 | + private Set<Tag> tags; |
| 70 | + |
| 71 | + @JsonProperty("inject_type") |
| 72 | + @Schema(description = "Type of the inject") |
| 73 | + public String injectType; |
| 74 | + |
| 75 | + @JsonProperty("inject_teams") |
| 76 | + @JsonSerialize(using = MultiIdListDeserializer.class) |
| 77 | + @ArraySchema(schema = @Schema(description = "Teams of the inject")) |
| 78 | + private List<Team> teams; |
| 79 | + |
| 80 | + @JsonProperty("inject_assets") |
| 81 | + @JsonSerialize(using = MultiIdListDeserializer.class) |
| 82 | + @ArraySchema(schema = @Schema(description = "Assets of the inject")) |
| 83 | + private List<Asset> assets; |
| 84 | + |
| 85 | + @JsonProperty("inject_asset_groups") |
| 86 | + @JsonSerialize(using = MultiIdListDeserializer.class) |
| 87 | + @ArraySchema(schema = @Schema(description = "Asset groups of the inject")) |
| 88 | + private List<AssetGroup> assetGroups; |
| 89 | + |
| 90 | + @JsonProperty("inject_content") |
| 91 | + @Schema(description = "Content of the inject") |
| 92 | + private ObjectNode content; |
| 93 | + |
| 94 | + @JsonProperty("inject_ready") |
| 95 | + @Schema(description = "Ready state of the inject") |
| 96 | + public boolean isReady() { |
| 97 | + return healthchecks.isEmpty() |
| 98 | + || healthchecks.stream() |
| 99 | + .noneMatch( |
| 100 | + healthcheck -> |
| 101 | + HealthCheck.Detail.MANDATORY_CONTENT.equals(healthcheck.getDetail())); |
| 102 | + } |
| 103 | + |
| 104 | + @JsonProperty("inject_healthchecks") |
| 105 | + @ArraySchema(schema = @Schema(description = "Healthchecks of the inject")) |
| 106 | + private List<HealthCheck> healthchecks = new ArrayList<>(); |
| 107 | + |
| 108 | + @JsonProperty("inject_testable") |
| 109 | + @Schema(description = "Testable state of the inject") |
| 110 | + public boolean canBeTested() { |
| 111 | + return EmailContract.TYPE.equals(this.getInjectType()) |
| 112 | + || OvhSmsContract.TYPE.equals(this.getInjectType()); |
| 113 | + } |
114 | 114 | } |
0 commit comments