| 1 | package Net::CoverArtArchive::CoverArt; | ||
| 2 | use Moose; | ||
| 3 | use namespace::autoclean; | ||
| 4 | |||
| 5 | use Moose::Util::TypeConstraints; | ||
| 6 | |||
| 7 | coerce 'Bool', from class_type('JSON::XS::Boolean'), via { $_ ? 1 : 0 }; | ||
| 8 | |||
| 9 | has id => ( | ||
| 10 | isa => 'Int', | ||
| 11 | is => 'ro', | ||
| 12 | required => 1 | ||
| 13 | ); | ||
| 14 | |||
| 15 | has types => ( | ||
| 16 | isa => 'ArrayRef[Str]', | ||
| 17 | is => 'ro', | ||
| 18 | ); | ||
| 19 | |||
| 20 | has is_front => ( | ||
| 21 | isa => 'Bool', | ||
| 22 | is => 'ro', | ||
| 23 | init_arg => 'front', | ||
| 24 | coerce => 1 | ||
| 25 | ); | ||
| 26 | |||
| 27 | has is_back => ( | ||
| 28 | isa => 'Bool', | ||
| 29 | is => 'ro', | ||
| 30 | init_arg => 'back', | ||
| 31 | coerce => 1 | ||
| 32 | ); | ||
| 33 | |||
| 34 | has comment => ( | ||
| 35 | isa => 'Str', | ||
| 36 | is => 'ro', | ||
| 37 | ); | ||
| 38 | |||
| 39 | has image => ( | ||
| 40 | isa => 'Str', | ||
| 41 | is => 'ro', | ||
| 42 | ); | ||
| 43 | |||
| 44 | has large_thumbnail => ( | ||
| 45 | isa => 'Str', | ||
| 46 | is => 'ro', | ||
| 47 | ); | ||
| 48 | |||
| 49 | has small_thumbnail => ( | ||
| 50 | isa => 'Str', | ||
| 51 | is => 'ro', | ||
| 52 | ); | ||
| 53 | |||
| 54 | has approved => ( | ||
| 55 | isa => 'Bool', | ||
| 56 | is => 'ro', | ||
| 57 | coerce => 1 | ||
| 58 | ); | ||
| 59 | |||
| 60 | has edit => ( | ||
| 61 | isa => 'Str', | ||
| 62 | is => 'ro', | ||
| 63 | ); | ||
| 64 | |||
| 65 | __PACKAGE__->meta->make_immutable; | ||
| 66 | 1; |