Method: Dnsimple::Client::Contacts#create_contact

Defined in:
lib/dnsimple/client/contacts.rb

#create_contact(account_id, attributes, options = {}) ⇒ Dnsimple::Response<Dnsimple::Struct::Contact>

Creates a contact in the account.

Parameters:

  • account_id (Integer)

    the account ID

  • attributes (Hash)
  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



69
70
71
72
73
74
# File 'lib/dnsimple/client/contacts.rb', line 69

def create_contact(, attributes, options = {})
  Extra.validate_mandatory_attributes(attributes, [:first_name, :last_name, :address1, :city, :state_province, :postal_code, :country, :phone, :email])
  response = client.post(Client.versioned("/%s/contacts" % []), attributes, options)

  Dnsimple::Response.new(response, Struct::Contact.new(response["data"]))
end