1use serde::{Serialize, Deserialize, de::Error};
5
6pub mod artifact_deleted_0_1_0;
7pub mod artifact_downloaded_0_1_0;
8pub mod artifact_packaged_0_1_1;
9pub mod artifact_packaged_0_2_0;
10pub mod artifact_published_0_1_1;
11pub mod artifact_published_0_2_0;
12pub mod artifact_signed_0_1_0;
13pub mod artifact_signed_0_2_0;
14pub mod branch_created_0_1_2;
15pub mod branch_created_0_2_0;
16pub mod branch_deleted_0_1_2;
17pub mod branch_deleted_0_2_0;
18pub mod build_finished_0_1_1;
19pub mod build_finished_0_2_0;
20pub mod build_queued_0_1_1;
21pub mod build_queued_0_2_0;
22pub mod build_started_0_1_1;
23pub mod build_started_0_2_0;
24pub mod change_abandoned_0_1_2;
25pub mod change_abandoned_0_2_0;
26pub mod change_created_0_1_2;
27pub mod change_created_0_3_0;
28pub mod change_merged_0_1_2;
29pub mod change_merged_0_2_0;
30pub mod change_reviewed_0_1_2;
31pub mod change_reviewed_0_2_0;
32pub mod change_updated_0_1_2;
33pub mod change_updated_0_2_0;
34pub mod environment_created_0_1_1;
35pub mod environment_created_0_2_0;
36pub mod environment_deleted_0_1_1;
37pub mod environment_deleted_0_2_0;
38pub mod environment_modified_0_1_1;
39pub mod environment_modified_0_2_0;
40pub mod incident_detected_0_1_0;
41pub mod incident_detected_0_2_0;
42pub mod incident_reported_0_1_0;
43pub mod incident_reported_0_2_0;
44pub mod incident_resolved_0_1_0;
45pub mod incident_resolved_0_2_0;
46pub mod pipelinerun_finished_0_1_1;
47pub mod pipelinerun_finished_0_2_0;
48pub mod pipelinerun_queued_0_1_1;
49pub mod pipelinerun_queued_0_2_0;
50pub mod pipelinerun_started_0_1_1;
51pub mod pipelinerun_started_0_2_0;
52pub mod repository_created_0_1_1;
53pub mod repository_created_0_2_0;
54pub mod repository_deleted_0_1_1;
55pub mod repository_deleted_0_2_0;
56pub mod repository_modified_0_1_1;
57pub mod repository_modified_0_2_0;
58pub mod service_deployed_0_1_1;
59pub mod service_deployed_0_2_0;
60pub mod service_published_0_1_1;
61pub mod service_published_0_2_0;
62pub mod service_removed_0_1_1;
63pub mod service_removed_0_2_0;
64pub mod service_rolledback_0_1_1;
65pub mod service_rolledback_0_2_0;
66pub mod service_upgraded_0_1_1;
67pub mod service_upgraded_0_2_0;
68pub mod taskrun_finished_0_1_1;
69pub mod taskrun_finished_0_2_0;
70pub mod taskrun_started_0_1_1;
71pub mod taskrun_started_0_2_0;
72pub mod testcaserun_finished_0_1_0;
73pub mod testcaserun_finished_0_2_0;
74pub mod testcaserun_queued_0_1_0;
75pub mod testcaserun_queued_0_2_0;
76pub mod testcaserun_skipped_0_1_0;
77pub mod testcaserun_started_0_1_0;
78pub mod testcaserun_started_0_2_0;
79pub mod testoutput_published_0_1_0;
80pub mod testoutput_published_0_2_0;
81pub mod testsuiterun_finished_0_1_0;
82pub mod testsuiterun_finished_0_2_0;
83pub mod testsuiterun_queued_0_1_0;
84pub mod testsuiterun_queued_0_2_0;
85pub mod testsuiterun_started_0_1_0;
86pub mod testsuiterun_started_0_2_0;
87pub mod ticket_closed_0_1_0;
88pub mod ticket_created_0_1_0;
89pub mod ticket_updated_0_1_0;
90
91pub mod latest {
92 pub use super::artifact_deleted_0_1_0 as artifact_deleted;
93 pub use super::artifact_downloaded_0_1_0 as artifact_downloaded;
94 pub use super::artifact_packaged_0_2_0 as artifact_packaged;
95 pub use super::artifact_published_0_2_0 as artifact_published;
96 pub use super::artifact_signed_0_2_0 as artifact_signed;
97 pub use super::branch_created_0_2_0 as branch_created;
98 pub use super::branch_deleted_0_2_0 as branch_deleted;
99 pub use super::build_finished_0_2_0 as build_finished;
100 pub use super::build_queued_0_2_0 as build_queued;
101 pub use super::build_started_0_2_0 as build_started;
102 pub use super::change_abandoned_0_2_0 as change_abandoned;
103 pub use super::change_created_0_3_0 as change_created;
104 pub use super::change_merged_0_2_0 as change_merged;
105 pub use super::change_reviewed_0_2_0 as change_reviewed;
106 pub use super::change_updated_0_2_0 as change_updated;
107 pub use super::environment_created_0_2_0 as environment_created;
108 pub use super::environment_deleted_0_2_0 as environment_deleted;
109 pub use super::environment_modified_0_2_0 as environment_modified;
110 pub use super::incident_detected_0_2_0 as incident_detected;
111 pub use super::incident_reported_0_2_0 as incident_reported;
112 pub use super::incident_resolved_0_2_0 as incident_resolved;
113 pub use super::pipelinerun_finished_0_2_0 as pipelinerun_finished;
114 pub use super::pipelinerun_queued_0_2_0 as pipelinerun_queued;
115 pub use super::pipelinerun_started_0_2_0 as pipelinerun_started;
116 pub use super::repository_created_0_2_0 as repository_created;
117 pub use super::repository_deleted_0_2_0 as repository_deleted;
118 pub use super::repository_modified_0_2_0 as repository_modified;
119 pub use super::service_deployed_0_2_0 as service_deployed;
120 pub use super::service_published_0_2_0 as service_published;
121 pub use super::service_removed_0_2_0 as service_removed;
122 pub use super::service_rolledback_0_2_0 as service_rolledback;
123 pub use super::service_upgraded_0_2_0 as service_upgraded;
124 pub use super::taskrun_finished_0_2_0 as taskrun_finished;
125 pub use super::taskrun_started_0_2_0 as taskrun_started;
126 pub use super::testcaserun_finished_0_2_0 as testcaserun_finished;
127 pub use super::testcaserun_queued_0_2_0 as testcaserun_queued;
128 pub use super::testcaserun_skipped_0_1_0 as testcaserun_skipped;
129 pub use super::testcaserun_started_0_2_0 as testcaserun_started;
130 pub use super::testoutput_published_0_2_0 as testoutput_published;
131 pub use super::testsuiterun_finished_0_2_0 as testsuiterun_finished;
132 pub use super::testsuiterun_queued_0_2_0 as testsuiterun_queued;
133 pub use super::testsuiterun_started_0_2_0 as testsuiterun_started;
134 pub use super::ticket_closed_0_1_0 as ticket_closed;
135 pub use super::ticket_created_0_1_0 as ticket_created;
136 pub use super::ticket_updated_0_1_0 as ticket_updated;
137}
138pub mod spec_0_3_0 {
139 pub use super::artifact_packaged_0_1_1 as artifact_packaged;
140 pub use super::artifact_published_0_1_1 as artifact_published;
141 pub use super::artifact_signed_0_1_0 as artifact_signed;
142 pub use super::branch_created_0_1_2 as branch_created;
143 pub use super::branch_deleted_0_1_2 as branch_deleted;
144 pub use super::build_finished_0_1_1 as build_finished;
145 pub use super::build_queued_0_1_1 as build_queued;
146 pub use super::build_started_0_1_1 as build_started;
147 pub use super::change_abandoned_0_1_2 as change_abandoned;
148 pub use super::change_created_0_1_2 as change_created;
149 pub use super::change_merged_0_1_2 as change_merged;
150 pub use super::change_reviewed_0_1_2 as change_reviewed;
151 pub use super::change_updated_0_1_2 as change_updated;
152 pub use super::environment_created_0_1_1 as environment_created;
153 pub use super::environment_deleted_0_1_1 as environment_deleted;
154 pub use super::environment_modified_0_1_1 as environment_modified;
155 pub use super::incident_detected_0_1_0 as incident_detected;
156 pub use super::incident_reported_0_1_0 as incident_reported;
157 pub use super::incident_resolved_0_1_0 as incident_resolved;
158 pub use super::pipelinerun_finished_0_1_1 as pipelinerun_finished;
159 pub use super::pipelinerun_queued_0_1_1 as pipelinerun_queued;
160 pub use super::pipelinerun_started_0_1_1 as pipelinerun_started;
161 pub use super::repository_created_0_1_1 as repository_created;
162 pub use super::repository_deleted_0_1_1 as repository_deleted;
163 pub use super::repository_modified_0_1_1 as repository_modified;
164 pub use super::service_deployed_0_1_1 as service_deployed;
165 pub use super::service_published_0_1_1 as service_published;
166 pub use super::service_removed_0_1_1 as service_removed;
167 pub use super::service_rolledback_0_1_1 as service_rolledback;
168 pub use super::service_upgraded_0_1_1 as service_upgraded;
169 pub use super::taskrun_finished_0_1_1 as taskrun_finished;
170 pub use super::taskrun_started_0_1_1 as taskrun_started;
171 pub use super::testcaserun_finished_0_1_0 as testcaserun_finished;
172 pub use super::testcaserun_queued_0_1_0 as testcaserun_queued;
173 pub use super::testcaserun_started_0_1_0 as testcaserun_started;
174 pub use super::testoutput_published_0_1_0 as testoutput_published;
175 pub use super::testsuiterun_finished_0_1_0 as testsuiterun_finished;
176 pub use super::testsuiterun_queued_0_1_0 as testsuiterun_queued;
177 pub use super::testsuiterun_started_0_1_0 as testsuiterun_started;
178}
179pub mod spec_0_4_1 {
180 pub use super::artifact_deleted_0_1_0 as artifact_deleted;
181 pub use super::artifact_downloaded_0_1_0 as artifact_downloaded;
182 pub use super::artifact_packaged_0_2_0 as artifact_packaged;
183 pub use super::artifact_published_0_2_0 as artifact_published;
184 pub use super::artifact_signed_0_2_0 as artifact_signed;
185 pub use super::branch_created_0_2_0 as branch_created;
186 pub use super::branch_deleted_0_2_0 as branch_deleted;
187 pub use super::build_finished_0_2_0 as build_finished;
188 pub use super::build_queued_0_2_0 as build_queued;
189 pub use super::build_started_0_2_0 as build_started;
190 pub use super::change_abandoned_0_2_0 as change_abandoned;
191 pub use super::change_created_0_3_0 as change_created;
192 pub use super::change_merged_0_2_0 as change_merged;
193 pub use super::change_reviewed_0_2_0 as change_reviewed;
194 pub use super::change_updated_0_2_0 as change_updated;
195 pub use super::environment_created_0_2_0 as environment_created;
196 pub use super::environment_deleted_0_2_0 as environment_deleted;
197 pub use super::environment_modified_0_2_0 as environment_modified;
198 pub use super::incident_detected_0_2_0 as incident_detected;
199 pub use super::incident_reported_0_2_0 as incident_reported;
200 pub use super::incident_resolved_0_2_0 as incident_resolved;
201 pub use super::pipelinerun_finished_0_2_0 as pipelinerun_finished;
202 pub use super::pipelinerun_queued_0_2_0 as pipelinerun_queued;
203 pub use super::pipelinerun_started_0_2_0 as pipelinerun_started;
204 pub use super::repository_created_0_2_0 as repository_created;
205 pub use super::repository_deleted_0_2_0 as repository_deleted;
206 pub use super::repository_modified_0_2_0 as repository_modified;
207 pub use super::service_deployed_0_2_0 as service_deployed;
208 pub use super::service_published_0_2_0 as service_published;
209 pub use super::service_removed_0_2_0 as service_removed;
210 pub use super::service_rolledback_0_2_0 as service_rolledback;
211 pub use super::service_upgraded_0_2_0 as service_upgraded;
212 pub use super::taskrun_finished_0_2_0 as taskrun_finished;
213 pub use super::taskrun_started_0_2_0 as taskrun_started;
214 pub use super::testcaserun_finished_0_2_0 as testcaserun_finished;
215 pub use super::testcaserun_queued_0_2_0 as testcaserun_queued;
216 pub use super::testcaserun_skipped_0_1_0 as testcaserun_skipped;
217 pub use super::testcaserun_started_0_2_0 as testcaserun_started;
218 pub use super::testoutput_published_0_2_0 as testoutput_published;
219 pub use super::testsuiterun_finished_0_2_0 as testsuiterun_finished;
220 pub use super::testsuiterun_queued_0_2_0 as testsuiterun_queued;
221 pub use super::testsuiterun_started_0_2_0 as testsuiterun_started;
222 pub use super::ticket_closed_0_1_0 as ticket_closed;
223 pub use super::ticket_created_0_1_0 as ticket_created;
224 pub use super::ticket_updated_0_1_0 as ticket_updated;
225}
226
227pub const ARTIFACT_DELETED_0_1_0: &str = "dev.cdevents.artifact.deleted.0.1.0";
228pub const ARTIFACT_DOWNLOADED_0_1_0: &str = "dev.cdevents.artifact.downloaded.0.1.0";
229pub const ARTIFACT_PACKAGED_0_1_1: &str = "dev.cdevents.artifact.packaged.0.1.1";
230pub const ARTIFACT_PACKAGED_0_2_0: &str = "dev.cdevents.artifact.packaged.0.2.0";
231pub const ARTIFACT_PUBLISHED_0_1_1: &str = "dev.cdevents.artifact.published.0.1.1";
232pub const ARTIFACT_PUBLISHED_0_2_0: &str = "dev.cdevents.artifact.published.0.2.0";
233pub const ARTIFACT_SIGNED_0_1_0: &str = "dev.cdevents.artifact.signed.0.1.0";
234pub const ARTIFACT_SIGNED_0_2_0: &str = "dev.cdevents.artifact.signed.0.2.0";
235pub const BRANCH_CREATED_0_1_2: &str = "dev.cdevents.branch.created.0.1.2";
236pub const BRANCH_CREATED_0_2_0: &str = "dev.cdevents.branch.created.0.2.0";
237pub const BRANCH_DELETED_0_1_2: &str = "dev.cdevents.branch.deleted.0.1.2";
238pub const BRANCH_DELETED_0_2_0: &str = "dev.cdevents.branch.deleted.0.2.0";
239pub const BUILD_FINISHED_0_1_1: &str = "dev.cdevents.build.finished.0.1.1";
240pub const BUILD_FINISHED_0_2_0: &str = "dev.cdevents.build.finished.0.2.0";
241pub const BUILD_QUEUED_0_1_1: &str = "dev.cdevents.build.queued.0.1.1";
242pub const BUILD_QUEUED_0_2_0: &str = "dev.cdevents.build.queued.0.2.0";
243pub const BUILD_STARTED_0_1_1: &str = "dev.cdevents.build.started.0.1.1";
244pub const BUILD_STARTED_0_2_0: &str = "dev.cdevents.build.started.0.2.0";
245pub const CHANGE_ABANDONED_0_1_2: &str = "dev.cdevents.change.abandoned.0.1.2";
246pub const CHANGE_ABANDONED_0_2_0: &str = "dev.cdevents.change.abandoned.0.2.0";
247pub const CHANGE_CREATED_0_1_2: &str = "dev.cdevents.change.created.0.1.2";
248pub const CHANGE_CREATED_0_3_0: &str = "dev.cdevents.change.created.0.3.0";
249pub const CHANGE_MERGED_0_1_2: &str = "dev.cdevents.change.merged.0.1.2";
250pub const CHANGE_MERGED_0_2_0: &str = "dev.cdevents.change.merged.0.2.0";
251pub const CHANGE_REVIEWED_0_1_2: &str = "dev.cdevents.change.reviewed.0.1.2";
252pub const CHANGE_REVIEWED_0_2_0: &str = "dev.cdevents.change.reviewed.0.2.0";
253pub const CHANGE_UPDATED_0_1_2: &str = "dev.cdevents.change.updated.0.1.2";
254pub const CHANGE_UPDATED_0_2_0: &str = "dev.cdevents.change.updated.0.2.0";
255pub const ENVIRONMENT_CREATED_0_1_1: &str = "dev.cdevents.environment.created.0.1.1";
256pub const ENVIRONMENT_CREATED_0_2_0: &str = "dev.cdevents.environment.created.0.2.0";
257pub const ENVIRONMENT_DELETED_0_1_1: &str = "dev.cdevents.environment.deleted.0.1.1";
258pub const ENVIRONMENT_DELETED_0_2_0: &str = "dev.cdevents.environment.deleted.0.2.0";
259pub const ENVIRONMENT_MODIFIED_0_1_1: &str = "dev.cdevents.environment.modified.0.1.1";
260pub const ENVIRONMENT_MODIFIED_0_2_0: &str = "dev.cdevents.environment.modified.0.2.0";
261pub const INCIDENT_DETECTED_0_1_0: &str = "dev.cdevents.incident.detected.0.1.0";
262pub const INCIDENT_DETECTED_0_2_0: &str = "dev.cdevents.incident.detected.0.2.0";
263pub const INCIDENT_REPORTED_0_1_0: &str = "dev.cdevents.incident.reported.0.1.0";
264pub const INCIDENT_REPORTED_0_2_0: &str = "dev.cdevents.incident.reported.0.2.0";
265pub const INCIDENT_RESOLVED_0_1_0: &str = "dev.cdevents.incident.resolved.0.1.0";
266pub const INCIDENT_RESOLVED_0_2_0: &str = "dev.cdevents.incident.resolved.0.2.0";
267pub const PIPELINERUN_FINISHED_0_1_1: &str = "dev.cdevents.pipelinerun.finished.0.1.1";
268pub const PIPELINERUN_FINISHED_0_2_0: &str = "dev.cdevents.pipelinerun.finished.0.2.0";
269pub const PIPELINERUN_QUEUED_0_1_1: &str = "dev.cdevents.pipelinerun.queued.0.1.1";
270pub const PIPELINERUN_QUEUED_0_2_0: &str = "dev.cdevents.pipelinerun.queued.0.2.0";
271pub const PIPELINERUN_STARTED_0_1_1: &str = "dev.cdevents.pipelinerun.started.0.1.1";
272pub const PIPELINERUN_STARTED_0_2_0: &str = "dev.cdevents.pipelinerun.started.0.2.0";
273pub const REPOSITORY_CREATED_0_1_1: &str = "dev.cdevents.repository.created.0.1.1";
274pub const REPOSITORY_CREATED_0_2_0: &str = "dev.cdevents.repository.created.0.2.0";
275pub const REPOSITORY_DELETED_0_1_1: &str = "dev.cdevents.repository.deleted.0.1.1";
276pub const REPOSITORY_DELETED_0_2_0: &str = "dev.cdevents.repository.deleted.0.2.0";
277pub const REPOSITORY_MODIFIED_0_1_1: &str = "dev.cdevents.repository.modified.0.1.1";
278pub const REPOSITORY_MODIFIED_0_2_0: &str = "dev.cdevents.repository.modified.0.2.0";
279pub const SERVICE_DEPLOYED_0_1_1: &str = "dev.cdevents.service.deployed.0.1.1";
280pub const SERVICE_DEPLOYED_0_2_0: &str = "dev.cdevents.service.deployed.0.2.0";
281pub const SERVICE_PUBLISHED_0_1_1: &str = "dev.cdevents.service.published.0.1.1";
282pub const SERVICE_PUBLISHED_0_2_0: &str = "dev.cdevents.service.published.0.2.0";
283pub const SERVICE_REMOVED_0_1_1: &str = "dev.cdevents.service.removed.0.1.1";
284pub const SERVICE_REMOVED_0_2_0: &str = "dev.cdevents.service.removed.0.2.0";
285pub const SERVICE_ROLLEDBACK_0_1_1: &str = "dev.cdevents.service.rolledback.0.1.1";
286pub const SERVICE_ROLLEDBACK_0_2_0: &str = "dev.cdevents.service.rolledback.0.2.0";
287pub const SERVICE_UPGRADED_0_1_1: &str = "dev.cdevents.service.upgraded.0.1.1";
288pub const SERVICE_UPGRADED_0_2_0: &str = "dev.cdevents.service.upgraded.0.2.0";
289pub const TASKRUN_FINISHED_0_1_1: &str = "dev.cdevents.taskrun.finished.0.1.1";
290pub const TASKRUN_FINISHED_0_2_0: &str = "dev.cdevents.taskrun.finished.0.2.0";
291pub const TASKRUN_STARTED_0_1_1: &str = "dev.cdevents.taskrun.started.0.1.1";
292pub const TASKRUN_STARTED_0_2_0: &str = "dev.cdevents.taskrun.started.0.2.0";
293pub const TESTCASERUN_FINISHED_0_1_0: &str = "dev.cdevents.testcaserun.finished.0.1.0";
294pub const TESTCASERUN_FINISHED_0_2_0: &str = "dev.cdevents.testcaserun.finished.0.2.0";
295pub const TESTCASERUN_QUEUED_0_1_0: &str = "dev.cdevents.testcaserun.queued.0.1.0";
296pub const TESTCASERUN_QUEUED_0_2_0: &str = "dev.cdevents.testcaserun.queued.0.2.0";
297pub const TESTCASERUN_SKIPPED_0_1_0: &str = "dev.cdevents.testcaserun.skipped.0.1.0";
298pub const TESTCASERUN_STARTED_0_1_0: &str = "dev.cdevents.testcaserun.started.0.1.0";
299pub const TESTCASERUN_STARTED_0_2_0: &str = "dev.cdevents.testcaserun.started.0.2.0";
300pub const TESTOUTPUT_PUBLISHED_0_1_0: &str = "dev.cdevents.testoutput.published.0.1.0";
301pub const TESTOUTPUT_PUBLISHED_0_2_0: &str = "dev.cdevents.testoutput.published.0.2.0";
302pub const TESTSUITERUN_FINISHED_0_1_0: &str = "dev.cdevents.testsuiterun.finished.0.1.0";
303pub const TESTSUITERUN_FINISHED_0_2_0: &str = "dev.cdevents.testsuiterun.finished.0.2.0";
304pub const TESTSUITERUN_QUEUED_0_1_0: &str = "dev.cdevents.testsuiterun.queued.0.1.0";
305pub const TESTSUITERUN_QUEUED_0_2_0: &str = "dev.cdevents.testsuiterun.queued.0.2.0";
306pub const TESTSUITERUN_STARTED_0_1_0: &str = "dev.cdevents.testsuiterun.started.0.1.0";
307pub const TESTSUITERUN_STARTED_0_2_0: &str = "dev.cdevents.testsuiterun.started.0.2.0";
308pub const TICKET_CLOSED_0_1_0: &str = "dev.cdevents.ticket.closed.0.1.0";
309pub const TICKET_CREATED_0_1_0: &str = "dev.cdevents.ticket.created.0.1.0";
310pub const TICKET_UPDATED_0_1_0: &str = "dev.cdevents.ticket.updated.0.1.0";
311
312#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
313#[serde(untagged)] pub enum Content {
315 ArtifactDeleted010(artifact_deleted_0_1_0::Content),
316 ArtifactDownloaded010(artifact_downloaded_0_1_0::Content),
317 ArtifactPackaged011(artifact_packaged_0_1_1::Content),
318 ArtifactPackaged020(artifact_packaged_0_2_0::Content),
319 ArtifactPublished011(artifact_published_0_1_1::Content),
320 ArtifactPublished020(artifact_published_0_2_0::Content),
321 ArtifactSigned010(artifact_signed_0_1_0::Content),
322 ArtifactSigned020(artifact_signed_0_2_0::Content),
323 BranchCreated012(branch_created_0_1_2::Content),
324 BranchCreated020(branch_created_0_2_0::Content),
325 BranchDeleted012(branch_deleted_0_1_2::Content),
326 BranchDeleted020(branch_deleted_0_2_0::Content),
327 BuildFinished011(build_finished_0_1_1::Content),
328 BuildFinished020(build_finished_0_2_0::Content),
329 BuildQueued011(build_queued_0_1_1::Content),
330 BuildQueued020(build_queued_0_2_0::Content),
331 BuildStarted011(build_started_0_1_1::Content),
332 BuildStarted020(build_started_0_2_0::Content),
333 ChangeAbandoned012(change_abandoned_0_1_2::Content),
334 ChangeAbandoned020(change_abandoned_0_2_0::Content),
335 ChangeCreated012(change_created_0_1_2::Content),
336 ChangeCreated030(change_created_0_3_0::Content),
337 ChangeMerged012(change_merged_0_1_2::Content),
338 ChangeMerged020(change_merged_0_2_0::Content),
339 ChangeReviewed012(change_reviewed_0_1_2::Content),
340 ChangeReviewed020(change_reviewed_0_2_0::Content),
341 ChangeUpdated012(change_updated_0_1_2::Content),
342 ChangeUpdated020(change_updated_0_2_0::Content),
343 EnvironmentCreated011(environment_created_0_1_1::Content),
344 EnvironmentCreated020(environment_created_0_2_0::Content),
345 EnvironmentDeleted011(environment_deleted_0_1_1::Content),
346 EnvironmentDeleted020(environment_deleted_0_2_0::Content),
347 EnvironmentModified011(environment_modified_0_1_1::Content),
348 EnvironmentModified020(environment_modified_0_2_0::Content),
349 IncidentDetected010(incident_detected_0_1_0::Content),
350 IncidentDetected020(incident_detected_0_2_0::Content),
351 IncidentReported010(incident_reported_0_1_0::Content),
352 IncidentReported020(incident_reported_0_2_0::Content),
353 IncidentResolved010(incident_resolved_0_1_0::Content),
354 IncidentResolved020(incident_resolved_0_2_0::Content),
355 PipelinerunFinished011(pipelinerun_finished_0_1_1::Content),
356 PipelinerunFinished020(pipelinerun_finished_0_2_0::Content),
357 PipelinerunQueued011(pipelinerun_queued_0_1_1::Content),
358 PipelinerunQueued020(pipelinerun_queued_0_2_0::Content),
359 PipelinerunStarted011(pipelinerun_started_0_1_1::Content),
360 PipelinerunStarted020(pipelinerun_started_0_2_0::Content),
361 RepositoryCreated011(repository_created_0_1_1::Content),
362 RepositoryCreated020(repository_created_0_2_0::Content),
363 RepositoryDeleted011(repository_deleted_0_1_1::Content),
364 RepositoryDeleted020(repository_deleted_0_2_0::Content),
365 RepositoryModified011(repository_modified_0_1_1::Content),
366 RepositoryModified020(repository_modified_0_2_0::Content),
367 ServiceDeployed011(service_deployed_0_1_1::Content),
368 ServiceDeployed020(service_deployed_0_2_0::Content),
369 ServicePublished011(service_published_0_1_1::Content),
370 ServicePublished020(service_published_0_2_0::Content),
371 ServiceRemoved011(service_removed_0_1_1::Content),
372 ServiceRemoved020(service_removed_0_2_0::Content),
373 ServiceRolledback011(service_rolledback_0_1_1::Content),
374 ServiceRolledback020(service_rolledback_0_2_0::Content),
375 ServiceUpgraded011(service_upgraded_0_1_1::Content),
376 ServiceUpgraded020(service_upgraded_0_2_0::Content),
377 TaskrunFinished011(taskrun_finished_0_1_1::Content),
378 TaskrunFinished020(taskrun_finished_0_2_0::Content),
379 TaskrunStarted011(taskrun_started_0_1_1::Content),
380 TaskrunStarted020(taskrun_started_0_2_0::Content),
381 TestcaserunFinished010(testcaserun_finished_0_1_0::Content),
382 TestcaserunFinished020(testcaserun_finished_0_2_0::Content),
383 TestcaserunQueued010(testcaserun_queued_0_1_0::Content),
384 TestcaserunQueued020(testcaserun_queued_0_2_0::Content),
385 TestcaserunSkipped010(testcaserun_skipped_0_1_0::Content),
386 TestcaserunStarted010(testcaserun_started_0_1_0::Content),
387 TestcaserunStarted020(testcaserun_started_0_2_0::Content),
388 TestoutputPublished010(testoutput_published_0_1_0::Content),
389 TestoutputPublished020(testoutput_published_0_2_0::Content),
390 TestsuiterunFinished010(testsuiterun_finished_0_1_0::Content),
391 TestsuiterunFinished020(testsuiterun_finished_0_2_0::Content),
392 TestsuiterunQueued010(testsuiterun_queued_0_1_0::Content),
393 TestsuiterunQueued020(testsuiterun_queued_0_2_0::Content),
394 TestsuiterunStarted010(testsuiterun_started_0_1_0::Content),
395 TestsuiterunStarted020(testsuiterun_started_0_2_0::Content),
396 TicketClosed010(ticket_closed_0_1_0::Content),
397 TicketCreated010(ticket_created_0_1_0::Content),
398 TicketUpdated010(ticket_updated_0_1_0::Content),
399 Custom{
400 #[serde(skip)]
401 ty: String,
402 #[serde(flatten)]
403 json: serde_json::Value,
404 },
405}
406
407impl Content {
408 pub fn from_json(ty: &str, json: serde_json::Value) -> Result<Self, serde_json::Error>{
409 match ty {
410 ARTIFACT_DELETED_0_1_0 => {
411 let variant: artifact_deleted_0_1_0::Content = serde_json::from_value(json)?;
412 Ok(variant.into())
413 },
414 ARTIFACT_DOWNLOADED_0_1_0 => {
415 let variant: artifact_downloaded_0_1_0::Content = serde_json::from_value(json)?;
416 Ok(variant.into())
417 },
418 ARTIFACT_PACKAGED_0_1_1 => {
419 let variant: artifact_packaged_0_1_1::Content = serde_json::from_value(json)?;
420 Ok(variant.into())
421 },
422 ARTIFACT_PACKAGED_0_2_0 => {
423 let variant: artifact_packaged_0_2_0::Content = serde_json::from_value(json)?;
424 Ok(variant.into())
425 },
426 ARTIFACT_PUBLISHED_0_1_1 => {
427 let variant: artifact_published_0_1_1::Content = serde_json::from_value(json)?;
428 Ok(variant.into())
429 },
430 ARTIFACT_PUBLISHED_0_2_0 => {
431 let variant: artifact_published_0_2_0::Content = serde_json::from_value(json)?;
432 Ok(variant.into())
433 },
434 ARTIFACT_SIGNED_0_1_0 => {
435 let variant: artifact_signed_0_1_0::Content = serde_json::from_value(json)?;
436 Ok(variant.into())
437 },
438 ARTIFACT_SIGNED_0_2_0 => {
439 let variant: artifact_signed_0_2_0::Content = serde_json::from_value(json)?;
440 Ok(variant.into())
441 },
442 BRANCH_CREATED_0_1_2 => {
443 let variant: branch_created_0_1_2::Content = serde_json::from_value(json)?;
444 Ok(variant.into())
445 },
446 BRANCH_CREATED_0_2_0 => {
447 let variant: branch_created_0_2_0::Content = serde_json::from_value(json)?;
448 Ok(variant.into())
449 },
450 BRANCH_DELETED_0_1_2 => {
451 let variant: branch_deleted_0_1_2::Content = serde_json::from_value(json)?;
452 Ok(variant.into())
453 },
454 BRANCH_DELETED_0_2_0 => {
455 let variant: branch_deleted_0_2_0::Content = serde_json::from_value(json)?;
456 Ok(variant.into())
457 },
458 BUILD_FINISHED_0_1_1 => {
459 let variant: build_finished_0_1_1::Content = serde_json::from_value(json)?;
460 Ok(variant.into())
461 },
462 BUILD_FINISHED_0_2_0 => {
463 let variant: build_finished_0_2_0::Content = serde_json::from_value(json)?;
464 Ok(variant.into())
465 },
466 BUILD_QUEUED_0_1_1 => {
467 let variant: build_queued_0_1_1::Content = serde_json::from_value(json)?;
468 Ok(variant.into())
469 },
470 BUILD_QUEUED_0_2_0 => {
471 let variant: build_queued_0_2_0::Content = serde_json::from_value(json)?;
472 Ok(variant.into())
473 },
474 BUILD_STARTED_0_1_1 => {
475 let variant: build_started_0_1_1::Content = serde_json::from_value(json)?;
476 Ok(variant.into())
477 },
478 BUILD_STARTED_0_2_0 => {
479 let variant: build_started_0_2_0::Content = serde_json::from_value(json)?;
480 Ok(variant.into())
481 },
482 CHANGE_ABANDONED_0_1_2 => {
483 let variant: change_abandoned_0_1_2::Content = serde_json::from_value(json)?;
484 Ok(variant.into())
485 },
486 CHANGE_ABANDONED_0_2_0 => {
487 let variant: change_abandoned_0_2_0::Content = serde_json::from_value(json)?;
488 Ok(variant.into())
489 },
490 CHANGE_CREATED_0_1_2 => {
491 let variant: change_created_0_1_2::Content = serde_json::from_value(json)?;
492 Ok(variant.into())
493 },
494 CHANGE_CREATED_0_3_0 => {
495 let variant: change_created_0_3_0::Content = serde_json::from_value(json)?;
496 Ok(variant.into())
497 },
498 CHANGE_MERGED_0_1_2 => {
499 let variant: change_merged_0_1_2::Content = serde_json::from_value(json)?;
500 Ok(variant.into())
501 },
502 CHANGE_MERGED_0_2_0 => {
503 let variant: change_merged_0_2_0::Content = serde_json::from_value(json)?;
504 Ok(variant.into())
505 },
506 CHANGE_REVIEWED_0_1_2 => {
507 let variant: change_reviewed_0_1_2::Content = serde_json::from_value(json)?;
508 Ok(variant.into())
509 },
510 CHANGE_REVIEWED_0_2_0 => {
511 let variant: change_reviewed_0_2_0::Content = serde_json::from_value(json)?;
512 Ok(variant.into())
513 },
514 CHANGE_UPDATED_0_1_2 => {
515 let variant: change_updated_0_1_2::Content = serde_json::from_value(json)?;
516 Ok(variant.into())
517 },
518 CHANGE_UPDATED_0_2_0 => {
519 let variant: change_updated_0_2_0::Content = serde_json::from_value(json)?;
520 Ok(variant.into())
521 },
522 ENVIRONMENT_CREATED_0_1_1 => {
523 let variant: environment_created_0_1_1::Content = serde_json::from_value(json)?;
524 Ok(variant.into())
525 },
526 ENVIRONMENT_CREATED_0_2_0 => {
527 let variant: environment_created_0_2_0::Content = serde_json::from_value(json)?;
528 Ok(variant.into())
529 },
530 ENVIRONMENT_DELETED_0_1_1 => {
531 let variant: environment_deleted_0_1_1::Content = serde_json::from_value(json)?;
532 Ok(variant.into())
533 },
534 ENVIRONMENT_DELETED_0_2_0 => {
535 let variant: environment_deleted_0_2_0::Content = serde_json::from_value(json)?;
536 Ok(variant.into())
537 },
538 ENVIRONMENT_MODIFIED_0_1_1 => {
539 let variant: environment_modified_0_1_1::Content = serde_json::from_value(json)?;
540 Ok(variant.into())
541 },
542 ENVIRONMENT_MODIFIED_0_2_0 => {
543 let variant: environment_modified_0_2_0::Content = serde_json::from_value(json)?;
544 Ok(variant.into())
545 },
546 INCIDENT_DETECTED_0_1_0 => {
547 let variant: incident_detected_0_1_0::Content = serde_json::from_value(json)?;
548 Ok(variant.into())
549 },
550 INCIDENT_DETECTED_0_2_0 => {
551 let variant: incident_detected_0_2_0::Content = serde_json::from_value(json)?;
552 Ok(variant.into())
553 },
554 INCIDENT_REPORTED_0_1_0 => {
555 let variant: incident_reported_0_1_0::Content = serde_json::from_value(json)?;
556 Ok(variant.into())
557 },
558 INCIDENT_REPORTED_0_2_0 => {
559 let variant: incident_reported_0_2_0::Content = serde_json::from_value(json)?;
560 Ok(variant.into())
561 },
562 INCIDENT_RESOLVED_0_1_0 => {
563 let variant: incident_resolved_0_1_0::Content = serde_json::from_value(json)?;
564 Ok(variant.into())
565 },
566 INCIDENT_RESOLVED_0_2_0 => {
567 let variant: incident_resolved_0_2_0::Content = serde_json::from_value(json)?;
568 Ok(variant.into())
569 },
570 PIPELINERUN_FINISHED_0_1_1 => {
571 let variant: pipelinerun_finished_0_1_1::Content = serde_json::from_value(json)?;
572 Ok(variant.into())
573 },
574 PIPELINERUN_FINISHED_0_2_0 => {
575 let variant: pipelinerun_finished_0_2_0::Content = serde_json::from_value(json)?;
576 Ok(variant.into())
577 },
578 PIPELINERUN_QUEUED_0_1_1 => {
579 let variant: pipelinerun_queued_0_1_1::Content = serde_json::from_value(json)?;
580 Ok(variant.into())
581 },
582 PIPELINERUN_QUEUED_0_2_0 => {
583 let variant: pipelinerun_queued_0_2_0::Content = serde_json::from_value(json)?;
584 Ok(variant.into())
585 },
586 PIPELINERUN_STARTED_0_1_1 => {
587 let variant: pipelinerun_started_0_1_1::Content = serde_json::from_value(json)?;
588 Ok(variant.into())
589 },
590 PIPELINERUN_STARTED_0_2_0 => {
591 let variant: pipelinerun_started_0_2_0::Content = serde_json::from_value(json)?;
592 Ok(variant.into())
593 },
594 REPOSITORY_CREATED_0_1_1 => {
595 let variant: repository_created_0_1_1::Content = serde_json::from_value(json)?;
596 Ok(variant.into())
597 },
598 REPOSITORY_CREATED_0_2_0 => {
599 let variant: repository_created_0_2_0::Content = serde_json::from_value(json)?;
600 Ok(variant.into())
601 },
602 REPOSITORY_DELETED_0_1_1 => {
603 let variant: repository_deleted_0_1_1::Content = serde_json::from_value(json)?;
604 Ok(variant.into())
605 },
606 REPOSITORY_DELETED_0_2_0 => {
607 let variant: repository_deleted_0_2_0::Content = serde_json::from_value(json)?;
608 Ok(variant.into())
609 },
610 REPOSITORY_MODIFIED_0_1_1 => {
611 let variant: repository_modified_0_1_1::Content = serde_json::from_value(json)?;
612 Ok(variant.into())
613 },
614 REPOSITORY_MODIFIED_0_2_0 => {
615 let variant: repository_modified_0_2_0::Content = serde_json::from_value(json)?;
616 Ok(variant.into())
617 },
618 SERVICE_DEPLOYED_0_1_1 => {
619 let variant: service_deployed_0_1_1::Content = serde_json::from_value(json)?;
620 Ok(variant.into())
621 },
622 SERVICE_DEPLOYED_0_2_0 => {
623 let variant: service_deployed_0_2_0::Content = serde_json::from_value(json)?;
624 Ok(variant.into())
625 },
626 SERVICE_PUBLISHED_0_1_1 => {
627 let variant: service_published_0_1_1::Content = serde_json::from_value(json)?;
628 Ok(variant.into())
629 },
630 SERVICE_PUBLISHED_0_2_0 => {
631 let variant: service_published_0_2_0::Content = serde_json::from_value(json)?;
632 Ok(variant.into())
633 },
634 SERVICE_REMOVED_0_1_1 => {
635 let variant: service_removed_0_1_1::Content = serde_json::from_value(json)?;
636 Ok(variant.into())
637 },
638 SERVICE_REMOVED_0_2_0 => {
639 let variant: service_removed_0_2_0::Content = serde_json::from_value(json)?;
640 Ok(variant.into())
641 },
642 SERVICE_ROLLEDBACK_0_1_1 => {
643 let variant: service_rolledback_0_1_1::Content = serde_json::from_value(json)?;
644 Ok(variant.into())
645 },
646 SERVICE_ROLLEDBACK_0_2_0 => {
647 let variant: service_rolledback_0_2_0::Content = serde_json::from_value(json)?;
648 Ok(variant.into())
649 },
650 SERVICE_UPGRADED_0_1_1 => {
651 let variant: service_upgraded_0_1_1::Content = serde_json::from_value(json)?;
652 Ok(variant.into())
653 },
654 SERVICE_UPGRADED_0_2_0 => {
655 let variant: service_upgraded_0_2_0::Content = serde_json::from_value(json)?;
656 Ok(variant.into())
657 },
658 TASKRUN_FINISHED_0_1_1 => {
659 let variant: taskrun_finished_0_1_1::Content = serde_json::from_value(json)?;
660 Ok(variant.into())
661 },
662 TASKRUN_FINISHED_0_2_0 => {
663 let variant: taskrun_finished_0_2_0::Content = serde_json::from_value(json)?;
664 Ok(variant.into())
665 },
666 TASKRUN_STARTED_0_1_1 => {
667 let variant: taskrun_started_0_1_1::Content = serde_json::from_value(json)?;
668 Ok(variant.into())
669 },
670 TASKRUN_STARTED_0_2_0 => {
671 let variant: taskrun_started_0_2_0::Content = serde_json::from_value(json)?;
672 Ok(variant.into())
673 },
674 TESTCASERUN_FINISHED_0_1_0 => {
675 let variant: testcaserun_finished_0_1_0::Content = serde_json::from_value(json)?;
676 Ok(variant.into())
677 },
678 TESTCASERUN_FINISHED_0_2_0 => {
679 let variant: testcaserun_finished_0_2_0::Content = serde_json::from_value(json)?;
680 Ok(variant.into())
681 },
682 TESTCASERUN_QUEUED_0_1_0 => {
683 let variant: testcaserun_queued_0_1_0::Content = serde_json::from_value(json)?;
684 Ok(variant.into())
685 },
686 TESTCASERUN_QUEUED_0_2_0 => {
687 let variant: testcaserun_queued_0_2_0::Content = serde_json::from_value(json)?;
688 Ok(variant.into())
689 },
690 TESTCASERUN_SKIPPED_0_1_0 => {
691 let variant: testcaserun_skipped_0_1_0::Content = serde_json::from_value(json)?;
692 Ok(variant.into())
693 },
694 TESTCASERUN_STARTED_0_1_0 => {
695 let variant: testcaserun_started_0_1_0::Content = serde_json::from_value(json)?;
696 Ok(variant.into())
697 },
698 TESTCASERUN_STARTED_0_2_0 => {
699 let variant: testcaserun_started_0_2_0::Content = serde_json::from_value(json)?;
700 Ok(variant.into())
701 },
702 TESTOUTPUT_PUBLISHED_0_1_0 => {
703 let variant: testoutput_published_0_1_0::Content = serde_json::from_value(json)?;
704 Ok(variant.into())
705 },
706 TESTOUTPUT_PUBLISHED_0_2_0 => {
707 let variant: testoutput_published_0_2_0::Content = serde_json::from_value(json)?;
708 Ok(variant.into())
709 },
710 TESTSUITERUN_FINISHED_0_1_0 => {
711 let variant: testsuiterun_finished_0_1_0::Content = serde_json::from_value(json)?;
712 Ok(variant.into())
713 },
714 TESTSUITERUN_FINISHED_0_2_0 => {
715 let variant: testsuiterun_finished_0_2_0::Content = serde_json::from_value(json)?;
716 Ok(variant.into())
717 },
718 TESTSUITERUN_QUEUED_0_1_0 => {
719 let variant: testsuiterun_queued_0_1_0::Content = serde_json::from_value(json)?;
720 Ok(variant.into())
721 },
722 TESTSUITERUN_QUEUED_0_2_0 => {
723 let variant: testsuiterun_queued_0_2_0::Content = serde_json::from_value(json)?;
724 Ok(variant.into())
725 },
726 TESTSUITERUN_STARTED_0_1_0 => {
727 let variant: testsuiterun_started_0_1_0::Content = serde_json::from_value(json)?;
728 Ok(variant.into())
729 },
730 TESTSUITERUN_STARTED_0_2_0 => {
731 let variant: testsuiterun_started_0_2_0::Content = serde_json::from_value(json)?;
732 Ok(variant.into())
733 },
734 TICKET_CLOSED_0_1_0 => {
735 let variant: ticket_closed_0_1_0::Content = serde_json::from_value(json)?;
736 Ok(variant.into())
737 },
738 TICKET_CREATED_0_1_0 => {
739 let variant: ticket_created_0_1_0::Content = serde_json::from_value(json)?;
740 Ok(variant.into())
741 },
742 TICKET_UPDATED_0_1_0 => {
743 let variant: ticket_updated_0_1_0::Content = serde_json::from_value(json)?;
744 Ok(variant.into())
745 },
746 variant => if variant.starts_with("dev.cdeventsx.") {
747 Ok(Self::Custom{ ty: ty.to_string(), json })
748 } else {
749 Err(serde_json::Error::custom(format_args!(
750 "unknown variant `{}`, expected 'dev.cdevents.{{subject}}.{{predicate}}.{{version}}'",
751 variant,
752 )))
753 },
754 }
755 }
756
757 pub fn ty(&self) -> &str {
758 match self {
759 Self::ArtifactDeleted010(_) => ARTIFACT_DELETED_0_1_0,
760 Self::ArtifactDownloaded010(_) => ARTIFACT_DOWNLOADED_0_1_0,
761 Self::ArtifactPackaged011(_) => ARTIFACT_PACKAGED_0_1_1,
762 Self::ArtifactPackaged020(_) => ARTIFACT_PACKAGED_0_2_0,
763 Self::ArtifactPublished011(_) => ARTIFACT_PUBLISHED_0_1_1,
764 Self::ArtifactPublished020(_) => ARTIFACT_PUBLISHED_0_2_0,
765 Self::ArtifactSigned010(_) => ARTIFACT_SIGNED_0_1_0,
766 Self::ArtifactSigned020(_) => ARTIFACT_SIGNED_0_2_0,
767 Self::BranchCreated012(_) => BRANCH_CREATED_0_1_2,
768 Self::BranchCreated020(_) => BRANCH_CREATED_0_2_0,
769 Self::BranchDeleted012(_) => BRANCH_DELETED_0_1_2,
770 Self::BranchDeleted020(_) => BRANCH_DELETED_0_2_0,
771 Self::BuildFinished011(_) => BUILD_FINISHED_0_1_1,
772 Self::BuildFinished020(_) => BUILD_FINISHED_0_2_0,
773 Self::BuildQueued011(_) => BUILD_QUEUED_0_1_1,
774 Self::BuildQueued020(_) => BUILD_QUEUED_0_2_0,
775 Self::BuildStarted011(_) => BUILD_STARTED_0_1_1,
776 Self::BuildStarted020(_) => BUILD_STARTED_0_2_0,
777 Self::ChangeAbandoned012(_) => CHANGE_ABANDONED_0_1_2,
778 Self::ChangeAbandoned020(_) => CHANGE_ABANDONED_0_2_0,
779 Self::ChangeCreated012(_) => CHANGE_CREATED_0_1_2,
780 Self::ChangeCreated030(_) => CHANGE_CREATED_0_3_0,
781 Self::ChangeMerged012(_) => CHANGE_MERGED_0_1_2,
782 Self::ChangeMerged020(_) => CHANGE_MERGED_0_2_0,
783 Self::ChangeReviewed012(_) => CHANGE_REVIEWED_0_1_2,
784 Self::ChangeReviewed020(_) => CHANGE_REVIEWED_0_2_0,
785 Self::ChangeUpdated012(_) => CHANGE_UPDATED_0_1_2,
786 Self::ChangeUpdated020(_) => CHANGE_UPDATED_0_2_0,
787 Self::EnvironmentCreated011(_) => ENVIRONMENT_CREATED_0_1_1,
788 Self::EnvironmentCreated020(_) => ENVIRONMENT_CREATED_0_2_0,
789 Self::EnvironmentDeleted011(_) => ENVIRONMENT_DELETED_0_1_1,
790 Self::EnvironmentDeleted020(_) => ENVIRONMENT_DELETED_0_2_0,
791 Self::EnvironmentModified011(_) => ENVIRONMENT_MODIFIED_0_1_1,
792 Self::EnvironmentModified020(_) => ENVIRONMENT_MODIFIED_0_2_0,
793 Self::IncidentDetected010(_) => INCIDENT_DETECTED_0_1_0,
794 Self::IncidentDetected020(_) => INCIDENT_DETECTED_0_2_0,
795 Self::IncidentReported010(_) => INCIDENT_REPORTED_0_1_0,
796 Self::IncidentReported020(_) => INCIDENT_REPORTED_0_2_0,
797 Self::IncidentResolved010(_) => INCIDENT_RESOLVED_0_1_0,
798 Self::IncidentResolved020(_) => INCIDENT_RESOLVED_0_2_0,
799 Self::PipelinerunFinished011(_) => PIPELINERUN_FINISHED_0_1_1,
800 Self::PipelinerunFinished020(_) => PIPELINERUN_FINISHED_0_2_0,
801 Self::PipelinerunQueued011(_) => PIPELINERUN_QUEUED_0_1_1,
802 Self::PipelinerunQueued020(_) => PIPELINERUN_QUEUED_0_2_0,
803 Self::PipelinerunStarted011(_) => PIPELINERUN_STARTED_0_1_1,
804 Self::PipelinerunStarted020(_) => PIPELINERUN_STARTED_0_2_0,
805 Self::RepositoryCreated011(_) => REPOSITORY_CREATED_0_1_1,
806 Self::RepositoryCreated020(_) => REPOSITORY_CREATED_0_2_0,
807 Self::RepositoryDeleted011(_) => REPOSITORY_DELETED_0_1_1,
808 Self::RepositoryDeleted020(_) => REPOSITORY_DELETED_0_2_0,
809 Self::RepositoryModified011(_) => REPOSITORY_MODIFIED_0_1_1,
810 Self::RepositoryModified020(_) => REPOSITORY_MODIFIED_0_2_0,
811 Self::ServiceDeployed011(_) => SERVICE_DEPLOYED_0_1_1,
812 Self::ServiceDeployed020(_) => SERVICE_DEPLOYED_0_2_0,
813 Self::ServicePublished011(_) => SERVICE_PUBLISHED_0_1_1,
814 Self::ServicePublished020(_) => SERVICE_PUBLISHED_0_2_0,
815 Self::ServiceRemoved011(_) => SERVICE_REMOVED_0_1_1,
816 Self::ServiceRemoved020(_) => SERVICE_REMOVED_0_2_0,
817 Self::ServiceRolledback011(_) => SERVICE_ROLLEDBACK_0_1_1,
818 Self::ServiceRolledback020(_) => SERVICE_ROLLEDBACK_0_2_0,
819 Self::ServiceUpgraded011(_) => SERVICE_UPGRADED_0_1_1,
820 Self::ServiceUpgraded020(_) => SERVICE_UPGRADED_0_2_0,
821 Self::TaskrunFinished011(_) => TASKRUN_FINISHED_0_1_1,
822 Self::TaskrunFinished020(_) => TASKRUN_FINISHED_0_2_0,
823 Self::TaskrunStarted011(_) => TASKRUN_STARTED_0_1_1,
824 Self::TaskrunStarted020(_) => TASKRUN_STARTED_0_2_0,
825 Self::TestcaserunFinished010(_) => TESTCASERUN_FINISHED_0_1_0,
826 Self::TestcaserunFinished020(_) => TESTCASERUN_FINISHED_0_2_0,
827 Self::TestcaserunQueued010(_) => TESTCASERUN_QUEUED_0_1_0,
828 Self::TestcaserunQueued020(_) => TESTCASERUN_QUEUED_0_2_0,
829 Self::TestcaserunSkipped010(_) => TESTCASERUN_SKIPPED_0_1_0,
830 Self::TestcaserunStarted010(_) => TESTCASERUN_STARTED_0_1_0,
831 Self::TestcaserunStarted020(_) => TESTCASERUN_STARTED_0_2_0,
832 Self::TestoutputPublished010(_) => TESTOUTPUT_PUBLISHED_0_1_0,
833 Self::TestoutputPublished020(_) => TESTOUTPUT_PUBLISHED_0_2_0,
834 Self::TestsuiterunFinished010(_) => TESTSUITERUN_FINISHED_0_1_0,
835 Self::TestsuiterunFinished020(_) => TESTSUITERUN_FINISHED_0_2_0,
836 Self::TestsuiterunQueued010(_) => TESTSUITERUN_QUEUED_0_1_0,
837 Self::TestsuiterunQueued020(_) => TESTSUITERUN_QUEUED_0_2_0,
838 Self::TestsuiterunStarted010(_) => TESTSUITERUN_STARTED_0_1_0,
839 Self::TestsuiterunStarted020(_) => TESTSUITERUN_STARTED_0_2_0,
840 Self::TicketClosed010(_) => TICKET_CLOSED_0_1_0,
841 Self::TicketCreated010(_) => TICKET_CREATED_0_1_0,
842 Self::TicketUpdated010(_) => TICKET_UPDATED_0_1_0,
843 Self::Custom{ty, ..} => ty,
844 }
845 }
846
847 pub fn subject(&self) -> &str {
848 match self {
849 Self::ArtifactDeleted010(_) => "artifact",
850 Self::ArtifactDownloaded010(_) => "artifact",
851 Self::ArtifactPackaged011(_) => "artifact",
852 Self::ArtifactPackaged020(_) => "artifact",
853 Self::ArtifactPublished011(_) => "artifact",
854 Self::ArtifactPublished020(_) => "artifact",
855 Self::ArtifactSigned010(_) => "artifact",
856 Self::ArtifactSigned020(_) => "artifact",
857 Self::BranchCreated012(_) => "branch",
858 Self::BranchCreated020(_) => "branch",
859 Self::BranchDeleted012(_) => "branch",
860 Self::BranchDeleted020(_) => "branch",
861 Self::BuildFinished011(_) => "build",
862 Self::BuildFinished020(_) => "build",
863 Self::BuildQueued011(_) => "build",
864 Self::BuildQueued020(_) => "build",
865 Self::BuildStarted011(_) => "build",
866 Self::BuildStarted020(_) => "build",
867 Self::ChangeAbandoned012(_) => "change",
868 Self::ChangeAbandoned020(_) => "change",
869 Self::ChangeCreated012(_) => "change",
870 Self::ChangeCreated030(_) => "change",
871 Self::ChangeMerged012(_) => "change",
872 Self::ChangeMerged020(_) => "change",
873 Self::ChangeReviewed012(_) => "change",
874 Self::ChangeReviewed020(_) => "change",
875 Self::ChangeUpdated012(_) => "change",
876 Self::ChangeUpdated020(_) => "change",
877 Self::EnvironmentCreated011(_) => "environment",
878 Self::EnvironmentCreated020(_) => "environment",
879 Self::EnvironmentDeleted011(_) => "environment",
880 Self::EnvironmentDeleted020(_) => "environment",
881 Self::EnvironmentModified011(_) => "environment",
882 Self::EnvironmentModified020(_) => "environment",
883 Self::IncidentDetected010(_) => "incident",
884 Self::IncidentDetected020(_) => "incident",
885 Self::IncidentReported010(_) => "incident",
886 Self::IncidentReported020(_) => "incident",
887 Self::IncidentResolved010(_) => "incident",
888 Self::IncidentResolved020(_) => "incident",
889 Self::PipelinerunFinished011(_) => "pipelineRun",
890 Self::PipelinerunFinished020(_) => "pipelineRun",
891 Self::PipelinerunQueued011(_) => "pipelineRun",
892 Self::PipelinerunQueued020(_) => "pipelineRun",
893 Self::PipelinerunStarted011(_) => "pipelineRun",
894 Self::PipelinerunStarted020(_) => "pipelineRun",
895 Self::RepositoryCreated011(_) => "repository",
896 Self::RepositoryCreated020(_) => "repository",
897 Self::RepositoryDeleted011(_) => "repository",
898 Self::RepositoryDeleted020(_) => "repository",
899 Self::RepositoryModified011(_) => "repository",
900 Self::RepositoryModified020(_) => "repository",
901 Self::ServiceDeployed011(_) => "service",
902 Self::ServiceDeployed020(_) => "service",
903 Self::ServicePublished011(_) => "service",
904 Self::ServicePublished020(_) => "service",
905 Self::ServiceRemoved011(_) => "service",
906 Self::ServiceRemoved020(_) => "service",
907 Self::ServiceRolledback011(_) => "service",
908 Self::ServiceRolledback020(_) => "service",
909 Self::ServiceUpgraded011(_) => "service",
910 Self::ServiceUpgraded020(_) => "service",
911 Self::TaskrunFinished011(_) => "taskRun",
912 Self::TaskrunFinished020(_) => "taskRun",
913 Self::TaskrunStarted011(_) => "taskRun",
914 Self::TaskrunStarted020(_) => "taskRun",
915 Self::TestcaserunFinished010(_) => "testCaseRun",
916 Self::TestcaserunFinished020(_) => "testCaseRun",
917 Self::TestcaserunQueued010(_) => "testCaseRun",
918 Self::TestcaserunQueued020(_) => "testCaseRun",
919 Self::TestcaserunSkipped010(_) => "testCaseRun",
920 Self::TestcaserunStarted010(_) => "testCaseRun",
921 Self::TestcaserunStarted020(_) => "testCaseRun",
922 Self::TestoutputPublished010(_) => "testOutput",
923 Self::TestoutputPublished020(_) => "testOutput",
924 Self::TestsuiterunFinished010(_) => "testSuiteRun",
925 Self::TestsuiterunFinished020(_) => "testSuiteRun",
926 Self::TestsuiterunQueued010(_) => "testSuiteRun",
927 Self::TestsuiterunQueued020(_) => "testSuiteRun",
928 Self::TestsuiterunStarted010(_) => "testSuiteRun",
929 Self::TestsuiterunStarted020(_) => "testSuiteRun",
930 Self::TicketClosed010(_) => "ticket",
931 Self::TicketCreated010(_) => "ticket",
932 Self::TicketUpdated010(_) => "ticket",
933 Self::Custom{ty, ..} => ty.split('.').nth(2).unwrap_or_default(),
934 }
935 }
936
937 pub fn predicate(&self) -> &str {
938 match self {
939 Self::ArtifactDeleted010(_) => "deleted",
940 Self::ArtifactDownloaded010(_) => "downloaded",
941 Self::ArtifactPackaged011(_) => "packaged",
942 Self::ArtifactPackaged020(_) => "packaged",
943 Self::ArtifactPublished011(_) => "published",
944 Self::ArtifactPublished020(_) => "published",
945 Self::ArtifactSigned010(_) => "signed",
946 Self::ArtifactSigned020(_) => "signed",
947 Self::BranchCreated012(_) => "created",
948 Self::BranchCreated020(_) => "created",
949 Self::BranchDeleted012(_) => "deleted",
950 Self::BranchDeleted020(_) => "deleted",
951 Self::BuildFinished011(_) => "finished",
952 Self::BuildFinished020(_) => "finished",
953 Self::BuildQueued011(_) => "queued",
954 Self::BuildQueued020(_) => "queued",
955 Self::BuildStarted011(_) => "started",
956 Self::BuildStarted020(_) => "started",
957 Self::ChangeAbandoned012(_) => "abandoned",
958 Self::ChangeAbandoned020(_) => "abandoned",
959 Self::ChangeCreated012(_) => "created",
960 Self::ChangeCreated030(_) => "created",
961 Self::ChangeMerged012(_) => "merged",
962 Self::ChangeMerged020(_) => "merged",
963 Self::ChangeReviewed012(_) => "reviewed",
964 Self::ChangeReviewed020(_) => "reviewed",
965 Self::ChangeUpdated012(_) => "updated",
966 Self::ChangeUpdated020(_) => "updated",
967 Self::EnvironmentCreated011(_) => "created",
968 Self::EnvironmentCreated020(_) => "created",
969 Self::EnvironmentDeleted011(_) => "deleted",
970 Self::EnvironmentDeleted020(_) => "deleted",
971 Self::EnvironmentModified011(_) => "modified",
972 Self::EnvironmentModified020(_) => "modified",
973 Self::IncidentDetected010(_) => "detected",
974 Self::IncidentDetected020(_) => "detected",
975 Self::IncidentReported010(_) => "reported",
976 Self::IncidentReported020(_) => "reported",
977 Self::IncidentResolved010(_) => "resolved",
978 Self::IncidentResolved020(_) => "resolved",
979 Self::PipelinerunFinished011(_) => "finished",
980 Self::PipelinerunFinished020(_) => "finished",
981 Self::PipelinerunQueued011(_) => "queued",
982 Self::PipelinerunQueued020(_) => "queued",
983 Self::PipelinerunStarted011(_) => "started",
984 Self::PipelinerunStarted020(_) => "started",
985 Self::RepositoryCreated011(_) => "created",
986 Self::RepositoryCreated020(_) => "created",
987 Self::RepositoryDeleted011(_) => "deleted",
988 Self::RepositoryDeleted020(_) => "deleted",
989 Self::RepositoryModified011(_) => "modified",
990 Self::RepositoryModified020(_) => "modified",
991 Self::ServiceDeployed011(_) => "deployed",
992 Self::ServiceDeployed020(_) => "deployed",
993 Self::ServicePublished011(_) => "published",
994 Self::ServicePublished020(_) => "published",
995 Self::ServiceRemoved011(_) => "removed",
996 Self::ServiceRemoved020(_) => "removed",
997 Self::ServiceRolledback011(_) => "rolledback",
998 Self::ServiceRolledback020(_) => "rolledback",
999 Self::ServiceUpgraded011(_) => "upgraded",
1000 Self::ServiceUpgraded020(_) => "upgraded",
1001 Self::TaskrunFinished011(_) => "finished",
1002 Self::TaskrunFinished020(_) => "finished",
1003 Self::TaskrunStarted011(_) => "started",
1004 Self::TaskrunStarted020(_) => "started",
1005 Self::TestcaserunFinished010(_) => "finished",
1006 Self::TestcaserunFinished020(_) => "finished",
1007 Self::TestcaserunQueued010(_) => "queued",
1008 Self::TestcaserunQueued020(_) => "queued",
1009 Self::TestcaserunSkipped010(_) => "skipped",
1010 Self::TestcaserunStarted010(_) => "started",
1011 Self::TestcaserunStarted020(_) => "started",
1012 Self::TestoutputPublished010(_) => "published",
1013 Self::TestoutputPublished020(_) => "published",
1014 Self::TestsuiterunFinished010(_) => "finished",
1015 Self::TestsuiterunFinished020(_) => "finished",
1016 Self::TestsuiterunQueued010(_) => "queued",
1017 Self::TestsuiterunQueued020(_) => "queued",
1018 Self::TestsuiterunStarted010(_) => "started",
1019 Self::TestsuiterunStarted020(_) => "started",
1020 Self::TicketClosed010(_) => "closed",
1021 Self::TicketCreated010(_) => "created",
1022 Self::TicketUpdated010(_) => "updated",
1023 Self::Custom{ty, ..} => ty.split('.').nth(3).unwrap_or_default(),
1024 }
1025 }
1026}
1027
1028pub fn extract_subject_predicate(ty: &str) -> Option<(&str, &str)>{
1031 match ty {
1033 ARTIFACT_DELETED_0_1_0 => Some(("artifact", "deleted")),
1034 ARTIFACT_DOWNLOADED_0_1_0 => Some(("artifact", "downloaded")),
1035 ARTIFACT_PACKAGED_0_1_1 => Some(("artifact", "packaged")),
1036 ARTIFACT_PACKAGED_0_2_0 => Some(("artifact", "packaged")),
1037 ARTIFACT_PUBLISHED_0_1_1 => Some(("artifact", "published")),
1038 ARTIFACT_PUBLISHED_0_2_0 => Some(("artifact", "published")),
1039 ARTIFACT_SIGNED_0_1_0 => Some(("artifact", "signed")),
1040 ARTIFACT_SIGNED_0_2_0 => Some(("artifact", "signed")),
1041 BRANCH_CREATED_0_1_2 => Some(("branch", "created")),
1042 BRANCH_CREATED_0_2_0 => Some(("branch", "created")),
1043 BRANCH_DELETED_0_1_2 => Some(("branch", "deleted")),
1044 BRANCH_DELETED_0_2_0 => Some(("branch", "deleted")),
1045 BUILD_FINISHED_0_1_1 => Some(("build", "finished")),
1046 BUILD_FINISHED_0_2_0 => Some(("build", "finished")),
1047 BUILD_QUEUED_0_1_1 => Some(("build", "queued")),
1048 BUILD_QUEUED_0_2_0 => Some(("build", "queued")),
1049 BUILD_STARTED_0_1_1 => Some(("build", "started")),
1050 BUILD_STARTED_0_2_0 => Some(("build", "started")),
1051 CHANGE_ABANDONED_0_1_2 => Some(("change", "abandoned")),
1052 CHANGE_ABANDONED_0_2_0 => Some(("change", "abandoned")),
1053 CHANGE_CREATED_0_1_2 => Some(("change", "created")),
1054 CHANGE_CREATED_0_3_0 => Some(("change", "created")),
1055 CHANGE_MERGED_0_1_2 => Some(("change", "merged")),
1056 CHANGE_MERGED_0_2_0 => Some(("change", "merged")),
1057 CHANGE_REVIEWED_0_1_2 => Some(("change", "reviewed")),
1058 CHANGE_REVIEWED_0_2_0 => Some(("change", "reviewed")),
1059 CHANGE_UPDATED_0_1_2 => Some(("change", "updated")),
1060 CHANGE_UPDATED_0_2_0 => Some(("change", "updated")),
1061 ENVIRONMENT_CREATED_0_1_1 => Some(("environment", "created")),
1062 ENVIRONMENT_CREATED_0_2_0 => Some(("environment", "created")),
1063 ENVIRONMENT_DELETED_0_1_1 => Some(("environment", "deleted")),
1064 ENVIRONMENT_DELETED_0_2_0 => Some(("environment", "deleted")),
1065 ENVIRONMENT_MODIFIED_0_1_1 => Some(("environment", "modified")),
1066 ENVIRONMENT_MODIFIED_0_2_0 => Some(("environment", "modified")),
1067 INCIDENT_DETECTED_0_1_0 => Some(("incident", "detected")),
1068 INCIDENT_DETECTED_0_2_0 => Some(("incident", "detected")),
1069 INCIDENT_REPORTED_0_1_0 => Some(("incident", "reported")),
1070 INCIDENT_REPORTED_0_2_0 => Some(("incident", "reported")),
1071 INCIDENT_RESOLVED_0_1_0 => Some(("incident", "resolved")),
1072 INCIDENT_RESOLVED_0_2_0 => Some(("incident", "resolved")),
1073 PIPELINERUN_FINISHED_0_1_1 => Some(("pipelineRun", "finished")),
1074 PIPELINERUN_FINISHED_0_2_0 => Some(("pipelineRun", "finished")),
1075 PIPELINERUN_QUEUED_0_1_1 => Some(("pipelineRun", "queued")),
1076 PIPELINERUN_QUEUED_0_2_0 => Some(("pipelineRun", "queued")),
1077 PIPELINERUN_STARTED_0_1_1 => Some(("pipelineRun", "started")),
1078 PIPELINERUN_STARTED_0_2_0 => Some(("pipelineRun", "started")),
1079 REPOSITORY_CREATED_0_1_1 => Some(("repository", "created")),
1080 REPOSITORY_CREATED_0_2_0 => Some(("repository", "created")),
1081 REPOSITORY_DELETED_0_1_1 => Some(("repository", "deleted")),
1082 REPOSITORY_DELETED_0_2_0 => Some(("repository", "deleted")),
1083 REPOSITORY_MODIFIED_0_1_1 => Some(("repository", "modified")),
1084 REPOSITORY_MODIFIED_0_2_0 => Some(("repository", "modified")),
1085 SERVICE_DEPLOYED_0_1_1 => Some(("service", "deployed")),
1086 SERVICE_DEPLOYED_0_2_0 => Some(("service", "deployed")),
1087 SERVICE_PUBLISHED_0_1_1 => Some(("service", "published")),
1088 SERVICE_PUBLISHED_0_2_0 => Some(("service", "published")),
1089 SERVICE_REMOVED_0_1_1 => Some(("service", "removed")),
1090 SERVICE_REMOVED_0_2_0 => Some(("service", "removed")),
1091 SERVICE_ROLLEDBACK_0_1_1 => Some(("service", "rolledback")),
1092 SERVICE_ROLLEDBACK_0_2_0 => Some(("service", "rolledback")),
1093 SERVICE_UPGRADED_0_1_1 => Some(("service", "upgraded")),
1094 SERVICE_UPGRADED_0_2_0 => Some(("service", "upgraded")),
1095 TASKRUN_FINISHED_0_1_1 => Some(("taskRun", "finished")),
1096 TASKRUN_FINISHED_0_2_0 => Some(("taskRun", "finished")),
1097 TASKRUN_STARTED_0_1_1 => Some(("taskRun", "started")),
1098 TASKRUN_STARTED_0_2_0 => Some(("taskRun", "started")),
1099 TESTCASERUN_FINISHED_0_1_0 => Some(("testCaseRun", "finished")),
1100 TESTCASERUN_FINISHED_0_2_0 => Some(("testCaseRun", "finished")),
1101 TESTCASERUN_QUEUED_0_1_0 => Some(("testCaseRun", "queued")),
1102 TESTCASERUN_QUEUED_0_2_0 => Some(("testCaseRun", "queued")),
1103 TESTCASERUN_SKIPPED_0_1_0 => Some(("testCaseRun", "skipped")),
1104 TESTCASERUN_STARTED_0_1_0 => Some(("testCaseRun", "started")),
1105 TESTCASERUN_STARTED_0_2_0 => Some(("testCaseRun", "started")),
1106 TESTOUTPUT_PUBLISHED_0_1_0 => Some(("testOutput", "published")),
1107 TESTOUTPUT_PUBLISHED_0_2_0 => Some(("testOutput", "published")),
1108 TESTSUITERUN_FINISHED_0_1_0 => Some(("testSuiteRun", "finished")),
1109 TESTSUITERUN_FINISHED_0_2_0 => Some(("testSuiteRun", "finished")),
1110 TESTSUITERUN_QUEUED_0_1_0 => Some(("testSuiteRun", "queued")),
1111 TESTSUITERUN_QUEUED_0_2_0 => Some(("testSuiteRun", "queued")),
1112 TESTSUITERUN_STARTED_0_1_0 => Some(("testSuiteRun", "started")),
1113 TESTSUITERUN_STARTED_0_2_0 => Some(("testSuiteRun", "started")),
1114 TICKET_CLOSED_0_1_0 => Some(("ticket", "closed")),
1115 TICKET_CREATED_0_1_0 => Some(("ticket", "created")),
1116 TICKET_UPDATED_0_1_0 => Some(("ticket", "updated")),
1117 _ => None,
1118 }
1119}
1120
1121impl From<artifact_deleted_0_1_0::Content> for Content {
1122 fn from(value: artifact_deleted_0_1_0::Content) -> Self {
1123 Self::ArtifactDeleted010(value)
1124 }
1125}
1126impl From<artifact_downloaded_0_1_0::Content> for Content {
1127 fn from(value: artifact_downloaded_0_1_0::Content) -> Self {
1128 Self::ArtifactDownloaded010(value)
1129 }
1130}
1131impl From<artifact_packaged_0_1_1::Content> for Content {
1132 fn from(value: artifact_packaged_0_1_1::Content) -> Self {
1133 Self::ArtifactPackaged011(value)
1134 }
1135}
1136impl From<artifact_packaged_0_2_0::Content> for Content {
1137 fn from(value: artifact_packaged_0_2_0::Content) -> Self {
1138 Self::ArtifactPackaged020(value)
1139 }
1140}
1141impl From<artifact_published_0_1_1::Content> for Content {
1142 fn from(value: artifact_published_0_1_1::Content) -> Self {
1143 Self::ArtifactPublished011(value)
1144 }
1145}
1146impl From<artifact_published_0_2_0::Content> for Content {
1147 fn from(value: artifact_published_0_2_0::Content) -> Self {
1148 Self::ArtifactPublished020(value)
1149 }
1150}
1151impl From<artifact_signed_0_1_0::Content> for Content {
1152 fn from(value: artifact_signed_0_1_0::Content) -> Self {
1153 Self::ArtifactSigned010(value)
1154 }
1155}
1156impl From<artifact_signed_0_2_0::Content> for Content {
1157 fn from(value: artifact_signed_0_2_0::Content) -> Self {
1158 Self::ArtifactSigned020(value)
1159 }
1160}
1161impl From<branch_created_0_1_2::Content> for Content {
1162 fn from(value: branch_created_0_1_2::Content) -> Self {
1163 Self::BranchCreated012(value)
1164 }
1165}
1166impl From<branch_created_0_2_0::Content> for Content {
1167 fn from(value: branch_created_0_2_0::Content) -> Self {
1168 Self::BranchCreated020(value)
1169 }
1170}
1171impl From<branch_deleted_0_1_2::Content> for Content {
1172 fn from(value: branch_deleted_0_1_2::Content) -> Self {
1173 Self::BranchDeleted012(value)
1174 }
1175}
1176impl From<branch_deleted_0_2_0::Content> for Content {
1177 fn from(value: branch_deleted_0_2_0::Content) -> Self {
1178 Self::BranchDeleted020(value)
1179 }
1180}
1181impl From<build_finished_0_1_1::Content> for Content {
1182 fn from(value: build_finished_0_1_1::Content) -> Self {
1183 Self::BuildFinished011(value)
1184 }
1185}
1186impl From<build_finished_0_2_0::Content> for Content {
1187 fn from(value: build_finished_0_2_0::Content) -> Self {
1188 Self::BuildFinished020(value)
1189 }
1190}
1191impl From<build_queued_0_1_1::Content> for Content {
1192 fn from(value: build_queued_0_1_1::Content) -> Self {
1193 Self::BuildQueued011(value)
1194 }
1195}
1196impl From<build_queued_0_2_0::Content> for Content {
1197 fn from(value: build_queued_0_2_0::Content) -> Self {
1198 Self::BuildQueued020(value)
1199 }
1200}
1201impl From<build_started_0_1_1::Content> for Content {
1202 fn from(value: build_started_0_1_1::Content) -> Self {
1203 Self::BuildStarted011(value)
1204 }
1205}
1206impl From<build_started_0_2_0::Content> for Content {
1207 fn from(value: build_started_0_2_0::Content) -> Self {
1208 Self::BuildStarted020(value)
1209 }
1210}
1211impl From<change_abandoned_0_1_2::Content> for Content {
1212 fn from(value: change_abandoned_0_1_2::Content) -> Self {
1213 Self::ChangeAbandoned012(value)
1214 }
1215}
1216impl From<change_abandoned_0_2_0::Content> for Content {
1217 fn from(value: change_abandoned_0_2_0::Content) -> Self {
1218 Self::ChangeAbandoned020(value)
1219 }
1220}
1221impl From<change_created_0_1_2::Content> for Content {
1222 fn from(value: change_created_0_1_2::Content) -> Self {
1223 Self::ChangeCreated012(value)
1224 }
1225}
1226impl From<change_created_0_3_0::Content> for Content {
1227 fn from(value: change_created_0_3_0::Content) -> Self {
1228 Self::ChangeCreated030(value)
1229 }
1230}
1231impl From<change_merged_0_1_2::Content> for Content {
1232 fn from(value: change_merged_0_1_2::Content) -> Self {
1233 Self::ChangeMerged012(value)
1234 }
1235}
1236impl From<change_merged_0_2_0::Content> for Content {
1237 fn from(value: change_merged_0_2_0::Content) -> Self {
1238 Self::ChangeMerged020(value)
1239 }
1240}
1241impl From<change_reviewed_0_1_2::Content> for Content {
1242 fn from(value: change_reviewed_0_1_2::Content) -> Self {
1243 Self::ChangeReviewed012(value)
1244 }
1245}
1246impl From<change_reviewed_0_2_0::Content> for Content {
1247 fn from(value: change_reviewed_0_2_0::Content) -> Self {
1248 Self::ChangeReviewed020(value)
1249 }
1250}
1251impl From<change_updated_0_1_2::Content> for Content {
1252 fn from(value: change_updated_0_1_2::Content) -> Self {
1253 Self::ChangeUpdated012(value)
1254 }
1255}
1256impl From<change_updated_0_2_0::Content> for Content {
1257 fn from(value: change_updated_0_2_0::Content) -> Self {
1258 Self::ChangeUpdated020(value)
1259 }
1260}
1261impl From<environment_created_0_1_1::Content> for Content {
1262 fn from(value: environment_created_0_1_1::Content) -> Self {
1263 Self::EnvironmentCreated011(value)
1264 }
1265}
1266impl From<environment_created_0_2_0::Content> for Content {
1267 fn from(value: environment_created_0_2_0::Content) -> Self {
1268 Self::EnvironmentCreated020(value)
1269 }
1270}
1271impl From<environment_deleted_0_1_1::Content> for Content {
1272 fn from(value: environment_deleted_0_1_1::Content) -> Self {
1273 Self::EnvironmentDeleted011(value)
1274 }
1275}
1276impl From<environment_deleted_0_2_0::Content> for Content {
1277 fn from(value: environment_deleted_0_2_0::Content) -> Self {
1278 Self::EnvironmentDeleted020(value)
1279 }
1280}
1281impl From<environment_modified_0_1_1::Content> for Content {
1282 fn from(value: environment_modified_0_1_1::Content) -> Self {
1283 Self::EnvironmentModified011(value)
1284 }
1285}
1286impl From<environment_modified_0_2_0::Content> for Content {
1287 fn from(value: environment_modified_0_2_0::Content) -> Self {
1288 Self::EnvironmentModified020(value)
1289 }
1290}
1291impl From<incident_detected_0_1_0::Content> for Content {
1292 fn from(value: incident_detected_0_1_0::Content) -> Self {
1293 Self::IncidentDetected010(value)
1294 }
1295}
1296impl From<incident_detected_0_2_0::Content> for Content {
1297 fn from(value: incident_detected_0_2_0::Content) -> Self {
1298 Self::IncidentDetected020(value)
1299 }
1300}
1301impl From<incident_reported_0_1_0::Content> for Content {
1302 fn from(value: incident_reported_0_1_0::Content) -> Self {
1303 Self::IncidentReported010(value)
1304 }
1305}
1306impl From<incident_reported_0_2_0::Content> for Content {
1307 fn from(value: incident_reported_0_2_0::Content) -> Self {
1308 Self::IncidentReported020(value)
1309 }
1310}
1311impl From<incident_resolved_0_1_0::Content> for Content {
1312 fn from(value: incident_resolved_0_1_0::Content) -> Self {
1313 Self::IncidentResolved010(value)
1314 }
1315}
1316impl From<incident_resolved_0_2_0::Content> for Content {
1317 fn from(value: incident_resolved_0_2_0::Content) -> Self {
1318 Self::IncidentResolved020(value)
1319 }
1320}
1321impl From<pipelinerun_finished_0_1_1::Content> for Content {
1322 fn from(value: pipelinerun_finished_0_1_1::Content) -> Self {
1323 Self::PipelinerunFinished011(value)
1324 }
1325}
1326impl From<pipelinerun_finished_0_2_0::Content> for Content {
1327 fn from(value: pipelinerun_finished_0_2_0::Content) -> Self {
1328 Self::PipelinerunFinished020(value)
1329 }
1330}
1331impl From<pipelinerun_queued_0_1_1::Content> for Content {
1332 fn from(value: pipelinerun_queued_0_1_1::Content) -> Self {
1333 Self::PipelinerunQueued011(value)
1334 }
1335}
1336impl From<pipelinerun_queued_0_2_0::Content> for Content {
1337 fn from(value: pipelinerun_queued_0_2_0::Content) -> Self {
1338 Self::PipelinerunQueued020(value)
1339 }
1340}
1341impl From<pipelinerun_started_0_1_1::Content> for Content {
1342 fn from(value: pipelinerun_started_0_1_1::Content) -> Self {
1343 Self::PipelinerunStarted011(value)
1344 }
1345}
1346impl From<pipelinerun_started_0_2_0::Content> for Content {
1347 fn from(value: pipelinerun_started_0_2_0::Content) -> Self {
1348 Self::PipelinerunStarted020(value)
1349 }
1350}
1351impl From<repository_created_0_1_1::Content> for Content {
1352 fn from(value: repository_created_0_1_1::Content) -> Self {
1353 Self::RepositoryCreated011(value)
1354 }
1355}
1356impl From<repository_created_0_2_0::Content> for Content {
1357 fn from(value: repository_created_0_2_0::Content) -> Self {
1358 Self::RepositoryCreated020(value)
1359 }
1360}
1361impl From<repository_deleted_0_1_1::Content> for Content {
1362 fn from(value: repository_deleted_0_1_1::Content) -> Self {
1363 Self::RepositoryDeleted011(value)
1364 }
1365}
1366impl From<repository_deleted_0_2_0::Content> for Content {
1367 fn from(value: repository_deleted_0_2_0::Content) -> Self {
1368 Self::RepositoryDeleted020(value)
1369 }
1370}
1371impl From<repository_modified_0_1_1::Content> for Content {
1372 fn from(value: repository_modified_0_1_1::Content) -> Self {
1373 Self::RepositoryModified011(value)
1374 }
1375}
1376impl From<repository_modified_0_2_0::Content> for Content {
1377 fn from(value: repository_modified_0_2_0::Content) -> Self {
1378 Self::RepositoryModified020(value)
1379 }
1380}
1381impl From<service_deployed_0_1_1::Content> for Content {
1382 fn from(value: service_deployed_0_1_1::Content) -> Self {
1383 Self::ServiceDeployed011(value)
1384 }
1385}
1386impl From<service_deployed_0_2_0::Content> for Content {
1387 fn from(value: service_deployed_0_2_0::Content) -> Self {
1388 Self::ServiceDeployed020(value)
1389 }
1390}
1391impl From<service_published_0_1_1::Content> for Content {
1392 fn from(value: service_published_0_1_1::Content) -> Self {
1393 Self::ServicePublished011(value)
1394 }
1395}
1396impl From<service_published_0_2_0::Content> for Content {
1397 fn from(value: service_published_0_2_0::Content) -> Self {
1398 Self::ServicePublished020(value)
1399 }
1400}
1401impl From<service_removed_0_1_1::Content> for Content {
1402 fn from(value: service_removed_0_1_1::Content) -> Self {
1403 Self::ServiceRemoved011(value)
1404 }
1405}
1406impl From<service_removed_0_2_0::Content> for Content {
1407 fn from(value: service_removed_0_2_0::Content) -> Self {
1408 Self::ServiceRemoved020(value)
1409 }
1410}
1411impl From<service_rolledback_0_1_1::Content> for Content {
1412 fn from(value: service_rolledback_0_1_1::Content) -> Self {
1413 Self::ServiceRolledback011(value)
1414 }
1415}
1416impl From<service_rolledback_0_2_0::Content> for Content {
1417 fn from(value: service_rolledback_0_2_0::Content) -> Self {
1418 Self::ServiceRolledback020(value)
1419 }
1420}
1421impl From<service_upgraded_0_1_1::Content> for Content {
1422 fn from(value: service_upgraded_0_1_1::Content) -> Self {
1423 Self::ServiceUpgraded011(value)
1424 }
1425}
1426impl From<service_upgraded_0_2_0::Content> for Content {
1427 fn from(value: service_upgraded_0_2_0::Content) -> Self {
1428 Self::ServiceUpgraded020(value)
1429 }
1430}
1431impl From<taskrun_finished_0_1_1::Content> for Content {
1432 fn from(value: taskrun_finished_0_1_1::Content) -> Self {
1433 Self::TaskrunFinished011(value)
1434 }
1435}
1436impl From<taskrun_finished_0_2_0::Content> for Content {
1437 fn from(value: taskrun_finished_0_2_0::Content) -> Self {
1438 Self::TaskrunFinished020(value)
1439 }
1440}
1441impl From<taskrun_started_0_1_1::Content> for Content {
1442 fn from(value: taskrun_started_0_1_1::Content) -> Self {
1443 Self::TaskrunStarted011(value)
1444 }
1445}
1446impl From<taskrun_started_0_2_0::Content> for Content {
1447 fn from(value: taskrun_started_0_2_0::Content) -> Self {
1448 Self::TaskrunStarted020(value)
1449 }
1450}
1451impl From<testcaserun_finished_0_1_0::Content> for Content {
1452 fn from(value: testcaserun_finished_0_1_0::Content) -> Self {
1453 Self::TestcaserunFinished010(value)
1454 }
1455}
1456impl From<testcaserun_finished_0_2_0::Content> for Content {
1457 fn from(value: testcaserun_finished_0_2_0::Content) -> Self {
1458 Self::TestcaserunFinished020(value)
1459 }
1460}
1461impl From<testcaserun_queued_0_1_0::Content> for Content {
1462 fn from(value: testcaserun_queued_0_1_0::Content) -> Self {
1463 Self::TestcaserunQueued010(value)
1464 }
1465}
1466impl From<testcaserun_queued_0_2_0::Content> for Content {
1467 fn from(value: testcaserun_queued_0_2_0::Content) -> Self {
1468 Self::TestcaserunQueued020(value)
1469 }
1470}
1471impl From<testcaserun_skipped_0_1_0::Content> for Content {
1472 fn from(value: testcaserun_skipped_0_1_0::Content) -> Self {
1473 Self::TestcaserunSkipped010(value)
1474 }
1475}
1476impl From<testcaserun_started_0_1_0::Content> for Content {
1477 fn from(value: testcaserun_started_0_1_0::Content) -> Self {
1478 Self::TestcaserunStarted010(value)
1479 }
1480}
1481impl From<testcaserun_started_0_2_0::Content> for Content {
1482 fn from(value: testcaserun_started_0_2_0::Content) -> Self {
1483 Self::TestcaserunStarted020(value)
1484 }
1485}
1486impl From<testoutput_published_0_1_0::Content> for Content {
1487 fn from(value: testoutput_published_0_1_0::Content) -> Self {
1488 Self::TestoutputPublished010(value)
1489 }
1490}
1491impl From<testoutput_published_0_2_0::Content> for Content {
1492 fn from(value: testoutput_published_0_2_0::Content) -> Self {
1493 Self::TestoutputPublished020(value)
1494 }
1495}
1496impl From<testsuiterun_finished_0_1_0::Content> for Content {
1497 fn from(value: testsuiterun_finished_0_1_0::Content) -> Self {
1498 Self::TestsuiterunFinished010(value)
1499 }
1500}
1501impl From<testsuiterun_finished_0_2_0::Content> for Content {
1502 fn from(value: testsuiterun_finished_0_2_0::Content) -> Self {
1503 Self::TestsuiterunFinished020(value)
1504 }
1505}
1506impl From<testsuiterun_queued_0_1_0::Content> for Content {
1507 fn from(value: testsuiterun_queued_0_1_0::Content) -> Self {
1508 Self::TestsuiterunQueued010(value)
1509 }
1510}
1511impl From<testsuiterun_queued_0_2_0::Content> for Content {
1512 fn from(value: testsuiterun_queued_0_2_0::Content) -> Self {
1513 Self::TestsuiterunQueued020(value)
1514 }
1515}
1516impl From<testsuiterun_started_0_1_0::Content> for Content {
1517 fn from(value: testsuiterun_started_0_1_0::Content) -> Self {
1518 Self::TestsuiterunStarted010(value)
1519 }
1520}
1521impl From<testsuiterun_started_0_2_0::Content> for Content {
1522 fn from(value: testsuiterun_started_0_2_0::Content) -> Self {
1523 Self::TestsuiterunStarted020(value)
1524 }
1525}
1526impl From<ticket_closed_0_1_0::Content> for Content {
1527 fn from(value: ticket_closed_0_1_0::Content) -> Self {
1528 Self::TicketClosed010(value)
1529 }
1530}
1531impl From<ticket_created_0_1_0::Content> for Content {
1532 fn from(value: ticket_created_0_1_0::Content) -> Self {
1533 Self::TicketCreated010(value)
1534 }
1535}
1536impl From<ticket_updated_0_1_0::Content> for Content {
1537 fn from(value: ticket_updated_0_1_0::Content) -> Self {
1538 Self::TicketUpdated010(value)
1539 }
1540}
1541
1542#[cfg(feature = "testkit")]
1543impl<> proptest::arbitrary::Arbitrary for Content {
1544 type Parameters = ();
1545 type Strategy = proptest::strategy::BoxedStrategy<Self>;
1546
1547 fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy {
1548 use proptest::prelude::*;
1549 prop_oneof![
1550 any::<artifact_deleted_0_1_0::Content>().prop_map(Content::from),
1551 any::<artifact_downloaded_0_1_0::Content>().prop_map(Content::from),
1552 any::<artifact_packaged_0_1_1::Content>().prop_map(Content::from),
1553 any::<artifact_packaged_0_2_0::Content>().prop_map(Content::from),
1554 any::<artifact_published_0_1_1::Content>().prop_map(Content::from),
1555 any::<artifact_published_0_2_0::Content>().prop_map(Content::from),
1556 any::<artifact_signed_0_1_0::Content>().prop_map(Content::from),
1557 any::<artifact_signed_0_2_0::Content>().prop_map(Content::from),
1558 any::<branch_created_0_1_2::Content>().prop_map(Content::from),
1559 any::<branch_created_0_2_0::Content>().prop_map(Content::from),
1560 any::<branch_deleted_0_1_2::Content>().prop_map(Content::from),
1561 any::<branch_deleted_0_2_0::Content>().prop_map(Content::from),
1562 any::<build_finished_0_1_1::Content>().prop_map(Content::from),
1563 any::<build_finished_0_2_0::Content>().prop_map(Content::from),
1564 any::<build_queued_0_1_1::Content>().prop_map(Content::from),
1565 any::<build_queued_0_2_0::Content>().prop_map(Content::from),
1566 any::<build_started_0_1_1::Content>().prop_map(Content::from),
1567 any::<build_started_0_2_0::Content>().prop_map(Content::from),
1568 any::<change_abandoned_0_1_2::Content>().prop_map(Content::from),
1569 any::<change_abandoned_0_2_0::Content>().prop_map(Content::from),
1570 any::<change_created_0_1_2::Content>().prop_map(Content::from),
1571 any::<change_created_0_3_0::Content>().prop_map(Content::from),
1572 any::<change_merged_0_1_2::Content>().prop_map(Content::from),
1573 any::<change_merged_0_2_0::Content>().prop_map(Content::from),
1574 any::<change_reviewed_0_1_2::Content>().prop_map(Content::from),
1575 any::<change_reviewed_0_2_0::Content>().prop_map(Content::from),
1576 any::<change_updated_0_1_2::Content>().prop_map(Content::from),
1577 any::<change_updated_0_2_0::Content>().prop_map(Content::from),
1578 any::<environment_created_0_1_1::Content>().prop_map(Content::from),
1579 any::<environment_created_0_2_0::Content>().prop_map(Content::from),
1580 any::<environment_deleted_0_1_1::Content>().prop_map(Content::from),
1581 any::<environment_deleted_0_2_0::Content>().prop_map(Content::from),
1582 any::<environment_modified_0_1_1::Content>().prop_map(Content::from),
1583 any::<environment_modified_0_2_0::Content>().prop_map(Content::from),
1584 any::<incident_detected_0_1_0::Content>().prop_map(Content::from),
1585 any::<incident_detected_0_2_0::Content>().prop_map(Content::from),
1586 any::<incident_reported_0_1_0::Content>().prop_map(Content::from),
1587 any::<incident_reported_0_2_0::Content>().prop_map(Content::from),
1588 any::<incident_resolved_0_1_0::Content>().prop_map(Content::from),
1589 any::<incident_resolved_0_2_0::Content>().prop_map(Content::from),
1590 any::<pipelinerun_finished_0_1_1::Content>().prop_map(Content::from),
1591 any::<pipelinerun_finished_0_2_0::Content>().prop_map(Content::from),
1592 any::<pipelinerun_queued_0_1_1::Content>().prop_map(Content::from),
1593 any::<pipelinerun_queued_0_2_0::Content>().prop_map(Content::from),
1594 any::<pipelinerun_started_0_1_1::Content>().prop_map(Content::from),
1595 any::<pipelinerun_started_0_2_0::Content>().prop_map(Content::from),
1596 any::<repository_created_0_1_1::Content>().prop_map(Content::from),
1597 any::<repository_created_0_2_0::Content>().prop_map(Content::from),
1598 any::<repository_deleted_0_1_1::Content>().prop_map(Content::from),
1599 any::<repository_deleted_0_2_0::Content>().prop_map(Content::from),
1600 any::<repository_modified_0_1_1::Content>().prop_map(Content::from),
1601 any::<repository_modified_0_2_0::Content>().prop_map(Content::from),
1602 any::<service_deployed_0_1_1::Content>().prop_map(Content::from),
1603 any::<service_deployed_0_2_0::Content>().prop_map(Content::from),
1604 any::<service_published_0_1_1::Content>().prop_map(Content::from),
1605 any::<service_published_0_2_0::Content>().prop_map(Content::from),
1606 any::<service_removed_0_1_1::Content>().prop_map(Content::from),
1607 any::<service_removed_0_2_0::Content>().prop_map(Content::from),
1608 any::<service_rolledback_0_1_1::Content>().prop_map(Content::from),
1609 any::<service_rolledback_0_2_0::Content>().prop_map(Content::from),
1610 any::<service_upgraded_0_1_1::Content>().prop_map(Content::from),
1611 any::<service_upgraded_0_2_0::Content>().prop_map(Content::from),
1612 any::<taskrun_finished_0_1_1::Content>().prop_map(Content::from),
1613 any::<taskrun_finished_0_2_0::Content>().prop_map(Content::from),
1614 any::<taskrun_started_0_1_1::Content>().prop_map(Content::from),
1615 any::<taskrun_started_0_2_0::Content>().prop_map(Content::from),
1616 any::<testcaserun_finished_0_1_0::Content>().prop_map(Content::from),
1617 any::<testcaserun_finished_0_2_0::Content>().prop_map(Content::from),
1618 any::<testcaserun_queued_0_1_0::Content>().prop_map(Content::from),
1619 any::<testcaserun_queued_0_2_0::Content>().prop_map(Content::from),
1620 any::<testcaserun_skipped_0_1_0::Content>().prop_map(Content::from),
1621 any::<testcaserun_started_0_1_0::Content>().prop_map(Content::from),
1622 any::<testcaserun_started_0_2_0::Content>().prop_map(Content::from),
1623 any::<testoutput_published_0_1_0::Content>().prop_map(Content::from),
1624 any::<testoutput_published_0_2_0::Content>().prop_map(Content::from),
1625 any::<testsuiterun_finished_0_1_0::Content>().prop_map(Content::from),
1626 any::<testsuiterun_finished_0_2_0::Content>().prop_map(Content::from),
1627 any::<testsuiterun_queued_0_1_0::Content>().prop_map(Content::from),
1628 any::<testsuiterun_queued_0_2_0::Content>().prop_map(Content::from),
1629 any::<testsuiterun_started_0_1_0::Content>().prop_map(Content::from),
1630 any::<testsuiterun_started_0_2_0::Content>().prop_map(Content::from),
1631 any::<ticket_closed_0_1_0::Content>().prop_map(Content::from),
1632 any::<ticket_created_0_1_0::Content>().prop_map(Content::from),
1633 any::<ticket_updated_0_1_0::Content>().prop_map(Content::from),
1634 ].boxed()
1635 }
1636}
1637
1638