Skip to content

Commit

Permalink
✨ first working basic cdevents implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidB committed Jan 10, 2024
1 parent ef2fef2 commit f59d663
Show file tree
Hide file tree
Showing 42 changed files with 745 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cdevents/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "cdevents"
edition.workspace = true
version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
publish = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
http = "1"
http-serde = "2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
time = { version = "0.3", features = ["serde-human-readable"] }

[dev-dependencies]
rstest = "0.18"
assert-json-diff = "2.0"
15 changes: 15 additions & 0 deletions cdevents/src/generated/artifact_packaged_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ArtifactPackagedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/artifact_published_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ArtifactPublishedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/artifact_signed_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ArtifactSignedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/branch_created_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BranchCreatedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/branch_deleted_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BranchDeletedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/build_finished_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuildFinishedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/build_queued_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuildQueuedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/build_started_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct BuildStartedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/change_abandoned_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChangeAbandonedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/change_created_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChangeCreatedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/change_merged_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChangeMergedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/change_reviewed_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChangeReviewedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/change_updated_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChangeUpdatedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/environment_created_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EnvironmentCreatedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/environment_deleted_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EnvironmentDeletedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/environment_modified_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EnvironmentModifiedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/incident_detected_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IncidentDetectedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/incident_reported_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IncidentReportedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
15 changes: 15 additions & 0 deletions cdevents/src/generated/incident_resolved_subject.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// code generated by cdevents/sdk-rust/generator (subject.hbs)
use serde::{Serialize, Deserialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IncidentResolvedSubject {

#[serde(rename = "content")]
pub content: serde_json::Map<String, serde_json::Value>,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "source")]
pub source: String,
#[serde(rename = "type")]
pub tpe: String,
}
Loading

0 comments on commit f59d663

Please sign in to comment.