Dnsimple.Contacts (dnsimple v3.1.0) View Source

Provides functions to interact with the contact endpoints.

Link to this section Summary

Link to this section Functions

Link to this function

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

View Source

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",
})
Link to this function

delete_contact(client, account_id, contact_id, options \\ [])

View Source

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")
Link to this function

get_contact(client, account_id, contact_id, options \\ [])

View Source

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")
Link to this function

list_contacts(client, account_id, options \\ [])

View Source

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")
Link to this function

update_contact(client, account_id, contact_id, attributes, options \\ [])

View Source

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",
})