alien_core/import/data/azure/
ai.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
10#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
11#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
12#[serde(rename_all = "camelCase")]
13pub struct AzureAiImportData {
14 pub account_name: String,
16 pub endpoint: String,
18 pub resource_group: String,
20 pub location: String,
22}
23
24#[cfg(test)]
25mod tests {
26 use super::*;
27
28 #[test]
33 fn deserializes_the_emitter_import_ref_keys() {
34 let json = serde_json::json!({
35 "subscriptionId": "sub-ignored",
36 "resourceGroup": "my-rg",
37 "accountName": "my-account",
38 "endpoint": "https://my-account.openai.azure.com/",
39 "location": "eastus",
40 });
41 let data: AzureAiImportData =
42 serde_json::from_value(json).expect("the emitter's import-ref keys must deserialize");
43 assert_eq!(data.account_name, "my-account");
44 assert_eq!(data.endpoint, "https://my-account.openai.azure.com/");
45 assert_eq!(data.resource_group, "my-rg");
46 assert_eq!(data.location, "eastus");
47 }
48}