-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Domain contact management API (#241)
This PR introduces 5 new endpoints that are part of the domain contact management API that was introduced in dnsimple/dnsimple-developer#501. The following endpoints have been added: - **listRegistrantChanges**: GET `/{account}/registrar/registrant_changes` - **createRegistrantChange**: POST `/{account}/registrar/registrant_changes` - **checkRegistrantChange**: POST `/{account}/registrar/registrant_changes/check` - **getRegistrantChange**: GET `/{account}/registrar/registrant_changes/{registrantchange}` - **deleteRegistrantChange**: DELETE `/{account}/registrar/registrant_changes/{registrantchange}` Belongs to dnsimple/dnsimple-business#1729 Belongs to https://github.com/dnsimple/dnsimple-external-integrations/issues/18
- Loading branch information
Showing
13 changed files
with
417 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule Dnsimple.RegistrantChange do | ||
@moduledoc """ | ||
Represents a registrant change. | ||
Developer preview: this API is currently in open beta and subject to change. | ||
""" | ||
@moduledoc section: :data_types | ||
|
||
@type t :: %__MODULE__{ | ||
id: integer, | ||
account_id: integer, | ||
contact_id: integer, | ||
domain_id: integer, | ||
state: String.t, | ||
extended_attributes: map(), | ||
registry_owner_change: boolean, | ||
irt_lock_lifted_by: String.t, | ||
created_at: String.t, | ||
updated_at: String.t, | ||
} | ||
|
||
defstruct ~w(id account_id contact_id domain_id state extended_attributes | ||
registry_owner_change irt_lock_lifted_by created_at updated_at)a | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule Dnsimple.RegistrantChangeCheck do | ||
@moduledoc """ | ||
Represents a registrant change check response. | ||
Developer preview: this API is currently in open beta and subject to change. | ||
""" | ||
@moduledoc section: :data_types | ||
|
||
@type t :: %__MODULE__{ | ||
contact_id: integer, | ||
domain_id: integer, | ||
extended_attributes: [map()], | ||
registry_owner_change: boolean | ||
} | ||
|
||
defstruct ~w(contact_id domain_id extended_attributes registry_owner_change)a | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/fixtures.http/checkRegistrantChange/error-contactnotfound.http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
HTTP/1.1 404 | ||
server: nginx | ||
date: Tue, 22 Aug 2023 13:59:02 GMT | ||
content-type: application/json; charset=utf-8 | ||
X-RateLimit-Limit: 2400 | ||
X-RateLimit-Remaining: 2395 | ||
X-RateLimit-Reset: 1692705338 | ||
x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs | ||
cache-control: no-cache | ||
x-request-id: b1dd3f42-ebb9-42fd-a121-d595de96f667 | ||
x-runtime: 0.019122 | ||
strict-transport-security: max-age=63072000 | ||
|
||
{"message":"Contact `21` not found"} |
15 changes: 15 additions & 0 deletions
15
test/fixtures.http/checkRegistrantChange/error-domainnotfound.http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
HTTP/1.1 404 | ||
server: nginx | ||
date: Tue, 22 Aug 2023 11:09:40 GMT | ||
content-type: application/json; charset=utf-8 | ||
X-RateLimit-Limit: 2400 | ||
X-RateLimit-Remaining: 2395 | ||
X-RateLimit-Reset: 1692705338 | ||
x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs | ||
etag: W/"cef1e7d85d0b9bfd25e81b812891d34f" | ||
cache-control: max-age=0, private, must-revalidate | ||
x-request-id: 5b0d8bfb-7b6a-40b5-a079-b640fd817e34 | ||
x-runtime: 3.066249 | ||
strict-transport-security: max-age=63072000 | ||
|
||
{"message":"Domain `dnsimple-rraform.bio` not found"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
HTTP/1.1 200 | ||
server: nginx | ||
date: Tue, 22 Aug 2023 11:09:40 GMT | ||
content-type: application/json; charset=utf-8 | ||
X-RateLimit-Limit: 2400 | ||
X-RateLimit-Remaining: 2395 | ||
X-RateLimit-Reset: 1692705338 | ||
x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs | ||
etag: W/"cef1e7d85d0b9bfd25e81b812891d34f" | ||
cache-control: max-age=0, private, must-revalidate | ||
x-request-id: 5b0d8bfb-7b6a-40b5-a079-b640fd817e34 | ||
x-runtime: 3.066249 | ||
strict-transport-security: max-age=63072000 | ||
|
||
{"data":{"domain_id":101,"contact_id":101,"extended_attributes":[],"registry_owner_change":true}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
HTTP/1.1 202 | ||
server: nginx | ||
date: Tue, 22 Aug 2023 11:11:00 GMT | ||
content-type: application/json; charset=utf-8 | ||
X-RateLimit-Limit: 2400 | ||
X-RateLimit-Remaining: 2395 | ||
X-RateLimit-Reset: 1692705338 | ||
x-work-with-us: Love automation? So do we! https://dnsimple.com/jobs | ||
cache-control: no-cache | ||
x-request-id: 26bf7ff9-2075-42b0-9431-1778c825b6b0 | ||
x-runtime: 3.408950 | ||
strict-transport-security: max-age=63072000 | ||
|
||
{"data":{"id":101,"account_id":101,"domain_id":101,"contact_id":101,"state":"new","extended_attributes":{},"registry_owner_change":true,"irt_lock_lifted_by":null,"created_at":"2017-02-03T17:43:22Z","updated_at":"2017-02-03T17:43:22Z"}} |
Oops, something went wrong.