Dnsimple.Contacts (dnsimple v3.1.1) View Source
Provides functions to interact with the contact endpoints.
Link to this section Summary
Functions
Creates a contact in an account.
Deletes a contact from an account.
Gets a contact in an account.
Lists the contacts in an account.
Updates a contact in an account.
Link to this section Functions
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",
})
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")
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")
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 SourceSpecs
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",
})