Skip to content

Commit

Permalink
feat: string enum are defined as rust Enum
Browse files Browse the repository at this point in the history
Signed-off-by: David Bernard <david.bernard.31@gmail.com>
  • Loading branch information
davidB committed Jan 28, 2024
1 parent 368acfd commit c7da42c
Show file tree
Hide file tree
Showing 41 changed files with 324 additions and 135 deletions.
5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/artifact_packaged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "change",)]
pub change: Change,
pub change: ContentChange,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Change {
pub struct ContentChange {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/artifact_published.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/artifact_signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pub struct Content {
#[serde(rename = "signature",)]
pub signature: String,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/branch_created.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/branch_deleted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/build_finished.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pub struct Content {
#[serde(rename = "artifactId", default, skip_serializing_if = "Option::is_none",)]
pub artifact_id: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/build_queued.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/build_started.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/change_abandoned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/change_created.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/change_merged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/change_reviewed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/change_updated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "repository", default, skip_serializing_if = "Option::is_none",)]
pub repository: Option<Repository>,
pub repository: Option<ContentRepository>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Repository {
pub struct ContentRepository {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/environment_created.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ pub struct Content {
#[serde(rename = "url", default, skip_serializing_if = "Option::is_none",)]
pub url: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/environment_deleted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pub struct Content {
#[serde(rename = "name", default, skip_serializing_if = "Option::is_none",)]
pub name: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/environment_modified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ pub struct Content {
#[serde(rename = "url", default, skip_serializing_if = "Option::is_none",)]
pub url: Option<String>,
}

9 changes: 4 additions & 5 deletions cdevents-sdk/src/generated/incident_detected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ pub struct Content {
#[serde(rename = "description", default, skip_serializing_if = "Option::is_none",)]
pub description: Option<String>,
#[serde(rename = "environment",)]
pub environment: Environment,
pub environment: ContentEnvironment,
#[serde(rename = "service", default, skip_serializing_if = "Option::is_none",)]
pub service: Option<Service>,
pub service: Option<ContentService>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Service {
pub struct ContentService {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
Expand All @@ -27,10 +27,9 @@ pub struct Service {

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

9 changes: 4 additions & 5 deletions cdevents-sdk/src/generated/incident_reported.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ pub struct Content {
#[serde(rename = "description", default, skip_serializing_if = "Option::is_none",)]
pub description: Option<String>,
#[serde(rename = "environment",)]
pub environment: Environment,
pub environment: ContentEnvironment,
#[serde(rename = "service", default, skip_serializing_if = "Option::is_none",)]
pub service: Option<Service>,
pub service: Option<ContentService>,
#[serde(rename = "ticketURI",)]
pub ticket_uri: crate::Uri,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Service {
pub struct ContentService {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
Expand All @@ -29,10 +29,9 @@ pub struct Service {

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

9 changes: 4 additions & 5 deletions cdevents-sdk/src/generated/incident_resolved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ pub struct Content {
#[serde(rename = "description", default, skip_serializing_if = "Option::is_none",)]
pub description: Option<String>,
#[serde(rename = "environment",)]
pub environment: Environment,
pub environment: ContentEnvironment,
#[serde(rename = "service", default, skip_serializing_if = "Option::is_none",)]
pub service: Option<Service>,
pub service: Option<ContentService>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Service {
pub struct ContentService {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
Expand All @@ -27,10 +27,9 @@ pub struct Service {

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/pipelinerun_finished.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ pub struct Content {
#[serde(rename = "url", default, skip_serializing_if = "Option::is_none",)]
pub url: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/pipelinerun_queued.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ pub struct Content {
#[serde(rename = "url", default, skip_serializing_if = "Option::is_none",)]
pub url: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/pipelinerun_started.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ pub struct Content {
#[serde(rename = "url",)]
pub url: String,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/repository_created.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ pub struct Content {
#[serde(rename = "viewUrl", default, skip_serializing_if = "Option::is_none",)]
pub view_url: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/repository_deleted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ pub struct Content {
#[serde(rename = "viewUrl", default, skip_serializing_if = "Option::is_none",)]
pub view_url: Option<String>,
}

1 change: 0 additions & 1 deletion cdevents-sdk/src/generated/repository_modified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ pub struct Content {
#[serde(rename = "viewUrl", default, skip_serializing_if = "Option::is_none",)]
pub view_url: Option<String>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/service_deployed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ pub struct Content {
#[serde(rename = "artifactId",)]
pub artifact_id: String,
#[serde(rename = "environment",)]
pub environment: Environment,
pub environment: ContentEnvironment,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/service_published.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "environment", default, skip_serializing_if = "Option::is_none",)]
pub environment: Option<Environment>,
pub environment: Option<ContentEnvironment>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/service_removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use serde::{Serialize, Deserialize};
#[serde(deny_unknown_fields)]
pub struct Content {
#[serde(rename = "environment", default, skip_serializing_if = "Option::is_none",)]
pub environment: Option<Environment>,
pub environment: Option<ContentEnvironment>,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/service_rolledback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ pub struct Content {
#[serde(rename = "artifactId",)]
pub artifact_id: String,
#[serde(rename = "environment",)]
pub environment: Environment,
pub environment: ContentEnvironment,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

5 changes: 2 additions & 3 deletions cdevents-sdk/src/generated/service_upgraded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ pub struct Content {
#[serde(rename = "artifactId",)]
pub artifact_id: String,
#[serde(rename = "environment",)]
pub environment: Environment,
pub environment: ContentEnvironment,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(deny_unknown_fields)]
pub struct Environment {
pub struct ContentEnvironment {
#[serde(rename = "id",)]
pub id: String,
#[serde(rename = "source", default, skip_serializing_if = "Option::is_none",)]
pub source: Option<crate::UriReference>,
}

Loading

0 comments on commit c7da42c

Please sign in to comment.