Skip to content

Commit f805580

Browse files
committed
switch to using Model derive macro
1 parent c5a8e91 commit f805580

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sdk/cosmosdb/azure_data_cosmos/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ categories = ["api-bindings"]
1818
[dependencies]
1919
async-trait.workspace = true
2020
azure_core.workspace = true
21+
typespec_client_core.workspace = true
2122
time.workspace = true
2223
tracing.workspace = true
2324
url.workspace = true
@@ -26,7 +27,6 @@ serde.workspace = true
2627
[dev-dependencies]
2728
tokio.workspace = true
2829
serde_json.workspace = true
29-
azure_core.workspace = true
3030
azure_identity.workspace = true
3131
clap.workspace = true
3232

sdk/cosmosdb/azure_data_cosmos/src/models/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use serde::{Deserialize, Serialize};
22
use time::error::ComponentRange;
33
use time::OffsetDateTime;
4+
use typespec_client_core::Model;
45

56
#[cfg(doc)]
67
use crate::DatabaseClientMethods;
@@ -25,7 +26,7 @@ impl TryInto<OffsetDateTime> for CosmosTimestamp {
2526
/// Properties of a Cosmos DB database.
2627
///
2728
/// Returned by [`DatabaseClient::read()`](crate::DatabaseClient::read()).
28-
#[derive(Debug, Deserialize)]
29+
#[derive(Model, Debug, Deserialize)]
2930
pub struct DatabaseProperties {
3031
/// The ID of the database.
3132
pub id: String,
@@ -46,6 +47,3 @@ pub struct DatabaseProperties {
4647
#[serde(rename = "_ts")]
4748
pub last_modified: Option<CosmosTimestamp>,
4849
}
49-
50-
// TODO: Migrate to derive macro once https://github.com/Azure/azure-sdk-for-rust/pull/1772 lands.
51-
azure_core::json_model!(DatabaseProperties);

0 commit comments

Comments
 (0)