From 244b50d910536fee8a4539873049580b5833a9ce Mon Sep 17 00:00:00 2001 From: andresperi Date: Sun, 5 May 2024 21:02:21 -0500 Subject: [PATCH] disabled releases fixes ENG-1615: expose device prn in API, SDK, CLI, docs --- src/api/devices.rs | 1 + src/api/releases.rs | 5 +++++ tests/fixtures/devices-authenticate-200.json | 3 ++- tests/fixtures/devices-create-201.json | 5 +++-- tests/fixtures/devices-get-200.json | 3 ++- tests/fixtures/devices-list-200.json | 6 ++++-- tests/fixtures/devices-update-200.json | 3 ++- tests/releases.rs | 4 +++- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/api/devices.rs b/src/api/devices.rs index 06a1f65..bff7beb 100644 --- a/src/api/devices.rs +++ b/src/api/devices.rs @@ -13,6 +13,7 @@ pub struct Device { pub healthy: Option, pub identifier: String, pub last_communication: String, + pub prn: String, pub status: String, pub tags: Option>, pub version: String, diff --git a/src/api/releases.rs b/src/api/releases.rs index 59d3f50..0dc9f35 100644 --- a/src/api/releases.rs +++ b/src/api/releases.rs @@ -11,6 +11,7 @@ pub struct Release { pub bundle_prn: String, pub cohort_prn: String, pub description: Option, + pub disabled: Option, pub inserted_at: String, pub name: String, pub next_release_prn: Option, @@ -33,6 +34,7 @@ pub struct CreateReleaseParams { pub bundle_prn: String, pub cohort_prn: String, pub description: Option, + pub disabled: Option, pub name: String, #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] @@ -93,6 +95,9 @@ pub struct UpdateReleaseParams { pub description: Option, #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] + pub disabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default)] pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] diff --git a/tests/fixtures/devices-authenticate-200.json b/tests/fixtures/devices-authenticate-200.json index 89c9ebc..7e9b427 100644 --- a/tests/fixtures/devices-authenticate-200.json +++ b/tests/fixtures/devices-authenticate-200.json @@ -9,6 +9,7 @@ "tag-2" ], "status": "offline", - "version": "1.0.0" + "version": "1.0.0", + "prn": "prn" } } diff --git a/tests/fixtures/devices-create-201.json b/tests/fixtures/devices-create-201.json index 8946e1b..14402d2 100644 --- a/tests/fixtures/devices-create-201.json +++ b/tests/fixtures/devices-create-201.json @@ -10,6 +10,7 @@ ], "status": "offline", "version": "1.0.0", - "target": "test-target" + "target": "test-target", + "prn": "prn" } -} \ No newline at end of file +} diff --git a/tests/fixtures/devices-get-200.json b/tests/fixtures/devices-get-200.json index b7ba602..88e5d0a 100644 --- a/tests/fixtures/devices-get-200.json +++ b/tests/fixtures/devices-get-200.json @@ -21,6 +21,7 @@ "tag-1", "tag-2" ], - "version": "1.0.0" + "version": "1.0.0", + "prn": "prn" } } diff --git a/tests/fixtures/devices-list-200.json b/tests/fixtures/devices-list-200.json index 0a1a1cf..ad441e0 100644 --- a/tests/fixtures/devices-list-200.json +++ b/tests/fixtures/devices-list-200.json @@ -22,7 +22,8 @@ "tag-1", "tag-2" ], - "version": "1.0.0" + "version": "1.0.0", + "prn": "prn" }, { "description": "test-2", @@ -46,7 +47,8 @@ "tag-3", "tag-4" ], - "version": "1.0.0" + "version": "1.0.0", + "prn": "prn" } ] } diff --git a/tests/fixtures/devices-update-200.json b/tests/fixtures/devices-update-200.json index 432465f..9ae2be5 100644 --- a/tests/fixtures/devices-update-200.json +++ b/tests/fixtures/devices-update-200.json @@ -9,6 +9,7 @@ "tag-2" ], "status": "offline", - "version": "1.0.0" + "version": "1.0.0", + "prn": "prn" } } diff --git a/tests/releases.rs b/tests/releases.rs index ee2a65c..ce0253e 100644 --- a/tests/releases.rs +++ b/tests/releases.rs @@ -29,7 +29,7 @@ async fn create_release() { ca_bundle_path: None, }); - let m = mock("POST", &*format!("/releases")) + let m = mock("POST", &*"/releases".to_string()) .with_status(201) .with_header("content-type", "application/json") .with_body_from_file("tests/fixtures/releases-create-201.json") @@ -39,6 +39,7 @@ async fn create_release() { bundle_prn: expected_bundle_prn.to_string(), cohort_prn: expected_cohort_prn.to_string(), description: Some(expected_description.to_string()), + disabled: None, name: expected_name.to_string(), next_release_prn: Some(expected_next_release_prn.to_string()), organization_prn: expected_organization_prn.to_string(), @@ -183,6 +184,7 @@ async fn update_release() { let params = UpdateReleaseParams { prn: expected_prn.to_string(), description: Some(expected_description.to_string()), + disabled: None, name: Some(expected_name.to_string()), next_release_prn: Some(expected_next_release_prn.to_string()), phase_mode: None,