NAME
WWW::eNom::Role::Command::Contact - Contact Related Operations
SYNOPSIS
use WWW::eNom;
use WWW::eNom::Contact;
my $api = WWW::eNom->new( ... );
# Get Contacts for a Domain
my $contacts = $api->get_contacts_by_domain_name( 'drzigman.com' );
for my $contact_type (qw( registrant_contact admin_contact technical_contact billing_contact )) {
print "Email Address of $contact_type is: " . $contacts->{$contact_type}->email . "\n";
}
# Update Contacts
my $new_registrant_contact = WWW::eNom::Contact->new( ... );
my $new_admin_contact = WWW::eNom::Contact->new( ... );
my $new_technical_contact = WWW::eNom::Contact->new( ... );
my $new_billing_contact = WWW::eNom::Contact->new( ... );
my $updated_contacts = $api->update_contacts_for_domain_name(
domain_name => 'drzigman.com',
registrant_contact => $new_registrant_contact, # Optional
admin_contact => $new_admin_contact, # Optional
technical_contact => $new_technical_contact, # Optional
billing_contact => $new_billing_contact, # Optional
);
REQUIRES
- submit
DESCRIPTION
Implements contact related operations with eNom's API.
METHODS
get_contacts_by_domain_name
my $contacts = $api->get_contacts_by_domain_name( 'drzigman.com' );
for my $contact_type (qw( registrant_contact admin_contact technical_contact billing_contact )) {
print "Email Address of $contact_type is: " . $contacts->{$contact_type}->email . "\n";
}
Abstraction of the GetContacts eNom API Call. Given a FQDN, returns a HashRef of contacts for that domain. The keys for the returned HashRef are:
- registrant_contact
- admin_contact
- technical_contact
- billing_contact
Each of these keys point to a value which is an instance of WWW::eNom::Contact.
update_contacts_for_domain_name
my $updated_contacts = $api->update_contacts_for_domain_name(
domain_name => 'drzigman.com',
registrant_contact => $new_registrant_contact, # Optional
admin_contact => $new_admin_contact, # Optional
technical_contact => $new_technical_contact, # Optional
billing_contact => $new_billing_contact, # Optional
);
Abstraction of the Contacts eNom API Call. Given a FQDN and new contacts to use, updates the specified contacts to match those provided. Returned is a HashRef of Contacts (see get_contacts_by_domain_name for response format).
One interesting thing about this method is that you only need specify the contacts you wish to update. If you wish to update registrant, admin, technical, and billing great! Go for it and include all of them in one call. If you wish to update only a subset of the contacts (1, 2 or 3 of them) you should pass only the contacts to be updated.