| 1 | package Net::Google::DocumentsList::Types; | ||
| 2 | use Any::Moose; | ||
| 3 | use Any::Moose '::Util::TypeConstraints'; | ||
| 4 | use DateTime::Format::Atom; | ||
| 5 | |||
| 6 | subtype 'Net::Google::DocumentsList::Types::ACL::Scope' | ||
| 7 | => as 'HashRef' | ||
| 8 | => where { | ||
| 9 | my $args = shift; | ||
| 10 | # scalar keys %$args == 2 && | ||
| 11 | defined $args->{type}; | ||
| 12 | # defined $args->{value}; | ||
| 13 | }; | ||
| 14 | |||
| 15 | subtype 'Net::Google::DocumentsList::Types::DateTime' | ||
| 16 | => as 'DateTime'; | ||
| 17 | |||
| 18 | coerce 'Net::Google::DocumentsList::Types::DateTime' | ||
| 19 | => from 'Str' | ||
| 20 | => via { | ||
| 21 | DateTime::Format::Atom->new->parse_datetime(shift); | ||
| 22 | }; | ||
| 23 | |||
| 24 | 1; |