Module: Dnsimple::Client::DomainsCollaborators

Included in:
DomainsService
Defined in:
lib/dnsimple/client/domains_collaborators.rb

Instance Method Summary collapse

Instance Method Details

#add_collaborator(account_id, domain_id, attributes, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Collaborator>

Deprecated.

‘DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature.

Add a collaborator to the domain.

Examples:

Add collaborator

client.domains.add_collaborator(1010, "example.com", email: "[email protected]")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    the domain ID or name

  • attributes (Hash)

    user attributes

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

    request options

Options Hash (attributes):

  • :email (String)

    user email (mandatory)

Returns:

Raises:

See Also:



50
51
52
53
54
55
56
57
# File 'lib/dnsimple/client/domains_collaborators.rb', line 50

def add_collaborator(, domain_id, attributes, options = {})
  Dnsimple.deprecate('`DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature.')

  Extra.validate_mandatory_attributes(attributes, [:email])
  response = client.post(Client.versioned("/%s/domains/%s/collaborators" % [, domain_id]), attributes, options)

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

#collaborators(account_id, domain_id, options = {}) ⇒ Dnsimple::PaginatedResponse<Dnsimple::Struct::Collaborator>

Deprecated.

‘DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature.

Lists the collaborators for a domain.

Examples:

List collaborators in the first page

client.domains.collaborators(1010, "example.com")

List collaborators, provide a specific page

client.domains.collaborators(1010, "example.com", page: 2)

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    the domain ID or name

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

    request options

Options Hash (options):

  • :page (Integer)

    current page (pagination)

  • :per_page (Integer)

    number of entries to return (pagination)

Returns:

Raises:

See Also:



26
27
28
29
30
31
32
# File 'lib/dnsimple/client/domains_collaborators.rb', line 26

def collaborators(, domain_id, options = {})
  Dnsimple.deprecate('`DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature.')

  response = client.get(Client.versioned("/%s/domains/%s/collaborators" % [, domain_id]), Options::ListOptions.new(options))

  Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Collaborator.new(r) })
end

#remove_collaborator(account_id, domain_id, contact_id, options = {}) ⇒ Dnsimple::Response<nil>

Deprecated.

‘DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature.

Removes a collaborator from the domain.

WARNING: this cannot be undone.

Examples:

Remove collaborator

client.domains.remove_collaborator(1010, "example.com", 999)

Parameters:

  • account_id (Integer)

    the account ID

  • domain_id (#to_s)

    the domain ID or name

  • contact_id (#to_s)

    the contact ID

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

    request options

Returns:

Raises:

See Also:



77
78
79
80
81
82
83
# File 'lib/dnsimple/client/domains_collaborators.rb', line 77

def remove_collaborator(, domain_id, contact_id, options = {})
  Dnsimple.deprecate('`DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature.')

  response = client.delete(Client.versioned("/%s/domains/%s/collaborators/%s" % [, domain_id, contact_id]), options)

  Dnsimple::Response.new(response, nil)
end