@@ -18,7 +18,7 @@ use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer};
18
18
use super :: AssetType ;
19
19
use crate :: {
20
20
assertion:: { Assertion , AssertionBase , AssertionDecodeError , AssertionDecodeErrorCause } ,
21
- assertions:: { labels, Metadata , ReviewRating } ,
21
+ assertions:: { labels, AssertionMetadata , ReviewRating } ,
22
22
cbor_types:: map_cbor_to_type,
23
23
error:: Result ,
24
24
hashed_uri:: HashedUri ,
@@ -56,7 +56,7 @@ pub struct Ingredient {
56
56
pub validation_status : Option < Vec < ValidationStatus > > ,
57
57
pub relationship : Relationship ,
58
58
pub thumbnail : Option < HashedUri > ,
59
- pub metadata : Option < Metadata > ,
59
+ pub metadata : Option < AssertionMetadata > ,
60
60
pub data : Option < HashedUri > ,
61
61
pub description : Option < String > ,
62
62
pub informational_uri : Option < String > ,
@@ -220,7 +220,7 @@ impl Ingredient {
220
220
221
221
pub fn add_reviews ( mut self , reviews : Option < Vec < ReviewRating > > ) -> Self {
222
222
if let Some ( reviews) = reviews {
223
- let metadata = Metadata :: new ( ) . set_reviews ( reviews) ;
223
+ let metadata = AssertionMetadata :: new ( ) . set_reviews ( reviews) ;
224
224
self . metadata = Some ( metadata) ;
225
225
} ;
226
226
self
@@ -641,7 +641,8 @@ impl AssertionBase for Ingredient {
641
641
let thumbnail: Option < HashedUri > = map_cbor_to_type ( "thumbnail" , & ingredient_value) ;
642
642
let validation_status: Option < Vec < ValidationStatus > > =
643
643
map_cbor_to_type ( "validationStatus" , & ingredient_value) ;
644
- let metadata: Option < Metadata > = map_cbor_to_type ( "metadata" , & ingredient_value) ;
644
+ let metadata: Option < AssertionMetadata > =
645
+ map_cbor_to_type ( "metadata" , & ingredient_value) ;
645
646
646
647
Ingredient {
647
648
title : Some ( title) ,
@@ -707,7 +708,8 @@ impl AssertionBase for Ingredient {
707
708
map_cbor_to_type ( "description" , & ingredient_value) ;
708
709
let informational_uri: Option < String > =
709
710
map_cbor_to_type ( "informational_URI" , & ingredient_value) ;
710
- let metadata: Option < Metadata > = map_cbor_to_type ( "metadata" , & ingredient_value) ;
711
+ let metadata: Option < AssertionMetadata > =
712
+ map_cbor_to_type ( "metadata" , & ingredient_value) ;
711
713
712
714
Ingredient {
713
715
title : Some ( title) ,
@@ -774,7 +776,8 @@ impl AssertionBase for Ingredient {
774
776
map_cbor_to_type ( "description" , & ingredient_value) ;
775
777
let informational_uri: Option < String > =
776
778
map_cbor_to_type ( "informationalURI" , & ingredient_value) ;
777
- let metadata: Option < Metadata > = map_cbor_to_type ( "metadata" , & ingredient_value) ;
779
+ let metadata: Option < AssertionMetadata > =
780
+ map_cbor_to_type ( "metadata" , & ingredient_value) ;
778
781
779
782
Ingredient {
780
783
title,
@@ -972,7 +975,7 @@ pub mod tests {
972
975
973
976
let review_rating = ReviewRating :: new ( "Content bindings validated" , None , 5 ) ;
974
977
975
- let metadata = Metadata :: new ( )
978
+ let metadata = AssertionMetadata :: new ( )
976
979
. set_date_time ( "2021-06-28T16:49:32.874Z" . to_owned ( ) )
977
980
. add_review ( review_rating) ;
978
981
0 commit comments