use super::*;
use openai_api_rs::v1::file::FileData;
#[ derive( Debug ) ]
pub struct FileDataWrap( pub FileData );
impl Clone for FileDataWrap
{
fn clone( &self ) -> Self
{
FileDataWrap( FileData
{
id : self.0.id.clone(),
object : self.0.object.clone(),
bytes : self.0.bytes,
created_at : self.0.created_at,
filename : self.0.filename.clone(),
purpose : self.0.purpose.clone(),
} )
}
}
impl TableWithFields for FileDataWrap {}
impl Fields< &'_ str, Option< Cow< '_, str > > >
for FileDataWrap
{
type Key<'k> = &'k str;
type Val< 'v > = Option< Cow< 'v, str > >;
fn fields( &self ) -> impl format_tools::IteratorTrait< Item = ( &'_ str, Option< Cow< '_, str > > ) >
{
use format_tools::ref_or_display_or_debug_multiline::field;
let mut dst = Vec::new();
dst.push( field!( &self.0.id ) );
dst.push( field!( &self.0.object ) );
dst.push( ( "bytes", Some( Cow::Owned( self.0.bytes.to_string() ) ) ) );
dst.push( ( "created_at", Some( Cow::Owned( self.0.created_at.to_string() ) ) ) );
dst.push( field!( &self.0.filename ) );
dst.push( field!( &self.0.purpose ) );
dst.into_iter()
}
}