<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is
# free software; you can redistribute it and/or modify it under the same
# terms as Perl itself.
# 
# $Id: Domain.pm,v 1.1 2011/12/03 11:44:52 gavin Exp $
package Net::EPP::Frame::Command::Transfer::Domain;
use base qw(Net::EPP::Frame::Command::Transfer);
use Net::EPP::Frame::ObjectSpec;
use strict;


=pod

=head1 NAME

Net::EPP::Frame::Command::Transfer::Domain - an instance of L&lt;Net::EPP::Frame::Command::Transfer&gt;
for domain objects.

=head1 SYNOPSIS

	use Net::EPP::Frame::Command::Transfer::Domain;
	use strict;

	my $info = Net::EPP::Frame::Command::Transfer::Domain-&gt;new;
	$info-&gt;setOp('query');
	$info-&gt;setDomain('example.tld');

	print $info-&gt;toString(1);

This results in an XML document like this:

	&lt;?xml version="1.0" encoding="UTF-8"?&gt;
	&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
	  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0
	  epp-1.0.xsd"&gt;
	    &lt;command&gt;
	      &lt;transfer op="query"&gt;
	        &lt;domain:transfer
	          xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
	          xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0
	          domain-1.0.xsd"&gt;
	            &lt;domain:name&gt;example.tldE&lt;lt&gt;/domain:name&gt;
	        &lt;/domain:transfer&gt;
	      &lt;/transfer&gt;
	      &lt;clTRID&gt;0cf1b8f7e14547d26f03b7641660c641d9e79f45&lt;/clTRIDE&lt;gt&gt;
	    &lt;/command&gt;
	&lt;/epp&gt;

=head1 OBJECT HIERARCHY

    L&lt;XML::LibXML::Node&gt;
    +----L&lt;XML::LibXML::Document&gt;
        +----L&lt;Net::EPP::Frame&gt;
            +----L&lt;Net::EPP::Frame::Command&gt;
                +----L&lt;Net::EPP::Frame::Command::Transfer&gt;
                    +----L&lt;Net::EPP::Frame::Command::Transfer::Domain&gt;

=cut

sub new {
	my $package = shift;
	my $self = bless($package-&gt;SUPER::new('transfer'), $package);

	my $domain = $self-&gt;addObject(Net::EPP::Frame::ObjectSpec-&gt;spec('domain'));

	return $self;
}

=pod

=head1 METHODS

	$frame-&gt;setDomain('example.tld');

This method specifies the domain name for the transfer.

=cut

sub setDomain {
	my ($self, $domain) = @_;

	my $name = $self-&gt;createElement('domain:name');
	$name-&gt;appendText($domain);

	$self-&gt;getNode('transfer')-&gt;getChildNodes-&gt;shift-&gt;appendChild($name);

	return 1;
}


=pod

	$frame-&gt;period($years);

This sets the optional renewal period for the transfer.

=cut

sub setPeriod {
	my ($self, $years) = @_;

	my $period = $self-&gt;createElement('domain:period');
	$period-&gt;setAttribute('unit', 'y');
	$period-&gt;appendText($years);

	$self-&gt;getNode('transfer')-&gt;getChildNodes-&gt;shift-&gt;appendChild($period);

	return 1;
}

=pod

	$frame-&gt;setAuthInfo($pw);

This sets the authInfo code for the transfer.

=cut

sub setAuthInfo {
	my ($self, $code) = @_;

	my $pw = $self-&gt;createElement('domain:pw');
	$pw-&gt;appendText($code);

	my $authInfo = $self-&gt;createElement('domain:authInfo');
	$authInfo-&gt;appendChild($pw);

	$self-&gt;getNode('transfer')-&gt;getChildNodes-&gt;shift-&gt;appendChild($authInfo);

	return 1;
}


=pod

=head1 AUTHOR

CentralNic Ltd (http://www.centralnic.com/).

=head1 COPYRIGHT

This module is (c) 2016 CentralNic Ltd. This module is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.

=head1 SEE ALSO

=over

=item * L&lt;Net::EPP::Frame&gt;

=back

=cut

1;
</pre></body></html>