Add ID type for reports
This commit is contained in:
		
							parent
							
								
									d4e7c4b59b
								
							
						
					
					
						commit
						06caec85b3
					
				| 
						 | 
					@ -6,7 +6,18 @@ use serde::{Deserialize, Serialize};
 | 
				
			||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
 | 
					#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
 | 
				
			||||||
pub struct Report {
 | 
					pub struct Report {
 | 
				
			||||||
    /// The ID of the report.
 | 
					    /// The ID of the report.
 | 
				
			||||||
    pub id: String,
 | 
					    pub id: ReportId,
 | 
				
			||||||
    /// The action taken in response to the report.
 | 
					    /// The action taken in response to the report.
 | 
				
			||||||
    pub action_taken: String,
 | 
					    pub action_taken: String,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// Wrapper type for a report ID string
 | 
				
			||||||
 | 
					#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
 | 
				
			||||||
 | 
					#[serde(transparent)]
 | 
				
			||||||
 | 
					pub struct ReportId(String);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					impl AsRef<str> for ReportId {
 | 
				
			||||||
 | 
					    fn as_ref(&self) -> &str {
 | 
				
			||||||
 | 
					        &self.0
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue