@@ -23,7 +23,14 @@ pub struct CustomersEndpoints<T: HttpClient + Default> {
2323}
2424
2525impl < T : HttpClient + Default > CustomersEndpoints < T > {
26- /// Constructor
26+ /// Creates a new CustomersEndpoints instance
27+ ///
28+ /// # Arguments
29+ /// * `key` - The Paystack API key
30+ /// * `http` - The HTTP client implementation to use for API requests
31+ ///
32+ /// # Returns
33+ /// A new CustomersEndpoints instance
2734 pub fn new ( key : Arc < String > , http : Arc < T > ) -> CustomersEndpoints < T > {
2835 let base_url = String :: from ( "https://api.paystack.co/customer" ) ;
2936 CustomersEndpoints {
@@ -35,9 +42,12 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
3542
3643 /// Create customer on your integration
3744 ///
38- /// It takes the following parameters:
39- /// - create_customer_request: contains the information about the customer to be created.
40- /// It should be built with `CreateCustomerRequestBuilder`.
45+ /// # Arguments
46+ /// * `create_customer_request` - Contains the information about the customer to be created.
47+ /// It should be built with `CreateCustomerRequestBuilder`.
48+ ///
49+ /// # Returns
50+ /// A Result containing the customer response data or an error
4151 pub async fn create_customer (
4252 & self ,
4353 create_customer_request : CreateCustomerRequest ,
@@ -60,11 +70,14 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
6070 }
6171 }
6272
63- /// List customers available on your integration
73+ /// Lists customers available on your integration
6474 ///
65- /// It takes the following parameters:
66- /// - `per_page`: Specify how many records you want to retreive per page. If not specified, default value of 50.
67- /// - `page`: Specify exactly waht page you want to retreive. If not specified, default value of 1.
75+ /// # Arguments
76+ /// * `per_page` - Optional number of records to retrieve per page. Default is 50
77+ /// * `page` - Optional page number to retrieve. Default is 1
78+ ///
79+ /// # Returns
80+ /// A Result containing a vector of customer response data or an error
6881 pub async fn list_customers (
6982 & self ,
7083 per_page : Option < u8 > ,
@@ -90,10 +103,13 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
90103 }
91104 }
92105
93- /// Get details of a customer on your integration.
106+ /// Gets details of a customer on your integration
107+ ///
108+ /// # Arguments
109+ /// * `email_or_code` - Email or customer code for the customer to fetch
94110 ///
95- /// It takes the following parameters:
96- /// - `email_or_code`: An `email`or `customer code` for the customer you want to fetch.
111+ /// # Returns
112+ /// A Result containing the customer response data or an error
97113 pub async fn fetch_customer (
98114 & self ,
99115 email_or_code : String ,
@@ -114,12 +130,15 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
114130 }
115131 }
116132
117- /// Update a customer's details on your integration
133+ /// Updates a customer's details on your integration
118134 ///
119- /// It takes the following parameters:
120- /// - `customer_code`: The customer's code
121- /// - `update_customer_request`: The data to update the customer with.
122- /// It should be created with the `UpdateCustomerRequestBuilder` struct.
135+ /// # Arguments
136+ /// * `customer_code` - The customer's code
137+ /// * `update_customer_request` - The data to update the customer with.
138+ /// Should be created with the UpdateCustomerRequestBuilder struct
139+ ///
140+ /// # Returns
141+ /// A Result containing the updated customer response data or an error
123142 pub async fn update_customer (
124143 & self ,
125144 customer_code : String ,
@@ -143,12 +162,15 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
143162 }
144163 }
145164
146- /// Validate a customer's identity
165+ /// Validates a customer's identity
166+ ///
167+ /// # Arguments
168+ /// * `customer_code` - Email or customer code of customer to be identified
169+ /// * `customer_validation_request` - The data to validate the customer with.
170+ /// Should be created with the ValidateCustomerRequestBuilder struct
147171 ///
148- /// It takes in the following parameters:
149- /// - `customer_code`: email, or customer code of customer to be identified.
150- /// - `customer_validation_request`: The data to validate the customer with.
151- /// It should be created with the `ValidateCustomerRequestBuilder` struct.
172+ /// # Returns
173+ /// A Result containing the validation response or an error
152174 pub async fn validate_customer (
153175 & self ,
154176 customer_code : String ,
@@ -172,11 +194,14 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
172194 }
173195 }
174196
175- /// Whitelist or blacklist a customer on your integration
197+ /// Whitelists or blacklists a customer on your integration
176198 ///
177- /// It takes in the following parameters:
178- /// - `customer_code`: Customer's code, or email address.
179- /// - `risk_action`: One of the possible risk actions for the customer.
199+ /// # Arguments
200+ /// * `customer_code` - Customer's code or email address
201+ /// * `risk_action` - The risk action to apply to the customer
202+ ///
203+ /// # Returns
204+ /// A Result containing the updated customer response data or an error
180205 pub async fn whitelist_or_blacklist_customer (
181206 & self ,
182207 customer_code : String ,
@@ -202,10 +227,13 @@ impl<T: HttpClient + Default> CustomersEndpoints<T> {
202227 }
203228 }
204229
205- /// Deactivate an authorization when the card needs to be forgotten
230+ /// Deactivates an authorization when the card needs to be forgotten
231+ ///
232+ /// # Arguments
233+ /// * `authorization_code` - Authorization code to be deactivated
206234 ///
207- /// It takes the following parameters:
208- /// - `authorization_code`: Authorization code to be deactivated.
235+ /// # Returns
236+ /// A Result containing the deactivation response or an error
209237 pub async fn deactivate_authorization (
210238 & self ,
211239 authorization_code : String ,
0 commit comments