| 1 | package XML::EPP::Host::Create; | ||
| 2 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use PRANG::Graph; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 0 | ▶ | sub root_element { "create" } |
|
Subroutine
root_element: not called CC=1 SCAR=6.9
| |||
| 5 | |||
| 6 | with | ||
| 7 | 'XML::EPP::Host::RQ', | ||
| 8 | 'XML::EPP::Host::Node', | ||
| 9 | ; | ||
| 10 | |||
| 11 | has_element 'name' => | ||
| 12 | is => "ro", | ||
| 13 | isa => "XML::EPP::Common::labelType", | ||
| 14 | ; | ||
| 15 | |||
| 16 | 0 | ▶ | use XML::EPP::Host::Address; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 17 | |||
| 18 | has_element 'addr' => | ||
| 19 | is => "ro", | ||
| 20 | isa => "ArrayRef[XML::EPP::Host::Address]", | ||
| 21 | xml_min => 0, | ||
| 22 | coerce => 1, | ||
| 23 | ; | ||
| 24 | |||
| 25 | use Moose::Util::TypeConstraints; | ||
| 26 | |||
| 27 | # Moose Wishlist: should be able to infer this coercion from the two | ||
| 28 | # at the end of ::Address | ||
| 29 | coerce "ArrayRef[XML::EPP::Host::Address]" | ||
| 30 | => from "ArrayRef[XML::EPP::Host::Address|HashRef|Str]" | ||
| 31 | => via { | ||
| 32 | my @rv = @$_; | ||
| 33 | for ( @rv ) { | ||
| 34 | if ( ref $_ eq "HASH" ) { | ||
| 35 | $_ = XML::EPP::Host::Address->new($_); | ||
| 36 | } | ||
| 37 | elsif ( !blessed $_ ) { | ||
| 38 | $_ = XML::EPP::Host::Address->new( | ||
| 39 | value => $_, | ||
| 40 | ); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | \@rv; | ||
| 44 | }, | ||
| 45 | ; | ||
| 46 | |||
| 47 | subtype "XML::EPP::Host::createType" => as __PACKAGE__; | ||
| 48 | |||
| 49 | 1; | ||
| 50 | |||
| 51 | =head1 NAME | ||
| 52 | |||
| 53 | XML::EPP::Host::Create - implement createType | ||
| 54 | |||
| 55 | =head1 SYNOPSIS | ||
| 56 | |||
| 57 | TODO | ||
| 58 | |||
| 59 | =head1 DESCRIPTION | ||
| 60 | |||
| 61 | TODO | ||
| 62 | |||
| 63 | =head2 XML Schema Definition | ||
| 64 | |||
| 65 | <!-- | ||
| 66 | Child elements of the <create> command. | ||
| 67 | --> | ||
| 68 | <complexType name="createType"> | ||
| 69 | <sequence> | ||
| 70 | <element name="name" type="eppcom:labelType"/> | ||
| 71 | <element name="addr" type="host:addrType" | ||
| 72 | minOccurs="0" maxOccurs="unbounded"/> | ||
| 73 | </sequence> | ||
| 74 | </complexType> | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||