| 1 | |||
| 2 | package XML::SRS::Contact; | ||
| 3 | |||
| 4 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use PRANG::Graph; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use XML::SRS::Contact::Address; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | use XML::SRS::Contact::PSTN; | ||
| 8 | use XML::SRS::Types; | ||
| 9 | |||
| 10 | # handles | ||
| 11 | has_attr 'handle_id' => | ||
| 12 | is => "ro", | ||
| 13 | isa => "XML::SRS::HandleId", | ||
| 14 | xml_name => "HandleId", | ||
| 15 | predicate => "has_handle_id", | ||
| 16 | ; | ||
| 17 | |||
| 18 | has_attr 'action_id' => | ||
| 19 | is => "rw", | ||
| 20 | isa => "XML::SRS::UID", | ||
| 21 | xml_name => 'ActionId', | ||
| 22 | xml_required => 0, | ||
| 23 | predicate => "has_action_id", | ||
| 24 | ; | ||
| 25 | |||
| 26 | # attributes | ||
| 27 | has_attr 'name' => | ||
| 28 | is => "ro", | ||
| 29 | isa => "Str", | ||
| 30 | xml_name => "Name", | ||
| 31 | predicate => "has_name", | ||
| 32 | ; | ||
| 33 | |||
| 34 | has_attr 'email' => | ||
| 35 | is => "ro", | ||
| 36 | isa => "XML::SRS::Email", | ||
| 37 | xml_name => "Email", | ||
| 38 | predicate => "has_email", | ||
| 39 | ; | ||
| 40 | |||
| 41 | # elements | ||
| 42 | has_element 'address' => | ||
| 43 | is => "ro", | ||
| 44 | isa => "XML::SRS::Contact::Address", | ||
| 45 | xml_nodeName => "PostalAddress", | ||
| 46 | predicate => "has_address", | ||
| 47 | coerce => 1, | ||
| 48 | xml_required => 0, | ||
| 49 | ; | ||
| 50 | |||
| 51 | has_element 'phone' => | ||
| 52 | is => "ro", | ||
| 53 | isa => "XML::SRS::Contact::PSTN", | ||
| 54 | predicate => "has_phone", | ||
| 55 | xml_nodeName => "Phone", | ||
| 56 | coerce => 1, | ||
| 57 | xml_required => 0, | ||
| 58 | ; | ||
| 59 | |||
| 60 | has_element 'fax' => | ||
| 61 | is => "ro", | ||
| 62 | isa => "XML::SRS::Contact::PSTN", | ||
| 63 | predicate => "has_fax", | ||
| 64 | xml_nodeName => "Fax", | ||
| 65 | coerce => 1, | ||
| 66 | xml_required => 0, | ||
| 67 | ; | ||
| 68 | |||
| 69 | with 'XML::SRS::Node'; | ||
| 70 | |||
| 71 | use Moose::Util::TypeConstraints; | ||
| 72 | coerce __PACKAGE__ | ||
| 73 | => from "HashRef" | ||
| 74 | => via { __PACKAGE__->new( %$_ ); }; | ||
| 75 | 1; | ||