1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! This module provides utility functions for parsing values from Namecheap API responses.
//!
//! It contains functions to safely extract and convert values from JSON responses.
use Value;
/// Parses a string value from a JSON object
///
/// # Parameters
///
/// - `json`: The JSON object to extract from
/// - `key`: The key to look for in the JSON object
/// - `default`: The default value to return if the key is not found or not a string
///
/// # Returns
///
/// The string value or the default if not found
/// Parses a boolean value from a JSON object
///
/// # Parameters
///
/// - `json`: The JSON object to extract from
/// - `key`: The key to look for in the JSON object
/// - `default`: The default value to return if the key is not found
/// - `true_value`: The string value that represents true (default is "true")
///
/// # Returns
///
/// The boolean value or the default if not found
/// Parses an integer value from a JSON object
///
/// # Parameters
///
/// - `json`: The JSON object to extract from
/// - `key`: The key to look for in the JSON object
/// - `default`: The default value to return if the key is not found or parsing fails
///
/// # Returns
///
/// The integer value or the default if not found or parsing fails