Edits an existing address book entry.
(
&self,
input: EditAddressBookEntryOperationInput,
)
| 137 | |
| 138 | /// Edits an existing address book entry. |
| 139 | pub async fn edit_entry( |
| 140 | &self, |
| 141 | input: EditAddressBookEntryOperationInput, |
| 142 | ) -> ServiceResult<AddressBookEntry> { |
| 143 | let mut entry = self.get_entry_by_id(&input.address_book_entry_id)?; |
| 144 | |
| 145 | if let Some(address_owner) = &input.address_owner { |
| 146 | address_owner.clone_into(&mut entry.address_owner); |
| 147 | } |
| 148 | |
| 149 | if let Some(change_metadata) = input.change_metadata { |
| 150 | entry.metadata.change(change_metadata); |
| 151 | } |
| 152 | |
| 153 | entry.validate()?; |
| 154 | |
| 155 | self.address_book_repository |
| 156 | .insert(entry.to_key(), entry.to_owned()); |
| 157 | |
| 158 | Ok(entry) |
| 159 | } |
| 160 | |
| 161 | /// Removes an existing address book entry. |
| 162 | pub async fn remove_entry( |
no test coverage detected