| 1 | package Business::TrueLayer::User; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Business::TrueLayer::User - class representing a user | ||
| 6 | as used in the TrueLayer v3 API. | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | my $User = Business::TrueLayer::User->new( | ||
| 11 | name => ... | ||
| 12 | ); | ||
| 13 | |||
| 14 | =cut | ||
| 15 | |||
| 16 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 4 | ▶ | use feature qw/ signatures postderef /; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 4 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 4 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | 4 | ▶ | no warnings qw/ experimental::signatures experimental::postderef /; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | 4 | ▶ | use DateTime::Format::DateParse; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | |||
| 26 | =head1 ATTRIBUTES | ||
| 27 | |||
| 28 | =over | ||
| 29 | |||
| 30 | =item id (Str) | ||
| 31 | |||
| 32 | =item name (Str) | ||
| 33 | |||
| 34 | =item email (Str) | ||
| 35 | |||
| 36 | =item phone (Str) | ||
| 37 | |||
| 38 | =item date_of_birth (DateTime, coerced via DateTime::Format::DateParse) | ||
| 39 | |||
| 40 | =back | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | 4 | has id => ( | |
| 45 | is => 'ro', | ||
| 46 | isa => 'Str', | ||
| 47 | required => 0, | ||
| 48 | ); | ||
| 49 | |||
| 50 | 4 | has [ qw/ name email phone / ] => ( | |
| 51 | is => 'ro', | ||
| 52 | isa => 'Str', | ||
| 53 | required => 0, | ||
| 54 | ); | ||
| 55 | |||
| 56 | 4 | class_type 'DateTime'; | |
| 57 | |||
| 58 | coerce 'DateTime' | ||
| 59 | => from 'Str' | ||
| 60 | 5 | ▶ | => via { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 61 | 5 | DateTime::Format::DateParse->parse_datetime( $_ ); | |
| 62 | } | ||
| 63 | 4 | ; | |
| 64 | |||
| 65 | 4 | has 'date_of_birth' => ( | |
| 66 | is => 'ro', | ||
| 67 | isa => 'DateTime', | ||
| 68 | coerce => 1, | ||
| 69 | required => 0, | ||
| 70 | ); | ||
| 71 | |||
| 72 | =head1 METHODS | ||
| 73 | |||
| 74 | None yet. | ||
| 75 | |||
| 76 | =head1 SEE ALSO | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | 4 | 1; | |