From b739000ae4a45f52ec147b101e47ee5ae4c58c81 Mon Sep 17 00:00:00 2001 From: Dallas Read Date: Tue, 10 Dec 2024 10:56:20 -0400 Subject: [PATCH] Deprecate shared domains --- CHANGELOG.md | 1 + lib/dnsimple/client/domains_collaborators.rb | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6d3cbd..9b2c3e4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/). - NEW: Added `alias_email` and `destination_email` to `EmailForward` - CHANGED: Deprecated `from` and `to` fields in `EmailForward` +- CHANGED: `DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature. ## 9.0.0 diff --git a/lib/dnsimple/client/domains_collaborators.rb b/lib/dnsimple/client/domains_collaborators.rb index ab51cc48..57ed19c3 100644 --- a/lib/dnsimple/client/domains_collaborators.rb +++ b/lib/dnsimple/client/domains_collaborators.rb @@ -20,9 +20,12 @@ module DomainsCollaborators # @option options [Integer] :page current page (pagination) # @option options [Integer] :per_page number of entries to return (pagination) # @return [Dnsimple::PaginatedResponse] + # @deprecated `DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature. # # @raise [Dnsimple::RequestError] def collaborators(account_id, 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" % [account_id, domain_id]), Options::ListOptions.new(options)) Dnsimple::PaginatedResponse.new(response, response["data"].map { |r| Struct::Collaborator.new(r) }) @@ -41,9 +44,12 @@ def collaborators(account_id, domain_id, options = {}) # @option attributes [String] :email user email (mandatory) # @param [Hash] options request options # @return [Dnsimple::PaginatedResponse] + # @deprecated `DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature. # # @raise [Dnsimple::RequestError] def add_collaborator(account_id, 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" % [account_id, domain_id]), attributes, options) @@ -65,9 +71,12 @@ def add_collaborator(account_id, domain_id, attributes, options = {}) # @param [Hash] options request options # @return [Dnsimple::Response] # + # @deprecated `DomainCollaborators` have been deprecated and will be removed in the next major version. Please use our Domain Access Control feature. # @raise [Dnsimple::NotFoundError] # @raise [Dnsimple::RequestError] def remove_collaborator(account_id, 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" % [account_id, domain_id, contact_id]), options) Dnsimple::Response.new(response, nil)