From c26af3bd9516c8e621bd305674c0dc6ce56ec132 Mon Sep 17 00:00:00 2001 From: Adam Leventhal Date: Sat, 4 Feb 2023 17:22:55 -0800 Subject: [PATCH] update typify; update tests (#326) --- Cargo.lock | 6 +- .../tests/output/buildomat-builder-tagged.out | 114 ++ .../tests/output/buildomat-builder.out | 114 ++ .../tests/output/buildomat-positional.out | 114 ++ .../tests/output/keeper-builder-tagged.out | 60 + .../tests/output/keeper-builder.out | 60 + .../tests/output/keeper-positional.out | 60 + .../tests/output/nexus-builder-tagged.out | 1347 +++++++++++++++++ .../tests/output/nexus-builder.out | 1347 +++++++++++++++++ .../tests/output/nexus-positional.out | 1347 +++++++++++++++++ .../output/propolis-server-builder-tagged.out | 190 +++ .../tests/output/propolis-server-builder.out | 190 +++ .../output/propolis-server-positional.out | 190 +++ .../output/test_default_params_builder.out | 12 + .../output/test_default_params_positional.out | 12 + .../tests/output/test_freeform_response.out | 6 + .../tests/output/test_renamed_parameters.out | 6 + 17 files changed, 5172 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 740dec2..e03a4e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2025,7 +2025,7 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "typify" version = "0.0.11-dev" -source = "git+https://github.com/oxidecomputer/typify#b745a238675ef5c9ee2466029fc8804db292eb51" +source = "git+https://github.com/oxidecomputer/typify#f6bdfa36b75e5e77ef17cf6dcfe01a939d8b918f" dependencies = [ "typify-impl", "typify-macro", @@ -2034,7 +2034,7 @@ dependencies = [ [[package]] name = "typify-impl" version = "0.0.11-dev" -source = "git+https://github.com/oxidecomputer/typify#b745a238675ef5c9ee2466029fc8804db292eb51" +source = "git+https://github.com/oxidecomputer/typify#f6bdfa36b75e5e77ef17cf6dcfe01a939d8b918f" dependencies = [ "heck", "log", @@ -2052,7 +2052,7 @@ dependencies = [ [[package]] name = "typify-macro" version = "0.0.11-dev" -source = "git+https://github.com/oxidecomputer/typify#b745a238675ef5c9ee2466029fc8804db292eb51" +source = "git+https://github.com/oxidecomputer/typify#f6bdfa36b75e5e77ef17cf6dcfe01a939d8b918f" dependencies = [ "proc-macro2", "quote", diff --git a/progenitor-impl/tests/output/buildomat-builder-tagged.out b/progenitor-impl/tests/output/buildomat-builder-tagged.out index e40111d..204aa4c 100644 --- a/progenitor-impl/tests/output/buildomat-builder-tagged.out +++ b/progenitor-impl/tests/output/buildomat-builder-tagged.out @@ -16,6 +16,12 @@ pub mod types { pub state: String, } + impl From<&Task> for Task { + fn from(value: &Task) -> Self { + value.clone() + } + } + impl Task { pub fn builder() -> builder::Task { builder::Task::default() @@ -30,6 +36,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&TaskEvent> for TaskEvent { + fn from(value: &TaskEvent) -> Self { + value.clone() + } + } + impl TaskEvent { pub fn builder() -> builder::TaskEvent { builder::TaskEvent::default() @@ -43,6 +55,12 @@ pub mod types { pub size: u64, } + impl From<&TaskOutput> for TaskOutput { + fn from(value: &TaskOutput) -> Self { + value.clone() + } + } + impl TaskOutput { pub fn builder() -> builder::TaskOutput { builder::TaskOutput::default() @@ -57,6 +75,12 @@ pub mod types { pub script: String, } + impl From<&TaskSubmit> for TaskSubmit { + fn from(value: &TaskSubmit) -> Self { + value.clone() + } + } + impl TaskSubmit { pub fn builder() -> builder::TaskSubmit { builder::TaskSubmit::default() @@ -68,6 +92,12 @@ pub mod types { pub id: String, } + impl From<&TaskSubmitResult> for TaskSubmitResult { + fn from(value: &TaskSubmitResult) -> Self { + value.clone() + } + } + impl TaskSubmitResult { pub fn builder() -> builder::TaskSubmitResult { builder::TaskSubmitResult::default() @@ -79,6 +109,12 @@ pub mod types { pub id: String, } + impl From<&UploadedChunk> for UploadedChunk { + fn from(value: &UploadedChunk) -> Self { + value.clone() + } + } + impl UploadedChunk { pub fn builder() -> builder::UploadedChunk { builder::UploadedChunk::default() @@ -90,6 +126,12 @@ pub mod types { pub name: String, } + impl From<&UserCreate> for UserCreate { + fn from(value: &UserCreate) -> Self { + value.clone() + } + } + impl UserCreate { pub fn builder() -> builder::UserCreate { builder::UserCreate::default() @@ -103,6 +145,12 @@ pub mod types { pub token: String, } + impl From<&UserCreateResult> for UserCreateResult { + fn from(value: &UserCreateResult) -> Self { + value.clone() + } + } + impl UserCreateResult { pub fn builder() -> builder::UserCreateResult { builder::UserCreateResult::default() @@ -115,6 +163,12 @@ pub mod types { pub name: String, } + impl From<&WhoamiResult> for WhoamiResult { + fn from(value: &WhoamiResult) -> Self { + value.clone() + } + } + impl WhoamiResult { pub fn builder() -> builder::WhoamiResult { builder::WhoamiResult::default() @@ -133,6 +187,12 @@ pub mod types { pub tasks: Vec, } + impl From<&Worker> for Worker { + fn from(value: &Worker) -> Self { + value.clone() + } + } + impl Worker { pub fn builder() -> builder::Worker { builder::Worker::default() @@ -146,6 +206,12 @@ pub mod types { pub size: i64, } + impl From<&WorkerAddOutput> for WorkerAddOutput { + fn from(value: &WorkerAddOutput) -> Self { + value.clone() + } + } + impl WorkerAddOutput { pub fn builder() -> builder::WorkerAddOutput { builder::WorkerAddOutput::default() @@ -159,6 +225,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&WorkerAppendTask> for WorkerAppendTask { + fn from(value: &WorkerAppendTask) -> Self { + value.clone() + } + } + impl WorkerAppendTask { pub fn builder() -> builder::WorkerAppendTask { builder::WorkerAppendTask::default() @@ -171,6 +243,12 @@ pub mod types { pub token: String, } + impl From<&WorkerBootstrap> for WorkerBootstrap { + fn from(value: &WorkerBootstrap) -> Self { + value.clone() + } + } + impl WorkerBootstrap { pub fn builder() -> builder::WorkerBootstrap { builder::WorkerBootstrap::default() @@ -182,6 +260,12 @@ pub mod types { pub id: String, } + impl From<&WorkerBootstrapResult> for WorkerBootstrapResult { + fn from(value: &WorkerBootstrapResult) -> Self { + value.clone() + } + } + impl WorkerBootstrapResult { pub fn builder() -> builder::WorkerBootstrapResult { builder::WorkerBootstrapResult::default() @@ -193,6 +277,12 @@ pub mod types { pub failed: bool, } + impl From<&WorkerCompleteTask> for WorkerCompleteTask { + fn from(value: &WorkerCompleteTask) -> Self { + value.clone() + } + } + impl WorkerCompleteTask { pub fn builder() -> builder::WorkerCompleteTask { builder::WorkerCompleteTask::default() @@ -206,6 +296,12 @@ pub mod types { pub task: Option, } + impl From<&WorkerPingResult> for WorkerPingResult { + fn from(value: &WorkerPingResult) -> Self { + value.clone() + } + } + impl WorkerPingResult { pub fn builder() -> builder::WorkerPingResult { builder::WorkerPingResult::default() @@ -219,6 +315,12 @@ pub mod types { pub script: String, } + impl From<&WorkerPingTask> for WorkerPingTask { + fn from(value: &WorkerPingTask) -> Self { + value.clone() + } + } + impl WorkerPingTask { pub fn builder() -> builder::WorkerPingTask { builder::WorkerPingTask::default() @@ -232,6 +334,12 @@ pub mod types { pub owner: String, } + impl From<&WorkerTask> for WorkerTask { + fn from(value: &WorkerTask) -> Self { + value.clone() + } + } + impl WorkerTask { pub fn builder() -> builder::WorkerTask { builder::WorkerTask::default() @@ -243,6 +351,12 @@ pub mod types { pub workers: Vec, } + impl From<&WorkersResult> for WorkersResult { + fn from(value: &WorkersResult) -> Self { + value.clone() + } + } + impl WorkersResult { pub fn builder() -> builder::WorkersResult { builder::WorkersResult::default() diff --git a/progenitor-impl/tests/output/buildomat-builder.out b/progenitor-impl/tests/output/buildomat-builder.out index f78c17f..6b7811f 100644 --- a/progenitor-impl/tests/output/buildomat-builder.out +++ b/progenitor-impl/tests/output/buildomat-builder.out @@ -16,6 +16,12 @@ pub mod types { pub state: String, } + impl From<&Task> for Task { + fn from(value: &Task) -> Self { + value.clone() + } + } + impl Task { pub fn builder() -> builder::Task { builder::Task::default() @@ -30,6 +36,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&TaskEvent> for TaskEvent { + fn from(value: &TaskEvent) -> Self { + value.clone() + } + } + impl TaskEvent { pub fn builder() -> builder::TaskEvent { builder::TaskEvent::default() @@ -43,6 +55,12 @@ pub mod types { pub size: u64, } + impl From<&TaskOutput> for TaskOutput { + fn from(value: &TaskOutput) -> Self { + value.clone() + } + } + impl TaskOutput { pub fn builder() -> builder::TaskOutput { builder::TaskOutput::default() @@ -57,6 +75,12 @@ pub mod types { pub script: String, } + impl From<&TaskSubmit> for TaskSubmit { + fn from(value: &TaskSubmit) -> Self { + value.clone() + } + } + impl TaskSubmit { pub fn builder() -> builder::TaskSubmit { builder::TaskSubmit::default() @@ -68,6 +92,12 @@ pub mod types { pub id: String, } + impl From<&TaskSubmitResult> for TaskSubmitResult { + fn from(value: &TaskSubmitResult) -> Self { + value.clone() + } + } + impl TaskSubmitResult { pub fn builder() -> builder::TaskSubmitResult { builder::TaskSubmitResult::default() @@ -79,6 +109,12 @@ pub mod types { pub id: String, } + impl From<&UploadedChunk> for UploadedChunk { + fn from(value: &UploadedChunk) -> Self { + value.clone() + } + } + impl UploadedChunk { pub fn builder() -> builder::UploadedChunk { builder::UploadedChunk::default() @@ -90,6 +126,12 @@ pub mod types { pub name: String, } + impl From<&UserCreate> for UserCreate { + fn from(value: &UserCreate) -> Self { + value.clone() + } + } + impl UserCreate { pub fn builder() -> builder::UserCreate { builder::UserCreate::default() @@ -103,6 +145,12 @@ pub mod types { pub token: String, } + impl From<&UserCreateResult> for UserCreateResult { + fn from(value: &UserCreateResult) -> Self { + value.clone() + } + } + impl UserCreateResult { pub fn builder() -> builder::UserCreateResult { builder::UserCreateResult::default() @@ -115,6 +163,12 @@ pub mod types { pub name: String, } + impl From<&WhoamiResult> for WhoamiResult { + fn from(value: &WhoamiResult) -> Self { + value.clone() + } + } + impl WhoamiResult { pub fn builder() -> builder::WhoamiResult { builder::WhoamiResult::default() @@ -133,6 +187,12 @@ pub mod types { pub tasks: Vec, } + impl From<&Worker> for Worker { + fn from(value: &Worker) -> Self { + value.clone() + } + } + impl Worker { pub fn builder() -> builder::Worker { builder::Worker::default() @@ -146,6 +206,12 @@ pub mod types { pub size: i64, } + impl From<&WorkerAddOutput> for WorkerAddOutput { + fn from(value: &WorkerAddOutput) -> Self { + value.clone() + } + } + impl WorkerAddOutput { pub fn builder() -> builder::WorkerAddOutput { builder::WorkerAddOutput::default() @@ -159,6 +225,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&WorkerAppendTask> for WorkerAppendTask { + fn from(value: &WorkerAppendTask) -> Self { + value.clone() + } + } + impl WorkerAppendTask { pub fn builder() -> builder::WorkerAppendTask { builder::WorkerAppendTask::default() @@ -171,6 +243,12 @@ pub mod types { pub token: String, } + impl From<&WorkerBootstrap> for WorkerBootstrap { + fn from(value: &WorkerBootstrap) -> Self { + value.clone() + } + } + impl WorkerBootstrap { pub fn builder() -> builder::WorkerBootstrap { builder::WorkerBootstrap::default() @@ -182,6 +260,12 @@ pub mod types { pub id: String, } + impl From<&WorkerBootstrapResult> for WorkerBootstrapResult { + fn from(value: &WorkerBootstrapResult) -> Self { + value.clone() + } + } + impl WorkerBootstrapResult { pub fn builder() -> builder::WorkerBootstrapResult { builder::WorkerBootstrapResult::default() @@ -193,6 +277,12 @@ pub mod types { pub failed: bool, } + impl From<&WorkerCompleteTask> for WorkerCompleteTask { + fn from(value: &WorkerCompleteTask) -> Self { + value.clone() + } + } + impl WorkerCompleteTask { pub fn builder() -> builder::WorkerCompleteTask { builder::WorkerCompleteTask::default() @@ -206,6 +296,12 @@ pub mod types { pub task: Option, } + impl From<&WorkerPingResult> for WorkerPingResult { + fn from(value: &WorkerPingResult) -> Self { + value.clone() + } + } + impl WorkerPingResult { pub fn builder() -> builder::WorkerPingResult { builder::WorkerPingResult::default() @@ -219,6 +315,12 @@ pub mod types { pub script: String, } + impl From<&WorkerPingTask> for WorkerPingTask { + fn from(value: &WorkerPingTask) -> Self { + value.clone() + } + } + impl WorkerPingTask { pub fn builder() -> builder::WorkerPingTask { builder::WorkerPingTask::default() @@ -232,6 +334,12 @@ pub mod types { pub owner: String, } + impl From<&WorkerTask> for WorkerTask { + fn from(value: &WorkerTask) -> Self { + value.clone() + } + } + impl WorkerTask { pub fn builder() -> builder::WorkerTask { builder::WorkerTask::default() @@ -243,6 +351,12 @@ pub mod types { pub workers: Vec, } + impl From<&WorkersResult> for WorkersResult { + fn from(value: &WorkersResult) -> Self { + value.clone() + } + } + impl WorkersResult { pub fn builder() -> builder::WorkersResult { builder::WorkersResult::default() diff --git a/progenitor-impl/tests/output/buildomat-positional.out b/progenitor-impl/tests/output/buildomat-positional.out index 7ceb9dd..d386e9f 100644 --- a/progenitor-impl/tests/output/buildomat-positional.out +++ b/progenitor-impl/tests/output/buildomat-positional.out @@ -16,6 +16,12 @@ pub mod types { pub state: String, } + impl From<&Task> for Task { + fn from(value: &Task) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TaskEvent { pub payload: String, @@ -24,6 +30,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&TaskEvent> for TaskEvent { + fn from(value: &TaskEvent) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TaskOutput { pub id: String, @@ -31,6 +43,12 @@ pub mod types { pub size: u64, } + impl From<&TaskOutput> for TaskOutput { + fn from(value: &TaskOutput) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TaskSubmit { pub name: String, @@ -39,21 +57,45 @@ pub mod types { pub script: String, } + impl From<&TaskSubmit> for TaskSubmit { + fn from(value: &TaskSubmit) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TaskSubmitResult { pub id: String, } + impl From<&TaskSubmitResult> for TaskSubmitResult { + fn from(value: &TaskSubmitResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UploadedChunk { pub id: String, } + impl From<&UploadedChunk> for UploadedChunk { + fn from(value: &UploadedChunk) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserCreate { pub name: String, } + impl From<&UserCreate> for UserCreate { + fn from(value: &UserCreate) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserCreateResult { pub id: String, @@ -61,12 +103,24 @@ pub mod types { pub token: String, } + impl From<&UserCreateResult> for UserCreateResult { + fn from(value: &UserCreateResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WhoamiResult { pub id: String, pub name: String, } + impl From<&WhoamiResult> for WhoamiResult { + fn from(value: &WhoamiResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Worker { pub deleted: bool, @@ -79,6 +133,12 @@ pub mod types { pub tasks: Vec, } + impl From<&Worker> for Worker { + fn from(value: &Worker) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerAddOutput { pub chunks: Vec, @@ -86,6 +146,12 @@ pub mod types { pub size: i64, } + impl From<&WorkerAddOutput> for WorkerAddOutput { + fn from(value: &WorkerAddOutput) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerAppendTask { pub payload: String, @@ -93,22 +159,46 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&WorkerAppendTask> for WorkerAppendTask { + fn from(value: &WorkerAppendTask) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerBootstrap { pub bootstrap: String, pub token: String, } + impl From<&WorkerBootstrap> for WorkerBootstrap { + fn from(value: &WorkerBootstrap) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerBootstrapResult { pub id: String, } + impl From<&WorkerBootstrapResult> for WorkerBootstrapResult { + fn from(value: &WorkerBootstrapResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerCompleteTask { pub failed: bool, } + impl From<&WorkerCompleteTask> for WorkerCompleteTask { + fn from(value: &WorkerCompleteTask) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerPingResult { pub poweroff: bool, @@ -116,6 +206,12 @@ pub mod types { pub task: Option, } + impl From<&WorkerPingResult> for WorkerPingResult { + fn from(value: &WorkerPingResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerPingTask { pub id: String, @@ -123,6 +219,12 @@ pub mod types { pub script: String, } + impl From<&WorkerPingTask> for WorkerPingTask { + fn from(value: &WorkerPingTask) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkerTask { pub id: String, @@ -130,10 +232,22 @@ pub mod types { pub owner: String, } + impl From<&WorkerTask> for WorkerTask { + fn from(value: &WorkerTask) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkersResult { pub workers: Vec, } + + impl From<&WorkersResult> for WorkersResult { + fn from(value: &WorkersResult) -> Self { + value.clone() + } + } } #[derive(Clone, Debug)] diff --git a/progenitor-impl/tests/output/keeper-builder-tagged.out b/progenitor-impl/tests/output/keeper-builder-tagged.out index e5d8ce1..f682319 100644 --- a/progenitor-impl/tests/output/keeper-builder-tagged.out +++ b/progenitor-impl/tests/output/keeper-builder-tagged.out @@ -13,6 +13,12 @@ pub mod types { pub key: String, } + impl From<&EnrolBody> for EnrolBody { + fn from(value: &EnrolBody) -> Self { + value.clone() + } + } + impl EnrolBody { pub fn builder() -> builder::EnrolBody { builder::EnrolBody::default() @@ -24,6 +30,12 @@ pub mod types { pub summary: Vec, } + impl From<&GlobalJobsResult> for GlobalJobsResult { + fn from(value: &GlobalJobsResult) -> Self { + value.clone() + } + } + impl GlobalJobsResult { pub fn builder() -> builder::GlobalJobsResult { builder::GlobalJobsResult::default() @@ -37,6 +49,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&OutputRecord> for OutputRecord { + fn from(value: &OutputRecord) -> Self { + value.clone() + } + } + impl OutputRecord { pub fn builder() -> builder::OutputRecord { builder::OutputRecord::default() @@ -49,6 +67,12 @@ pub mod types { pub ok: bool, } + impl From<&PingResult> for PingResult { + fn from(value: &PingResult) -> Self { + value.clone() + } + } + impl PingResult { pub fn builder() -> builder::PingResult { builder::PingResult::default() @@ -63,6 +87,12 @@ pub mod types { pub id: ReportId, } + impl From<&ReportFinishBody> for ReportFinishBody { + fn from(value: &ReportFinishBody) -> Self { + value.clone() + } + } + impl ReportFinishBody { pub fn builder() -> builder::ReportFinishBody { builder::ReportFinishBody::default() @@ -78,6 +108,12 @@ pub mod types { pub uuid: String, } + impl From<&ReportId> for ReportId { + fn from(value: &ReportId) -> Self { + value.clone() + } + } + impl ReportId { pub fn builder() -> builder::ReportId { builder::ReportId::default() @@ -90,6 +126,12 @@ pub mod types { pub record: OutputRecord, } + impl From<&ReportOutputBody> for ReportOutputBody { + fn from(value: &ReportOutputBody) -> Self { + value.clone() + } + } + impl ReportOutputBody { pub fn builder() -> builder::ReportOutputBody { builder::ReportOutputBody::default() @@ -101,6 +143,12 @@ pub mod types { pub existed_already: bool, } + impl From<&ReportResult> for ReportResult { + fn from(value: &ReportResult) -> Self { + value.clone() + } + } + impl ReportResult { pub fn builder() -> builder::ReportResult { builder::ReportResult::default() @@ -114,6 +162,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&ReportStartBody> for ReportStartBody { + fn from(value: &ReportStartBody) -> Self { + value.clone() + } + } + impl ReportStartBody { pub fn builder() -> builder::ReportStartBody { builder::ReportStartBody::default() @@ -130,6 +184,12 @@ pub mod types { pub when: chrono::DateTime, } + impl From<&ReportSummary> for ReportSummary { + fn from(value: &ReportSummary) -> Self { + value.clone() + } + } + impl ReportSummary { pub fn builder() -> builder::ReportSummary { builder::ReportSummary::default() diff --git a/progenitor-impl/tests/output/keeper-builder.out b/progenitor-impl/tests/output/keeper-builder.out index 148e157..5e125cc 100644 --- a/progenitor-impl/tests/output/keeper-builder.out +++ b/progenitor-impl/tests/output/keeper-builder.out @@ -13,6 +13,12 @@ pub mod types { pub key: String, } + impl From<&EnrolBody> for EnrolBody { + fn from(value: &EnrolBody) -> Self { + value.clone() + } + } + impl EnrolBody { pub fn builder() -> builder::EnrolBody { builder::EnrolBody::default() @@ -24,6 +30,12 @@ pub mod types { pub summary: Vec, } + impl From<&GlobalJobsResult> for GlobalJobsResult { + fn from(value: &GlobalJobsResult) -> Self { + value.clone() + } + } + impl GlobalJobsResult { pub fn builder() -> builder::GlobalJobsResult { builder::GlobalJobsResult::default() @@ -37,6 +49,12 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&OutputRecord> for OutputRecord { + fn from(value: &OutputRecord) -> Self { + value.clone() + } + } + impl OutputRecord { pub fn builder() -> builder::OutputRecord { builder::OutputRecord::default() @@ -49,6 +67,12 @@ pub mod types { pub ok: bool, } + impl From<&PingResult> for PingResult { + fn from(value: &PingResult) -> Self { + value.clone() + } + } + impl PingResult { pub fn builder() -> builder::PingResult { builder::PingResult::default() @@ -63,6 +87,12 @@ pub mod types { pub id: ReportId, } + impl From<&ReportFinishBody> for ReportFinishBody { + fn from(value: &ReportFinishBody) -> Self { + value.clone() + } + } + impl ReportFinishBody { pub fn builder() -> builder::ReportFinishBody { builder::ReportFinishBody::default() @@ -78,6 +108,12 @@ pub mod types { pub uuid: String, } + impl From<&ReportId> for ReportId { + fn from(value: &ReportId) -> Self { + value.clone() + } + } + impl ReportId { pub fn builder() -> builder::ReportId { builder::ReportId::default() @@ -90,6 +126,12 @@ pub mod types { pub record: OutputRecord, } + impl From<&ReportOutputBody> for ReportOutputBody { + fn from(value: &ReportOutputBody) -> Self { + value.clone() + } + } + impl ReportOutputBody { pub fn builder() -> builder::ReportOutputBody { builder::ReportOutputBody::default() @@ -101,6 +143,12 @@ pub mod types { pub existed_already: bool, } + impl From<&ReportResult> for ReportResult { + fn from(value: &ReportResult) -> Self { + value.clone() + } + } + impl ReportResult { pub fn builder() -> builder::ReportResult { builder::ReportResult::default() @@ -114,6 +162,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&ReportStartBody> for ReportStartBody { + fn from(value: &ReportStartBody) -> Self { + value.clone() + } + } + impl ReportStartBody { pub fn builder() -> builder::ReportStartBody { builder::ReportStartBody::default() @@ -130,6 +184,12 @@ pub mod types { pub when: chrono::DateTime, } + impl From<&ReportSummary> for ReportSummary { + fn from(value: &ReportSummary) -> Self { + value.clone() + } + } + impl ReportSummary { pub fn builder() -> builder::ReportSummary { builder::ReportSummary::default() diff --git a/progenitor-impl/tests/output/keeper-positional.out b/progenitor-impl/tests/output/keeper-positional.out index fdeda5e..447b237 100644 --- a/progenitor-impl/tests/output/keeper-positional.out +++ b/progenitor-impl/tests/output/keeper-positional.out @@ -13,11 +13,23 @@ pub mod types { pub key: String, } + impl From<&EnrolBody> for EnrolBody { + fn from(value: &EnrolBody) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GlobalJobsResult { pub summary: Vec, } + impl From<&GlobalJobsResult> for GlobalJobsResult { + fn from(value: &GlobalJobsResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct OutputRecord { pub msg: String, @@ -25,12 +37,24 @@ pub mod types { pub time: chrono::DateTime, } + impl From<&OutputRecord> for OutputRecord { + fn from(value: &OutputRecord) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct PingResult { pub host: String, pub ok: bool, } + impl From<&PingResult> for PingResult { + fn from(value: &PingResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ReportFinishBody { pub duration_millis: i32, @@ -39,6 +63,12 @@ pub mod types { pub id: ReportId, } + impl From<&ReportFinishBody> for ReportFinishBody { + fn from(value: &ReportFinishBody) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ReportId { pub host: String, @@ -48,17 +78,35 @@ pub mod types { pub uuid: String, } + impl From<&ReportId> for ReportId { + fn from(value: &ReportId) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ReportOutputBody { pub id: ReportId, pub record: OutputRecord, } + impl From<&ReportOutputBody> for ReportOutputBody { + fn from(value: &ReportOutputBody) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ReportResult { pub existed_already: bool, } + impl From<&ReportResult> for ReportResult { + fn from(value: &ReportResult) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ReportStartBody { pub id: ReportId, @@ -66,6 +114,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&ReportStartBody> for ReportStartBody { + fn from(value: &ReportStartBody) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ReportSummary { pub age_seconds: i32, @@ -75,6 +129,12 @@ pub mod types { pub status: i32, pub when: chrono::DateTime, } + + impl From<&ReportSummary> for ReportSummary { + fn from(value: &ReportSummary) -> Self { + value.clone() + } + } } #[derive(Clone, Debug)] diff --git a/progenitor-impl/tests/output/nexus-builder-tagged.out b/progenitor-impl/tests/output/nexus-builder-tagged.out index 1b8d71a..068cecd 100644 --- a/progenitor-impl/tests/output/nexus-builder-tagged.out +++ b/progenitor-impl/tests/output/nexus-builder-tagged.out @@ -15,6 +15,12 @@ pub mod types { pub serial: String, } + impl From<&Baseboard> for Baseboard { + fn from(value: &Baseboard) -> Self { + value.clone() + } + } + impl Baseboard { pub fn builder() -> builder::Baseboard { builder::Baseboard::default() @@ -41,6 +47,12 @@ pub mod types { RangeFrom { start: f64 }, } + impl From<&BinRangedouble> for BinRangedouble { + fn from(value: &BinRangedouble) -> Self { + value.clone() + } + } + ///A type storing a range over `T`. /// ///This type supports ranges similar to the `RangeTo`, `Range` and @@ -61,6 +73,12 @@ pub mod types { RangeFrom { start: i64 }, } + impl From<&BinRangeint64> for BinRangeint64 { + fn from(value: &BinRangeint64) -> Self { + value.clone() + } + } + ///Type storing bin edges and a count of samples within it. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Bindouble { @@ -70,6 +88,12 @@ pub mod types { pub range: BinRangedouble, } + impl From<&Bindouble> for Bindouble { + fn from(value: &Bindouble) -> Self { + value.clone() + } + } + impl Bindouble { pub fn builder() -> builder::Bindouble { builder::Bindouble::default() @@ -85,6 +109,12 @@ pub mod types { pub range: BinRangeint64, } + impl From<&Binint64> for Binint64 { + fn from(value: &Binint64) -> Self { + value.clone() + } + } + impl Binint64 { pub fn builder() -> builder::Binint64 { builder::Binint64::default() @@ -100,6 +130,18 @@ pub mod types { } } + impl From for i64 { + fn from(value: BlockSize) -> Self { + value.0 + } + } + + impl From<&BlockSize> for BlockSize { + fn from(value: &BlockSize) -> Self { + value.clone() + } + } + impl std::convert::TryFrom for BlockSize { type Error = &'static str; fn try_from(value: i64) -> Result { @@ -137,6 +179,58 @@ pub mod types { } } + impl From for u64 { + fn from(value: ByteCount) -> Self { + value.0 + } + } + + impl From<&ByteCount> for ByteCount { + fn from(value: &ByteCount) -> Self { + value.clone() + } + } + + impl From for ByteCount { + fn from(value: u64) -> Self { + Self(value) + } + } + + impl std::str::FromStr for ByteCount { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for ByteCount { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for ByteCount { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for ByteCount { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for ByteCount { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Client view of a [`Certificate`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Certificate { @@ -153,6 +247,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Certificate> for Certificate { + fn from(value: &Certificate) -> Self { + value.clone() + } + } + impl Certificate { pub fn builder() -> builder::Certificate { builder::Certificate::default() @@ -173,6 +273,12 @@ pub mod types { pub service: ServiceUsingCertificate, } + impl From<&CertificateCreate> for CertificateCreate { + fn from(value: &CertificateCreate) -> Self { + value.clone() + } + } + impl CertificateCreate { pub fn builder() -> builder::CertificateCreate { builder::CertificateCreate::default() @@ -189,6 +295,12 @@ pub mod types { pub next_page: Option, } + impl From<&CertificateResultsPage> for CertificateResultsPage { + fn from(value: &CertificateResultsPage) -> Self { + value.clone() + } + } + impl CertificateResultsPage { pub fn builder() -> builder::CertificateResultsPage { builder::CertificateResultsPage::default() @@ -209,6 +321,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&ComponentUpdate> for ComponentUpdate { + fn from(value: &ComponentUpdate) -> Self { + value.clone() + } + } + impl ComponentUpdate { pub fn builder() -> builder::ComponentUpdate { builder::ComponentUpdate::default() @@ -225,6 +343,12 @@ pub mod types { pub next_page: Option, } + impl From<&ComponentUpdateResultsPage> for ComponentUpdateResultsPage { + fn from(value: &ComponentUpdateResultsPage) -> Self { + value.clone() + } + } + impl ComponentUpdateResultsPage { pub fn builder() -> builder::ComponentUpdateResultsPage { builder::ComponentUpdateResultsPage::default() @@ -238,6 +362,12 @@ pub mod types { pub value: f64, } + impl From<&Cumulativedouble> for Cumulativedouble { + fn from(value: &Cumulativedouble) -> Self { + value.clone() + } + } + impl Cumulativedouble { pub fn builder() -> builder::Cumulativedouble { builder::Cumulativedouble::default() @@ -251,6 +381,12 @@ pub mod types { pub value: i64, } + impl From<&Cumulativeint64> for Cumulativeint64 { + fn from(value: &Cumulativeint64) -> Self { + value.clone() + } + } + impl Cumulativeint64 { pub fn builder() -> builder::Cumulativeint64 { builder::Cumulativeint64::default() @@ -281,6 +417,12 @@ pub mod types { HistogramF64(Histogramdouble), } + impl From<&Datum> for Datum { + fn from(value: &Datum) -> Self { + value.clone() + } + } + ///The type of an individual datum of a metric. #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum DatumType { @@ -304,6 +446,12 @@ pub mod types { HistogramF64, } + impl From<&DatumType> for DatumType { + fn from(value: &DatumType) -> Self { + value.clone() + } + } + impl ToString for DatumType { fn to_string(&self) -> String { match *self { @@ -367,6 +515,12 @@ pub mod types { pub public_cert: String, } + impl From<&DerEncodedKeyPair> for DerEncodedKeyPair { + fn from(value: &DerEncodedKeyPair) -> Self { + value.clone() + } + } + impl DerEncodedKeyPair { pub fn builder() -> builder::DerEncodedKeyPair { builder::DerEncodedKeyPair::default() @@ -380,6 +534,12 @@ pub mod types { pub grant_type: String, } + impl From<&DeviceAccessTokenRequest> for DeviceAccessTokenRequest { + fn from(value: &DeviceAccessTokenRequest) -> Self { + value.clone() + } + } + impl DeviceAccessTokenRequest { pub fn builder() -> builder::DeviceAccessTokenRequest { builder::DeviceAccessTokenRequest::default() @@ -391,6 +551,12 @@ pub mod types { pub client_id: uuid::Uuid, } + impl From<&DeviceAuthRequest> for DeviceAuthRequest { + fn from(value: &DeviceAuthRequest) -> Self { + value.clone() + } + } + impl DeviceAuthRequest { pub fn builder() -> builder::DeviceAuthRequest { builder::DeviceAuthRequest::default() @@ -402,6 +568,12 @@ pub mod types { pub user_code: String, } + impl From<&DeviceAuthVerify> for DeviceAuthVerify { + fn from(value: &DeviceAuthVerify) -> Self { + value.clone() + } + } + impl DeviceAuthVerify { pub fn builder() -> builder::DeviceAuthVerify { builder::DeviceAuthVerify::default() @@ -415,6 +587,12 @@ pub mod types { Sha256(String), } + impl From<&Digest> for Digest { + fn from(value: &Digest) -> Self { + value.clone() + } + } + ///Client view of a [`Disk`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Disk { @@ -439,6 +617,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Disk> for Disk { + fn from(value: &Disk) -> Self { + value.clone() + } + } + impl Disk { pub fn builder() -> builder::Disk { builder::Disk::default() @@ -457,6 +641,12 @@ pub mod types { pub size: ByteCount, } + impl From<&DiskCreate> for DiskCreate { + fn from(value: &DiskCreate) -> Self { + value.clone() + } + } + impl DiskCreate { pub fn builder() -> builder::DiskCreate { builder::DiskCreate::default() @@ -471,6 +661,12 @@ pub mod types { pub name: Name, } + impl From<&DiskIdentifier> for DiskIdentifier { + fn from(value: &DiskIdentifier) -> Self { + value.clone() + } + } + impl DiskIdentifier { pub fn builder() -> builder::DiskIdentifier { builder::DiskIdentifier::default() @@ -493,6 +689,12 @@ pub mod types { WriteBytes, } + impl From<&DiskMetricName> for DiskMetricName { + fn from(value: &DiskMetricName) -> Self { + value.clone() + } + } + impl ToString for DiskMetricName { fn to_string(&self) -> String { match *self { @@ -547,6 +749,12 @@ pub mod types { pub disk: NameOrId, } + impl From<&DiskPath> for DiskPath { + fn from(value: &DiskPath) -> Self { + value.clone() + } + } + impl DiskPath { pub fn builder() -> builder::DiskPath { builder::DiskPath::default() @@ -563,6 +771,12 @@ pub mod types { pub next_page: Option, } + impl From<&DiskResultsPage> for DiskResultsPage { + fn from(value: &DiskResultsPage) -> Self { + value.clone() + } + } + impl DiskResultsPage { pub fn builder() -> builder::DiskResultsPage { builder::DiskResultsPage::default() @@ -591,6 +805,12 @@ pub mod types { GlobalImage { image_id: uuid::Uuid }, } + impl From<&DiskSource> for DiskSource { + fn from(value: &DiskSource) -> Self { + value.clone() + } + } + ///State of a Disk (primarily: attached or not) #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "state", content = "instance")] @@ -614,6 +834,12 @@ pub mod types { Faulted, } + impl From<&DiskState> for DiskState { + fn from(value: &DiskState) -> Self { + value.clone() + } + } + ///OS image distribution #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Distribution { @@ -623,6 +849,12 @@ pub mod types { pub version: String, } + impl From<&Distribution> for Distribution { + fn from(value: &Distribution) -> Self { + value.clone() + } + } + impl Distribution { pub fn builder() -> builder::Distribution { builder::Distribution::default() @@ -638,6 +870,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + impl Error { pub fn builder() -> builder::Error { builder::Error::default() @@ -650,6 +888,12 @@ pub mod types { pub kind: IpKind, } + impl From<&ExternalIp> for ExternalIp { + fn from(value: &ExternalIp) -> Self { + value.clone() + } + } + impl ExternalIp { pub fn builder() -> builder::ExternalIp { builder::ExternalIp::default() @@ -670,6 +914,12 @@ pub mod types { }, } + impl From<&ExternalIpCreate> for ExternalIpCreate { + fn from(value: &ExternalIpCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ExternalIpResultsPage { @@ -680,6 +930,12 @@ pub mod types { pub next_page: Option, } + impl From<&ExternalIpResultsPage> for ExternalIpResultsPage { + fn from(value: &ExternalIpResultsPage) -> Self { + value.clone() + } + } + impl ExternalIpResultsPage { pub fn builder() -> builder::ExternalIpResultsPage { builder::ExternalIpResultsPage::default() @@ -694,6 +950,12 @@ pub mod types { pub ty: FieldType, } + impl From<&FieldSchema> for FieldSchema { + fn from(value: &FieldSchema) -> Self { + value.clone() + } + } + impl FieldSchema { pub fn builder() -> builder::FieldSchema { builder::FieldSchema::default() @@ -709,6 +971,12 @@ pub mod types { Metric, } + impl From<&FieldSource> for FieldSource { + fn from(value: &FieldSource) -> Self { + value.clone() + } + } + impl ToString for FieldSource { fn to_string(&self) -> String { match *self { @@ -765,6 +1033,12 @@ pub mod types { Bool, } + impl From<&FieldType> for FieldType { + fn from(value: &FieldType) -> Self { + value.clone() + } + } + impl ToString for FieldType { fn to_string(&self) -> String { match *self { @@ -822,6 +1096,12 @@ pub mod types { Viewer, } + impl From<&FleetRole> for FleetRole { + fn from(value: &FleetRole) -> Self { + value.clone() + } + } + impl ToString for FleetRole { fn to_string(&self) -> String { match *self { @@ -877,6 +1157,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&FleetRolePolicy> for FleetRolePolicy { + fn from(value: &FleetRolePolicy) -> Self { + value.clone() + } + } + impl FleetRolePolicy { pub fn builder() -> builder::FleetRolePolicy { builder::FleetRolePolicy::default() @@ -896,6 +1182,12 @@ pub mod types { pub role_name: FleetRole, } + impl From<&FleetRoleRoleAssignment> for FleetRoleRoleAssignment { + fn from(value: &FleetRoleRoleAssignment) -> Self { + value.clone() + } + } + impl FleetRoleRoleAssignment { pub fn builder() -> builder::FleetRoleRoleAssignment { builder::FleetRoleRoleAssignment::default() @@ -931,6 +1223,12 @@ pub mod types { pub version: String, } + impl From<&GlobalImage> for GlobalImage { + fn from(value: &GlobalImage) -> Self { + value.clone() + } + } + impl GlobalImage { pub fn builder() -> builder::GlobalImage { builder::GlobalImage::default() @@ -951,6 +1249,12 @@ pub mod types { pub source: ImageSource, } + impl From<&GlobalImageCreate> for GlobalImageCreate { + fn from(value: &GlobalImageCreate) -> Self { + value.clone() + } + } + impl GlobalImageCreate { pub fn builder() -> builder::GlobalImageCreate { builder::GlobalImageCreate::default() @@ -967,6 +1271,12 @@ pub mod types { pub next_page: Option, } + impl From<&GlobalImageResultsPage> for GlobalImageResultsPage { + fn from(value: &GlobalImageResultsPage) -> Self { + value.clone() + } + } + impl GlobalImageResultsPage { pub fn builder() -> builder::GlobalImageResultsPage { builder::GlobalImageResultsPage::default() @@ -983,6 +1293,12 @@ pub mod types { pub silo_id: uuid::Uuid, } + impl From<&Group> for Group { + fn from(value: &Group) -> Self { + value.clone() + } + } + impl Group { pub fn builder() -> builder::Group { builder::Group::default() @@ -999,6 +1315,12 @@ pub mod types { pub next_page: Option, } + impl From<&GroupResultsPage> for GroupResultsPage { + fn from(value: &GroupResultsPage) -> Self { + value.clone() + } + } + impl GroupResultsPage { pub fn builder() -> builder::GroupResultsPage { builder::GroupResultsPage::default() @@ -1054,6 +1376,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&Histogramdouble> for Histogramdouble { + fn from(value: &Histogramdouble) -> Self { + value.clone() + } + } + impl Histogramdouble { pub fn builder() -> builder::Histogramdouble { builder::Histogramdouble::default() @@ -1109,6 +1437,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&Histogramint64> for Histogramint64 { + fn from(value: &Histogramint64) -> Self { + value.clone() + } + } + impl Histogramint64 { pub fn builder() -> builder::Histogramint64 { builder::Histogramint64::default() @@ -1125,6 +1459,12 @@ pub mod types { IdAscending, } + impl From<&IdSortMode> for IdSortMode { + fn from(value: &IdSortMode) -> Self { + value.clone() + } + } + impl ToString for IdSortMode { fn to_string(&self) -> String { match *self { @@ -1181,6 +1521,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&IdentityProvider> for IdentityProvider { + fn from(value: &IdentityProvider) -> Self { + value.clone() + } + } + impl IdentityProvider { pub fn builder() -> builder::IdentityProvider { builder::IdentityProvider::default() @@ -1197,6 +1543,12 @@ pub mod types { pub next_page: Option, } + impl From<&IdentityProviderResultsPage> for IdentityProviderResultsPage { + fn from(value: &IdentityProviderResultsPage) -> Self { + value.clone() + } + } + impl IdentityProviderResultsPage { pub fn builder() -> builder::IdentityProviderResultsPage { builder::IdentityProviderResultsPage::default() @@ -1210,6 +1562,12 @@ pub mod types { Saml, } + impl From<&IdentityProviderType> for IdentityProviderType { + fn from(value: &IdentityProviderType) -> Self { + value.clone() + } + } + impl ToString for IdentityProviderType { fn to_string(&self) -> String { match *self { @@ -1258,6 +1616,12 @@ pub mod types { SiloGroup, } + impl From<&IdentityType> for IdentityType { + fn from(value: &IdentityType) -> Self { + value.clone() + } + } + impl ToString for IdentityType { fn to_string(&self) -> String { match *self { @@ -1308,6 +1672,12 @@ pub mod types { Base64EncodedXml { data: String }, } + impl From<&IdpMetadataSource> for IdpMetadataSource { + fn from(value: &IdpMetadataSource) -> Self { + value.clone() + } + } + ///Client view of project Images #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Image { @@ -1338,6 +1708,12 @@ pub mod types { pub version: Option, } + impl From<&Image> for Image { + fn from(value: &Image) -> Self { + value.clone() + } + } + impl Image { pub fn builder() -> builder::Image { builder::Image::default() @@ -1356,6 +1732,12 @@ pub mod types { pub source: ImageSource, } + impl From<&ImageCreate> for ImageCreate { + fn from(value: &ImageCreate) -> Self { + value.clone() + } + } + impl ImageCreate { pub fn builder() -> builder::ImageCreate { builder::ImageCreate::default() @@ -1372,6 +1754,12 @@ pub mod types { pub next_page: Option, } + impl From<&ImageResultsPage> for ImageResultsPage { + fn from(value: &ImageResultsPage) -> Self { + value.clone() + } + } + impl ImageResultsPage { pub fn builder() -> builder::ImageResultsPage { builder::ImageResultsPage::default() @@ -1390,6 +1778,12 @@ pub mod types { YouCanBootAnythingAsLongAsItsAlpine, } + impl From<&ImageSource> for ImageSource { + fn from(value: &ImageSource) -> Self { + value.clone() + } + } + ///Client view of an [`Instance`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Instance { @@ -1415,6 +1809,12 @@ pub mod types { pub time_run_state_updated: chrono::DateTime, } + impl From<&Instance> for Instance { + fn from(value: &Instance) -> Self { + value.clone() + } + } + impl Instance { pub fn builder() -> builder::Instance { builder::Instance::default() @@ -1431,6 +1831,58 @@ pub mod types { } } + impl From for u16 { + fn from(value: InstanceCpuCount) -> Self { + value.0 + } + } + + impl From<&InstanceCpuCount> for InstanceCpuCount { + fn from(value: &InstanceCpuCount) -> Self { + value.clone() + } + } + + impl From for InstanceCpuCount { + fn from(value: u16) -> Self { + Self(value) + } + } + + impl std::str::FromStr for InstanceCpuCount { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for InstanceCpuCount { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Create-time parameters for an /// [`Instance`](omicron_common::api::external::Instance) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -1464,6 +1916,12 @@ pub mod types { pub user_data: String, } + impl From<&InstanceCreate> for InstanceCreate { + fn from(value: &InstanceCreate) -> Self { + value.clone() + } + } + impl InstanceCreate { pub fn builder() -> builder::InstanceCreate { builder::InstanceCreate::default() @@ -1492,6 +1950,12 @@ pub mod types { }, } + impl From<&InstanceDiskAttachment> for InstanceDiskAttachment { + fn from(value: &InstanceDiskAttachment) -> Self { + value.clone() + } + } + ///Migration parameters for an /// [`Instance`](omicron_common::api::external::Instance) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -1499,6 +1963,12 @@ pub mod types { pub dst_sled_id: uuid::Uuid, } + impl From<&InstanceMigrate> for InstanceMigrate { + fn from(value: &InstanceMigrate) -> Self { + value.clone() + } + } + impl InstanceMigrate { pub fn builder() -> builder::InstanceMigrate { builder::InstanceMigrate::default() @@ -1522,6 +1992,12 @@ pub mod types { None, } + impl From<&InstanceNetworkInterfaceAttachment> for InstanceNetworkInterfaceAttachment { + fn from(value: &InstanceNetworkInterfaceAttachment) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceResultsPage { @@ -1532,6 +2008,12 @@ pub mod types { pub next_page: Option, } + impl From<&InstanceResultsPage> for InstanceResultsPage { + fn from(value: &InstanceResultsPage) -> Self { + value.clone() + } + } + impl InstanceResultsPage { pub fn builder() -> builder::InstanceResultsPage { builder::InstanceResultsPage::default() @@ -1550,6 +2032,12 @@ pub mod types { pub last_byte_offset: u64, } + impl From<&InstanceSerialConsoleData> for InstanceSerialConsoleData { + fn from(value: &InstanceSerialConsoleData) -> Self { + value.clone() + } + } + impl InstanceSerialConsoleData { pub fn builder() -> builder::InstanceSerialConsoleData { builder::InstanceSerialConsoleData::default() @@ -1598,6 +2086,12 @@ pub mod types { Destroyed, } + impl From<&InstanceState> for InstanceState { + fn from(value: &InstanceState) -> Self { + value.clone() + } + } + impl ToString for InstanceState { fn to_string(&self) -> String { match *self { @@ -1664,6 +2158,12 @@ pub mod types { Floating, } + impl From<&IpKind> for IpKind { + fn from(value: &IpKind) -> Self { + value.clone() + } + } + impl ToString for IpKind { fn to_string(&self) -> String { match *self { @@ -1712,6 +2212,12 @@ pub mod types { V6(Ipv6Net), } + impl From<&IpNet> for IpNet { + fn from(value: &IpNet) -> Self { + value.clone() + } + } + impl std::str::FromStr for IpNet { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1771,6 +2277,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&IpPool> for IpPool { + fn from(value: &IpPool) -> Self { + value.clone() + } + } + impl IpPool { pub fn builder() -> builder::IpPool { builder::IpPool::default() @@ -1786,6 +2298,12 @@ pub mod types { pub name: Name, } + impl From<&IpPoolCreate> for IpPoolCreate { + fn from(value: &IpPoolCreate) -> Self { + value.clone() + } + } + impl IpPoolCreate { pub fn builder() -> builder::IpPoolCreate { builder::IpPoolCreate::default() @@ -1799,6 +2317,12 @@ pub mod types { pub time_created: chrono::DateTime, } + impl From<&IpPoolRange> for IpPoolRange { + fn from(value: &IpPoolRange) -> Self { + value.clone() + } + } + impl IpPoolRange { pub fn builder() -> builder::IpPoolRange { builder::IpPoolRange::default() @@ -1815,6 +2339,12 @@ pub mod types { pub next_page: Option, } + impl From<&IpPoolRangeResultsPage> for IpPoolRangeResultsPage { + fn from(value: &IpPoolRangeResultsPage) -> Self { + value.clone() + } + } + impl IpPoolRangeResultsPage { pub fn builder() -> builder::IpPoolRangeResultsPage { builder::IpPoolRangeResultsPage::default() @@ -1831,6 +2361,12 @@ pub mod types { pub next_page: Option, } + impl From<&IpPoolResultsPage> for IpPoolResultsPage { + fn from(value: &IpPoolResultsPage) -> Self { + value.clone() + } + } + impl IpPoolResultsPage { pub fn builder() -> builder::IpPoolResultsPage { builder::IpPoolResultsPage::default() @@ -1846,6 +2382,12 @@ pub mod types { pub name: Option, } + impl From<&IpPoolUpdate> for IpPoolUpdate { + fn from(value: &IpPoolUpdate) -> Self { + value.clone() + } + } + impl IpPoolUpdate { pub fn builder() -> builder::IpPoolUpdate { builder::IpPoolUpdate::default() @@ -1859,6 +2401,12 @@ pub mod types { V6(Ipv6Range), } + impl From<&IpRange> for IpRange { + fn from(value: &IpRange) -> Self { + value.clone() + } + } + ///An IPv4 subnet, including prefix and subnet mask #[derive(Clone, Debug, Serialize)] pub struct Ipv4Net(String); @@ -1869,6 +2417,18 @@ pub mod types { } } + impl From for String { + fn from(value: Ipv4Net) -> Self { + value.0 + } + } + + impl From<&Ipv4Net> for Ipv4Net { + fn from(value: &Ipv4Net) -> Self { + value.clone() + } + } + impl std::str::FromStr for Ipv4Net { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1918,6 +2478,12 @@ pub mod types { pub last: std::net::Ipv4Addr, } + impl From<&Ipv4Range> for Ipv4Range { + fn from(value: &Ipv4Range) -> Self { + value.clone() + } + } + impl Ipv4Range { pub fn builder() -> builder::Ipv4Range { builder::Ipv4Range::default() @@ -1934,6 +2500,18 @@ pub mod types { } } + impl From for String { + fn from(value: Ipv6Net) -> Self { + value.0 + } + } + + impl From<&Ipv6Net> for Ipv6Net { + fn from(value: &Ipv6Net) -> Self { + value.clone() + } + } + impl std::str::FromStr for Ipv6Net { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1983,6 +2561,12 @@ pub mod types { pub last: std::net::Ipv6Addr, } + impl From<&Ipv6Range> for Ipv6Range { + fn from(value: &Ipv6Range) -> Self { + value.clone() + } + } + impl Ipv6Range { pub fn builder() -> builder::Ipv6Range { builder::Ipv6Range::default() @@ -2000,6 +2584,18 @@ pub mod types { } } + impl From for String { + fn from(value: L4PortRange) -> Self { + value.0 + } + } + + impl From<&L4PortRange> for L4PortRange { + fn from(value: &L4PortRange) -> Self { + value.clone() + } + } + impl std::str::FromStr for L4PortRange { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2062,6 +2658,18 @@ pub mod types { } } + impl From for String { + fn from(value: MacAddr) -> Self { + value.0 + } + } + + impl From<&MacAddr> for MacAddr { + fn from(value: &MacAddr) -> Self { + value.clone() + } + } + impl std::str::FromStr for MacAddr { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2121,6 +2729,12 @@ pub mod types { pub timestamp: chrono::DateTime, } + impl From<&Measurement> for Measurement { + fn from(value: &Measurement) -> Self { + value.clone() + } + } + impl Measurement { pub fn builder() -> builder::Measurement { builder::Measurement::default() @@ -2137,6 +2751,12 @@ pub mod types { pub next_page: Option, } + impl From<&MeasurementResultsPage> for MeasurementResultsPage { + fn from(value: &MeasurementResultsPage) -> Self { + value.clone() + } + } + impl MeasurementResultsPage { pub fn builder() -> builder::MeasurementResultsPage { builder::MeasurementResultsPage::default() @@ -2155,6 +2775,18 @@ pub mod types { } } + impl From for String { + fn from(value: Name) -> Self { + value.0 + } + } + + impl From<&Name> for Name { + fn from(value: &Name) -> Self { + value.clone() + } + } + impl std::str::FromStr for Name { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2205,6 +2837,12 @@ pub mod types { Name(Name), } + impl From<&NameOrId> for NameOrId { + fn from(value: &NameOrId) -> Self { + value.clone() + } + } + impl std::str::FromStr for NameOrId { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2262,6 +2900,12 @@ pub mod types { IdAscending, } + impl From<&NameOrIdSortMode> for NameOrIdSortMode { + fn from(value: &NameOrIdSortMode) -> Self { + value.clone() + } + } + impl ToString for NameOrIdSortMode { fn to_string(&self) -> String { match *self { @@ -2315,6 +2959,12 @@ pub mod types { NameAscending, } + impl From<&NameSortMode> for NameSortMode { + fn from(value: &NameSortMode) -> Self { + value.clone() + } + } + impl ToString for NameSortMode { fn to_string(&self) -> String { match *self { @@ -2382,6 +3032,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&NetworkInterface> for NetworkInterface { + fn from(value: &NetworkInterface) -> Self { + value.clone() + } + } + impl NetworkInterface { pub fn builder() -> builder::NetworkInterface { builder::NetworkInterface::default() @@ -2404,6 +3060,12 @@ pub mod types { pub vpc_name: Name, } + impl From<&NetworkInterfaceCreate> for NetworkInterfaceCreate { + fn from(value: &NetworkInterfaceCreate) -> Self { + value.clone() + } + } + impl NetworkInterfaceCreate { pub fn builder() -> builder::NetworkInterfaceCreate { builder::NetworkInterfaceCreate::default() @@ -2420,6 +3082,12 @@ pub mod types { pub next_page: Option, } + impl From<&NetworkInterfaceResultsPage> for NetworkInterfaceResultsPage { + fn from(value: &NetworkInterfaceResultsPage) -> Self { + value.clone() + } + } + impl NetworkInterfaceResultsPage { pub fn builder() -> builder::NetworkInterfaceResultsPage { builder::NetworkInterfaceResultsPage::default() @@ -2452,6 +3120,12 @@ pub mod types { pub primary: bool, } + impl From<&NetworkInterfaceUpdate> for NetworkInterfaceUpdate { + fn from(value: &NetworkInterfaceUpdate) -> Self { + value.clone() + } + } + impl NetworkInterfaceUpdate { pub fn builder() -> builder::NetworkInterfaceUpdate { builder::NetworkInterfaceUpdate::default() @@ -2473,6 +3147,37 @@ pub mod types { } } + impl From for String { + fn from(value: NodeName) -> Self { + value.0 + } + } + + impl From<&NodeName> for NodeName { + fn from(value: &NodeName) -> Self { + value.clone() + } + } + + impl From for NodeName { + fn from(value: String) -> Self { + Self(value) + } + } + + impl std::str::FromStr for NodeName { + type Err = std::convert::Infallible; + fn from_str(value: &str) -> Result { + Ok(Self(value.to_string())) + } + } + + impl ToString for NodeName { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Client view of an [`Organization`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Organization { @@ -2488,6 +3193,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Organization> for Organization { + fn from(value: &Organization) -> Self { + value.clone() + } + } + impl Organization { pub fn builder() -> builder::Organization { builder::Organization::default() @@ -2502,6 +3213,12 @@ pub mod types { pub name: Name, } + impl From<&OrganizationCreate> for OrganizationCreate { + fn from(value: &OrganizationCreate) -> Self { + value.clone() + } + } + impl OrganizationCreate { pub fn builder() -> builder::OrganizationCreate { builder::OrganizationCreate::default() @@ -2518,6 +3235,12 @@ pub mod types { pub next_page: Option, } + impl From<&OrganizationResultsPage> for OrganizationResultsPage { + fn from(value: &OrganizationResultsPage) -> Self { + value.clone() + } + } + impl OrganizationResultsPage { pub fn builder() -> builder::OrganizationResultsPage { builder::OrganizationResultsPage::default() @@ -2534,6 +3257,12 @@ pub mod types { Viewer, } + impl From<&OrganizationRole> for OrganizationRole { + fn from(value: &OrganizationRole) -> Self { + value.clone() + } + } + impl ToString for OrganizationRole { fn to_string(&self) -> String { match *self { @@ -2589,6 +3318,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&OrganizationRolePolicy> for OrganizationRolePolicy { + fn from(value: &OrganizationRolePolicy) -> Self { + value.clone() + } + } + impl OrganizationRolePolicy { pub fn builder() -> builder::OrganizationRolePolicy { builder::OrganizationRolePolicy::default() @@ -2608,6 +3343,12 @@ pub mod types { pub role_name: OrganizationRole, } + impl From<&OrganizationRoleRoleAssignment> for OrganizationRoleRoleAssignment { + fn from(value: &OrganizationRoleRoleAssignment) -> Self { + value.clone() + } + } + impl OrganizationRoleRoleAssignment { pub fn builder() -> builder::OrganizationRoleRoleAssignment { builder::OrganizationRoleRoleAssignment::default() @@ -2624,6 +3365,12 @@ pub mod types { pub name: Option, } + impl From<&OrganizationUpdate> for OrganizationUpdate { + fn from(value: &OrganizationUpdate) -> Self { + value.clone() + } + } + impl OrganizationUpdate { pub fn builder() -> builder::OrganizationUpdate { builder::OrganizationUpdate::default() @@ -2640,6 +3387,18 @@ pub mod types { } } + impl From for String { + fn from(value: Password) -> Self { + value.0 + } + } + + impl From<&Password> for Password { + fn from(value: &Password) -> Self { + value.clone() + } + } + impl std::str::FromStr for Password { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2700,6 +3459,12 @@ pub mod types { pub vendor: String, } + impl From<&PhysicalDisk> for PhysicalDisk { + fn from(value: &PhysicalDisk) -> Self { + value.clone() + } + } + impl PhysicalDisk { pub fn builder() -> builder::PhysicalDisk { builder::PhysicalDisk::default() @@ -2716,6 +3481,12 @@ pub mod types { pub next_page: Option, } + impl From<&PhysicalDiskResultsPage> for PhysicalDiskResultsPage { + fn from(value: &PhysicalDiskResultsPage) -> Self { + value.clone() + } + } + impl PhysicalDiskResultsPage { pub fn builder() -> builder::PhysicalDiskResultsPage { builder::PhysicalDiskResultsPage::default() @@ -2730,6 +3501,12 @@ pub mod types { External, } + impl From<&PhysicalDiskType> for PhysicalDiskType { + fn from(value: &PhysicalDiskType) -> Self { + value.clone() + } + } + impl ToString for PhysicalDiskType { fn to_string(&self) -> String { match *self { @@ -2787,6 +3564,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Project> for Project { + fn from(value: &Project) -> Self { + value.clone() + } + } + impl Project { pub fn builder() -> builder::Project { builder::Project::default() @@ -2801,6 +3584,12 @@ pub mod types { pub name: Name, } + impl From<&ProjectCreate> for ProjectCreate { + fn from(value: &ProjectCreate) -> Self { + value.clone() + } + } + impl ProjectCreate { pub fn builder() -> builder::ProjectCreate { builder::ProjectCreate::default() @@ -2817,6 +3606,12 @@ pub mod types { pub next_page: Option, } + impl From<&ProjectResultsPage> for ProjectResultsPage { + fn from(value: &ProjectResultsPage) -> Self { + value.clone() + } + } + impl ProjectResultsPage { pub fn builder() -> builder::ProjectResultsPage { builder::ProjectResultsPage::default() @@ -2833,6 +3628,12 @@ pub mod types { Viewer, } + impl From<&ProjectRole> for ProjectRole { + fn from(value: &ProjectRole) -> Self { + value.clone() + } + } + impl ToString for ProjectRole { fn to_string(&self) -> String { match *self { @@ -2888,6 +3689,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&ProjectRolePolicy> for ProjectRolePolicy { + fn from(value: &ProjectRolePolicy) -> Self { + value.clone() + } + } + impl ProjectRolePolicy { pub fn builder() -> builder::ProjectRolePolicy { builder::ProjectRolePolicy::default() @@ -2907,6 +3714,12 @@ pub mod types { pub role_name: ProjectRole, } + impl From<&ProjectRoleRoleAssignment> for ProjectRoleRoleAssignment { + fn from(value: &ProjectRoleRoleAssignment) -> Self { + value.clone() + } + } + impl ProjectRoleRoleAssignment { pub fn builder() -> builder::ProjectRoleRoleAssignment { builder::ProjectRoleRoleAssignment::default() @@ -2923,6 +3736,12 @@ pub mod types { pub name: Option, } + impl From<&ProjectUpdate> for ProjectUpdate { + fn from(value: &ProjectUpdate) -> Self { + value.clone() + } + } + impl ProjectUpdate { pub fn builder() -> builder::ProjectUpdate { builder::ProjectUpdate::default() @@ -2940,6 +3759,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Rack> for Rack { + fn from(value: &Rack) -> Self { + value.clone() + } + } + impl Rack { pub fn builder() -> builder::Rack { builder::Rack::default() @@ -2956,6 +3781,12 @@ pub mod types { pub next_page: Option, } + impl From<&RackResultsPage> for RackResultsPage { + fn from(value: &RackResultsPage) -> Self { + value.clone() + } + } + impl RackResultsPage { pub fn builder() -> builder::RackResultsPage { builder::RackResultsPage::default() @@ -2969,6 +3800,12 @@ pub mod types { pub name: RoleName, } + impl From<&Role> for Role { + fn from(value: &Role) -> Self { + value.clone() + } + } + impl Role { pub fn builder() -> builder::Role { builder::Role::default() @@ -2985,6 +3822,18 @@ pub mod types { } } + impl From for String { + fn from(value: RoleName) -> Self { + value.0 + } + } + + impl From<&RoleName> for RoleName { + fn from(value: &RoleName) -> Self { + value.clone() + } + } + impl std::str::FromStr for RoleName { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -3044,6 +3893,12 @@ pub mod types { pub next_page: Option, } + impl From<&RoleResultsPage> for RoleResultsPage { + fn from(value: &RoleResultsPage) -> Self { + value.clone() + } + } + impl RoleResultsPage { pub fn builder() -> builder::RoleResultsPage { builder::RoleResultsPage::default() @@ -3073,6 +3928,12 @@ pub mod types { Subnet(Name), } + impl From<&RouteDestination> for RouteDestination { + fn from(value: &RouteDestination) -> Self { + value.clone() + } + } + ///A `RouteTarget` describes the possible locations that traffic matching a /// route destination can be sent. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -3095,6 +3956,12 @@ pub mod types { InternetGateway(Name), } + impl From<&RouteTarget> for RouteTarget { + fn from(value: &RouteTarget) -> Self { + value.clone() + } + } + ///A route defines a rule that governs where traffic should be sent based /// on its destination. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -3117,6 +3984,12 @@ pub mod types { pub vpc_router_id: uuid::Uuid, } + impl From<&RouterRoute> for RouterRoute { + fn from(value: &RouterRoute) -> Self { + value.clone() + } + } + impl RouterRoute { pub fn builder() -> builder::RouterRoute { builder::RouterRoute::default() @@ -3132,6 +4005,12 @@ pub mod types { pub target: RouteTarget, } + impl From<&RouterRouteCreateParams> for RouterRouteCreateParams { + fn from(value: &RouterRouteCreateParams) -> Self { + value.clone() + } + } + impl RouterRouteCreateParams { pub fn builder() -> builder::RouterRouteCreateParams { builder::RouterRouteCreateParams::default() @@ -3168,6 +4047,12 @@ pub mod types { Custom, } + impl From<&RouterRouteKind> for RouterRouteKind { + fn from(value: &RouterRouteKind) -> Self { + value.clone() + } + } + impl ToString for RouterRouteKind { fn to_string(&self) -> String { match *self { @@ -3223,6 +4108,12 @@ pub mod types { pub next_page: Option, } + impl From<&RouterRouteResultsPage> for RouterRouteResultsPage { + fn from(value: &RouterRouteResultsPage) -> Self { + value.clone() + } + } + impl RouterRouteResultsPage { pub fn builder() -> builder::RouterRouteResultsPage { builder::RouterRouteResultsPage::default() @@ -3240,6 +4131,12 @@ pub mod types { pub target: RouteTarget, } + impl From<&RouterRouteUpdateParams> for RouterRouteUpdateParams { + fn from(value: &RouterRouteUpdateParams) -> Self { + value.clone() + } + } + impl RouterRouteUpdateParams { pub fn builder() -> builder::RouterRouteUpdateParams { builder::RouterRouteUpdateParams::default() @@ -3252,6 +4149,12 @@ pub mod types { pub state: SagaState, } + impl From<&Saga> for Saga { + fn from(value: &Saga) -> Self { + value.clone() + } + } + impl Saga { pub fn builder() -> builder::Saga { builder::Saga::default() @@ -3273,6 +4176,12 @@ pub mod types { SubsagaCreateFailed { message: String }, } + impl From<&SagaErrorInfo> for SagaErrorInfo { + fn from(value: &SagaErrorInfo) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SagaResultsPage { @@ -3283,6 +4192,12 @@ pub mod types { pub next_page: Option, } + impl From<&SagaResultsPage> for SagaResultsPage { + fn from(value: &SagaResultsPage) -> Self { + value.clone() + } + } + impl SagaResultsPage { pub fn builder() -> builder::SagaResultsPage { builder::SagaResultsPage::default() @@ -3303,6 +4218,12 @@ pub mod types { }, } + impl From<&SagaState> for SagaState { + fn from(value: &SagaState) -> Self { + value.clone() + } + } + ///Identity-related metadata that's included in nearly all public API /// objects #[derive(Clone, Debug, Deserialize, Serialize)] @@ -3333,6 +4254,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&SamlIdentityProvider> for SamlIdentityProvider { + fn from(value: &SamlIdentityProvider) -> Self { + value.clone() + } + } + impl SamlIdentityProvider { pub fn builder() -> builder::SamlIdentityProvider { builder::SamlIdentityProvider::default() @@ -3366,6 +4293,12 @@ pub mod types { pub technical_contact_email: String, } + impl From<&SamlIdentityProviderCreate> for SamlIdentityProviderCreate { + fn from(value: &SamlIdentityProviderCreate) -> Self { + value.clone() + } + } + impl SamlIdentityProviderCreate { pub fn builder() -> builder::SamlIdentityProviderCreate { builder::SamlIdentityProviderCreate::default() @@ -3381,6 +4314,18 @@ pub mod types { } } + impl From for String { + fn from(value: SemverVersion) -> Self { + value.0 + } + } + + impl From<&SemverVersion> for SemverVersion { + fn from(value: &SemverVersion) -> Self { + value.clone() + } + } + impl std::str::FromStr for SemverVersion { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -3435,6 +4380,12 @@ pub mod types { ExternalApi, } + impl From<&ServiceUsingCertificate> for ServiceUsingCertificate { + fn from(value: &ServiceUsingCertificate) -> Self { + value.clone() + } + } + impl ToString for ServiceUsingCertificate { fn to_string(&self) -> String { match *self { @@ -3494,6 +4445,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Silo> for Silo { + fn from(value: &Silo) -> Self { + value.clone() + } + } + impl Silo { pub fn builder() -> builder::Silo { builder::Silo::default() @@ -3519,6 +4476,12 @@ pub mod types { pub name: Name, } + impl From<&SiloCreate> for SiloCreate { + fn from(value: &SiloCreate) -> Self { + value.clone() + } + } + impl SiloCreate { pub fn builder() -> builder::SiloCreate { builder::SiloCreate::default() @@ -3541,6 +4504,12 @@ pub mod types { LocalOnly, } + impl From<&SiloIdentityMode> for SiloIdentityMode { + fn from(value: &SiloIdentityMode) -> Self { + value.clone() + } + } + impl ToString for SiloIdentityMode { fn to_string(&self) -> String { match *self { @@ -3592,6 +4561,12 @@ pub mod types { pub next_page: Option, } + impl From<&SiloResultsPage> for SiloResultsPage { + fn from(value: &SiloResultsPage) -> Self { + value.clone() + } + } + impl SiloResultsPage { pub fn builder() -> builder::SiloResultsPage { builder::SiloResultsPage::default() @@ -3608,6 +4583,12 @@ pub mod types { Viewer, } + impl From<&SiloRole> for SiloRole { + fn from(value: &SiloRole) -> Self { + value.clone() + } + } + impl ToString for SiloRole { fn to_string(&self) -> String { match *self { @@ -3663,6 +4644,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&SiloRolePolicy> for SiloRolePolicy { + fn from(value: &SiloRolePolicy) -> Self { + value.clone() + } + } + impl SiloRolePolicy { pub fn builder() -> builder::SiloRolePolicy { builder::SiloRolePolicy::default() @@ -3682,6 +4669,12 @@ pub mod types { pub role_name: SiloRole, } + impl From<&SiloRoleRoleAssignment> for SiloRoleRoleAssignment { + fn from(value: &SiloRoleRoleAssignment) -> Self { + value.clone() + } + } + impl SiloRoleRoleAssignment { pub fn builder() -> builder::SiloRoleRoleAssignment { builder::SiloRoleRoleAssignment::default() @@ -3701,6 +4694,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Sled> for Sled { + fn from(value: &Sled) -> Self { + value.clone() + } + } + impl Sled { pub fn builder() -> builder::Sled { builder::Sled::default() @@ -3717,6 +4716,12 @@ pub mod types { pub next_page: Option, } + impl From<&SledResultsPage> for SledResultsPage { + fn from(value: &SledResultsPage) -> Self { + value.clone() + } + } + impl SledResultsPage { pub fn builder() -> builder::SledResultsPage { builder::SledResultsPage::default() @@ -3742,6 +4747,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Snapshot> for Snapshot { + fn from(value: &Snapshot) -> Self { + value.clone() + } + } + impl Snapshot { pub fn builder() -> builder::Snapshot { builder::Snapshot::default() @@ -3758,6 +4769,12 @@ pub mod types { pub name: Name, } + impl From<&SnapshotCreate> for SnapshotCreate { + fn from(value: &SnapshotCreate) -> Self { + value.clone() + } + } + impl SnapshotCreate { pub fn builder() -> builder::SnapshotCreate { builder::SnapshotCreate::default() @@ -3774,6 +4791,12 @@ pub mod types { pub next_page: Option, } + impl From<&SnapshotResultsPage> for SnapshotResultsPage { + fn from(value: &SnapshotResultsPage) -> Self { + value.clone() + } + } + impl SnapshotResultsPage { pub fn builder() -> builder::SnapshotResultsPage { builder::SnapshotResultsPage::default() @@ -3792,6 +4815,12 @@ pub mod types { Destroyed, } + impl From<&SnapshotState> for SnapshotState { + fn from(value: &SnapshotState) -> Self { + value.clone() + } + } + impl ToString for SnapshotState { fn to_string(&self) -> String { match *self { @@ -3842,6 +4871,12 @@ pub mod types { pub username: String, } + impl From<&SpoofLoginBody> for SpoofLoginBody { + fn from(value: &SpoofLoginBody) -> Self { + value.clone() + } + } + impl SpoofLoginBody { pub fn builder() -> builder::SpoofLoginBody { builder::SpoofLoginBody::default() @@ -3867,6 +4902,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&SshKey> for SshKey { + fn from(value: &SshKey) -> Self { + value.clone() + } + } + impl SshKey { pub fn builder() -> builder::SshKey { builder::SshKey::default() @@ -3883,6 +4924,12 @@ pub mod types { pub public_key: String, } + impl From<&SshKeyCreate> for SshKeyCreate { + fn from(value: &SshKeyCreate) -> Self { + value.clone() + } + } + impl SshKeyCreate { pub fn builder() -> builder::SshKeyCreate { builder::SshKeyCreate::default() @@ -3899,6 +4946,12 @@ pub mod types { pub next_page: Option, } + impl From<&SshKeyResultsPage> for SshKeyResultsPage { + fn from(value: &SshKeyResultsPage) -> Self { + value.clone() + } + } + impl SshKeyResultsPage { pub fn builder() -> builder::SshKeyResultsPage { builder::SshKeyResultsPage::default() @@ -3915,6 +4968,12 @@ pub mod types { RamProvisioned, } + impl From<&SystemMetricName> for SystemMetricName { + fn from(value: &SystemMetricName) -> Self { + value.clone() + } + } + impl ToString for SystemMetricName { fn to_string(&self) -> String { match *self { @@ -3971,6 +5030,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&SystemUpdate> for SystemUpdate { + fn from(value: &SystemUpdate) -> Self { + value.clone() + } + } + impl SystemUpdate { pub fn builder() -> builder::SystemUpdate { builder::SystemUpdate::default() @@ -3987,6 +5052,12 @@ pub mod types { pub next_page: Option, } + impl From<&SystemUpdateResultsPage> for SystemUpdateResultsPage { + fn from(value: &SystemUpdateResultsPage) -> Self { + value.clone() + } + } + impl SystemUpdateResultsPage { pub fn builder() -> builder::SystemUpdateResultsPage { builder::SystemUpdateResultsPage::default() @@ -3998,6 +5069,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&SystemUpdateStart> for SystemUpdateStart { + fn from(value: &SystemUpdateStart) -> Self { + value.clone() + } + } + impl SystemUpdateStart { pub fn builder() -> builder::SystemUpdateStart { builder::SystemUpdateStart::default() @@ -4010,6 +5087,12 @@ pub mod types { pub version_range: VersionRange, } + impl From<&SystemVersion> for SystemVersion { + fn from(value: &SystemVersion) -> Self { + value.clone() + } + } + impl SystemVersion { pub fn builder() -> builder::SystemVersion { builder::SystemVersion::default() @@ -4028,6 +5111,18 @@ pub mod types { } } + impl From for String { + fn from(value: TimeseriesName) -> Self { + value.0 + } + } + + impl From<&TimeseriesName> for TimeseriesName { + fn from(value: &TimeseriesName) -> Self { + value.clone() + } + } + impl std::str::FromStr for TimeseriesName { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -4088,6 +5183,12 @@ pub mod types { pub timeseries_name: TimeseriesName, } + impl From<&TimeseriesSchema> for TimeseriesSchema { + fn from(value: &TimeseriesSchema) -> Self { + value.clone() + } + } + impl TimeseriesSchema { pub fn builder() -> builder::TimeseriesSchema { builder::TimeseriesSchema::default() @@ -4104,6 +5205,12 @@ pub mod types { pub next_page: Option, } + impl From<&TimeseriesSchemaResultsPage> for TimeseriesSchemaResultsPage { + fn from(value: &TimeseriesSchemaResultsPage) -> Self { + value.clone() + } + } + impl TimeseriesSchemaResultsPage { pub fn builder() -> builder::TimeseriesSchemaResultsPage { builder::TimeseriesSchemaResultsPage::default() @@ -4124,6 +5231,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&UpdateDeployment> for UpdateDeployment { + fn from(value: &UpdateDeployment) -> Self { + value.clone() + } + } + impl UpdateDeployment { pub fn builder() -> builder::UpdateDeployment { builder::UpdateDeployment::default() @@ -4140,6 +5253,12 @@ pub mod types { pub next_page: Option, } + impl From<&UpdateDeploymentResultsPage> for UpdateDeploymentResultsPage { + fn from(value: &UpdateDeploymentResultsPage) -> Self { + value.clone() + } + } + impl UpdateDeploymentResultsPage { pub fn builder() -> builder::UpdateDeploymentResultsPage { builder::UpdateDeploymentResultsPage::default() @@ -4155,6 +5274,12 @@ pub mod types { Steady, } + impl From<&UpdateStatus> for UpdateStatus { + fn from(value: &UpdateStatus) -> Self { + value.clone() + } + } + impl ToString for UpdateStatus { fn to_string(&self) -> String { match *self { @@ -4213,6 +5338,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&UpdateableComponent> for UpdateableComponent { + fn from(value: &UpdateableComponent) -> Self { + value.clone() + } + } + impl UpdateableComponent { pub fn builder() -> builder::UpdateableComponent { builder::UpdateableComponent::default() @@ -4229,6 +5360,12 @@ pub mod types { pub next_page: Option, } + impl From<&UpdateableComponentResultsPage> for UpdateableComponentResultsPage { + fn from(value: &UpdateableComponentResultsPage) -> Self { + value.clone() + } + } + impl UpdateableComponentResultsPage { pub fn builder() -> builder::UpdateableComponentResultsPage { builder::UpdateableComponentResultsPage::default() @@ -4263,6 +5400,12 @@ pub mod types { HostOmicron, } + impl From<&UpdateableComponentType> for UpdateableComponentType { + fn from(value: &UpdateableComponentType) -> Self { + value.clone() + } + } + impl ToString for UpdateableComponentType { fn to_string(&self) -> String { match *self { @@ -4334,6 +5477,12 @@ pub mod types { pub silo_id: uuid::Uuid, } + impl From<&User> for User { + fn from(value: &User) -> Self { + value.clone() + } + } + impl User { pub fn builder() -> builder::User { builder::User::default() @@ -4355,6 +5504,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&UserBuiltin> for UserBuiltin { + fn from(value: &UserBuiltin) -> Self { + value.clone() + } + } + impl UserBuiltin { pub fn builder() -> builder::UserBuiltin { builder::UserBuiltin::default() @@ -4371,6 +5526,12 @@ pub mod types { pub next_page: Option, } + impl From<&UserBuiltinResultsPage> for UserBuiltinResultsPage { + fn from(value: &UserBuiltinResultsPage) -> Self { + value.clone() + } + } + impl UserBuiltinResultsPage { pub fn builder() -> builder::UserBuiltinResultsPage { builder::UserBuiltinResultsPage::default() @@ -4386,6 +5547,12 @@ pub mod types { pub password: UserPassword, } + impl From<&UserCreate> for UserCreate { + fn from(value: &UserCreate) -> Self { + value.clone() + } + } + impl UserCreate { pub fn builder() -> builder::UserCreate { builder::UserCreate::default() @@ -4404,6 +5571,18 @@ pub mod types { } } + impl From for String { + fn from(value: UserId) -> Self { + value.0 + } + } + + impl From<&UserId> for UserId { + fn from(value: &UserId) -> Self { + value.clone() + } + } + impl std::str::FromStr for UserId { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -4458,6 +5637,12 @@ pub mod types { InvalidPassword, } + impl From<&UserPassword> for UserPassword { + fn from(value: &UserPassword) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserResultsPage { @@ -4468,6 +5653,12 @@ pub mod types { pub next_page: Option, } + impl From<&UserResultsPage> for UserResultsPage { + fn from(value: &UserResultsPage) -> Self { + value.clone() + } + } + impl UserResultsPage { pub fn builder() -> builder::UserResultsPage { builder::UserResultsPage::default() @@ -4481,6 +5672,12 @@ pub mod types { pub username: UserId, } + impl From<&UsernamePasswordCredentials> for UsernamePasswordCredentials { + fn from(value: &UsernamePasswordCredentials) -> Self { + value.clone() + } + } + impl UsernamePasswordCredentials { pub fn builder() -> builder::UsernamePasswordCredentials { builder::UsernamePasswordCredentials::default() @@ -4493,6 +5690,12 @@ pub mod types { pub low: SemverVersion, } + impl From<&VersionRange> for VersionRange { + fn from(value: &VersionRange) -> Self { + value.clone() + } + } + impl VersionRange { pub fn builder() -> builder::VersionRange { builder::VersionRange::default() @@ -4522,6 +5725,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Vpc> for Vpc { + fn from(value: &Vpc) -> Self { + value.clone() + } + } + impl Vpc { pub fn builder() -> builder::Vpc { builder::Vpc::default() @@ -4544,6 +5753,12 @@ pub mod types { pub name: Name, } + impl From<&VpcCreate> for VpcCreate { + fn from(value: &VpcCreate) -> Self { + value.clone() + } + } + impl VpcCreate { pub fn builder() -> builder::VpcCreate { builder::VpcCreate::default() @@ -4579,6 +5794,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcFirewallRule> for VpcFirewallRule { + fn from(value: &VpcFirewallRule) -> Self { + value.clone() + } + } + impl VpcFirewallRule { pub fn builder() -> builder::VpcFirewallRule { builder::VpcFirewallRule::default() @@ -4593,6 +5814,12 @@ pub mod types { Deny, } + impl From<&VpcFirewallRuleAction> for VpcFirewallRuleAction { + fn from(value: &VpcFirewallRuleAction) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleAction { fn to_string(&self) -> String { match *self { @@ -4642,6 +5869,12 @@ pub mod types { Outbound, } + impl From<&VpcFirewallRuleDirection> for VpcFirewallRuleDirection { + fn from(value: &VpcFirewallRuleDirection) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleDirection { fn to_string(&self) -> String { match *self { @@ -4700,6 +5933,12 @@ pub mod types { pub protocols: Option>, } + impl From<&VpcFirewallRuleFilter> for VpcFirewallRuleFilter { + fn from(value: &VpcFirewallRuleFilter) -> Self { + value.clone() + } + } + impl VpcFirewallRuleFilter { pub fn builder() -> builder::VpcFirewallRuleFilter { builder::VpcFirewallRuleFilter::default() @@ -4728,6 +5967,12 @@ pub mod types { IpNet(IpNet), } + impl From<&VpcFirewallRuleHostFilter> for VpcFirewallRuleHostFilter { + fn from(value: &VpcFirewallRuleHostFilter) -> Self { + value.clone() + } + } + ///The protocols that may be specified in a firewall rule's filter #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum VpcFirewallRuleProtocol { @@ -4739,6 +5984,12 @@ pub mod types { Icmp, } + impl From<&VpcFirewallRuleProtocol> for VpcFirewallRuleProtocol { + fn from(value: &VpcFirewallRuleProtocol) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleProtocol { fn to_string(&self) -> String { match *self { @@ -4790,6 +6041,12 @@ pub mod types { Enabled, } + impl From<&VpcFirewallRuleStatus> for VpcFirewallRuleStatus { + fn from(value: &VpcFirewallRuleStatus) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleStatus { fn to_string(&self) -> String { match *self { @@ -4853,6 +6110,12 @@ pub mod types { IpNet(IpNet), } + impl From<&VpcFirewallRuleTarget> for VpcFirewallRuleTarget { + fn from(value: &VpcFirewallRuleTarget) -> Self { + value.clone() + } + } + ///A single rule in a VPC firewall #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcFirewallRuleUpdate { @@ -4874,6 +6137,12 @@ pub mod types { pub targets: Vec, } + impl From<&VpcFirewallRuleUpdate> for VpcFirewallRuleUpdate { + fn from(value: &VpcFirewallRuleUpdate) -> Self { + value.clone() + } + } + impl VpcFirewallRuleUpdate { pub fn builder() -> builder::VpcFirewallRuleUpdate { builder::VpcFirewallRuleUpdate::default() @@ -4888,6 +6157,12 @@ pub mod types { pub rules: Vec, } + impl From<&VpcFirewallRuleUpdateParams> for VpcFirewallRuleUpdateParams { + fn from(value: &VpcFirewallRuleUpdateParams) -> Self { + value.clone() + } + } + impl VpcFirewallRuleUpdateParams { pub fn builder() -> builder::VpcFirewallRuleUpdateParams { builder::VpcFirewallRuleUpdateParams::default() @@ -4900,6 +6175,12 @@ pub mod types { pub rules: Vec, } + impl From<&VpcFirewallRules> for VpcFirewallRules { + fn from(value: &VpcFirewallRules) -> Self { + value.clone() + } + } + impl VpcFirewallRules { pub fn builder() -> builder::VpcFirewallRules { builder::VpcFirewallRules::default() @@ -4916,6 +6197,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcResultsPage> for VpcResultsPage { + fn from(value: &VpcResultsPage) -> Self { + value.clone() + } + } + impl VpcResultsPage { pub fn builder() -> builder::VpcResultsPage { builder::VpcResultsPage::default() @@ -4941,6 +6228,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcRouter> for VpcRouter { + fn from(value: &VpcRouter) -> Self { + value.clone() + } + } + impl VpcRouter { pub fn builder() -> builder::VpcRouter { builder::VpcRouter::default() @@ -4955,6 +6248,12 @@ pub mod types { pub name: Name, } + impl From<&VpcRouterCreate> for VpcRouterCreate { + fn from(value: &VpcRouterCreate) -> Self { + value.clone() + } + } + impl VpcRouterCreate { pub fn builder() -> builder::VpcRouterCreate { builder::VpcRouterCreate::default() @@ -4969,6 +6268,12 @@ pub mod types { Custom, } + impl From<&VpcRouterKind> for VpcRouterKind { + fn from(value: &VpcRouterKind) -> Self { + value.clone() + } + } + impl ToString for VpcRouterKind { fn to_string(&self) -> String { match *self { @@ -5020,6 +6325,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcRouterResultsPage> for VpcRouterResultsPage { + fn from(value: &VpcRouterResultsPage) -> Self { + value.clone() + } + } + impl VpcRouterResultsPage { pub fn builder() -> builder::VpcRouterResultsPage { builder::VpcRouterResultsPage::default() @@ -5036,6 +6347,12 @@ pub mod types { pub name: Option, } + impl From<&VpcRouterUpdate> for VpcRouterUpdate { + fn from(value: &VpcRouterUpdate) -> Self { + value.clone() + } + } + impl VpcRouterUpdate { pub fn builder() -> builder::VpcRouterUpdate { builder::VpcRouterUpdate::default() @@ -5065,6 +6382,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcSubnet> for VpcSubnet { + fn from(value: &VpcSubnet) -> Self { + value.clone() + } + } + impl VpcSubnet { pub fn builder() -> builder::VpcSubnet { builder::VpcSubnet::default() @@ -5092,6 +6415,12 @@ pub mod types { pub name: Name, } + impl From<&VpcSubnetCreate> for VpcSubnetCreate { + fn from(value: &VpcSubnetCreate) -> Self { + value.clone() + } + } + impl VpcSubnetCreate { pub fn builder() -> builder::VpcSubnetCreate { builder::VpcSubnetCreate::default() @@ -5108,6 +6437,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcSubnetResultsPage> for VpcSubnetResultsPage { + fn from(value: &VpcSubnetResultsPage) -> Self { + value.clone() + } + } + impl VpcSubnetResultsPage { pub fn builder() -> builder::VpcSubnetResultsPage { builder::VpcSubnetResultsPage::default() @@ -5124,6 +6459,12 @@ pub mod types { pub name: Option, } + impl From<&VpcSubnetUpdate> for VpcSubnetUpdate { + fn from(value: &VpcSubnetUpdate) -> Self { + value.clone() + } + } + impl VpcSubnetUpdate { pub fn builder() -> builder::VpcSubnetUpdate { builder::VpcSubnetUpdate::default() @@ -5141,6 +6482,12 @@ pub mod types { pub name: Option, } + impl From<&VpcUpdate> for VpcUpdate { + fn from(value: &VpcUpdate) -> Self { + value.clone() + } + } + impl VpcUpdate { pub fn builder() -> builder::VpcUpdate { builder::VpcUpdate::default() diff --git a/progenitor-impl/tests/output/nexus-builder.out b/progenitor-impl/tests/output/nexus-builder.out index 2eb6c3b..ce04faf 100644 --- a/progenitor-impl/tests/output/nexus-builder.out +++ b/progenitor-impl/tests/output/nexus-builder.out @@ -15,6 +15,12 @@ pub mod types { pub serial: String, } + impl From<&Baseboard> for Baseboard { + fn from(value: &Baseboard) -> Self { + value.clone() + } + } + impl Baseboard { pub fn builder() -> builder::Baseboard { builder::Baseboard::default() @@ -41,6 +47,12 @@ pub mod types { RangeFrom { start: f64 }, } + impl From<&BinRangedouble> for BinRangedouble { + fn from(value: &BinRangedouble) -> Self { + value.clone() + } + } + ///A type storing a range over `T`. /// ///This type supports ranges similar to the `RangeTo`, `Range` and @@ -61,6 +73,12 @@ pub mod types { RangeFrom { start: i64 }, } + impl From<&BinRangeint64> for BinRangeint64 { + fn from(value: &BinRangeint64) -> Self { + value.clone() + } + } + ///Type storing bin edges and a count of samples within it. #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Bindouble { @@ -70,6 +88,12 @@ pub mod types { pub range: BinRangedouble, } + impl From<&Bindouble> for Bindouble { + fn from(value: &Bindouble) -> Self { + value.clone() + } + } + impl Bindouble { pub fn builder() -> builder::Bindouble { builder::Bindouble::default() @@ -85,6 +109,12 @@ pub mod types { pub range: BinRangeint64, } + impl From<&Binint64> for Binint64 { + fn from(value: &Binint64) -> Self { + value.clone() + } + } + impl Binint64 { pub fn builder() -> builder::Binint64 { builder::Binint64::default() @@ -100,6 +130,18 @@ pub mod types { } } + impl From for i64 { + fn from(value: BlockSize) -> Self { + value.0 + } + } + + impl From<&BlockSize> for BlockSize { + fn from(value: &BlockSize) -> Self { + value.clone() + } + } + impl std::convert::TryFrom for BlockSize { type Error = &'static str; fn try_from(value: i64) -> Result { @@ -137,6 +179,58 @@ pub mod types { } } + impl From for u64 { + fn from(value: ByteCount) -> Self { + value.0 + } + } + + impl From<&ByteCount> for ByteCount { + fn from(value: &ByteCount) -> Self { + value.clone() + } + } + + impl From for ByteCount { + fn from(value: u64) -> Self { + Self(value) + } + } + + impl std::str::FromStr for ByteCount { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for ByteCount { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for ByteCount { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for ByteCount { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for ByteCount { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Client view of a [`Certificate`] #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Certificate { @@ -153,6 +247,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Certificate> for Certificate { + fn from(value: &Certificate) -> Self { + value.clone() + } + } + impl Certificate { pub fn builder() -> builder::Certificate { builder::Certificate::default() @@ -173,6 +273,12 @@ pub mod types { pub service: ServiceUsingCertificate, } + impl From<&CertificateCreate> for CertificateCreate { + fn from(value: &CertificateCreate) -> Self { + value.clone() + } + } + impl CertificateCreate { pub fn builder() -> builder::CertificateCreate { builder::CertificateCreate::default() @@ -189,6 +295,12 @@ pub mod types { pub next_page: Option, } + impl From<&CertificateResultsPage> for CertificateResultsPage { + fn from(value: &CertificateResultsPage) -> Self { + value.clone() + } + } + impl CertificateResultsPage { pub fn builder() -> builder::CertificateResultsPage { builder::CertificateResultsPage::default() @@ -209,6 +321,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&ComponentUpdate> for ComponentUpdate { + fn from(value: &ComponentUpdate) -> Self { + value.clone() + } + } + impl ComponentUpdate { pub fn builder() -> builder::ComponentUpdate { builder::ComponentUpdate::default() @@ -225,6 +343,12 @@ pub mod types { pub next_page: Option, } + impl From<&ComponentUpdateResultsPage> for ComponentUpdateResultsPage { + fn from(value: &ComponentUpdateResultsPage) -> Self { + value.clone() + } + } + impl ComponentUpdateResultsPage { pub fn builder() -> builder::ComponentUpdateResultsPage { builder::ComponentUpdateResultsPage::default() @@ -238,6 +362,12 @@ pub mod types { pub value: f64, } + impl From<&Cumulativedouble> for Cumulativedouble { + fn from(value: &Cumulativedouble) -> Self { + value.clone() + } + } + impl Cumulativedouble { pub fn builder() -> builder::Cumulativedouble { builder::Cumulativedouble::default() @@ -251,6 +381,12 @@ pub mod types { pub value: i64, } + impl From<&Cumulativeint64> for Cumulativeint64 { + fn from(value: &Cumulativeint64) -> Self { + value.clone() + } + } + impl Cumulativeint64 { pub fn builder() -> builder::Cumulativeint64 { builder::Cumulativeint64::default() @@ -281,6 +417,12 @@ pub mod types { HistogramF64(Histogramdouble), } + impl From<&Datum> for Datum { + fn from(value: &Datum) -> Self { + value.clone() + } + } + ///The type of an individual datum of a metric. #[derive( Clone, Copy, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize, @@ -306,6 +448,12 @@ pub mod types { HistogramF64, } + impl From<&DatumType> for DatumType { + fn from(value: &DatumType) -> Self { + value.clone() + } + } + impl ToString for DatumType { fn to_string(&self) -> String { match *self { @@ -369,6 +517,12 @@ pub mod types { pub public_cert: String, } + impl From<&DerEncodedKeyPair> for DerEncodedKeyPair { + fn from(value: &DerEncodedKeyPair) -> Self { + value.clone() + } + } + impl DerEncodedKeyPair { pub fn builder() -> builder::DerEncodedKeyPair { builder::DerEncodedKeyPair::default() @@ -382,6 +536,12 @@ pub mod types { pub grant_type: String, } + impl From<&DeviceAccessTokenRequest> for DeviceAccessTokenRequest { + fn from(value: &DeviceAccessTokenRequest) -> Self { + value.clone() + } + } + impl DeviceAccessTokenRequest { pub fn builder() -> builder::DeviceAccessTokenRequest { builder::DeviceAccessTokenRequest::default() @@ -393,6 +553,12 @@ pub mod types { pub client_id: uuid::Uuid, } + impl From<&DeviceAuthRequest> for DeviceAuthRequest { + fn from(value: &DeviceAuthRequest) -> Self { + value.clone() + } + } + impl DeviceAuthRequest { pub fn builder() -> builder::DeviceAuthRequest { builder::DeviceAuthRequest::default() @@ -404,6 +570,12 @@ pub mod types { pub user_code: String, } + impl From<&DeviceAuthVerify> for DeviceAuthVerify { + fn from(value: &DeviceAuthVerify) -> Self { + value.clone() + } + } + impl DeviceAuthVerify { pub fn builder() -> builder::DeviceAuthVerify { builder::DeviceAuthVerify::default() @@ -417,6 +589,12 @@ pub mod types { Sha256(String), } + impl From<&Digest> for Digest { + fn from(value: &Digest) -> Self { + value.clone() + } + } + ///Client view of a [`Disk`] #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Disk { @@ -441,6 +619,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Disk> for Disk { + fn from(value: &Disk) -> Self { + value.clone() + } + } + impl Disk { pub fn builder() -> builder::Disk { builder::Disk::default() @@ -459,6 +643,12 @@ pub mod types { pub size: ByteCount, } + impl From<&DiskCreate> for DiskCreate { + fn from(value: &DiskCreate) -> Self { + value.clone() + } + } + impl DiskCreate { pub fn builder() -> builder::DiskCreate { builder::DiskCreate::default() @@ -473,6 +663,12 @@ pub mod types { pub name: Name, } + impl From<&DiskIdentifier> for DiskIdentifier { + fn from(value: &DiskIdentifier) -> Self { + value.clone() + } + } + impl DiskIdentifier { pub fn builder() -> builder::DiskIdentifier { builder::DiskIdentifier::default() @@ -497,6 +693,12 @@ pub mod types { WriteBytes, } + impl From<&DiskMetricName> for DiskMetricName { + fn from(value: &DiskMetricName) -> Self { + value.clone() + } + } + impl ToString for DiskMetricName { fn to_string(&self) -> String { match *self { @@ -551,6 +753,12 @@ pub mod types { pub disk: NameOrId, } + impl From<&DiskPath> for DiskPath { + fn from(value: &DiskPath) -> Self { + value.clone() + } + } + impl DiskPath { pub fn builder() -> builder::DiskPath { builder::DiskPath::default() @@ -567,6 +775,12 @@ pub mod types { pub next_page: Option, } + impl From<&DiskResultsPage> for DiskResultsPage { + fn from(value: &DiskResultsPage) -> Self { + value.clone() + } + } + impl DiskResultsPage { pub fn builder() -> builder::DiskResultsPage { builder::DiskResultsPage::default() @@ -595,6 +809,12 @@ pub mod types { GlobalImage { image_id: uuid::Uuid }, } + impl From<&DiskSource> for DiskSource { + fn from(value: &DiskSource) -> Self { + value.clone() + } + } + ///State of a Disk (primarily: attached or not) #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] #[serde(tag = "state", content = "instance")] @@ -618,6 +838,12 @@ pub mod types { Faulted, } + impl From<&DiskState> for DiskState { + fn from(value: &DiskState) -> Self { + value.clone() + } + } + ///OS image distribution #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Distribution { @@ -627,6 +853,12 @@ pub mod types { pub version: String, } + impl From<&Distribution> for Distribution { + fn from(value: &Distribution) -> Self { + value.clone() + } + } + impl Distribution { pub fn builder() -> builder::Distribution { builder::Distribution::default() @@ -642,6 +874,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + impl Error { pub fn builder() -> builder::Error { builder::Error::default() @@ -654,6 +892,12 @@ pub mod types { pub kind: IpKind, } + impl From<&ExternalIp> for ExternalIp { + fn from(value: &ExternalIp) -> Self { + value.clone() + } + } + impl ExternalIp { pub fn builder() -> builder::ExternalIp { builder::ExternalIp::default() @@ -674,6 +918,12 @@ pub mod types { }, } + impl From<&ExternalIpCreate> for ExternalIpCreate { + fn from(value: &ExternalIpCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct ExternalIpResultsPage { @@ -684,6 +934,12 @@ pub mod types { pub next_page: Option, } + impl From<&ExternalIpResultsPage> for ExternalIpResultsPage { + fn from(value: &ExternalIpResultsPage) -> Self { + value.clone() + } + } + impl ExternalIpResultsPage { pub fn builder() -> builder::ExternalIpResultsPage { builder::ExternalIpResultsPage::default() @@ -698,6 +954,12 @@ pub mod types { pub ty: FieldType, } + impl From<&FieldSchema> for FieldSchema { + fn from(value: &FieldSchema) -> Self { + value.clone() + } + } + impl FieldSchema { pub fn builder() -> builder::FieldSchema { builder::FieldSchema::default() @@ -715,6 +977,12 @@ pub mod types { Metric, } + impl From<&FieldSource> for FieldSource { + fn from(value: &FieldSource) -> Self { + value.clone() + } + } + impl ToString for FieldSource { fn to_string(&self) -> String { match *self { @@ -773,6 +1041,12 @@ pub mod types { Bool, } + impl From<&FieldType> for FieldType { + fn from(value: &FieldType) -> Self { + value.clone() + } + } + impl ToString for FieldType { fn to_string(&self) -> String { match *self { @@ -832,6 +1106,12 @@ pub mod types { Viewer, } + impl From<&FleetRole> for FleetRole { + fn from(value: &FleetRole) -> Self { + value.clone() + } + } + impl ToString for FleetRole { fn to_string(&self) -> String { match *self { @@ -887,6 +1167,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&FleetRolePolicy> for FleetRolePolicy { + fn from(value: &FleetRolePolicy) -> Self { + value.clone() + } + } + impl FleetRolePolicy { pub fn builder() -> builder::FleetRolePolicy { builder::FleetRolePolicy::default() @@ -906,6 +1192,12 @@ pub mod types { pub role_name: FleetRole, } + impl From<&FleetRoleRoleAssignment> for FleetRoleRoleAssignment { + fn from(value: &FleetRoleRoleAssignment) -> Self { + value.clone() + } + } + impl FleetRoleRoleAssignment { pub fn builder() -> builder::FleetRoleRoleAssignment { builder::FleetRoleRoleAssignment::default() @@ -941,6 +1233,12 @@ pub mod types { pub version: String, } + impl From<&GlobalImage> for GlobalImage { + fn from(value: &GlobalImage) -> Self { + value.clone() + } + } + impl GlobalImage { pub fn builder() -> builder::GlobalImage { builder::GlobalImage::default() @@ -961,6 +1259,12 @@ pub mod types { pub source: ImageSource, } + impl From<&GlobalImageCreate> for GlobalImageCreate { + fn from(value: &GlobalImageCreate) -> Self { + value.clone() + } + } + impl GlobalImageCreate { pub fn builder() -> builder::GlobalImageCreate { builder::GlobalImageCreate::default() @@ -977,6 +1281,12 @@ pub mod types { pub next_page: Option, } + impl From<&GlobalImageResultsPage> for GlobalImageResultsPage { + fn from(value: &GlobalImageResultsPage) -> Self { + value.clone() + } + } + impl GlobalImageResultsPage { pub fn builder() -> builder::GlobalImageResultsPage { builder::GlobalImageResultsPage::default() @@ -993,6 +1303,12 @@ pub mod types { pub silo_id: uuid::Uuid, } + impl From<&Group> for Group { + fn from(value: &Group) -> Self { + value.clone() + } + } + impl Group { pub fn builder() -> builder::Group { builder::Group::default() @@ -1009,6 +1325,12 @@ pub mod types { pub next_page: Option, } + impl From<&GroupResultsPage> for GroupResultsPage { + fn from(value: &GroupResultsPage) -> Self { + value.clone() + } + } + impl GroupResultsPage { pub fn builder() -> builder::GroupResultsPage { builder::GroupResultsPage::default() @@ -1064,6 +1386,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&Histogramdouble> for Histogramdouble { + fn from(value: &Histogramdouble) -> Self { + value.clone() + } + } + impl Histogramdouble { pub fn builder() -> builder::Histogramdouble { builder::Histogramdouble::default() @@ -1119,6 +1447,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&Histogramint64> for Histogramint64 { + fn from(value: &Histogramint64) -> Self { + value.clone() + } + } + impl Histogramint64 { pub fn builder() -> builder::Histogramint64 { builder::Histogramint64::default() @@ -1137,6 +1471,12 @@ pub mod types { IdAscending, } + impl From<&IdSortMode> for IdSortMode { + fn from(value: &IdSortMode) -> Self { + value.clone() + } + } + impl ToString for IdSortMode { fn to_string(&self) -> String { match *self { @@ -1193,6 +1533,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&IdentityProvider> for IdentityProvider { + fn from(value: &IdentityProvider) -> Self { + value.clone() + } + } + impl IdentityProvider { pub fn builder() -> builder::IdentityProvider { builder::IdentityProvider::default() @@ -1209,6 +1555,12 @@ pub mod types { pub next_page: Option, } + impl From<&IdentityProviderResultsPage> for IdentityProviderResultsPage { + fn from(value: &IdentityProviderResultsPage) -> Self { + value.clone() + } + } + impl IdentityProviderResultsPage { pub fn builder() -> builder::IdentityProviderResultsPage { builder::IdentityProviderResultsPage::default() @@ -1224,6 +1576,12 @@ pub mod types { Saml, } + impl From<&IdentityProviderType> for IdentityProviderType { + fn from(value: &IdentityProviderType) -> Self { + value.clone() + } + } + impl ToString for IdentityProviderType { fn to_string(&self) -> String { match *self { @@ -1274,6 +1632,12 @@ pub mod types { SiloGroup, } + impl From<&IdentityType> for IdentityType { + fn from(value: &IdentityType) -> Self { + value.clone() + } + } + impl ToString for IdentityType { fn to_string(&self) -> String { match *self { @@ -1324,6 +1688,12 @@ pub mod types { Base64EncodedXml { data: String }, } + impl From<&IdpMetadataSource> for IdpMetadataSource { + fn from(value: &IdpMetadataSource) -> Self { + value.clone() + } + } + ///Client view of project Images #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Image { @@ -1354,6 +1724,12 @@ pub mod types { pub version: Option, } + impl From<&Image> for Image { + fn from(value: &Image) -> Self { + value.clone() + } + } + impl Image { pub fn builder() -> builder::Image { builder::Image::default() @@ -1372,6 +1748,12 @@ pub mod types { pub source: ImageSource, } + impl From<&ImageCreate> for ImageCreate { + fn from(value: &ImageCreate) -> Self { + value.clone() + } + } + impl ImageCreate { pub fn builder() -> builder::ImageCreate { builder::ImageCreate::default() @@ -1388,6 +1770,12 @@ pub mod types { pub next_page: Option, } + impl From<&ImageResultsPage> for ImageResultsPage { + fn from(value: &ImageResultsPage) -> Self { + value.clone() + } + } + impl ImageResultsPage { pub fn builder() -> builder::ImageResultsPage { builder::ImageResultsPage::default() @@ -1406,6 +1794,12 @@ pub mod types { YouCanBootAnythingAsLongAsItsAlpine, } + impl From<&ImageSource> for ImageSource { + fn from(value: &ImageSource) -> Self { + value.clone() + } + } + ///Client view of an [`Instance`] #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Instance { @@ -1431,6 +1825,12 @@ pub mod types { pub time_run_state_updated: chrono::DateTime, } + impl From<&Instance> for Instance { + fn from(value: &Instance) -> Self { + value.clone() + } + } + impl Instance { pub fn builder() -> builder::Instance { builder::Instance::default() @@ -1447,6 +1847,58 @@ pub mod types { } } + impl From for u16 { + fn from(value: InstanceCpuCount) -> Self { + value.0 + } + } + + impl From<&InstanceCpuCount> for InstanceCpuCount { + fn from(value: &InstanceCpuCount) -> Self { + value.clone() + } + } + + impl From for InstanceCpuCount { + fn from(value: u16) -> Self { + Self(value) + } + } + + impl std::str::FromStr for InstanceCpuCount { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for InstanceCpuCount { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Create-time parameters for an /// [`Instance`](omicron_common::api::external::Instance) #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] @@ -1480,6 +1932,12 @@ pub mod types { pub user_data: String, } + impl From<&InstanceCreate> for InstanceCreate { + fn from(value: &InstanceCreate) -> Self { + value.clone() + } + } + impl InstanceCreate { pub fn builder() -> builder::InstanceCreate { builder::InstanceCreate::default() @@ -1508,6 +1966,12 @@ pub mod types { }, } + impl From<&InstanceDiskAttachment> for InstanceDiskAttachment { + fn from(value: &InstanceDiskAttachment) -> Self { + value.clone() + } + } + ///Migration parameters for an /// [`Instance`](omicron_common::api::external::Instance) #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] @@ -1515,6 +1979,12 @@ pub mod types { pub dst_sled_id: uuid::Uuid, } + impl From<&InstanceMigrate> for InstanceMigrate { + fn from(value: &InstanceMigrate) -> Self { + value.clone() + } + } + impl InstanceMigrate { pub fn builder() -> builder::InstanceMigrate { builder::InstanceMigrate::default() @@ -1538,6 +2008,12 @@ pub mod types { None, } + impl From<&InstanceNetworkInterfaceAttachment> for InstanceNetworkInterfaceAttachment { + fn from(value: &InstanceNetworkInterfaceAttachment) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct InstanceResultsPage { @@ -1548,6 +2024,12 @@ pub mod types { pub next_page: Option, } + impl From<&InstanceResultsPage> for InstanceResultsPage { + fn from(value: &InstanceResultsPage) -> Self { + value.clone() + } + } + impl InstanceResultsPage { pub fn builder() -> builder::InstanceResultsPage { builder::InstanceResultsPage::default() @@ -1566,6 +2048,12 @@ pub mod types { pub last_byte_offset: u64, } + impl From<&InstanceSerialConsoleData> for InstanceSerialConsoleData { + fn from(value: &InstanceSerialConsoleData) -> Self { + value.clone() + } + } + impl InstanceSerialConsoleData { pub fn builder() -> builder::InstanceSerialConsoleData { builder::InstanceSerialConsoleData::default() @@ -1616,6 +2104,12 @@ pub mod types { Destroyed, } + impl From<&InstanceState> for InstanceState { + fn from(value: &InstanceState) -> Self { + value.clone() + } + } + impl ToString for InstanceState { fn to_string(&self) -> String { match *self { @@ -1684,6 +2178,12 @@ pub mod types { Floating, } + impl From<&IpKind> for IpKind { + fn from(value: &IpKind) -> Self { + value.clone() + } + } + impl ToString for IpKind { fn to_string(&self) -> String { match *self { @@ -1732,6 +2232,12 @@ pub mod types { V6(Ipv6Net), } + impl From<&IpNet> for IpNet { + fn from(value: &IpNet) -> Self { + value.clone() + } + } + impl std::str::FromStr for IpNet { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1791,6 +2297,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&IpPool> for IpPool { + fn from(value: &IpPool) -> Self { + value.clone() + } + } + impl IpPool { pub fn builder() -> builder::IpPool { builder::IpPool::default() @@ -1806,6 +2318,12 @@ pub mod types { pub name: Name, } + impl From<&IpPoolCreate> for IpPoolCreate { + fn from(value: &IpPoolCreate) -> Self { + value.clone() + } + } + impl IpPoolCreate { pub fn builder() -> builder::IpPoolCreate { builder::IpPoolCreate::default() @@ -1819,6 +2337,12 @@ pub mod types { pub time_created: chrono::DateTime, } + impl From<&IpPoolRange> for IpPoolRange { + fn from(value: &IpPoolRange) -> Self { + value.clone() + } + } + impl IpPoolRange { pub fn builder() -> builder::IpPoolRange { builder::IpPoolRange::default() @@ -1835,6 +2359,12 @@ pub mod types { pub next_page: Option, } + impl From<&IpPoolRangeResultsPage> for IpPoolRangeResultsPage { + fn from(value: &IpPoolRangeResultsPage) -> Self { + value.clone() + } + } + impl IpPoolRangeResultsPage { pub fn builder() -> builder::IpPoolRangeResultsPage { builder::IpPoolRangeResultsPage::default() @@ -1851,6 +2381,12 @@ pub mod types { pub next_page: Option, } + impl From<&IpPoolResultsPage> for IpPoolResultsPage { + fn from(value: &IpPoolResultsPage) -> Self { + value.clone() + } + } + impl IpPoolResultsPage { pub fn builder() -> builder::IpPoolResultsPage { builder::IpPoolResultsPage::default() @@ -1866,6 +2402,12 @@ pub mod types { pub name: Option, } + impl From<&IpPoolUpdate> for IpPoolUpdate { + fn from(value: &IpPoolUpdate) -> Self { + value.clone() + } + } + impl IpPoolUpdate { pub fn builder() -> builder::IpPoolUpdate { builder::IpPoolUpdate::default() @@ -1879,6 +2421,12 @@ pub mod types { V6(Ipv6Range), } + impl From<&IpRange> for IpRange { + fn from(value: &IpRange) -> Self { + value.clone() + } + } + ///An IPv4 subnet, including prefix and subnet mask #[derive(Clone, Debug, JsonSchema, Serialize)] pub struct Ipv4Net(String); @@ -1889,6 +2437,18 @@ pub mod types { } } + impl From for String { + fn from(value: Ipv4Net) -> Self { + value.0 + } + } + + impl From<&Ipv4Net> for Ipv4Net { + fn from(value: &Ipv4Net) -> Self { + value.clone() + } + } + impl std::str::FromStr for Ipv4Net { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1938,6 +2498,12 @@ pub mod types { pub last: std::net::Ipv4Addr, } + impl From<&Ipv4Range> for Ipv4Range { + fn from(value: &Ipv4Range) -> Self { + value.clone() + } + } + impl Ipv4Range { pub fn builder() -> builder::Ipv4Range { builder::Ipv4Range::default() @@ -1954,6 +2520,18 @@ pub mod types { } } + impl From for String { + fn from(value: Ipv6Net) -> Self { + value.0 + } + } + + impl From<&Ipv6Net> for Ipv6Net { + fn from(value: &Ipv6Net) -> Self { + value.clone() + } + } + impl std::str::FromStr for Ipv6Net { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2003,6 +2581,12 @@ pub mod types { pub last: std::net::Ipv6Addr, } + impl From<&Ipv6Range> for Ipv6Range { + fn from(value: &Ipv6Range) -> Self { + value.clone() + } + } + impl Ipv6Range { pub fn builder() -> builder::Ipv6Range { builder::Ipv6Range::default() @@ -2020,6 +2604,18 @@ pub mod types { } } + impl From for String { + fn from(value: L4PortRange) -> Self { + value.0 + } + } + + impl From<&L4PortRange> for L4PortRange { + fn from(value: &L4PortRange) -> Self { + value.clone() + } + } + impl std::str::FromStr for L4PortRange { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2082,6 +2678,18 @@ pub mod types { } } + impl From for String { + fn from(value: MacAddr) -> Self { + value.0 + } + } + + impl From<&MacAddr> for MacAddr { + fn from(value: &MacAddr) -> Self { + value.clone() + } + } + impl std::str::FromStr for MacAddr { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2141,6 +2749,12 @@ pub mod types { pub timestamp: chrono::DateTime, } + impl From<&Measurement> for Measurement { + fn from(value: &Measurement) -> Self { + value.clone() + } + } + impl Measurement { pub fn builder() -> builder::Measurement { builder::Measurement::default() @@ -2157,6 +2771,12 @@ pub mod types { pub next_page: Option, } + impl From<&MeasurementResultsPage> for MeasurementResultsPage { + fn from(value: &MeasurementResultsPage) -> Self { + value.clone() + } + } + impl MeasurementResultsPage { pub fn builder() -> builder::MeasurementResultsPage { builder::MeasurementResultsPage::default() @@ -2175,6 +2795,18 @@ pub mod types { } } + impl From for String { + fn from(value: Name) -> Self { + value.0 + } + } + + impl From<&Name> for Name { + fn from(value: &Name) -> Self { + value.clone() + } + } + impl std::str::FromStr for Name { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2225,6 +2857,12 @@ pub mod types { Name(Name), } + impl From<&NameOrId> for NameOrId { + fn from(value: &NameOrId) -> Self { + value.clone() + } + } + impl std::str::FromStr for NameOrId { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2284,6 +2922,12 @@ pub mod types { IdAscending, } + impl From<&NameOrIdSortMode> for NameOrIdSortMode { + fn from(value: &NameOrIdSortMode) -> Self { + value.clone() + } + } + impl ToString for NameOrIdSortMode { fn to_string(&self) -> String { match *self { @@ -2339,6 +2983,12 @@ pub mod types { NameAscending, } + impl From<&NameSortMode> for NameSortMode { + fn from(value: &NameSortMode) -> Self { + value.clone() + } + } + impl ToString for NameSortMode { fn to_string(&self) -> String { match *self { @@ -2406,6 +3056,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&NetworkInterface> for NetworkInterface { + fn from(value: &NetworkInterface) -> Self { + value.clone() + } + } + impl NetworkInterface { pub fn builder() -> builder::NetworkInterface { builder::NetworkInterface::default() @@ -2428,6 +3084,12 @@ pub mod types { pub vpc_name: Name, } + impl From<&NetworkInterfaceCreate> for NetworkInterfaceCreate { + fn from(value: &NetworkInterfaceCreate) -> Self { + value.clone() + } + } + impl NetworkInterfaceCreate { pub fn builder() -> builder::NetworkInterfaceCreate { builder::NetworkInterfaceCreate::default() @@ -2444,6 +3106,12 @@ pub mod types { pub next_page: Option, } + impl From<&NetworkInterfaceResultsPage> for NetworkInterfaceResultsPage { + fn from(value: &NetworkInterfaceResultsPage) -> Self { + value.clone() + } + } + impl NetworkInterfaceResultsPage { pub fn builder() -> builder::NetworkInterfaceResultsPage { builder::NetworkInterfaceResultsPage::default() @@ -2476,6 +3144,12 @@ pub mod types { pub primary: bool, } + impl From<&NetworkInterfaceUpdate> for NetworkInterfaceUpdate { + fn from(value: &NetworkInterfaceUpdate) -> Self { + value.clone() + } + } + impl NetworkInterfaceUpdate { pub fn builder() -> builder::NetworkInterfaceUpdate { builder::NetworkInterfaceUpdate::default() @@ -2497,6 +3171,37 @@ pub mod types { } } + impl From for String { + fn from(value: NodeName) -> Self { + value.0 + } + } + + impl From<&NodeName> for NodeName { + fn from(value: &NodeName) -> Self { + value.clone() + } + } + + impl From for NodeName { + fn from(value: String) -> Self { + Self(value) + } + } + + impl std::str::FromStr for NodeName { + type Err = std::convert::Infallible; + fn from_str(value: &str) -> Result { + Ok(Self(value.to_string())) + } + } + + impl ToString for NodeName { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Client view of an [`Organization`] #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct Organization { @@ -2512,6 +3217,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Organization> for Organization { + fn from(value: &Organization) -> Self { + value.clone() + } + } + impl Organization { pub fn builder() -> builder::Organization { builder::Organization::default() @@ -2526,6 +3237,12 @@ pub mod types { pub name: Name, } + impl From<&OrganizationCreate> for OrganizationCreate { + fn from(value: &OrganizationCreate) -> Self { + value.clone() + } + } + impl OrganizationCreate { pub fn builder() -> builder::OrganizationCreate { builder::OrganizationCreate::default() @@ -2542,6 +3259,12 @@ pub mod types { pub next_page: Option, } + impl From<&OrganizationResultsPage> for OrganizationResultsPage { + fn from(value: &OrganizationResultsPage) -> Self { + value.clone() + } + } + impl OrganizationResultsPage { pub fn builder() -> builder::OrganizationResultsPage { builder::OrganizationResultsPage::default() @@ -2560,6 +3283,12 @@ pub mod types { Viewer, } + impl From<&OrganizationRole> for OrganizationRole { + fn from(value: &OrganizationRole) -> Self { + value.clone() + } + } + impl ToString for OrganizationRole { fn to_string(&self) -> String { match *self { @@ -2615,6 +3344,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&OrganizationRolePolicy> for OrganizationRolePolicy { + fn from(value: &OrganizationRolePolicy) -> Self { + value.clone() + } + } + impl OrganizationRolePolicy { pub fn builder() -> builder::OrganizationRolePolicy { builder::OrganizationRolePolicy::default() @@ -2634,6 +3369,12 @@ pub mod types { pub role_name: OrganizationRole, } + impl From<&OrganizationRoleRoleAssignment> for OrganizationRoleRoleAssignment { + fn from(value: &OrganizationRoleRoleAssignment) -> Self { + value.clone() + } + } + impl OrganizationRoleRoleAssignment { pub fn builder() -> builder::OrganizationRoleRoleAssignment { builder::OrganizationRoleRoleAssignment::default() @@ -2650,6 +3391,12 @@ pub mod types { pub name: Option, } + impl From<&OrganizationUpdate> for OrganizationUpdate { + fn from(value: &OrganizationUpdate) -> Self { + value.clone() + } + } + impl OrganizationUpdate { pub fn builder() -> builder::OrganizationUpdate { builder::OrganizationUpdate::default() @@ -2666,6 +3413,18 @@ pub mod types { } } + impl From for String { + fn from(value: Password) -> Self { + value.0 + } + } + + impl From<&Password> for Password { + fn from(value: &Password) -> Self { + value.clone() + } + } + impl std::str::FromStr for Password { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2726,6 +3485,12 @@ pub mod types { pub vendor: String, } + impl From<&PhysicalDisk> for PhysicalDisk { + fn from(value: &PhysicalDisk) -> Self { + value.clone() + } + } + impl PhysicalDisk { pub fn builder() -> builder::PhysicalDisk { builder::PhysicalDisk::default() @@ -2742,6 +3507,12 @@ pub mod types { pub next_page: Option, } + impl From<&PhysicalDiskResultsPage> for PhysicalDiskResultsPage { + fn from(value: &PhysicalDiskResultsPage) -> Self { + value.clone() + } + } + impl PhysicalDiskResultsPage { pub fn builder() -> builder::PhysicalDiskResultsPage { builder::PhysicalDiskResultsPage::default() @@ -2758,6 +3529,12 @@ pub mod types { External, } + impl From<&PhysicalDiskType> for PhysicalDiskType { + fn from(value: &PhysicalDiskType) -> Self { + value.clone() + } + } + impl ToString for PhysicalDiskType { fn to_string(&self) -> String { match *self { @@ -2815,6 +3592,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Project> for Project { + fn from(value: &Project) -> Self { + value.clone() + } + } + impl Project { pub fn builder() -> builder::Project { builder::Project::default() @@ -2829,6 +3612,12 @@ pub mod types { pub name: Name, } + impl From<&ProjectCreate> for ProjectCreate { + fn from(value: &ProjectCreate) -> Self { + value.clone() + } + } + impl ProjectCreate { pub fn builder() -> builder::ProjectCreate { builder::ProjectCreate::default() @@ -2845,6 +3634,12 @@ pub mod types { pub next_page: Option, } + impl From<&ProjectResultsPage> for ProjectResultsPage { + fn from(value: &ProjectResultsPage) -> Self { + value.clone() + } + } + impl ProjectResultsPage { pub fn builder() -> builder::ProjectResultsPage { builder::ProjectResultsPage::default() @@ -2863,6 +3658,12 @@ pub mod types { Viewer, } + impl From<&ProjectRole> for ProjectRole { + fn from(value: &ProjectRole) -> Self { + value.clone() + } + } + impl ToString for ProjectRole { fn to_string(&self) -> String { match *self { @@ -2918,6 +3719,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&ProjectRolePolicy> for ProjectRolePolicy { + fn from(value: &ProjectRolePolicy) -> Self { + value.clone() + } + } + impl ProjectRolePolicy { pub fn builder() -> builder::ProjectRolePolicy { builder::ProjectRolePolicy::default() @@ -2937,6 +3744,12 @@ pub mod types { pub role_name: ProjectRole, } + impl From<&ProjectRoleRoleAssignment> for ProjectRoleRoleAssignment { + fn from(value: &ProjectRoleRoleAssignment) -> Self { + value.clone() + } + } + impl ProjectRoleRoleAssignment { pub fn builder() -> builder::ProjectRoleRoleAssignment { builder::ProjectRoleRoleAssignment::default() @@ -2953,6 +3766,12 @@ pub mod types { pub name: Option, } + impl From<&ProjectUpdate> for ProjectUpdate { + fn from(value: &ProjectUpdate) -> Self { + value.clone() + } + } + impl ProjectUpdate { pub fn builder() -> builder::ProjectUpdate { builder::ProjectUpdate::default() @@ -2970,6 +3789,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Rack> for Rack { + fn from(value: &Rack) -> Self { + value.clone() + } + } + impl Rack { pub fn builder() -> builder::Rack { builder::Rack::default() @@ -2986,6 +3811,12 @@ pub mod types { pub next_page: Option, } + impl From<&RackResultsPage> for RackResultsPage { + fn from(value: &RackResultsPage) -> Self { + value.clone() + } + } + impl RackResultsPage { pub fn builder() -> builder::RackResultsPage { builder::RackResultsPage::default() @@ -2999,6 +3830,12 @@ pub mod types { pub name: RoleName, } + impl From<&Role> for Role { + fn from(value: &Role) -> Self { + value.clone() + } + } + impl Role { pub fn builder() -> builder::Role { builder::Role::default() @@ -3015,6 +3852,18 @@ pub mod types { } } + impl From for String { + fn from(value: RoleName) -> Self { + value.0 + } + } + + impl From<&RoleName> for RoleName { + fn from(value: &RoleName) -> Self { + value.clone() + } + } + impl std::str::FromStr for RoleName { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -3074,6 +3923,12 @@ pub mod types { pub next_page: Option, } + impl From<&RoleResultsPage> for RoleResultsPage { + fn from(value: &RoleResultsPage) -> Self { + value.clone() + } + } + impl RoleResultsPage { pub fn builder() -> builder::RoleResultsPage { builder::RoleResultsPage::default() @@ -3103,6 +3958,12 @@ pub mod types { Subnet(Name), } + impl From<&RouteDestination> for RouteDestination { + fn from(value: &RouteDestination) -> Self { + value.clone() + } + } + ///A `RouteTarget` describes the possible locations that traffic matching a /// route destination can be sent. #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] @@ -3125,6 +3986,12 @@ pub mod types { InternetGateway(Name), } + impl From<&RouteTarget> for RouteTarget { + fn from(value: &RouteTarget) -> Self { + value.clone() + } + } + ///A route defines a rule that governs where traffic should be sent based /// on its destination. #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] @@ -3147,6 +4014,12 @@ pub mod types { pub vpc_router_id: uuid::Uuid, } + impl From<&RouterRoute> for RouterRoute { + fn from(value: &RouterRoute) -> Self { + value.clone() + } + } + impl RouterRoute { pub fn builder() -> builder::RouterRoute { builder::RouterRoute::default() @@ -3162,6 +4035,12 @@ pub mod types { pub target: RouteTarget, } + impl From<&RouterRouteCreateParams> for RouterRouteCreateParams { + fn from(value: &RouterRouteCreateParams) -> Self { + value.clone() + } + } + impl RouterRouteCreateParams { pub fn builder() -> builder::RouterRouteCreateParams { builder::RouterRouteCreateParams::default() @@ -3200,6 +4079,12 @@ pub mod types { Custom, } + impl From<&RouterRouteKind> for RouterRouteKind { + fn from(value: &RouterRouteKind) -> Self { + value.clone() + } + } + impl ToString for RouterRouteKind { fn to_string(&self) -> String { match *self { @@ -3255,6 +4140,12 @@ pub mod types { pub next_page: Option, } + impl From<&RouterRouteResultsPage> for RouterRouteResultsPage { + fn from(value: &RouterRouteResultsPage) -> Self { + value.clone() + } + } + impl RouterRouteResultsPage { pub fn builder() -> builder::RouterRouteResultsPage { builder::RouterRouteResultsPage::default() @@ -3272,6 +4163,12 @@ pub mod types { pub target: RouteTarget, } + impl From<&RouterRouteUpdateParams> for RouterRouteUpdateParams { + fn from(value: &RouterRouteUpdateParams) -> Self { + value.clone() + } + } + impl RouterRouteUpdateParams { pub fn builder() -> builder::RouterRouteUpdateParams { builder::RouterRouteUpdateParams::default() @@ -3284,6 +4181,12 @@ pub mod types { pub state: SagaState, } + impl From<&Saga> for Saga { + fn from(value: &Saga) -> Self { + value.clone() + } + } + impl Saga { pub fn builder() -> builder::Saga { builder::Saga::default() @@ -3305,6 +4208,12 @@ pub mod types { SubsagaCreateFailed { message: String }, } + impl From<&SagaErrorInfo> for SagaErrorInfo { + fn from(value: &SagaErrorInfo) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct SagaResultsPage { @@ -3315,6 +4224,12 @@ pub mod types { pub next_page: Option, } + impl From<&SagaResultsPage> for SagaResultsPage { + fn from(value: &SagaResultsPage) -> Self { + value.clone() + } + } + impl SagaResultsPage { pub fn builder() -> builder::SagaResultsPage { builder::SagaResultsPage::default() @@ -3335,6 +4250,12 @@ pub mod types { }, } + impl From<&SagaState> for SagaState { + fn from(value: &SagaState) -> Self { + value.clone() + } + } + ///Identity-related metadata that's included in nearly all public API /// objects #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] @@ -3365,6 +4286,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&SamlIdentityProvider> for SamlIdentityProvider { + fn from(value: &SamlIdentityProvider) -> Self { + value.clone() + } + } + impl SamlIdentityProvider { pub fn builder() -> builder::SamlIdentityProvider { builder::SamlIdentityProvider::default() @@ -3398,6 +4325,12 @@ pub mod types { pub technical_contact_email: String, } + impl From<&SamlIdentityProviderCreate> for SamlIdentityProviderCreate { + fn from(value: &SamlIdentityProviderCreate) -> Self { + value.clone() + } + } + impl SamlIdentityProviderCreate { pub fn builder() -> builder::SamlIdentityProviderCreate { builder::SamlIdentityProviderCreate::default() @@ -3413,6 +4346,18 @@ pub mod types { } } + impl From for String { + fn from(value: SemverVersion) -> Self { + value.0 + } + } + + impl From<&SemverVersion> for SemverVersion { + fn from(value: &SemverVersion) -> Self { + value.clone() + } + } + impl std::str::FromStr for SemverVersion { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -3469,6 +4414,12 @@ pub mod types { ExternalApi, } + impl From<&ServiceUsingCertificate> for ServiceUsingCertificate { + fn from(value: &ServiceUsingCertificate) -> Self { + value.clone() + } + } + impl ToString for ServiceUsingCertificate { fn to_string(&self) -> String { match *self { @@ -3528,6 +4479,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Silo> for Silo { + fn from(value: &Silo) -> Self { + value.clone() + } + } + impl Silo { pub fn builder() -> builder::Silo { builder::Silo::default() @@ -3553,6 +4510,12 @@ pub mod types { pub name: Name, } + impl From<&SiloCreate> for SiloCreate { + fn from(value: &SiloCreate) -> Self { + value.clone() + } + } + impl SiloCreate { pub fn builder() -> builder::SiloCreate { builder::SiloCreate::default() @@ -3577,6 +4540,12 @@ pub mod types { LocalOnly, } + impl From<&SiloIdentityMode> for SiloIdentityMode { + fn from(value: &SiloIdentityMode) -> Self { + value.clone() + } + } + impl ToString for SiloIdentityMode { fn to_string(&self) -> String { match *self { @@ -3628,6 +4597,12 @@ pub mod types { pub next_page: Option, } + impl From<&SiloResultsPage> for SiloResultsPage { + fn from(value: &SiloResultsPage) -> Self { + value.clone() + } + } + impl SiloResultsPage { pub fn builder() -> builder::SiloResultsPage { builder::SiloResultsPage::default() @@ -3646,6 +4621,12 @@ pub mod types { Viewer, } + impl From<&SiloRole> for SiloRole { + fn from(value: &SiloRole) -> Self { + value.clone() + } + } + impl ToString for SiloRole { fn to_string(&self) -> String { match *self { @@ -3701,6 +4682,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&SiloRolePolicy> for SiloRolePolicy { + fn from(value: &SiloRolePolicy) -> Self { + value.clone() + } + } + impl SiloRolePolicy { pub fn builder() -> builder::SiloRolePolicy { builder::SiloRolePolicy::default() @@ -3720,6 +4707,12 @@ pub mod types { pub role_name: SiloRole, } + impl From<&SiloRoleRoleAssignment> for SiloRoleRoleAssignment { + fn from(value: &SiloRoleRoleAssignment) -> Self { + value.clone() + } + } + impl SiloRoleRoleAssignment { pub fn builder() -> builder::SiloRoleRoleAssignment { builder::SiloRoleRoleAssignment::default() @@ -3739,6 +4732,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Sled> for Sled { + fn from(value: &Sled) -> Self { + value.clone() + } + } + impl Sled { pub fn builder() -> builder::Sled { builder::Sled::default() @@ -3755,6 +4754,12 @@ pub mod types { pub next_page: Option, } + impl From<&SledResultsPage> for SledResultsPage { + fn from(value: &SledResultsPage) -> Self { + value.clone() + } + } + impl SledResultsPage { pub fn builder() -> builder::SledResultsPage { builder::SledResultsPage::default() @@ -3780,6 +4785,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Snapshot> for Snapshot { + fn from(value: &Snapshot) -> Self { + value.clone() + } + } + impl Snapshot { pub fn builder() -> builder::Snapshot { builder::Snapshot::default() @@ -3796,6 +4807,12 @@ pub mod types { pub name: Name, } + impl From<&SnapshotCreate> for SnapshotCreate { + fn from(value: &SnapshotCreate) -> Self { + value.clone() + } + } + impl SnapshotCreate { pub fn builder() -> builder::SnapshotCreate { builder::SnapshotCreate::default() @@ -3812,6 +4829,12 @@ pub mod types { pub next_page: Option, } + impl From<&SnapshotResultsPage> for SnapshotResultsPage { + fn from(value: &SnapshotResultsPage) -> Self { + value.clone() + } + } + impl SnapshotResultsPage { pub fn builder() -> builder::SnapshotResultsPage { builder::SnapshotResultsPage::default() @@ -3832,6 +4855,12 @@ pub mod types { Destroyed, } + impl From<&SnapshotState> for SnapshotState { + fn from(value: &SnapshotState) -> Self { + value.clone() + } + } + impl ToString for SnapshotState { fn to_string(&self) -> String { match *self { @@ -3882,6 +4911,12 @@ pub mod types { pub username: String, } + impl From<&SpoofLoginBody> for SpoofLoginBody { + fn from(value: &SpoofLoginBody) -> Self { + value.clone() + } + } + impl SpoofLoginBody { pub fn builder() -> builder::SpoofLoginBody { builder::SpoofLoginBody::default() @@ -3907,6 +4942,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&SshKey> for SshKey { + fn from(value: &SshKey) -> Self { + value.clone() + } + } + impl SshKey { pub fn builder() -> builder::SshKey { builder::SshKey::default() @@ -3923,6 +4964,12 @@ pub mod types { pub public_key: String, } + impl From<&SshKeyCreate> for SshKeyCreate { + fn from(value: &SshKeyCreate) -> Self { + value.clone() + } + } + impl SshKeyCreate { pub fn builder() -> builder::SshKeyCreate { builder::SshKeyCreate::default() @@ -3939,6 +4986,12 @@ pub mod types { pub next_page: Option, } + impl From<&SshKeyResultsPage> for SshKeyResultsPage { + fn from(value: &SshKeyResultsPage) -> Self { + value.clone() + } + } + impl SshKeyResultsPage { pub fn builder() -> builder::SshKeyResultsPage { builder::SshKeyResultsPage::default() @@ -3957,6 +5010,12 @@ pub mod types { RamProvisioned, } + impl From<&SystemMetricName> for SystemMetricName { + fn from(value: &SystemMetricName) -> Self { + value.clone() + } + } + impl ToString for SystemMetricName { fn to_string(&self) -> String { match *self { @@ -4013,6 +5072,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&SystemUpdate> for SystemUpdate { + fn from(value: &SystemUpdate) -> Self { + value.clone() + } + } + impl SystemUpdate { pub fn builder() -> builder::SystemUpdate { builder::SystemUpdate::default() @@ -4029,6 +5094,12 @@ pub mod types { pub next_page: Option, } + impl From<&SystemUpdateResultsPage> for SystemUpdateResultsPage { + fn from(value: &SystemUpdateResultsPage) -> Self { + value.clone() + } + } + impl SystemUpdateResultsPage { pub fn builder() -> builder::SystemUpdateResultsPage { builder::SystemUpdateResultsPage::default() @@ -4040,6 +5111,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&SystemUpdateStart> for SystemUpdateStart { + fn from(value: &SystemUpdateStart) -> Self { + value.clone() + } + } + impl SystemUpdateStart { pub fn builder() -> builder::SystemUpdateStart { builder::SystemUpdateStart::default() @@ -4052,6 +5129,12 @@ pub mod types { pub version_range: VersionRange, } + impl From<&SystemVersion> for SystemVersion { + fn from(value: &SystemVersion) -> Self { + value.clone() + } + } + impl SystemVersion { pub fn builder() -> builder::SystemVersion { builder::SystemVersion::default() @@ -4070,6 +5153,18 @@ pub mod types { } } + impl From for String { + fn from(value: TimeseriesName) -> Self { + value.0 + } + } + + impl From<&TimeseriesName> for TimeseriesName { + fn from(value: &TimeseriesName) -> Self { + value.clone() + } + } + impl std::str::FromStr for TimeseriesName { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -4130,6 +5225,12 @@ pub mod types { pub timeseries_name: TimeseriesName, } + impl From<&TimeseriesSchema> for TimeseriesSchema { + fn from(value: &TimeseriesSchema) -> Self { + value.clone() + } + } + impl TimeseriesSchema { pub fn builder() -> builder::TimeseriesSchema { builder::TimeseriesSchema::default() @@ -4146,6 +5247,12 @@ pub mod types { pub next_page: Option, } + impl From<&TimeseriesSchemaResultsPage> for TimeseriesSchemaResultsPage { + fn from(value: &TimeseriesSchemaResultsPage) -> Self { + value.clone() + } + } + impl TimeseriesSchemaResultsPage { pub fn builder() -> builder::TimeseriesSchemaResultsPage { builder::TimeseriesSchemaResultsPage::default() @@ -4166,6 +5273,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&UpdateDeployment> for UpdateDeployment { + fn from(value: &UpdateDeployment) -> Self { + value.clone() + } + } + impl UpdateDeployment { pub fn builder() -> builder::UpdateDeployment { builder::UpdateDeployment::default() @@ -4182,6 +5295,12 @@ pub mod types { pub next_page: Option, } + impl From<&UpdateDeploymentResultsPage> for UpdateDeploymentResultsPage { + fn from(value: &UpdateDeploymentResultsPage) -> Self { + value.clone() + } + } + impl UpdateDeploymentResultsPage { pub fn builder() -> builder::UpdateDeploymentResultsPage { builder::UpdateDeploymentResultsPage::default() @@ -4199,6 +5318,12 @@ pub mod types { Steady, } + impl From<&UpdateStatus> for UpdateStatus { + fn from(value: &UpdateStatus) -> Self { + value.clone() + } + } + impl ToString for UpdateStatus { fn to_string(&self) -> String { match *self { @@ -4257,6 +5382,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&UpdateableComponent> for UpdateableComponent { + fn from(value: &UpdateableComponent) -> Self { + value.clone() + } + } + impl UpdateableComponent { pub fn builder() -> builder::UpdateableComponent { builder::UpdateableComponent::default() @@ -4273,6 +5404,12 @@ pub mod types { pub next_page: Option, } + impl From<&UpdateableComponentResultsPage> for UpdateableComponentResultsPage { + fn from(value: &UpdateableComponentResultsPage) -> Self { + value.clone() + } + } + impl UpdateableComponentResultsPage { pub fn builder() -> builder::UpdateableComponentResultsPage { builder::UpdateableComponentResultsPage::default() @@ -4309,6 +5446,12 @@ pub mod types { HostOmicron, } + impl From<&UpdateableComponentType> for UpdateableComponentType { + fn from(value: &UpdateableComponentType) -> Self { + value.clone() + } + } + impl ToString for UpdateableComponentType { fn to_string(&self) -> String { match *self { @@ -4380,6 +5523,12 @@ pub mod types { pub silo_id: uuid::Uuid, } + impl From<&User> for User { + fn from(value: &User) -> Self { + value.clone() + } + } + impl User { pub fn builder() -> builder::User { builder::User::default() @@ -4401,6 +5550,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&UserBuiltin> for UserBuiltin { + fn from(value: &UserBuiltin) -> Self { + value.clone() + } + } + impl UserBuiltin { pub fn builder() -> builder::UserBuiltin { builder::UserBuiltin::default() @@ -4417,6 +5572,12 @@ pub mod types { pub next_page: Option, } + impl From<&UserBuiltinResultsPage> for UserBuiltinResultsPage { + fn from(value: &UserBuiltinResultsPage) -> Self { + value.clone() + } + } + impl UserBuiltinResultsPage { pub fn builder() -> builder::UserBuiltinResultsPage { builder::UserBuiltinResultsPage::default() @@ -4432,6 +5593,12 @@ pub mod types { pub password: UserPassword, } + impl From<&UserCreate> for UserCreate { + fn from(value: &UserCreate) -> Self { + value.clone() + } + } + impl UserCreate { pub fn builder() -> builder::UserCreate { builder::UserCreate::default() @@ -4450,6 +5617,18 @@ pub mod types { } } + impl From for String { + fn from(value: UserId) -> Self { + value.0 + } + } + + impl From<&UserId> for UserId { + fn from(value: &UserId) -> Self { + value.clone() + } + } + impl std::str::FromStr for UserId { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -4504,6 +5683,12 @@ pub mod types { InvalidPassword, } + impl From<&UserPassword> for UserPassword { + fn from(value: &UserPassword) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct UserResultsPage { @@ -4514,6 +5699,12 @@ pub mod types { pub next_page: Option, } + impl From<&UserResultsPage> for UserResultsPage { + fn from(value: &UserResultsPage) -> Self { + value.clone() + } + } + impl UserResultsPage { pub fn builder() -> builder::UserResultsPage { builder::UserResultsPage::default() @@ -4527,6 +5718,12 @@ pub mod types { pub username: UserId, } + impl From<&UsernamePasswordCredentials> for UsernamePasswordCredentials { + fn from(value: &UsernamePasswordCredentials) -> Self { + value.clone() + } + } + impl UsernamePasswordCredentials { pub fn builder() -> builder::UsernamePasswordCredentials { builder::UsernamePasswordCredentials::default() @@ -4539,6 +5736,12 @@ pub mod types { pub low: SemverVersion, } + impl From<&VersionRange> for VersionRange { + fn from(value: &VersionRange) -> Self { + value.clone() + } + } + impl VersionRange { pub fn builder() -> builder::VersionRange { builder::VersionRange::default() @@ -4568,6 +5771,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Vpc> for Vpc { + fn from(value: &Vpc) -> Self { + value.clone() + } + } + impl Vpc { pub fn builder() -> builder::Vpc { builder::Vpc::default() @@ -4590,6 +5799,12 @@ pub mod types { pub name: Name, } + impl From<&VpcCreate> for VpcCreate { + fn from(value: &VpcCreate) -> Self { + value.clone() + } + } + impl VpcCreate { pub fn builder() -> builder::VpcCreate { builder::VpcCreate::default() @@ -4625,6 +5840,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcFirewallRule> for VpcFirewallRule { + fn from(value: &VpcFirewallRule) -> Self { + value.clone() + } + } + impl VpcFirewallRule { pub fn builder() -> builder::VpcFirewallRule { builder::VpcFirewallRule::default() @@ -4641,6 +5862,12 @@ pub mod types { Deny, } + impl From<&VpcFirewallRuleAction> for VpcFirewallRuleAction { + fn from(value: &VpcFirewallRuleAction) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleAction { fn to_string(&self) -> String { match *self { @@ -4692,6 +5919,12 @@ pub mod types { Outbound, } + impl From<&VpcFirewallRuleDirection> for VpcFirewallRuleDirection { + fn from(value: &VpcFirewallRuleDirection) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleDirection { fn to_string(&self) -> String { match *self { @@ -4750,6 +5983,12 @@ pub mod types { pub protocols: Option>, } + impl From<&VpcFirewallRuleFilter> for VpcFirewallRuleFilter { + fn from(value: &VpcFirewallRuleFilter) -> Self { + value.clone() + } + } + impl VpcFirewallRuleFilter { pub fn builder() -> builder::VpcFirewallRuleFilter { builder::VpcFirewallRuleFilter::default() @@ -4778,6 +6017,12 @@ pub mod types { IpNet(IpNet), } + impl From<&VpcFirewallRuleHostFilter> for VpcFirewallRuleHostFilter { + fn from(value: &VpcFirewallRuleHostFilter) -> Self { + value.clone() + } + } + ///The protocols that may be specified in a firewall rule's filter #[derive( Clone, Copy, Debug, Deserialize, Eq, Hash, JsonSchema, Ord, PartialEq, PartialOrd, Serialize, @@ -4791,6 +6036,12 @@ pub mod types { Icmp, } + impl From<&VpcFirewallRuleProtocol> for VpcFirewallRuleProtocol { + fn from(value: &VpcFirewallRuleProtocol) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleProtocol { fn to_string(&self) -> String { match *self { @@ -4844,6 +6095,12 @@ pub mod types { Enabled, } + impl From<&VpcFirewallRuleStatus> for VpcFirewallRuleStatus { + fn from(value: &VpcFirewallRuleStatus) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleStatus { fn to_string(&self) -> String { match *self { @@ -4907,6 +6164,12 @@ pub mod types { IpNet(IpNet), } + impl From<&VpcFirewallRuleTarget> for VpcFirewallRuleTarget { + fn from(value: &VpcFirewallRuleTarget) -> Self { + value.clone() + } + } + ///A single rule in a VPC firewall #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct VpcFirewallRuleUpdate { @@ -4928,6 +6191,12 @@ pub mod types { pub targets: Vec, } + impl From<&VpcFirewallRuleUpdate> for VpcFirewallRuleUpdate { + fn from(value: &VpcFirewallRuleUpdate) -> Self { + value.clone() + } + } + impl VpcFirewallRuleUpdate { pub fn builder() -> builder::VpcFirewallRuleUpdate { builder::VpcFirewallRuleUpdate::default() @@ -4942,6 +6211,12 @@ pub mod types { pub rules: Vec, } + impl From<&VpcFirewallRuleUpdateParams> for VpcFirewallRuleUpdateParams { + fn from(value: &VpcFirewallRuleUpdateParams) -> Self { + value.clone() + } + } + impl VpcFirewallRuleUpdateParams { pub fn builder() -> builder::VpcFirewallRuleUpdateParams { builder::VpcFirewallRuleUpdateParams::default() @@ -4954,6 +6229,12 @@ pub mod types { pub rules: Vec, } + impl From<&VpcFirewallRules> for VpcFirewallRules { + fn from(value: &VpcFirewallRules) -> Self { + value.clone() + } + } + impl VpcFirewallRules { pub fn builder() -> builder::VpcFirewallRules { builder::VpcFirewallRules::default() @@ -4970,6 +6251,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcResultsPage> for VpcResultsPage { + fn from(value: &VpcResultsPage) -> Self { + value.clone() + } + } + impl VpcResultsPage { pub fn builder() -> builder::VpcResultsPage { builder::VpcResultsPage::default() @@ -4995,6 +6282,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcRouter> for VpcRouter { + fn from(value: &VpcRouter) -> Self { + value.clone() + } + } + impl VpcRouter { pub fn builder() -> builder::VpcRouter { builder::VpcRouter::default() @@ -5009,6 +6302,12 @@ pub mod types { pub name: Name, } + impl From<&VpcRouterCreate> for VpcRouterCreate { + fn from(value: &VpcRouterCreate) -> Self { + value.clone() + } + } + impl VpcRouterCreate { pub fn builder() -> builder::VpcRouterCreate { builder::VpcRouterCreate::default() @@ -5025,6 +6324,12 @@ pub mod types { Custom, } + impl From<&VpcRouterKind> for VpcRouterKind { + fn from(value: &VpcRouterKind) -> Self { + value.clone() + } + } + impl ToString for VpcRouterKind { fn to_string(&self) -> String { match *self { @@ -5076,6 +6381,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcRouterResultsPage> for VpcRouterResultsPage { + fn from(value: &VpcRouterResultsPage) -> Self { + value.clone() + } + } + impl VpcRouterResultsPage { pub fn builder() -> builder::VpcRouterResultsPage { builder::VpcRouterResultsPage::default() @@ -5092,6 +6403,12 @@ pub mod types { pub name: Option, } + impl From<&VpcRouterUpdate> for VpcRouterUpdate { + fn from(value: &VpcRouterUpdate) -> Self { + value.clone() + } + } + impl VpcRouterUpdate { pub fn builder() -> builder::VpcRouterUpdate { builder::VpcRouterUpdate::default() @@ -5121,6 +6438,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcSubnet> for VpcSubnet { + fn from(value: &VpcSubnet) -> Self { + value.clone() + } + } + impl VpcSubnet { pub fn builder() -> builder::VpcSubnet { builder::VpcSubnet::default() @@ -5148,6 +6471,12 @@ pub mod types { pub name: Name, } + impl From<&VpcSubnetCreate> for VpcSubnetCreate { + fn from(value: &VpcSubnetCreate) -> Self { + value.clone() + } + } + impl VpcSubnetCreate { pub fn builder() -> builder::VpcSubnetCreate { builder::VpcSubnetCreate::default() @@ -5164,6 +6493,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcSubnetResultsPage> for VpcSubnetResultsPage { + fn from(value: &VpcSubnetResultsPage) -> Self { + value.clone() + } + } + impl VpcSubnetResultsPage { pub fn builder() -> builder::VpcSubnetResultsPage { builder::VpcSubnetResultsPage::default() @@ -5180,6 +6515,12 @@ pub mod types { pub name: Option, } + impl From<&VpcSubnetUpdate> for VpcSubnetUpdate { + fn from(value: &VpcSubnetUpdate) -> Self { + value.clone() + } + } + impl VpcSubnetUpdate { pub fn builder() -> builder::VpcSubnetUpdate { builder::VpcSubnetUpdate::default() @@ -5197,6 +6538,12 @@ pub mod types { pub name: Option, } + impl From<&VpcUpdate> for VpcUpdate { + fn from(value: &VpcUpdate) -> Self { + value.clone() + } + } + impl VpcUpdate { pub fn builder() -> builder::VpcUpdate { builder::VpcUpdate::default() diff --git a/progenitor-impl/tests/output/nexus-positional.out b/progenitor-impl/tests/output/nexus-positional.out index 2380fb8..f4f9762 100644 --- a/progenitor-impl/tests/output/nexus-positional.out +++ b/progenitor-impl/tests/output/nexus-positional.out @@ -15,6 +15,12 @@ pub mod types { pub serial: String, } + impl From<&Baseboard> for Baseboard { + fn from(value: &Baseboard) -> Self { + value.clone() + } + } + ///A type storing a range over `T`. /// ///This type supports ranges similar to the `RangeTo`, `Range` and @@ -35,6 +41,12 @@ pub mod types { RangeFrom { start: f64 }, } + impl From<&BinRangedouble> for BinRangedouble { + fn from(value: &BinRangedouble) -> Self { + value.clone() + } + } + ///A type storing a range over `T`. /// ///This type supports ranges similar to the `RangeTo`, `Range` and @@ -55,6 +67,12 @@ pub mod types { RangeFrom { start: i64 }, } + impl From<&BinRangeint64> for BinRangeint64 { + fn from(value: &BinRangeint64) -> Self { + value.clone() + } + } + ///Type storing bin edges and a count of samples within it. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Bindouble { @@ -64,6 +82,12 @@ pub mod types { pub range: BinRangedouble, } + impl From<&Bindouble> for Bindouble { + fn from(value: &Bindouble) -> Self { + value.clone() + } + } + ///Type storing bin edges and a count of samples within it. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Binint64 { @@ -73,6 +97,12 @@ pub mod types { pub range: BinRangeint64, } + impl From<&Binint64> for Binint64 { + fn from(value: &Binint64) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Serialize)] pub struct BlockSize(i64); impl std::ops::Deref for BlockSize { @@ -82,6 +112,18 @@ pub mod types { } } + impl From for i64 { + fn from(value: BlockSize) -> Self { + value.0 + } + } + + impl From<&BlockSize> for BlockSize { + fn from(value: &BlockSize) -> Self { + value.clone() + } + } + impl std::convert::TryFrom for BlockSize { type Error = &'static str; fn try_from(value: i64) -> Result { @@ -119,6 +161,58 @@ pub mod types { } } + impl From for u64 { + fn from(value: ByteCount) -> Self { + value.0 + } + } + + impl From<&ByteCount> for ByteCount { + fn from(value: &ByteCount) -> Self { + value.clone() + } + } + + impl From for ByteCount { + fn from(value: u64) -> Self { + Self(value) + } + } + + impl std::str::FromStr for ByteCount { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for ByteCount { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for ByteCount { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for ByteCount { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for ByteCount { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Client view of a [`Certificate`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Certificate { @@ -135,6 +229,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Certificate> for Certificate { + fn from(value: &Certificate) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`Certificate`](crate::external_api::views::Certificate) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -149,6 +249,12 @@ pub mod types { pub service: ServiceUsingCertificate, } + impl From<&CertificateCreate> for CertificateCreate { + fn from(value: &CertificateCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct CertificateResultsPage { @@ -159,6 +265,12 @@ pub mod types { pub next_page: Option, } + impl From<&CertificateResultsPage> for CertificateResultsPage { + fn from(value: &CertificateResultsPage) -> Self { + value.clone() + } + } + ///Identity-related metadata that's included in "asset" public API objects /// (which generally have no name or description) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -173,6 +285,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&ComponentUpdate> for ComponentUpdate { + fn from(value: &ComponentUpdate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ComponentUpdateResultsPage { @@ -183,6 +301,12 @@ pub mod types { pub next_page: Option, } + impl From<&ComponentUpdateResultsPage> for ComponentUpdateResultsPage { + fn from(value: &ComponentUpdateResultsPage) -> Self { + value.clone() + } + } + ///A cumulative or counter data type. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Cumulativedouble { @@ -190,6 +314,12 @@ pub mod types { pub value: f64, } + impl From<&Cumulativedouble> for Cumulativedouble { + fn from(value: &Cumulativedouble) -> Self { + value.clone() + } + } + ///A cumulative or counter data type. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Cumulativeint64 { @@ -197,6 +327,12 @@ pub mod types { pub value: i64, } + impl From<&Cumulativeint64> for Cumulativeint64 { + fn from(value: &Cumulativeint64) -> Self { + value.clone() + } + } + ///A `Datum` is a single sampled data point from a metric. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type", content = "datum")] @@ -221,6 +357,12 @@ pub mod types { HistogramF64(Histogramdouble), } + impl From<&Datum> for Datum { + fn from(value: &Datum) -> Self { + value.clone() + } + } + ///The type of an individual datum of a metric. #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum DatumType { @@ -244,6 +386,12 @@ pub mod types { HistogramF64, } + impl From<&DatumType> for DatumType { + fn from(value: &DatumType) -> Self { + value.clone() + } + } + impl ToString for DatumType { fn to_string(&self) -> String { match *self { @@ -307,6 +455,12 @@ pub mod types { pub public_cert: String, } + impl From<&DerEncodedKeyPair> for DerEncodedKeyPair { + fn from(value: &DerEncodedKeyPair) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DeviceAccessTokenRequest { pub client_id: uuid::Uuid, @@ -314,16 +468,34 @@ pub mod types { pub grant_type: String, } + impl From<&DeviceAccessTokenRequest> for DeviceAccessTokenRequest { + fn from(value: &DeviceAccessTokenRequest) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DeviceAuthRequest { pub client_id: uuid::Uuid, } + impl From<&DeviceAuthRequest> for DeviceAuthRequest { + fn from(value: &DeviceAuthRequest) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DeviceAuthVerify { pub user_code: String, } + impl From<&DeviceAuthVerify> for DeviceAuthVerify { + fn from(value: &DeviceAuthVerify) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type", content = "value")] pub enum Digest { @@ -331,6 +503,12 @@ pub mod types { Sha256(String), } + impl From<&Digest> for Digest { + fn from(value: &Digest) -> Self { + value.clone() + } + } + ///Client view of a [`Disk`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Disk { @@ -355,6 +533,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Disk> for Disk { + fn from(value: &Disk) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`Disk`](omicron_common::api::external::Disk) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -367,6 +551,12 @@ pub mod types { pub size: ByteCount, } + impl From<&DiskCreate> for DiskCreate { + fn from(value: &DiskCreate) -> Self { + value.clone() + } + } + ///TODO-v1: Delete this Parameters for the /// [`Disk`](omicron_common::api::external::Disk) to be attached or detached /// to an instance @@ -375,6 +565,12 @@ pub mod types { pub name: Name, } + impl From<&DiskIdentifier> for DiskIdentifier { + fn from(value: &DiskIdentifier) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum DiskMetricName { #[serde(rename = "activated")] @@ -391,6 +587,12 @@ pub mod types { WriteBytes, } + impl From<&DiskMetricName> for DiskMetricName { + fn from(value: &DiskMetricName) -> Self { + value.clone() + } + } + impl ToString for DiskMetricName { fn to_string(&self) -> String { match *self { @@ -445,6 +647,12 @@ pub mod types { pub disk: NameOrId, } + impl From<&DiskPath> for DiskPath { + fn from(value: &DiskPath) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DiskResultsPage { @@ -455,6 +663,12 @@ pub mod types { pub next_page: Option, } + impl From<&DiskResultsPage> for DiskResultsPage { + fn from(value: &DiskResultsPage) -> Self { + value.clone() + } + } + ///Different sources for a disk #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] @@ -477,6 +691,12 @@ pub mod types { GlobalImage { image_id: uuid::Uuid }, } + impl From<&DiskSource> for DiskSource { + fn from(value: &DiskSource) -> Self { + value.clone() + } + } + ///State of a Disk (primarily: attached or not) #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "state", content = "instance")] @@ -500,6 +720,12 @@ pub mod types { Faulted, } + impl From<&DiskState> for DiskState { + fn from(value: &DiskState) -> Self { + value.clone() + } + } + ///OS image distribution #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Distribution { @@ -509,6 +735,12 @@ pub mod types { pub version: String, } + impl From<&Distribution> for Distribution { + fn from(value: &Distribution) -> Self { + value.clone() + } + } + ///Error information from a response. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Error { @@ -518,12 +750,24 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ExternalIp { pub ip: std::net::IpAddr, pub kind: IpKind, } + impl From<&ExternalIp> for ExternalIp { + fn from(value: &ExternalIp) -> Self { + value.clone() + } + } + ///Parameters for creating an external IP address for instances. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] @@ -538,6 +782,12 @@ pub mod types { }, } + impl From<&ExternalIpCreate> for ExternalIpCreate { + fn from(value: &ExternalIpCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ExternalIpResultsPage { @@ -548,6 +798,12 @@ pub mod types { pub next_page: Option, } + impl From<&ExternalIpResultsPage> for ExternalIpResultsPage { + fn from(value: &ExternalIpResultsPage) -> Self { + value.clone() + } + } + ///The name and type information for a field of a timeseries schema. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct FieldSchema { @@ -556,6 +812,12 @@ pub mod types { pub ty: FieldType, } + impl From<&FieldSchema> for FieldSchema { + fn from(value: &FieldSchema) -> Self { + value.clone() + } + } + ///The source from which a field is derived, the target or metric. #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum FieldSource { @@ -565,6 +827,12 @@ pub mod types { Metric, } + impl From<&FieldSource> for FieldSource { + fn from(value: &FieldSource) -> Self { + value.clone() + } + } + impl ToString for FieldSource { fn to_string(&self) -> String { match *self { @@ -621,6 +889,12 @@ pub mod types { Bool, } + impl From<&FieldType> for FieldType { + fn from(value: &FieldType) -> Self { + value.clone() + } + } + impl ToString for FieldType { fn to_string(&self) -> String { match *self { @@ -678,6 +952,12 @@ pub mod types { Viewer, } + impl From<&FleetRole> for FleetRole { + fn from(value: &FleetRole) -> Self { + value.clone() + } + } + impl ToString for FleetRole { fn to_string(&self) -> String { match *self { @@ -733,6 +1013,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&FleetRolePolicy> for FleetRolePolicy { + fn from(value: &FleetRolePolicy) -> Self { + value.clone() + } + } + ///Describes the assignment of a particular role on a particular resource /// to a particular identity (user, group, etc.) /// @@ -746,6 +1032,12 @@ pub mod types { pub role_name: FleetRole, } + impl From<&FleetRoleRoleAssignment> for FleetRoleRoleAssignment { + fn from(value: &FleetRoleRoleAssignment) -> Self { + value.clone() + } + } + ///Client view of global Images #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GlobalImage { @@ -775,6 +1067,12 @@ pub mod types { pub version: String, } + impl From<&GlobalImage> for GlobalImage { + fn from(value: &GlobalImage) -> Self { + value.clone() + } + } + ///Create-time parameters for an /// [`GlobalImage`](crate::external_api::views::GlobalImage) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -789,6 +1087,12 @@ pub mod types { pub source: ImageSource, } + impl From<&GlobalImageCreate> for GlobalImageCreate { + fn from(value: &GlobalImageCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GlobalImageResultsPage { @@ -799,6 +1103,12 @@ pub mod types { pub next_page: Option, } + impl From<&GlobalImageResultsPage> for GlobalImageResultsPage { + fn from(value: &GlobalImageResultsPage) -> Self { + value.clone() + } + } + ///Client view of a [`Group`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Group { @@ -809,6 +1119,12 @@ pub mod types { pub silo_id: uuid::Uuid, } + impl From<&Group> for Group { + fn from(value: &Group) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GroupResultsPage { @@ -819,6 +1135,12 @@ pub mod types { pub next_page: Option, } + impl From<&GroupResultsPage> for GroupResultsPage { + fn from(value: &GroupResultsPage) -> Self { + value.clone() + } + } + ///A simple type for managing a histogram metric. /// ///A histogram maintains the count of any number of samples, over a set of @@ -868,6 +1190,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&Histogramdouble> for Histogramdouble { + fn from(value: &Histogramdouble) -> Self { + value.clone() + } + } + ///A simple type for managing a histogram metric. /// ///A histogram maintains the count of any number of samples, over a set of @@ -917,6 +1245,12 @@ pub mod types { pub start_time: chrono::DateTime, } + impl From<&Histogramint64> for Histogramint64 { + fn from(value: &Histogramint64) -> Self { + value.clone() + } + } + ///Supported set of sort modes for scanning by id only. /// ///Currently, we only support scanning in ascending order. @@ -927,6 +1261,12 @@ pub mod types { IdAscending, } + impl From<&IdSortMode> for IdSortMode { + fn from(value: &IdSortMode) -> Self { + value.clone() + } + } + impl ToString for IdSortMode { fn to_string(&self) -> String { match *self { @@ -983,6 +1323,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&IdentityProvider> for IdentityProvider { + fn from(value: &IdentityProvider) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct IdentityProviderResultsPage { @@ -993,6 +1339,12 @@ pub mod types { pub next_page: Option, } + impl From<&IdentityProviderResultsPage> for IdentityProviderResultsPage { + fn from(value: &IdentityProviderResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum IdentityProviderType { ///SAML identity provider @@ -1000,6 +1352,12 @@ pub mod types { Saml, } + impl From<&IdentityProviderType> for IdentityProviderType { + fn from(value: &IdentityProviderType) -> Self { + value.clone() + } + } + impl ToString for IdentityProviderType { fn to_string(&self) -> String { match *self { @@ -1048,6 +1406,12 @@ pub mod types { SiloGroup, } + impl From<&IdentityType> for IdentityType { + fn from(value: &IdentityType) -> Self { + value.clone() + } + } + impl ToString for IdentityType { fn to_string(&self) -> String { match *self { @@ -1098,6 +1462,12 @@ pub mod types { Base64EncodedXml { data: String }, } + impl From<&IdpMetadataSource> for IdpMetadataSource { + fn from(value: &IdpMetadataSource) -> Self { + value.clone() + } + } + ///Client view of project Images #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Image { @@ -1128,6 +1498,12 @@ pub mod types { pub version: Option, } + impl From<&Image> for Image { + fn from(value: &Image) -> Self { + value.clone() + } + } + ///Create-time parameters for an /// [`Image`](crate::external_api::views::Image) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -1140,6 +1516,12 @@ pub mod types { pub source: ImageSource, } + impl From<&ImageCreate> for ImageCreate { + fn from(value: &ImageCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ImageResultsPage { @@ -1150,6 +1532,12 @@ pub mod types { pub next_page: Option, } + impl From<&ImageResultsPage> for ImageResultsPage { + fn from(value: &ImageResultsPage) -> Self { + value.clone() + } + } + ///The source of the underlying image. #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] @@ -1162,6 +1550,12 @@ pub mod types { YouCanBootAnythingAsLongAsItsAlpine, } + impl From<&ImageSource> for ImageSource { + fn from(value: &ImageSource) -> Self { + value.clone() + } + } + ///Client view of an [`Instance`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Instance { @@ -1187,6 +1581,12 @@ pub mod types { pub time_run_state_updated: chrono::DateTime, } + impl From<&Instance> for Instance { + fn from(value: &Instance) -> Self { + value.clone() + } + } + ///The number of CPUs in an Instance #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceCpuCount(pub u16); @@ -1197,6 +1597,58 @@ pub mod types { } } + impl From for u16 { + fn from(value: InstanceCpuCount) -> Self { + value.0 + } + } + + impl From<&InstanceCpuCount> for InstanceCpuCount { + fn from(value: &InstanceCpuCount) -> Self { + value.clone() + } + } + + impl From for InstanceCpuCount { + fn from(value: u16) -> Self { + Self(value) + } + } + + impl std::str::FromStr for InstanceCpuCount { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for InstanceCpuCount { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for InstanceCpuCount { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Create-time parameters for an /// [`Instance`](omicron_common::api::external::Instance) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -1230,6 +1682,12 @@ pub mod types { pub user_data: String, } + impl From<&InstanceCreate> for InstanceCreate { + fn from(value: &InstanceCreate) -> Self { + value.clone() + } + } + ///Describe the instance's disks at creation time #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] @@ -1252,6 +1710,12 @@ pub mod types { }, } + impl From<&InstanceDiskAttachment> for InstanceDiskAttachment { + fn from(value: &InstanceDiskAttachment) -> Self { + value.clone() + } + } + ///Migration parameters for an /// [`Instance`](omicron_common::api::external::Instance) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -1259,6 +1723,12 @@ pub mod types { pub dst_sled_id: uuid::Uuid, } + impl From<&InstanceMigrate> for InstanceMigrate { + fn from(value: &InstanceMigrate) -> Self { + value.clone() + } + } + ///Describes an attachment of a `NetworkInterface` to an `Instance`, at the /// time the instance is created. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -1276,6 +1746,12 @@ pub mod types { None, } + impl From<&InstanceNetworkInterfaceAttachment> for InstanceNetworkInterfaceAttachment { + fn from(value: &InstanceNetworkInterfaceAttachment) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceResultsPage { @@ -1286,6 +1762,12 @@ pub mod types { pub next_page: Option, } + impl From<&InstanceResultsPage> for InstanceResultsPage { + fn from(value: &InstanceResultsPage) -> Self { + value.clone() + } + } + ///Contents of an Instance's serial console buffer. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceSerialConsoleData { @@ -1298,6 +1780,12 @@ pub mod types { pub last_byte_offset: u64, } + impl From<&InstanceSerialConsoleData> for InstanceSerialConsoleData { + fn from(value: &InstanceSerialConsoleData) -> Self { + value.clone() + } + } + ///Running state of an Instance (primarily: booted or stopped) /// ///This typically reflects whether it's starting, running, stopping, or @@ -1340,6 +1828,12 @@ pub mod types { Destroyed, } + impl From<&InstanceState> for InstanceState { + fn from(value: &InstanceState) -> Self { + value.clone() + } + } + impl ToString for InstanceState { fn to_string(&self) -> String { match *self { @@ -1406,6 +1900,12 @@ pub mod types { Floating, } + impl From<&IpKind> for IpKind { + fn from(value: &IpKind) -> Self { + value.clone() + } + } + impl ToString for IpKind { fn to_string(&self) -> String { match *self { @@ -1454,6 +1954,12 @@ pub mod types { V6(Ipv6Net), } + impl From<&IpNet> for IpNet { + fn from(value: &IpNet) -> Self { + value.clone() + } + } + impl std::str::FromStr for IpNet { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1513,6 +2019,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&IpPool> for IpPool { + fn from(value: &IpPool) -> Self { + value.clone() + } + } + ///Create-time parameters for an IP Pool. /// ///See [`IpPool`](crate::external_api::views::IpPool) @@ -1522,6 +2034,12 @@ pub mod types { pub name: Name, } + impl From<&IpPoolCreate> for IpPoolCreate { + fn from(value: &IpPoolCreate) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct IpPoolRange { pub id: uuid::Uuid, @@ -1529,6 +2047,12 @@ pub mod types { pub time_created: chrono::DateTime, } + impl From<&IpPoolRange> for IpPoolRange { + fn from(value: &IpPoolRange) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct IpPoolRangeResultsPage { @@ -1539,6 +2063,12 @@ pub mod types { pub next_page: Option, } + impl From<&IpPoolRangeResultsPage> for IpPoolRangeResultsPage { + fn from(value: &IpPoolRangeResultsPage) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct IpPoolResultsPage { @@ -1549,6 +2079,12 @@ pub mod types { pub next_page: Option, } + impl From<&IpPoolResultsPage> for IpPoolResultsPage { + fn from(value: &IpPoolResultsPage) -> Self { + value.clone() + } + } + ///Parameters for updating an IP Pool #[derive(Clone, Debug, Deserialize, Serialize)] pub struct IpPoolUpdate { @@ -1558,6 +2094,12 @@ pub mod types { pub name: Option, } + impl From<&IpPoolUpdate> for IpPoolUpdate { + fn from(value: &IpPoolUpdate) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(untagged)] pub enum IpRange { @@ -1565,6 +2107,12 @@ pub mod types { V6(Ipv6Range), } + impl From<&IpRange> for IpRange { + fn from(value: &IpRange) -> Self { + value.clone() + } + } + ///An IPv4 subnet, including prefix and subnet mask #[derive(Clone, Debug, Serialize)] pub struct Ipv4Net(String); @@ -1575,6 +2123,18 @@ pub mod types { } } + impl From for String { + fn from(value: Ipv4Net) -> Self { + value.0 + } + } + + impl From<&Ipv4Net> for Ipv4Net { + fn from(value: &Ipv4Net) -> Self { + value.clone() + } + } + impl std::str::FromStr for Ipv4Net { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1624,6 +2184,12 @@ pub mod types { pub last: std::net::Ipv4Addr, } + impl From<&Ipv4Range> for Ipv4Range { + fn from(value: &Ipv4Range) -> Self { + value.clone() + } + } + ///An IPv6 subnet, including prefix and subnet mask #[derive(Clone, Debug, Serialize)] pub struct Ipv6Net(String); @@ -1634,6 +2200,18 @@ pub mod types { } } + impl From for String { + fn from(value: Ipv6Net) -> Self { + value.0 + } + } + + impl From<&Ipv6Net> for Ipv6Net { + fn from(value: &Ipv6Net) -> Self { + value.clone() + } + } + impl std::str::FromStr for Ipv6Net { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1683,6 +2261,12 @@ pub mod types { pub last: std::net::Ipv6Addr, } + impl From<&Ipv6Range> for Ipv6Range { + fn from(value: &Ipv6Range) -> Self { + value.clone() + } + } + ///An inclusive-inclusive range of IP ports. The second port may be omitted /// to represent a single port #[derive(Clone, Debug, Serialize)] @@ -1694,6 +2278,18 @@ pub mod types { } } + impl From for String { + fn from(value: L4PortRange) -> Self { + value.0 + } + } + + impl From<&L4PortRange> for L4PortRange { + fn from(value: &L4PortRange) -> Self { + value.clone() + } + } + impl std::str::FromStr for L4PortRange { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1756,6 +2352,18 @@ pub mod types { } } + impl From for String { + fn from(value: MacAddr) -> Self { + value.0 + } + } + + impl From<&MacAddr> for MacAddr { + fn from(value: &MacAddr) -> Self { + value.clone() + } + } + impl std::str::FromStr for MacAddr { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1815,6 +2423,12 @@ pub mod types { pub timestamp: chrono::DateTime, } + impl From<&Measurement> for Measurement { + fn from(value: &Measurement) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct MeasurementResultsPage { @@ -1825,6 +2439,12 @@ pub mod types { pub next_page: Option, } + impl From<&MeasurementResultsPage> for MeasurementResultsPage { + fn from(value: &MeasurementResultsPage) -> Self { + value.clone() + } + } + ///Names must begin with a lower case ASCII letter, be composed exclusively /// of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end /// with a '-'. Names cannot be a UUID though they may contain a UUID. @@ -1837,6 +2457,18 @@ pub mod types { } } + impl From for String { + fn from(value: Name) -> Self { + value.0 + } + } + + impl From<&Name> for Name { + fn from(value: &Name) -> Self { + value.clone() + } + } + impl std::str::FromStr for Name { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1887,6 +2519,12 @@ pub mod types { Name(Name), } + impl From<&NameOrId> for NameOrId { + fn from(value: &NameOrId) -> Self { + value.clone() + } + } + impl std::str::FromStr for NameOrId { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -1944,6 +2582,12 @@ pub mod types { IdAscending, } + impl From<&NameOrIdSortMode> for NameOrIdSortMode { + fn from(value: &NameOrIdSortMode) -> Self { + value.clone() + } + } + impl ToString for NameOrIdSortMode { fn to_string(&self) -> String { match *self { @@ -1997,6 +2641,12 @@ pub mod types { NameAscending, } + impl From<&NameSortMode> for NameSortMode { + fn from(value: &NameSortMode) -> Self { + value.clone() + } + } + impl ToString for NameSortMode { fn to_string(&self) -> String { match *self { @@ -2064,6 +2714,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&NetworkInterface> for NetworkInterface { + fn from(value: &NetworkInterface) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`NetworkInterface`](omicron_common::api::external::NetworkInterface) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2080,6 +2736,12 @@ pub mod types { pub vpc_name: Name, } + impl From<&NetworkInterfaceCreate> for NetworkInterfaceCreate { + fn from(value: &NetworkInterfaceCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct NetworkInterfaceResultsPage { @@ -2090,6 +2752,12 @@ pub mod types { pub next_page: Option, } + impl From<&NetworkInterfaceResultsPage> for NetworkInterfaceResultsPage { + fn from(value: &NetworkInterfaceResultsPage) -> Self { + value.clone() + } + } + ///Parameters for updating a /// [`NetworkInterface`](omicron_common::api::external::NetworkInterface). /// @@ -2116,6 +2784,12 @@ pub mod types { pub primary: bool, } + impl From<&NetworkInterfaceUpdate> for NetworkInterfaceUpdate { + fn from(value: &NetworkInterfaceUpdate) -> Self { + value.clone() + } + } + ///Unique name for a saga [`Node`] /// ///Each node requires a string name that's unique within its DAG. The name @@ -2131,6 +2805,37 @@ pub mod types { } } + impl From for String { + fn from(value: NodeName) -> Self { + value.0 + } + } + + impl From<&NodeName> for NodeName { + fn from(value: &NodeName) -> Self { + value.clone() + } + } + + impl From for NodeName { + fn from(value: String) -> Self { + Self(value) + } + } + + impl std::str::FromStr for NodeName { + type Err = std::convert::Infallible; + fn from_str(value: &str) -> Result { + Ok(Self(value.to_string())) + } + } + + impl ToString for NodeName { + fn to_string(&self) -> String { + self.0.to_string() + } + } + ///Client view of an [`Organization`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Organization { @@ -2146,6 +2851,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Organization> for Organization { + fn from(value: &Organization) -> Self { + value.clone() + } + } + ///Create-time parameters for an /// [`Organization`](crate::external_api::views::Organization) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2154,6 +2865,12 @@ pub mod types { pub name: Name, } + impl From<&OrganizationCreate> for OrganizationCreate { + fn from(value: &OrganizationCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct OrganizationResultsPage { @@ -2164,6 +2881,12 @@ pub mod types { pub next_page: Option, } + impl From<&OrganizationResultsPage> for OrganizationResultsPage { + fn from(value: &OrganizationResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum OrganizationRole { #[serde(rename = "admin")] @@ -2174,6 +2897,12 @@ pub mod types { Viewer, } + impl From<&OrganizationRole> for OrganizationRole { + fn from(value: &OrganizationRole) -> Self { + value.clone() + } + } + impl ToString for OrganizationRole { fn to_string(&self) -> String { match *self { @@ -2229,6 +2958,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&OrganizationRolePolicy> for OrganizationRolePolicy { + fn from(value: &OrganizationRolePolicy) -> Self { + value.clone() + } + } + ///Describes the assignment of a particular role on a particular resource /// to a particular identity (user, group, etc.) /// @@ -2242,6 +2977,12 @@ pub mod types { pub role_name: OrganizationRole, } + impl From<&OrganizationRoleRoleAssignment> for OrganizationRoleRoleAssignment { + fn from(value: &OrganizationRoleRoleAssignment) -> Self { + value.clone() + } + } + ///Updateable properties of an /// [`Organization`](crate::external_api::views::Organization) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2252,6 +2993,12 @@ pub mod types { pub name: Option, } + impl From<&OrganizationUpdate> for OrganizationUpdate { + fn from(value: &OrganizationUpdate) -> Self { + value.clone() + } + } + ///Passwords may be subject to additional constraints. #[derive(Clone, Debug, Serialize)] pub struct Password(String); @@ -2262,6 +3009,18 @@ pub mod types { } } + impl From for String { + fn from(value: Password) -> Self { + value.0 + } + } + + impl From<&Password> for Password { + fn from(value: &Password) -> Self { + value.clone() + } + } + impl std::str::FromStr for Password { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2322,6 +3081,12 @@ pub mod types { pub vendor: String, } + impl From<&PhysicalDisk> for PhysicalDisk { + fn from(value: &PhysicalDisk) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct PhysicalDiskResultsPage { @@ -2332,6 +3097,12 @@ pub mod types { pub next_page: Option, } + impl From<&PhysicalDiskResultsPage> for PhysicalDiskResultsPage { + fn from(value: &PhysicalDiskResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum PhysicalDiskType { #[serde(rename = "internal")] @@ -2340,6 +3111,12 @@ pub mod types { External, } + impl From<&PhysicalDiskType> for PhysicalDiskType { + fn from(value: &PhysicalDiskType) -> Self { + value.clone() + } + } + impl ToString for PhysicalDiskType { fn to_string(&self) -> String { match *self { @@ -2397,6 +3174,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Project> for Project { + fn from(value: &Project) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`Project`](crate::external_api::views::Project) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2405,6 +3188,12 @@ pub mod types { pub name: Name, } + impl From<&ProjectCreate> for ProjectCreate { + fn from(value: &ProjectCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ProjectResultsPage { @@ -2415,6 +3204,12 @@ pub mod types { pub next_page: Option, } + impl From<&ProjectResultsPage> for ProjectResultsPage { + fn from(value: &ProjectResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum ProjectRole { #[serde(rename = "admin")] @@ -2425,6 +3220,12 @@ pub mod types { Viewer, } + impl From<&ProjectRole> for ProjectRole { + fn from(value: &ProjectRole) -> Self { + value.clone() + } + } + impl ToString for ProjectRole { fn to_string(&self) -> String { match *self { @@ -2480,6 +3281,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&ProjectRolePolicy> for ProjectRolePolicy { + fn from(value: &ProjectRolePolicy) -> Self { + value.clone() + } + } + ///Describes the assignment of a particular role on a particular resource /// to a particular identity (user, group, etc.) /// @@ -2493,6 +3300,12 @@ pub mod types { pub role_name: ProjectRole, } + impl From<&ProjectRoleRoleAssignment> for ProjectRoleRoleAssignment { + fn from(value: &ProjectRoleRoleAssignment) -> Self { + value.clone() + } + } + ///Updateable properties of a /// [`Project`](crate::external_api::views::Project) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2503,6 +3316,12 @@ pub mod types { pub name: Option, } + impl From<&ProjectUpdate> for ProjectUpdate { + fn from(value: &ProjectUpdate) -> Self { + value.clone() + } + } + ///Client view of an [`Rack`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Rack { @@ -2514,6 +3333,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Rack> for Rack { + fn from(value: &Rack) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RackResultsPage { @@ -2524,6 +3349,12 @@ pub mod types { pub next_page: Option, } + impl From<&RackResultsPage> for RackResultsPage { + fn from(value: &RackResultsPage) -> Self { + value.clone() + } + } + ///Client view of a [`Role`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Role { @@ -2531,6 +3362,12 @@ pub mod types { pub name: RoleName, } + impl From<&Role> for Role { + fn from(value: &Role) -> Self { + value.clone() + } + } + ///Role names consist of two string components separated by dot ("."). #[derive(Clone, Debug, Serialize)] pub struct RoleName(String); @@ -2541,6 +3378,18 @@ pub mod types { } } + impl From for String { + fn from(value: RoleName) -> Self { + value.0 + } + } + + impl From<&RoleName> for RoleName { + fn from(value: &RoleName) -> Self { + value.clone() + } + } + impl std::str::FromStr for RoleName { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2600,6 +3449,12 @@ pub mod types { pub next_page: Option, } + impl From<&RoleResultsPage> for RoleResultsPage { + fn from(value: &RoleResultsPage) -> Self { + value.clone() + } + } + ///A `RouteDestination` is used to match traffic with a routing rule, on /// the destination of that traffic. /// @@ -2623,6 +3478,12 @@ pub mod types { Subnet(Name), } + impl From<&RouteDestination> for RouteDestination { + fn from(value: &RouteDestination) -> Self { + value.clone() + } + } + ///A `RouteTarget` describes the possible locations that traffic matching a /// route destination can be sent. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2645,6 +3506,12 @@ pub mod types { InternetGateway(Name), } + impl From<&RouteTarget> for RouteTarget { + fn from(value: &RouteTarget) -> Self { + value.clone() + } + } + ///A route defines a rule that governs where traffic should be sent based /// on its destination. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2667,6 +3534,12 @@ pub mod types { pub vpc_router_id: uuid::Uuid, } + impl From<&RouterRoute> for RouterRoute { + fn from(value: &RouterRoute) -> Self { + value.clone() + } + } + ///Create-time parameters for a [`RouterRoute`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RouterRouteCreateParams { @@ -2676,6 +3549,12 @@ pub mod types { pub target: RouteTarget, } + impl From<&RouterRouteCreateParams> for RouterRouteCreateParams { + fn from(value: &RouterRouteCreateParams) -> Self { + value.clone() + } + } + ///The classification of a [`RouterRoute`] as defined by the system. The /// kind determines certain attributes such as if the route is modifiable /// and describes how or where the route was created. @@ -2706,6 +3585,12 @@ pub mod types { Custom, } + impl From<&RouterRouteKind> for RouterRouteKind { + fn from(value: &RouterRouteKind) -> Self { + value.clone() + } + } + impl ToString for RouterRouteKind { fn to_string(&self) -> String { match *self { @@ -2761,6 +3646,12 @@ pub mod types { pub next_page: Option, } + impl From<&RouterRouteResultsPage> for RouterRouteResultsPage { + fn from(value: &RouterRouteResultsPage) -> Self { + value.clone() + } + } + ///Updateable properties of a [`RouterRoute`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RouterRouteUpdateParams { @@ -2772,12 +3663,24 @@ pub mod types { pub target: RouteTarget, } + impl From<&RouterRouteUpdateParams> for RouterRouteUpdateParams { + fn from(value: &RouterRouteUpdateParams) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Saga { pub id: uuid::Uuid, pub state: SagaState, } + impl From<&Saga> for Saga { + fn from(value: &Saga) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "error")] pub enum SagaErrorInfo { @@ -2793,6 +3696,12 @@ pub mod types { SubsagaCreateFailed { message: String }, } + impl From<&SagaErrorInfo> for SagaErrorInfo { + fn from(value: &SagaErrorInfo) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SagaResultsPage { @@ -2803,6 +3712,12 @@ pub mod types { pub next_page: Option, } + impl From<&SagaResultsPage> for SagaResultsPage { + fn from(value: &SagaResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "state")] pub enum SagaState { @@ -2817,6 +3732,12 @@ pub mod types { }, } + impl From<&SagaState> for SagaState { + fn from(value: &SagaState) -> Self { + value.clone() + } + } + ///Identity-related metadata that's included in nearly all public API /// objects #[derive(Clone, Debug, Deserialize, Serialize)] @@ -2847,6 +3768,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&SamlIdentityProvider> for SamlIdentityProvider { + fn from(value: &SamlIdentityProvider) -> Self { + value.clone() + } + } + ///Create-time identity-related parameters #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SamlIdentityProviderCreate { @@ -2874,6 +3801,12 @@ pub mod types { pub technical_contact_email: String, } + impl From<&SamlIdentityProviderCreate> for SamlIdentityProviderCreate { + fn from(value: &SamlIdentityProviderCreate) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Serialize)] pub struct SemverVersion(String); impl std::ops::Deref for SemverVersion { @@ -2883,6 +3816,18 @@ pub mod types { } } + impl From for String { + fn from(value: SemverVersion) -> Self { + value.0 + } + } + + impl From<&SemverVersion> for SemverVersion { + fn from(value: &SemverVersion) -> Self { + value.clone() + } + } + impl std::str::FromStr for SemverVersion { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -2937,6 +3882,12 @@ pub mod types { ExternalApi, } + impl From<&ServiceUsingCertificate> for ServiceUsingCertificate { + fn from(value: &ServiceUsingCertificate) -> Self { + value.clone() + } + } + impl ToString for ServiceUsingCertificate { fn to_string(&self) -> String { match *self { @@ -2996,6 +3947,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Silo> for Silo { + fn from(value: &Silo) -> Self { + value.clone() + } + } + ///Create-time parameters for a [`Silo`](crate::external_api::views::Silo) #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SiloCreate { @@ -3015,6 +3972,12 @@ pub mod types { pub name: Name, } + impl From<&SiloCreate> for SiloCreate { + fn from(value: &SiloCreate) -> Self { + value.clone() + } + } + ///Describes how identities are managed and users are authenticated in this /// Silo #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] @@ -3031,6 +3994,12 @@ pub mod types { LocalOnly, } + impl From<&SiloIdentityMode> for SiloIdentityMode { + fn from(value: &SiloIdentityMode) -> Self { + value.clone() + } + } + impl ToString for SiloIdentityMode { fn to_string(&self) -> String { match *self { @@ -3082,6 +4051,12 @@ pub mod types { pub next_page: Option, } + impl From<&SiloResultsPage> for SiloResultsPage { + fn from(value: &SiloResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum SiloRole { #[serde(rename = "admin")] @@ -3092,6 +4067,12 @@ pub mod types { Viewer, } + impl From<&SiloRole> for SiloRole { + fn from(value: &SiloRole) -> Self { + value.clone() + } + } + impl ToString for SiloRole { fn to_string(&self) -> String { match *self { @@ -3147,6 +4128,12 @@ pub mod types { pub role_assignments: Vec, } + impl From<&SiloRolePolicy> for SiloRolePolicy { + fn from(value: &SiloRolePolicy) -> Self { + value.clone() + } + } + ///Describes the assignment of a particular role on a particular resource /// to a particular identity (user, group, etc.) /// @@ -3160,6 +4147,12 @@ pub mod types { pub role_name: SiloRole, } + impl From<&SiloRoleRoleAssignment> for SiloRoleRoleAssignment { + fn from(value: &SiloRoleRoleAssignment) -> Self { + value.clone() + } + } + ///Client view of a [`Sled`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Sled { @@ -3173,6 +4166,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Sled> for Sled { + fn from(value: &Sled) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SledResultsPage { @@ -3183,6 +4182,12 @@ pub mod types { pub next_page: Option, } + impl From<&SledResultsPage> for SledResultsPage { + fn from(value: &SledResultsPage) -> Self { + value.clone() + } + } + ///Client view of a Snapshot #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Snapshot { @@ -3202,6 +4207,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Snapshot> for Snapshot { + fn from(value: &Snapshot) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`Snapshot`](crate::external_api::views::Snapshot) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -3212,6 +4223,12 @@ pub mod types { pub name: Name, } + impl From<&SnapshotCreate> for SnapshotCreate { + fn from(value: &SnapshotCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SnapshotResultsPage { @@ -3222,6 +4239,12 @@ pub mod types { pub next_page: Option, } + impl From<&SnapshotResultsPage> for SnapshotResultsPage { + fn from(value: &SnapshotResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum SnapshotState { #[serde(rename = "creating")] @@ -3234,6 +4257,12 @@ pub mod types { Destroyed, } + impl From<&SnapshotState> for SnapshotState { + fn from(value: &SnapshotState) -> Self { + value.clone() + } + } + impl ToString for SnapshotState { fn to_string(&self) -> String { match *self { @@ -3284,6 +4313,12 @@ pub mod types { pub username: String, } + impl From<&SpoofLoginBody> for SpoofLoginBody { + fn from(value: &SpoofLoginBody) -> Self { + value.clone() + } + } + ///Client view of a [`SshKey`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SshKey { @@ -3303,6 +4338,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&SshKey> for SshKey { + fn from(value: &SshKey) -> Self { + value.clone() + } + } + ///Create-time parameters for an /// [`SshKey`](crate::external_api::views::SshKey) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -3313,6 +4354,12 @@ pub mod types { pub public_key: String, } + impl From<&SshKeyCreate> for SshKeyCreate { + fn from(value: &SshKeyCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SshKeyResultsPage { @@ -3323,6 +4370,12 @@ pub mod types { pub next_page: Option, } + impl From<&SshKeyResultsPage> for SshKeyResultsPage { + fn from(value: &SshKeyResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum SystemMetricName { #[serde(rename = "virtual_disk_space_provisioned")] @@ -3333,6 +4386,12 @@ pub mod types { RamProvisioned, } + impl From<&SystemMetricName> for SystemMetricName { + fn from(value: &SystemMetricName) -> Self { + value.clone() + } + } + impl ToString for SystemMetricName { fn to_string(&self) -> String { match *self { @@ -3389,6 +4448,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&SystemUpdate> for SystemUpdate { + fn from(value: &SystemUpdate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SystemUpdateResultsPage { @@ -3399,17 +4464,35 @@ pub mod types { pub next_page: Option, } + impl From<&SystemUpdateResultsPage> for SystemUpdateResultsPage { + fn from(value: &SystemUpdateResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SystemUpdateStart { pub version: SemverVersion, } + impl From<&SystemUpdateStart> for SystemUpdateStart { + fn from(value: &SystemUpdateStart) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct SystemVersion { pub status: UpdateStatus, pub version_range: VersionRange, } + impl From<&SystemVersion> for SystemVersion { + fn from(value: &SystemVersion) -> Self { + value.clone() + } + } + ///Names are constructed by concatenating the target and metric names with /// ':'. Target and metric names must be lowercase alphanumeric characters /// with '_' separating words. @@ -3422,6 +4505,18 @@ pub mod types { } } + impl From for String { + fn from(value: TimeseriesName) -> Self { + value.0 + } + } + + impl From<&TimeseriesName> for TimeseriesName { + fn from(value: &TimeseriesName) -> Self { + value.clone() + } + } + impl std::str::FromStr for TimeseriesName { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -3482,6 +4577,12 @@ pub mod types { pub timeseries_name: TimeseriesName, } + impl From<&TimeseriesSchema> for TimeseriesSchema { + fn from(value: &TimeseriesSchema) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TimeseriesSchemaResultsPage { @@ -3492,6 +4593,12 @@ pub mod types { pub next_page: Option, } + impl From<&TimeseriesSchemaResultsPage> for TimeseriesSchemaResultsPage { + fn from(value: &TimeseriesSchemaResultsPage) -> Self { + value.clone() + } + } + ///Identity-related metadata that's included in "asset" public API objects /// (which generally have no name or description) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -3506,6 +4613,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&UpdateDeployment> for UpdateDeployment { + fn from(value: &UpdateDeployment) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UpdateDeploymentResultsPage { @@ -3516,6 +4629,12 @@ pub mod types { pub next_page: Option, } + impl From<&UpdateDeploymentResultsPage> for UpdateDeploymentResultsPage { + fn from(value: &UpdateDeploymentResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] #[serde(tag = "status")] pub enum UpdateStatus { @@ -3525,6 +4644,12 @@ pub mod types { Steady, } + impl From<&UpdateStatus> for UpdateStatus { + fn from(value: &UpdateStatus) -> Self { + value.clone() + } + } + impl ToString for UpdateStatus { fn to_string(&self) -> String { match *self { @@ -3583,6 +4708,12 @@ pub mod types { pub version: SemverVersion, } + impl From<&UpdateableComponent> for UpdateableComponent { + fn from(value: &UpdateableComponent) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UpdateableComponentResultsPage { @@ -3593,6 +4724,12 @@ pub mod types { pub next_page: Option, } + impl From<&UpdateableComponentResultsPage> for UpdateableComponentResultsPage { + fn from(value: &UpdateableComponentResultsPage) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum UpdateableComponentType { #[serde(rename = "bootloader_for_rot")] @@ -3621,6 +4758,12 @@ pub mod types { HostOmicron, } + impl From<&UpdateableComponentType> for UpdateableComponentType { + fn from(value: &UpdateableComponentType) -> Self { + value.clone() + } + } + impl ToString for UpdateableComponentType { fn to_string(&self) -> String { match *self { @@ -3692,6 +4835,12 @@ pub mod types { pub silo_id: uuid::Uuid, } + impl From<&User> for User { + fn from(value: &User) -> Self { + value.clone() + } + } + ///Client view of a [`UserBuiltin`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserBuiltin { @@ -3707,6 +4856,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&UserBuiltin> for UserBuiltin { + fn from(value: &UserBuiltin) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserBuiltinResultsPage { @@ -3717,6 +4872,12 @@ pub mod types { pub next_page: Option, } + impl From<&UserBuiltinResultsPage> for UserBuiltinResultsPage { + fn from(value: &UserBuiltinResultsPage) -> Self { + value.clone() + } + } + ///Create-time parameters for a [`User`](crate::external_api::views::User) #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserCreate { @@ -3726,6 +4887,12 @@ pub mod types { pub password: UserPassword, } + impl From<&UserCreate> for UserCreate { + fn from(value: &UserCreate) -> Self { + value.clone() + } + } + ///Names must begin with a lower case ASCII letter, be composed exclusively /// of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end /// with a '-'. Names cannot be a UUID though they may contain a UUID. @@ -3738,6 +4905,18 @@ pub mod types { } } + impl From for String { + fn from(value: UserId) -> Self { + value.0 + } + } + + impl From<&UserId> for UserId { + fn from(value: &UserId) -> Self { + value.clone() + } + } + impl std::str::FromStr for UserId { type Err = &'static str; fn from_str(value: &str) -> Result { @@ -3792,6 +4971,12 @@ pub mod types { InvalidPassword, } + impl From<&UserPassword> for UserPassword { + fn from(value: &UserPassword) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UserResultsPage { @@ -3802,6 +4987,12 @@ pub mod types { pub next_page: Option, } + impl From<&UserResultsPage> for UserResultsPage { + fn from(value: &UserResultsPage) -> Self { + value.clone() + } + } + ///Credentials for local user login #[derive(Clone, Debug, Deserialize, Serialize)] pub struct UsernamePasswordCredentials { @@ -3809,12 +5000,24 @@ pub mod types { pub username: UserId, } + impl From<&UsernamePasswordCredentials> for UsernamePasswordCredentials { + fn from(value: &UsernamePasswordCredentials) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VersionRange { pub high: SemverVersion, pub low: SemverVersion, } + impl From<&VersionRange> for VersionRange { + fn from(value: &VersionRange) -> Self { + value.clone() + } + } + ///Client view of a [`Vpc`] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Vpc { @@ -3838,6 +5041,12 @@ pub mod types { pub time_modified: chrono::DateTime, } + impl From<&Vpc> for Vpc { + fn from(value: &Vpc) -> Self { + value.clone() + } + } + ///Create-time parameters for a [`Vpc`](crate::external_api::views::Vpc) #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcCreate { @@ -3854,6 +5063,12 @@ pub mod types { pub name: Name, } + impl From<&VpcCreate> for VpcCreate { + fn from(value: &VpcCreate) -> Self { + value.clone() + } + } + ///A single rule in a VPC firewall #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcFirewallRule { @@ -3883,6 +5098,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcFirewallRule> for VpcFirewallRule { + fn from(value: &VpcFirewallRule) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum VpcFirewallRuleAction { #[serde(rename = "allow")] @@ -3891,6 +5112,12 @@ pub mod types { Deny, } + impl From<&VpcFirewallRuleAction> for VpcFirewallRuleAction { + fn from(value: &VpcFirewallRuleAction) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleAction { fn to_string(&self) -> String { match *self { @@ -3940,6 +5167,12 @@ pub mod types { Outbound, } + impl From<&VpcFirewallRuleDirection> for VpcFirewallRuleDirection { + fn from(value: &VpcFirewallRuleDirection) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleDirection { fn to_string(&self) -> String { match *self { @@ -3998,6 +5231,12 @@ pub mod types { pub protocols: Option>, } + impl From<&VpcFirewallRuleFilter> for VpcFirewallRuleFilter { + fn from(value: &VpcFirewallRuleFilter) -> Self { + value.clone() + } + } + ///The `VpcFirewallRuleHostFilter` is used to filter traffic on the basis /// of its source or destination host. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -4020,6 +5259,12 @@ pub mod types { IpNet(IpNet), } + impl From<&VpcFirewallRuleHostFilter> for VpcFirewallRuleHostFilter { + fn from(value: &VpcFirewallRuleHostFilter) -> Self { + value.clone() + } + } + ///The protocols that may be specified in a firewall rule's filter #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum VpcFirewallRuleProtocol { @@ -4031,6 +5276,12 @@ pub mod types { Icmp, } + impl From<&VpcFirewallRuleProtocol> for VpcFirewallRuleProtocol { + fn from(value: &VpcFirewallRuleProtocol) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleProtocol { fn to_string(&self) -> String { match *self { @@ -4082,6 +5333,12 @@ pub mod types { Enabled, } + impl From<&VpcFirewallRuleStatus> for VpcFirewallRuleStatus { + fn from(value: &VpcFirewallRuleStatus) -> Self { + value.clone() + } + } + impl ToString for VpcFirewallRuleStatus { fn to_string(&self) -> String { match *self { @@ -4145,6 +5402,12 @@ pub mod types { IpNet(IpNet), } + impl From<&VpcFirewallRuleTarget> for VpcFirewallRuleTarget { + fn from(value: &VpcFirewallRuleTarget) -> Self { + value.clone() + } + } + ///A single rule in a VPC firewall #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcFirewallRuleUpdate { @@ -4166,6 +5429,12 @@ pub mod types { pub targets: Vec, } + impl From<&VpcFirewallRuleUpdate> for VpcFirewallRuleUpdate { + fn from(value: &VpcFirewallRuleUpdate) -> Self { + value.clone() + } + } + ///Updateable properties of a `Vpc`'s firewall Note that VpcFirewallRules /// are implicitly created along with a Vpc, so there is no explicit /// creation. @@ -4174,12 +5443,24 @@ pub mod types { pub rules: Vec, } + impl From<&VpcFirewallRuleUpdateParams> for VpcFirewallRuleUpdateParams { + fn from(value: &VpcFirewallRuleUpdateParams) -> Self { + value.clone() + } + } + ///Collection of a Vpc's firewall rules #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcFirewallRules { pub rules: Vec, } + impl From<&VpcFirewallRules> for VpcFirewallRules { + fn from(value: &VpcFirewallRules) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcResultsPage { @@ -4190,6 +5471,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcResultsPage> for VpcResultsPage { + fn from(value: &VpcResultsPage) -> Self { + value.clone() + } + } + ///A VPC router defines a series of rules that indicate where traffic /// should be sent depending on its destination. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -4209,6 +5496,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcRouter> for VpcRouter { + fn from(value: &VpcRouter) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`VpcRouter`](crate::external_api::views::VpcRouter) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -4217,6 +5510,12 @@ pub mod types { pub name: Name, } + impl From<&VpcRouterCreate> for VpcRouterCreate { + fn from(value: &VpcRouterCreate) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum VpcRouterKind { #[serde(rename = "system")] @@ -4225,6 +5524,12 @@ pub mod types { Custom, } + impl From<&VpcRouterKind> for VpcRouterKind { + fn from(value: &VpcRouterKind) -> Self { + value.clone() + } + } + impl ToString for VpcRouterKind { fn to_string(&self) -> String { match *self { @@ -4276,6 +5581,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcRouterResultsPage> for VpcRouterResultsPage { + fn from(value: &VpcRouterResultsPage) -> Self { + value.clone() + } + } + ///Updateable properties of a /// [`VpcRouter`](crate::external_api::views::VpcRouter) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -4286,6 +5597,12 @@ pub mod types { pub name: Option, } + impl From<&VpcRouterUpdate> for VpcRouterUpdate { + fn from(value: &VpcRouterUpdate) -> Self { + value.clone() + } + } + ///A VPC subnet represents a logical grouping for instances that allows /// network traffic between them, within a IPv4 subnetwork or optionall an /// IPv6 subnetwork. @@ -4309,6 +5626,12 @@ pub mod types { pub vpc_id: uuid::Uuid, } + impl From<&VpcSubnet> for VpcSubnet { + fn from(value: &VpcSubnet) -> Self { + value.clone() + } + } + ///Create-time parameters for a /// [`VpcSubnet`](crate::external_api::views::VpcSubnet) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -4330,6 +5653,12 @@ pub mod types { pub name: Name, } + impl From<&VpcSubnetCreate> for VpcSubnetCreate { + fn from(value: &VpcSubnetCreate) -> Self { + value.clone() + } + } + ///A single page of results #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcSubnetResultsPage { @@ -4340,6 +5669,12 @@ pub mod types { pub next_page: Option, } + impl From<&VpcSubnetResultsPage> for VpcSubnetResultsPage { + fn from(value: &VpcSubnetResultsPage) -> Self { + value.clone() + } + } + ///Updateable properties of a /// [`VpcSubnet`](crate::external_api::views::VpcSubnet) #[derive(Clone, Debug, Deserialize, Serialize)] @@ -4350,6 +5685,12 @@ pub mod types { pub name: Option, } + impl From<&VpcSubnetUpdate> for VpcSubnetUpdate { + fn from(value: &VpcSubnetUpdate) -> Self { + value.clone() + } + } + ///Updateable properties of a [`Vpc`](crate::external_api::views::Vpc) #[derive(Clone, Debug, Deserialize, Serialize)] pub struct VpcUpdate { @@ -4361,6 +5702,12 @@ pub mod types { pub name: Option, } + impl From<&VpcUpdate> for VpcUpdate { + fn from(value: &VpcUpdate) -> Self { + value.clone() + } + } + mod defaults { pub(super) fn default_bool() -> bool { V diff --git a/progenitor-impl/tests/output/propolis-server-builder-tagged.out b/progenitor-impl/tests/output/propolis-server-builder-tagged.out index 92ab28b..db0ab31 100644 --- a/progenitor-impl/tests/output/propolis-server-builder-tagged.out +++ b/progenitor-impl/tests/output/propolis-server-builder-tagged.out @@ -27,6 +27,12 @@ pub mod types { pub target: Vec, } + impl From<&CrucibleOpts> for CrucibleOpts { + fn from(value: &CrucibleOpts) -> Self { + value.clone() + } + } + impl CrucibleOpts { pub fn builder() -> builder::CrucibleOpts { builder::CrucibleOpts::default() @@ -40,6 +46,12 @@ pub mod types { pub state: DiskAttachmentState, } + impl From<&DiskAttachment> for DiskAttachment { + fn from(value: &DiskAttachment) -> Self { + value.clone() + } + } + impl DiskAttachment { pub fn builder() -> builder::DiskAttachment { builder::DiskAttachment::default() @@ -54,6 +66,12 @@ pub mod types { Attached(uuid::Uuid), } + impl From<&DiskAttachmentState> for DiskAttachmentState { + fn from(value: &DiskAttachmentState) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DiskRequest { pub device: String, @@ -64,6 +82,12 @@ pub mod types { pub volume_construction_request: VolumeConstructionRequest, } + impl From<&DiskRequest> for DiskRequest { + fn from(value: &DiskRequest) -> Self { + value.clone() + } + } + impl DiskRequest { pub fn builder() -> builder::DiskRequest { builder::DiskRequest::default() @@ -79,6 +103,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + impl Error { pub fn builder() -> builder::Error { builder::Error::default() @@ -93,6 +123,12 @@ pub mod types { pub state: InstanceState, } + impl From<&Instance> for Instance { + fn from(value: &Instance) -> Self { + value.clone() + } + } + impl Instance { pub fn builder() -> builder::Instance { builder::Instance::default() @@ -112,6 +148,12 @@ pub mod types { pub properties: InstanceProperties, } + impl From<&InstanceEnsureRequest> for InstanceEnsureRequest { + fn from(value: &InstanceEnsureRequest) -> Self { + value.clone() + } + } + impl InstanceEnsureRequest { pub fn builder() -> builder::InstanceEnsureRequest { builder::InstanceEnsureRequest::default() @@ -124,6 +166,12 @@ pub mod types { pub migrate: Option, } + impl From<&InstanceEnsureResponse> for InstanceEnsureResponse { + fn from(value: &InstanceEnsureResponse) -> Self { + value.clone() + } + } + impl InstanceEnsureResponse { pub fn builder() -> builder::InstanceEnsureResponse { builder::InstanceEnsureResponse::default() @@ -135,6 +183,12 @@ pub mod types { pub instance: Instance, } + impl From<&InstanceGetResponse> for InstanceGetResponse { + fn from(value: &InstanceGetResponse) -> Self { + value.clone() + } + } + impl InstanceGetResponse { pub fn builder() -> builder::InstanceGetResponse { builder::InstanceGetResponse::default() @@ -148,6 +202,12 @@ pub mod types { pub src_uuid: uuid::Uuid, } + impl From<&InstanceMigrateInitiateRequest> for InstanceMigrateInitiateRequest { + fn from(value: &InstanceMigrateInitiateRequest) -> Self { + value.clone() + } + } + impl InstanceMigrateInitiateRequest { pub fn builder() -> builder::InstanceMigrateInitiateRequest { builder::InstanceMigrateInitiateRequest::default() @@ -159,6 +219,12 @@ pub mod types { pub migration_id: uuid::Uuid, } + impl From<&InstanceMigrateInitiateResponse> for InstanceMigrateInitiateResponse { + fn from(value: &InstanceMigrateInitiateResponse) -> Self { + value.clone() + } + } + impl InstanceMigrateInitiateResponse { pub fn builder() -> builder::InstanceMigrateInitiateResponse { builder::InstanceMigrateInitiateResponse::default() @@ -170,6 +236,12 @@ pub mod types { pub migration_id: uuid::Uuid, } + impl From<&InstanceMigrateStatusRequest> for InstanceMigrateStatusRequest { + fn from(value: &InstanceMigrateStatusRequest) -> Self { + value.clone() + } + } + impl InstanceMigrateStatusRequest { pub fn builder() -> builder::InstanceMigrateStatusRequest { builder::InstanceMigrateStatusRequest::default() @@ -181,6 +253,12 @@ pub mod types { pub state: MigrationState, } + impl From<&InstanceMigrateStatusResponse> for InstanceMigrateStatusResponse { + fn from(value: &InstanceMigrateStatusResponse) -> Self { + value.clone() + } + } + impl InstanceMigrateStatusResponse { pub fn builder() -> builder::InstanceMigrateStatusResponse { builder::InstanceMigrateStatusResponse::default() @@ -205,6 +283,12 @@ pub mod types { pub vcpus: u8, } + impl From<&InstanceProperties> for InstanceProperties { + fn from(value: &InstanceProperties) -> Self { + value.clone() + } + } + impl InstanceProperties { pub fn builder() -> builder::InstanceProperties { builder::InstanceProperties::default() @@ -226,6 +310,12 @@ pub mod types { Destroyed, } + impl From<&InstanceState> for InstanceState { + fn from(value: &InstanceState) -> Self { + value.clone() + } + } + impl ToString for InstanceState { fn to_string(&self) -> String { match *self { @@ -288,6 +378,12 @@ pub mod types { pub gen: u64, } + impl From<&InstanceStateMonitorRequest> for InstanceStateMonitorRequest { + fn from(value: &InstanceStateMonitorRequest) -> Self { + value.clone() + } + } + impl InstanceStateMonitorRequest { pub fn builder() -> builder::InstanceStateMonitorRequest { builder::InstanceStateMonitorRequest::default() @@ -300,6 +396,12 @@ pub mod types { pub state: InstanceState, } + impl From<&InstanceStateMonitorResponse> for InstanceStateMonitorResponse { + fn from(value: &InstanceStateMonitorResponse) -> Self { + value.clone() + } + } + impl InstanceStateMonitorResponse { pub fn builder() -> builder::InstanceStateMonitorResponse { builder::InstanceStateMonitorResponse::default() @@ -314,6 +416,12 @@ pub mod types { MigrateStart, } + impl From<&InstanceStateRequested> for InstanceStateRequested { + fn from(value: &InstanceStateRequested) -> Self { + value.clone() + } + } + impl ToString for InstanceStateRequested { fn to_string(&self) -> String { match *self { @@ -373,6 +481,12 @@ pub mod types { Error, } + impl From<&MigrationState> for MigrationState { + fn from(value: &MigrationState) -> Self { + value.clone() + } + } + impl ToString for MigrationState { fn to_string(&self) -> String { match *self { @@ -436,6 +550,12 @@ pub mod types { pub name: String, } + impl From<&NetworkInterface> for NetworkInterface { + fn from(value: &NetworkInterface) -> Self { + value.clone() + } + } + impl NetworkInterface { pub fn builder() -> builder::NetworkInterface { builder::NetworkInterface::default() @@ -449,12 +569,24 @@ pub mod types { Attached(Slot), } + impl From<&NetworkInterfaceAttachmentState> for NetworkInterfaceAttachmentState { + fn from(value: &NetworkInterfaceAttachmentState) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct NetworkInterfaceRequest { pub name: String, pub slot: Slot, } + impl From<&NetworkInterfaceRequest> for NetworkInterfaceRequest { + fn from(value: &NetworkInterfaceRequest) -> Self { + value.clone() + } + } + impl NetworkInterfaceRequest { pub fn builder() -> builder::NetworkInterfaceRequest { builder::NetworkInterfaceRequest::default() @@ -472,6 +604,58 @@ pub mod types { } } + impl From for u8 { + fn from(value: Slot) -> Self { + value.0 + } + } + + impl From<&Slot> for Slot { + fn from(value: &Slot) -> Self { + value.clone() + } + } + + impl From for Slot { + fn from(value: u8) -> Self { + Self(value) + } + } + + impl std::str::FromStr for Slot { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for Slot { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for Slot { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for Slot { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for Slot { + fn to_string(&self) -> String { + self.0.to_string() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] pub enum VolumeConstructionRequest { @@ -503,6 +687,12 @@ pub mod types { }, } + impl From<&VolumeConstructionRequest> for VolumeConstructionRequest { + fn from(value: &VolumeConstructionRequest) -> Self { + value.clone() + } + } + mod builder { pub struct CrucibleOpts { cert_pem: Result, String>, diff --git a/progenitor-impl/tests/output/propolis-server-builder.out b/progenitor-impl/tests/output/propolis-server-builder.out index 61a456c..209fa85 100644 --- a/progenitor-impl/tests/output/propolis-server-builder.out +++ b/progenitor-impl/tests/output/propolis-server-builder.out @@ -27,6 +27,12 @@ pub mod types { pub target: Vec, } + impl From<&CrucibleOpts> for CrucibleOpts { + fn from(value: &CrucibleOpts) -> Self { + value.clone() + } + } + impl CrucibleOpts { pub fn builder() -> builder::CrucibleOpts { builder::CrucibleOpts::default() @@ -40,6 +46,12 @@ pub mod types { pub state: DiskAttachmentState, } + impl From<&DiskAttachment> for DiskAttachment { + fn from(value: &DiskAttachment) -> Self { + value.clone() + } + } + impl DiskAttachment { pub fn builder() -> builder::DiskAttachment { builder::DiskAttachment::default() @@ -54,6 +66,12 @@ pub mod types { Attached(uuid::Uuid), } + impl From<&DiskAttachmentState> for DiskAttachmentState { + fn from(value: &DiskAttachmentState) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct DiskRequest { pub device: String, @@ -64,6 +82,12 @@ pub mod types { pub volume_construction_request: VolumeConstructionRequest, } + impl From<&DiskRequest> for DiskRequest { + fn from(value: &DiskRequest) -> Self { + value.clone() + } + } + impl DiskRequest { pub fn builder() -> builder::DiskRequest { builder::DiskRequest::default() @@ -79,6 +103,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + impl Error { pub fn builder() -> builder::Error { builder::Error::default() @@ -93,6 +123,12 @@ pub mod types { pub state: InstanceState, } + impl From<&Instance> for Instance { + fn from(value: &Instance) -> Self { + value.clone() + } + } + impl Instance { pub fn builder() -> builder::Instance { builder::Instance::default() @@ -112,6 +148,12 @@ pub mod types { pub properties: InstanceProperties, } + impl From<&InstanceEnsureRequest> for InstanceEnsureRequest { + fn from(value: &InstanceEnsureRequest) -> Self { + value.clone() + } + } + impl InstanceEnsureRequest { pub fn builder() -> builder::InstanceEnsureRequest { builder::InstanceEnsureRequest::default() @@ -124,6 +166,12 @@ pub mod types { pub migrate: Option, } + impl From<&InstanceEnsureResponse> for InstanceEnsureResponse { + fn from(value: &InstanceEnsureResponse) -> Self { + value.clone() + } + } + impl InstanceEnsureResponse { pub fn builder() -> builder::InstanceEnsureResponse { builder::InstanceEnsureResponse::default() @@ -135,6 +183,12 @@ pub mod types { pub instance: Instance, } + impl From<&InstanceGetResponse> for InstanceGetResponse { + fn from(value: &InstanceGetResponse) -> Self { + value.clone() + } + } + impl InstanceGetResponse { pub fn builder() -> builder::InstanceGetResponse { builder::InstanceGetResponse::default() @@ -148,6 +202,12 @@ pub mod types { pub src_uuid: uuid::Uuid, } + impl From<&InstanceMigrateInitiateRequest> for InstanceMigrateInitiateRequest { + fn from(value: &InstanceMigrateInitiateRequest) -> Self { + value.clone() + } + } + impl InstanceMigrateInitiateRequest { pub fn builder() -> builder::InstanceMigrateInitiateRequest { builder::InstanceMigrateInitiateRequest::default() @@ -159,6 +219,12 @@ pub mod types { pub migration_id: uuid::Uuid, } + impl From<&InstanceMigrateInitiateResponse> for InstanceMigrateInitiateResponse { + fn from(value: &InstanceMigrateInitiateResponse) -> Self { + value.clone() + } + } + impl InstanceMigrateInitiateResponse { pub fn builder() -> builder::InstanceMigrateInitiateResponse { builder::InstanceMigrateInitiateResponse::default() @@ -170,6 +236,12 @@ pub mod types { pub migration_id: uuid::Uuid, } + impl From<&InstanceMigrateStatusRequest> for InstanceMigrateStatusRequest { + fn from(value: &InstanceMigrateStatusRequest) -> Self { + value.clone() + } + } + impl InstanceMigrateStatusRequest { pub fn builder() -> builder::InstanceMigrateStatusRequest { builder::InstanceMigrateStatusRequest::default() @@ -181,6 +253,12 @@ pub mod types { pub state: MigrationState, } + impl From<&InstanceMigrateStatusResponse> for InstanceMigrateStatusResponse { + fn from(value: &InstanceMigrateStatusResponse) -> Self { + value.clone() + } + } + impl InstanceMigrateStatusResponse { pub fn builder() -> builder::InstanceMigrateStatusResponse { builder::InstanceMigrateStatusResponse::default() @@ -205,6 +283,12 @@ pub mod types { pub vcpus: u8, } + impl From<&InstanceProperties> for InstanceProperties { + fn from(value: &InstanceProperties) -> Self { + value.clone() + } + } + impl InstanceProperties { pub fn builder() -> builder::InstanceProperties { builder::InstanceProperties::default() @@ -228,6 +312,12 @@ pub mod types { Destroyed, } + impl From<&InstanceState> for InstanceState { + fn from(value: &InstanceState) -> Self { + value.clone() + } + } + impl ToString for InstanceState { fn to_string(&self) -> String { match *self { @@ -290,6 +380,12 @@ pub mod types { pub gen: u64, } + impl From<&InstanceStateMonitorRequest> for InstanceStateMonitorRequest { + fn from(value: &InstanceStateMonitorRequest) -> Self { + value.clone() + } + } + impl InstanceStateMonitorRequest { pub fn builder() -> builder::InstanceStateMonitorRequest { builder::InstanceStateMonitorRequest::default() @@ -302,6 +398,12 @@ pub mod types { pub state: InstanceState, } + impl From<&InstanceStateMonitorResponse> for InstanceStateMonitorResponse { + fn from(value: &InstanceStateMonitorResponse) -> Self { + value.clone() + } + } + impl InstanceStateMonitorResponse { pub fn builder() -> builder::InstanceStateMonitorResponse { builder::InstanceStateMonitorResponse::default() @@ -318,6 +420,12 @@ pub mod types { MigrateStart, } + impl From<&InstanceStateRequested> for InstanceStateRequested { + fn from(value: &InstanceStateRequested) -> Self { + value.clone() + } + } + impl ToString for InstanceStateRequested { fn to_string(&self) -> String { match *self { @@ -379,6 +487,12 @@ pub mod types { Error, } + impl From<&MigrationState> for MigrationState { + fn from(value: &MigrationState) -> Self { + value.clone() + } + } + impl ToString for MigrationState { fn to_string(&self) -> String { match *self { @@ -442,6 +556,12 @@ pub mod types { pub name: String, } + impl From<&NetworkInterface> for NetworkInterface { + fn from(value: &NetworkInterface) -> Self { + value.clone() + } + } + impl NetworkInterface { pub fn builder() -> builder::NetworkInterface { builder::NetworkInterface::default() @@ -455,12 +575,24 @@ pub mod types { Attached(Slot), } + impl From<&NetworkInterfaceAttachmentState> for NetworkInterfaceAttachmentState { + fn from(value: &NetworkInterfaceAttachmentState) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] pub struct NetworkInterfaceRequest { pub name: String, pub slot: Slot, } + impl From<&NetworkInterfaceRequest> for NetworkInterfaceRequest { + fn from(value: &NetworkInterfaceRequest) -> Self { + value.clone() + } + } + impl NetworkInterfaceRequest { pub fn builder() -> builder::NetworkInterfaceRequest { builder::NetworkInterfaceRequest::default() @@ -478,6 +610,58 @@ pub mod types { } } + impl From for u8 { + fn from(value: Slot) -> Self { + value.0 + } + } + + impl From<&Slot> for Slot { + fn from(value: &Slot) -> Self { + value.clone() + } + } + + impl From for Slot { + fn from(value: u8) -> Self { + Self(value) + } + } + + impl std::str::FromStr for Slot { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for Slot { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for Slot { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for Slot { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for Slot { + fn to_string(&self) -> String { + self.0.to_string() + } + } + #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] #[serde(tag = "type")] pub enum VolumeConstructionRequest { @@ -509,6 +693,12 @@ pub mod types { }, } + impl From<&VolumeConstructionRequest> for VolumeConstructionRequest { + fn from(value: &VolumeConstructionRequest) -> Self { + value.clone() + } + } + mod builder { pub struct CrucibleOpts { cert_pem: Result, String>, diff --git a/progenitor-impl/tests/output/propolis-server-positional.out b/progenitor-impl/tests/output/propolis-server-positional.out index 6a649e3..659b216 100644 --- a/progenitor-impl/tests/output/propolis-server-positional.out +++ b/progenitor-impl/tests/output/propolis-server-positional.out @@ -27,6 +27,12 @@ pub mod types { pub target: Vec, } + impl From<&CrucibleOpts> for CrucibleOpts { + fn from(value: &CrucibleOpts) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DiskAttachment { pub disk_id: uuid::Uuid, @@ -34,6 +40,12 @@ pub mod types { pub state: DiskAttachmentState, } + impl From<&DiskAttachment> for DiskAttachment { + fn from(value: &DiskAttachment) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub enum DiskAttachmentState { Detached, @@ -42,6 +54,12 @@ pub mod types { Attached(uuid::Uuid), } + impl From<&DiskAttachmentState> for DiskAttachmentState { + fn from(value: &DiskAttachmentState) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DiskRequest { pub device: String, @@ -52,6 +70,12 @@ pub mod types { pub volume_construction_request: VolumeConstructionRequest, } + impl From<&DiskRequest> for DiskRequest { + fn from(value: &DiskRequest) -> Self { + value.clone() + } + } + ///Error information from a response. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Error { @@ -61,6 +85,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Instance { pub disks: Vec, @@ -69,6 +99,12 @@ pub mod types { pub state: InstanceState, } + impl From<&Instance> for Instance { + fn from(value: &Instance) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceEnsureRequest { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -82,17 +118,35 @@ pub mod types { pub properties: InstanceProperties, } + impl From<&InstanceEnsureRequest> for InstanceEnsureRequest { + fn from(value: &InstanceEnsureRequest) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceEnsureResponse { #[serde(default, skip_serializing_if = "Option::is_none")] pub migrate: Option, } + impl From<&InstanceEnsureResponse> for InstanceEnsureResponse { + fn from(value: &InstanceEnsureResponse) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceGetResponse { pub instance: Instance, } + impl From<&InstanceGetResponse> for InstanceGetResponse { + fn from(value: &InstanceGetResponse) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceMigrateInitiateRequest { pub migration_id: uuid::Uuid, @@ -100,21 +154,45 @@ pub mod types { pub src_uuid: uuid::Uuid, } + impl From<&InstanceMigrateInitiateRequest> for InstanceMigrateInitiateRequest { + fn from(value: &InstanceMigrateInitiateRequest) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceMigrateInitiateResponse { pub migration_id: uuid::Uuid, } + impl From<&InstanceMigrateInitiateResponse> for InstanceMigrateInitiateResponse { + fn from(value: &InstanceMigrateInitiateResponse) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceMigrateStatusRequest { pub migration_id: uuid::Uuid, } + impl From<&InstanceMigrateStatusRequest> for InstanceMigrateStatusRequest { + fn from(value: &InstanceMigrateStatusRequest) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceMigrateStatusResponse { pub state: MigrationState, } + impl From<&InstanceMigrateStatusResponse> for InstanceMigrateStatusResponse { + fn from(value: &InstanceMigrateStatusResponse) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceProperties { ///ID of the bootrom used to initialize this Instance. @@ -133,6 +211,12 @@ pub mod types { pub vcpus: u8, } + impl From<&InstanceProperties> for InstanceProperties { + fn from(value: &InstanceProperties) -> Self { + value.clone() + } + } + ///Current state of an Instance. #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum InstanceState { @@ -148,6 +232,12 @@ pub mod types { Destroyed, } + impl From<&InstanceState> for InstanceState { + fn from(value: &InstanceState) -> Self { + value.clone() + } + } + impl ToString for InstanceState { fn to_string(&self) -> String { match *self { @@ -210,12 +300,24 @@ pub mod types { pub gen: u64, } + impl From<&InstanceStateMonitorRequest> for InstanceStateMonitorRequest { + fn from(value: &InstanceStateMonitorRequest) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct InstanceStateMonitorResponse { pub gen: u64, pub state: InstanceState, } + impl From<&InstanceStateMonitorResponse> for InstanceStateMonitorResponse { + fn from(value: &InstanceStateMonitorResponse) -> Self { + value.clone() + } + } + #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum InstanceStateRequested { Run, @@ -224,6 +326,12 @@ pub mod types { MigrateStart, } + impl From<&InstanceStateRequested> for InstanceStateRequested { + fn from(value: &InstanceStateRequested) -> Self { + value.clone() + } + } + impl ToString for InstanceStateRequested { fn to_string(&self) -> String { match *self { @@ -283,6 +391,12 @@ pub mod types { Error, } + impl From<&MigrationState> for MigrationState { + fn from(value: &MigrationState) -> Self { + value.clone() + } + } + impl ToString for MigrationState { fn to_string(&self) -> String { match *self { @@ -346,6 +460,12 @@ pub mod types { pub name: String, } + impl From<&NetworkInterface> for NetworkInterface { + fn from(value: &NetworkInterface) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub enum NetworkInterfaceAttachmentState { Detached, @@ -353,12 +473,24 @@ pub mod types { Attached(Slot), } + impl From<&NetworkInterfaceAttachmentState> for NetworkInterfaceAttachmentState { + fn from(value: &NetworkInterfaceAttachmentState) -> Self { + value.clone() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct NetworkInterfaceRequest { pub name: String, pub slot: Slot, } + impl From<&NetworkInterfaceRequest> for NetworkInterfaceRequest { + fn from(value: &NetworkInterfaceRequest) -> Self { + value.clone() + } + } + ///A stable index which is translated by Propolis into a PCI BDF, visible /// to the guest. #[derive(Clone, Debug, Deserialize, Serialize)] @@ -370,6 +502,58 @@ pub mod types { } } + impl From for u8 { + fn from(value: Slot) -> Self { + value.0 + } + } + + impl From<&Slot> for Slot { + fn from(value: &Slot) -> Self { + value.clone() + } + } + + impl From for Slot { + fn from(value: u8) -> Self { + Self(value) + } + } + + impl std::str::FromStr for Slot { + type Err = ::Err; + fn from_str(value: &str) -> Result { + Ok(Self(value.parse()?)) + } + } + + impl std::convert::TryFrom<&str> for Slot { + type Error = ::Err; + fn try_from(value: &str) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom<&String> for Slot { + type Error = ::Err; + fn try_from(value: &String) -> Result { + value.parse() + } + } + + impl std::convert::TryFrom for Slot { + type Error = ::Err; + fn try_from(value: String) -> Result { + value.parse() + } + } + + impl ToString for Slot { + fn to_string(&self) -> String { + self.0.to_string() + } + } + #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(tag = "type")] pub enum VolumeConstructionRequest { @@ -400,6 +584,12 @@ pub mod types { path: String, }, } + + impl From<&VolumeConstructionRequest> for VolumeConstructionRequest { + fn from(value: &VolumeConstructionRequest) -> Self { + value.clone() + } + } } #[derive(Clone, Debug)] diff --git a/progenitor-impl/tests/output/test_default_params_builder.out b/progenitor-impl/tests/output/test_default_params_builder.out index f49160d..a255399 100644 --- a/progenitor-impl/tests/output/test_default_params_builder.out +++ b/progenitor-impl/tests/output/test_default_params_builder.out @@ -18,6 +18,12 @@ pub mod types { pub yes: bool, } + impl From<&BodyWithDefaults> for BodyWithDefaults { + fn from(value: &BodyWithDefaults) -> Self { + value.clone() + } + } + impl BodyWithDefaults { pub fn builder() -> builder::BodyWithDefaults { builder::BodyWithDefaults::default() @@ -33,6 +39,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + impl Error { pub fn builder() -> builder::Error { builder::Error::default() diff --git a/progenitor-impl/tests/output/test_default_params_positional.out b/progenitor-impl/tests/output/test_default_params_positional.out index c0a06f8..efcbed3 100644 --- a/progenitor-impl/tests/output/test_default_params_positional.out +++ b/progenitor-impl/tests/output/test_default_params_positional.out @@ -18,6 +18,12 @@ pub mod types { pub yes: bool, } + impl From<&BodyWithDefaults> for BodyWithDefaults { + fn from(value: &BodyWithDefaults) -> Self { + value.clone() + } + } + ///Error information from a response. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Error { @@ -27,6 +33,12 @@ pub mod types { pub request_id: String, } + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } + mod defaults { pub(super) fn default_u64() -> T where diff --git a/progenitor-impl/tests/output/test_freeform_response.out b/progenitor-impl/tests/output/test_freeform_response.out index 6fb8a12..6da1a6d 100644 --- a/progenitor-impl/tests/output/test_freeform_response.out +++ b/progenitor-impl/tests/output/test_freeform_response.out @@ -15,6 +15,12 @@ pub mod types { pub message: String, pub request_id: String, } + + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } } #[derive(Clone, Debug)] diff --git a/progenitor-impl/tests/output/test_renamed_parameters.out b/progenitor-impl/tests/output/test_renamed_parameters.out index 8aa0c60..05fa9f5 100644 --- a/progenitor-impl/tests/output/test_renamed_parameters.out +++ b/progenitor-impl/tests/output/test_renamed_parameters.out @@ -15,6 +15,12 @@ pub mod types { pub message: String, pub request_id: String, } + + impl From<&Error> for Error { + fn from(value: &Error) -> Self { + value.clone() + } + } } #[derive(Clone, Debug)]