package WebService::ForecastIo::DataPoint; use Moose; use Moose::Util::TypeConstraints; use MooseX::Types::DateTime; class_type 'WebService::ForecastIo::DataPoint'; subtype 'WebService::ForecastIo::DataPointArray', as 'ArrayRef[WebService::ForecastIo::DataPoint]'; coerce 'WebService::ForecastIo::DataPoint', from 'HashRef', via { WebService::ForecastIo::DataPoint->new($_) }; coerce 'WebService::ForecastIo::DataPointArray', from 'ArrayRef[HashRef]', via { my $array = $_; [ map { WebService::ForecastIo::DataPoint->new($_) } @$array ] }; has [qw( time sunriseTime sunsetTime precipIntensityMaxTime temperatureMinTime temperatureMaxTime )] => ( is => 'ro', isa => 'DateTime', coerce => 1, ); has [qw(summary icon precipType)] => ( is => 'ro', isa => 'Str', ); has [qw( precipIntensity precipIntensityMax precipProbability precipAccumulation temperature temperatureMin temperatureMax dewPoint humidity windSpeed windBearing cloudCover pressure visibility ozone )] => ( is => 'ro', isa => 'Num', ); 1;