module EPPClient::Contact

This module handles all the contact interactions.

See RFC 5733 for more informations.

Public Instance Methods

contact_check(*contacts) click to toggle source

Check the availability of contacts

takes list of contacts as arguments

returns an array of hashes containing three fields :

:id

the contact id

:avail

wether the contact id can be provisionned.

:reason

the server-specific text to help explain why the object cannot be provisioned.

# File lib/epp-client/contact.rb, line 31
def contact_check(*contacts)
  contacts.flatten!

  response = send_request(contact_check_xml(*contacts))
  get_result(:xml => response, :callback => :contact_check_process)
end
contact_create(contact) click to toggle source

Creates a contact

Takes a hash as an argument containing the following keys :

:id

the server-unique identifier of the contact object. Most of the time, the nic handle.

:postalInfo

a hash containing one or two keys, loc and int representing the localized and internationalized version of the postal address information. The value is a hash with the following keys :

:name

the name of the individual or role represented by the contact.

:org

the name of the organization with which the contact is affiliated.

:addr

a hash with the following keys :

:street

an array that contains the contact's street address.

:city

the contact's city.

:sp

the contact's state or province.

:pc

the contact's postal code.

:cc

the contact's country code.

:voice

the contact's optional voice telephone number.

:fax

the contact's optional facsimile telephone number.

:email

the contact's email address.

:authInfo

authorization information associated with the contact object.

:disclose

an optional array that identifies elements that require exceptional server-operator handling to allow or restrict disclosure to third parties. See section 2.9 of RFC 5733 for details.

Returns a hash with the following keys :

:id

the nic handle.

:crDate

the date and time of contact-object creation.

# File lib/epp-client/contact.rb, line 274
def contact_create(contact)
  response = send_request(contact_create_xml(contact))

  get_result(:xml => response, :callback => :contact_create_process)
end
contact_delete(contact) click to toggle source

Deletes a contact

Takes a single nic handle for argument.

Returns true on success, or raises an exception.

# File lib/epp-client/contact.rb, line 303
def contact_delete(contact)
  response = send_request(contact_delete_xml(contact))

  get_result(response)
end
contact_info(args) click to toggle source

Returns the informations about a contact

Takes either a unique argument, either a string, representing the contact id or a hash with the following keys :

:id

the contact id, and optionnaly

:authInfo

an optional authentication information.

Returned is a hash mapping as closely as possible the result expected from the command as per Section 3.1.2 of RFC 5733 :

:id

the server-unique identifier of the contact object. Most of the time, the nic handle.

:roid

the Repository Object IDentifier assigned to the contact object when the object was created.

:status

the status of the contact object.

:postalInfo

a hash containing one or two keys, loc and int representing the localized and internationalized version of the postal address information. The value is a hash with the following keys :

:name

the name of the individual or role represented by the contact.

:org

the name of the organization with which the contact is affiliated.

:addr

a hash with the following keys :

:street

an array that contains the contact's street address.

:city

the contact's city.

:sp

the contact's state or province.

:pc

the contact's postal code.

:cc

the contact's country code.

:voice

the contact's optional voice telephone number.

:fax

the contact's optional facsimile telephone number.

:email

the contact's email address.

:clID

the identifier of the sponsoring client.

:crID

the identifier of the client that created the contact object.

:crDate

the date and time of contact-object creation.

:upID

the optional identifier of the client that last updated the contact object.

:upDate

the optional date and time of the most recent contact-object modification.

:trDate

the optional date and time of the most recent successful contact-object transfer.

:authInfo

authorization information associated with the contact object.

:disclose

an optional array that identifies elements that require exceptional server-operator handling to allow or restrict disclosure to third parties. See section 2.9 of RFC 5733 for details.

# File lib/epp-client/contact.rb, line 122
def contact_info(args)
  args = { :id => args } if args.is_a?(String)
  response = send_request(contact_info_xml(args))

  get_result(:xml => response, :callback => :contact_info_process)
end
contact_update(args) click to toggle source

Updates a contact

Takes a hash with the id, and at least one of the following keys :

:id

the server-unique identifier of the contact object to be updated.

:add/:rem

adds or removes the following data from the contact object :

:status

an array of status to add to/remove from the object.

:chg

changes the datas of the contact object, takes the same arguments as the creation of the contact, except the id, with the small change that each first level key is now optional. (Meaning that you don't have to supply a :postalInfo if you don't need to, but if you do, all it's mandatory fields are mandatory.)

Returns true on success, or raises an exception.

# File lib/epp-client/contact.rb, line 391
def contact_update(args)
  response = send_request(contact_update_xml(args))

  get_result(response)
end