minor fixes

This commit is contained in:
Ritesh Chitlangi 2021-12-21 00:05:12 +08:00
parent 6445b63c62
commit 537fe10bee
2 changed files with 17 additions and 7 deletions

View File

@ -19,10 +19,10 @@ impl Extension for Update {
type Response = NoExtension; type Response = NoExtension;
} }
impl Transaction<UpdateWithNameStore> for DomainUpdate {} impl Transaction<UpdateWithNameStore<'_>> for DomainUpdate<'_> {}
impl Extension for UpdateWithNameStore { impl<'a> Extension for UpdateWithNameStore<'a> {
type Response = NameStore; type Response = NameStore<'a>;
} }
#[derive(PartialEq, Debug)] #[derive(PartialEq, Debug)]
@ -78,12 +78,12 @@ impl Update {
} }
} }
impl UpdateWithNameStore { impl UpdateWithNameStore<'_> {
/// Create a new sync update with namestore request /// Create a new sync update with namestore request
pub fn new(expiration: GMonthDay, subproduct: &str) -> Self { pub fn new(expiration: GMonthDay, subproduct: &str) -> Self {
Self { Self {
sync: Update::new(expiration).data, sync: Update::new(expiration).data,
namestore: NameStore::new(subproduct).data, namestore: NameStoreData::new(subproduct),
} }
} }
} }
@ -95,11 +95,11 @@ pub struct Update {
} }
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub struct UpdateWithNameStore { pub struct UpdateWithNameStore<'a> {
#[serde(rename = "sync:update")] #[serde(rename = "sync:update")]
pub sync: UpdateData, pub sync: UpdateData,
#[serde(rename = "namestoreExt:namestoreExt")] #[serde(rename = "namestoreExt:namestoreExt")]
pub namestore: NameStoreData, pub namestore: NameStoreData<'a>,
} }
#[derive(Serialize, Debug)] #[derive(Serialize, Debug)]

View File

@ -61,6 +61,16 @@ impl<'a> NameStore<'a> {
} }
} }
impl<'a> NameStoreData<'a> {
/// Create a new RGP restore report request
pub fn new(subproduct: &str) -> Self {
Self {
xmlns: XMLNS.into(),
subproduct: subproduct.to_owned().into(),
}
}
}
impl<'a> Extension for NameStore<'a> { impl<'a> Extension for NameStore<'a> {
type Response = NameStore<'static>; type Response = NameStore<'static>;
} }