Skip to content

Commit 8581829

Browse files
committed
Removed deprecated getDomainPremiumPrice
Ref: dnsimple/dnsimple-developer#916
1 parent 6f5b588 commit 8581829

File tree

6 files changed

+3
-170
lines changed

6 files changed

+3
-170
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
44

55
## main
66

7+
- REMOVED: Removed deprecated `check_domain_premium_price`. Use `get_domain_prices` instead.
8+
79
## 4.0.0 - 2025-08-20
810

911
- CHANGED: Removed `from` and `to` fields in `EmailForward`. Please use `alias_email` and `destination_email` instead.

src/dnsimple/registrar.rs

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ pub struct DomainCheck {
1414
pub premium: bool,
1515
}
1616

17-
/// Represents a domain premium price
18-
#[derive(Debug, Deserialize, Serialize)]
19-
pub struct DomainPremiumPrice {
20-
/// The domain premium price
21-
pub premium_price: String,
22-
/// The action: registration/transfer/renewal
23-
pub action: String,
24-
}
25-
2617
/// Represents the domain prices
2718
#[derive(Debug, Deserialize, Serialize)]
2819
pub struct DomainPrice {
@@ -156,12 +147,6 @@ impl Endpoint for DomainCheckEndpoint {
156147
type Output = DomainCheck;
157148
}
158149

159-
struct DomainPremiumPriceEndpoint;
160-
161-
impl Endpoint for DomainPremiumPriceEndpoint {
162-
type Output = DomainPremiumPrice;
163-
}
164-
165150
struct DomainPricesEndpoint;
166151

167152
impl Endpoint for DomainPricesEndpoint {
@@ -219,39 +204,7 @@ impl Registrar<'_> {
219204
self.client.get::<DomainCheckEndpoint>(&path, None)
220205
}
221206

222-
/// Get the premium price for a domain.
223-
///
224-
/// # Examples
225-
///
226-
/// ```no_run
227-
/// use dnsimple::dnsimple::new_client;
228-
///
229-
/// let client = new_client(true, String::from("AUTH_TOKEN"));
230-
/// let domain_check = client.registrar().check_domain_premium_price(1234, "example.com", None).unwrap().data.unwrap();
231-
/// ```
232-
///
233-
/// # Attributes
234-
///
235-
/// `account_id`: The account id
236-
/// `domain`: The domain name
237-
#[deprecated(note = "please use `get_domain_prices` instead")]
238-
pub fn check_domain_premium_price(
239-
&self,
240-
account_id: u64,
241-
domain: &str,
242-
action: Option<String>,
243-
) -> Result<DNSimpleResponse<DomainPremiumPrice>, DNSimpleError> {
244-
let path = format!(
245-
"/{}/registrar/domains/{}/premium_price?action={}",
246-
account_id,
247-
domain,
248-
action.unwrap_or_else(|| "registration".into())
249-
);
250-
251-
self.client.get::<DomainPremiumPriceEndpoint>(&path, None)
252-
}
253-
254-
/// Get a domain’s price for registration, renewal, and transfer.
207+
/// Get a domain's price for registration, renewal, and transfer.
255208
///
256209
/// # Examples
257210
///

tests/fixtures/v2/api/checkDomainPremiumPrice/error_400_not_a_premium_domain.http

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/fixtures/v2/api/checkDomainPremiumPrice/error_400_tld_not_supported.http

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/fixtures/v2/api/checkDomainPremiumPrice/success.http

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/registrar_test.rs

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -23,72 +23,6 @@ fn test_check_domain() {
2323
assert!(domain_check.premium);
2424
}
2525

26-
#[test]
27-
#[allow(deprecated)]
28-
fn test_check_domain_premium_price() {
29-
let setup = setup_mock_for(
30-
"/1010/registrar/domains/ruby.codes/premium_price?action=registration",
31-
"checkDomainPremiumPrice/success",
32-
"GET",
33-
);
34-
let client = setup.0;
35-
let account_id = 1010;
36-
let domain = "ruby.codes";
37-
38-
let response = client
39-
.registrar()
40-
.check_domain_premium_price(account_id, domain, None)
41-
.unwrap();
42-
let domain_premium_price = response.data.unwrap();
43-
44-
assert_eq!("2640.00", domain_premium_price.premium_price);
45-
assert_eq!("registration", domain_premium_price.action);
46-
}
47-
48-
#[test]
49-
#[allow(deprecated)]
50-
fn test_check_domain_premium_price_not_a_premium_domain() {
51-
let setup = setup_mock_for(
52-
"/1010/registrar/domains/cocotero.love/premium_price?action=registration",
53-
"checkDomainPremiumPrice/error_400_not_a_premium_domain",
54-
"GET",
55-
);
56-
let client = setup.0;
57-
let account_id = 1010;
58-
let domain = "cocotero.love";
59-
60-
let response = client
61-
.registrar()
62-
.check_domain_premium_price(account_id, domain, None);
63-
assert!(response.is_err());
64-
65-
let error = response.unwrap_err();
66-
67-
assert_eq!(
68-
"`cocotero.love` is not a premium domain for registration",
69-
error.to_string()
70-
);
71-
}
72-
#[test]
73-
#[allow(deprecated)]
74-
fn test_check_domain_premium_price_tld_not_supported() {
75-
let setup = setup_mock_for(
76-
"/1010/registrar/domains/.love/premium_price?action=registration",
77-
"checkDomainPremiumPrice/error_400_tld_not_supported",
78-
"GET",
79-
);
80-
let client = setup.0;
81-
let account_id = 1010;
82-
let domain = ".love";
83-
84-
let response = client
85-
.registrar()
86-
.check_domain_premium_price(account_id, domain, None);
87-
let error = response.unwrap_err();
88-
89-
assert_eq!("TLD .LOVE is not supported", error.to_string());
90-
}
91-
9226
#[test]
9327
fn test_get_domain_prices() {
9428
let setup = setup_mock_for(

0 commit comments

Comments
 (0)