dnsimple v1.2.0 Dnsimple.Contacts

Provides functions to interact with the contact endpoints.

Summary

Functions

create_contact(client, account_id, attributes, options \\ [])

Specs

create_contact(Dnsimple.Client.t, String.t | integer, Keyword.t, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Creates a contact in an account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Contacts.create_contact(client, account_id = "1010", %{
  first_name: "John",
  last_name: "Doe",
  address1: "Italian street, 10",
  city: "Roma",
  state_province: "RM",
  postal_code: "00100",
  country: "IT",
  email: "john.doe@email.com",
  phone: "+18001234567",
  fax: "+18011234567",
})
delete_contact(client, account_id, contact_id, options \\ [])

Specs

delete_contact(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Deletes a contact from an account.

Warning: this is a destructive operation.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Contacts.delete_contact(client, account_id = "1010", contact_id = "123")
get_contact(client, account_id, contact_id, options \\ [])

Specs

get_contact(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Gets a contact in an account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Contacts.get_contact(client, account_id = "1010", contact_id = "123")
list_contacts(client, account_id, options \\ [])

Lists the contacts in an account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Contacts.list_contacts(client, account_id = "1010")
{:ok, response} = Dnsimple.Contacts.list_contacts(client, account_id = "1010", sort: "email:desc")
update_contact(client, account_id, contact_id, attributes, options \\ [])

Specs

update_contact(Dnsimple.Client.t, String.t | integer, String.t | integer, Keyword.t, Keyword.t) :: {:ok | :error, Dnsimple.Response.t}

Updates a contact in an account.

See:

Examples:

client = %Dnsimple.Client{access_token: "a1b2c3d4"}
{:ok, response} = Dnsimple.Contacts.update_contact(client, account_id = "1010", contact_id = "123", %{
  email: "johndoe@email-provider.com",
})