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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
use crate::methods::Method;
use crate::model::*;
use crate::params::*;
const API_JSON_RPC_VERSION: &str = "2.0";
pub type EmptyRequest = Request<ApiKeyParams>;
impl EmptyRequest {
pub fn new(method: Method, api_key: ApiKey) -> EmptyRequest {
EmptyRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method,
params: ApiKeyParams { api_key },
id: RequestId(1),
}
}
}
pub type GenerateIntegersRequest = Request<GenerateIntegersParams>;
impl GenerateIntegersRequest {
pub fn new(
api_key: ApiKey,
min: i32,
max: i32,
limit: u16,
replacement: bool,
) -> GenerateIntegersRequest {
GenerateIntegersRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method: Method::GenerateIntegers,
params: GenerateIntegersParams {
api_key,
min,
max,
limit,
replacement,
},
id: RequestId(1),
}
}
}
pub type GenerateDecimalFractionsRequest = Request<GenerateDecimalFractionsParams>;
impl GenerateDecimalFractionsRequest {
pub fn new(api_key: ApiKey, limit: u16, decimal_places: u8) -> GenerateDecimalFractionsRequest {
GenerateDecimalFractionsRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method: Method::GenerateDecimalFractions,
params: GenerateDecimalFractionsParams {
api_key,
limit,
decimal_places,
},
id: RequestId(1),
}
}
}
pub type GenerateGaussiansRequest = Request<GenerateGaussiansParams>;
impl GenerateGaussiansRequest {
pub fn new(
api_key: ApiKey,
limit: u16,
mean: i32,
standard_deviation: i32,
significant_digits: u8,
) -> GenerateGaussiansRequest {
GenerateGaussiansRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method: Method::GenerateGaussians,
params: GenerateGaussiansParams {
api_key,
limit,
mean,
standard_deviation,
significant_digits,
},
id: RequestId(1),
}
}
}
pub type GenerateStringsRequest = Request<GenerateStringsParams>;
impl GenerateStringsRequest {
pub fn new(
api_key: ApiKey,
limit: u16,
length: u8,
characters: AllowedCharacters,
) -> GenerateStringsRequest {
GenerateStringsRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method: Method::GenerateStrings,
params: GenerateStringsParams {
api_key,
limit,
length,
characters: characters.0.iter().collect::<String>(),
},
id: RequestId(1),
}
}
}
pub type GenerateUUIDsRequest = Request<GenerateUUIDsParams>;
impl GenerateUUIDsRequest {
pub fn new(api_key: ApiKey, limit: u16) -> GenerateUUIDsRequest {
GenerateUUIDsRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method: Method::GenerateUUIDs,
params: GenerateUUIDsParams { api_key, limit },
id: RequestId(1),
}
}
}
pub type GenerateBlobsRequest = Request<GenerateBlobsParams>;
impl GenerateBlobsRequest {
pub fn new(api_key: ApiKey, limit: u16, size: u32) -> GenerateBlobsRequest {
GenerateBlobsRequest {
json_rpc: API_JSON_RPC_VERSION.to_owned(),
method: Method::GenerateBlobs,
params: GenerateBlobsParams {
api_key,
limit,
size,
},
id: RequestId(1),
}
}
}