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.
69 70 71 72 73 74 |
# File 'lib/dnsimple/client/contacts.rb', line 69 def create_contact(account_id, attributes, = {}) 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" % [account_id]), attributes, ) Dnsimple::Response.new(response, Struct::Contact.new(response["data"])) end |