pub struct PlansEndpoints<T: HttpClient + Default> { /* private fields */ }Implementations§
Source§impl<T: HttpClient + Default> PlansEndpoints<T>
Create a new PlansEndpoints<T> instance
impl<T: HttpClient + Default> PlansEndpoints<T>
Create a new PlansEndpoints<T> instance
§Arguments
key- The Paystack API keyhttp: The HTTP client implementation to use for the API requests
§Returns
A new PlansEndpoints instance
pub fn new(key: Arc<String>, http: Arc<T>) -> PlansEndpoints<T>
Sourcepub async fn create_plan(
&self,
plan_request: PlanRequest,
) -> PaystackResult<PlanResponseData>
pub async fn create_plan( &self, plan_request: PlanRequest, ) -> PaystackResult<PlanResponseData>
Sourcepub async fn list_plans(
&self,
per_page: Option<u8>,
page: Option<u8>,
status: Option<PlanStatus>,
interval: Option<Interval>,
amount: Option<u32>,
) -> PaystackResult<Vec<PlanResponseData>>
pub async fn list_plans( &self, per_page: Option<u8>, page: Option<u8>, status: Option<PlanStatus>, interval: Option<Interval>, amount: Option<u32>, ) -> PaystackResult<Vec<PlanResponseData>>
Lists plans available in your integration
§Arguments
per_page- specify how many records you want to retrieve per page. Defaults to 50 if Nonepage- specify exactly what page you want to retrieve. Defaults to 1 if Nonestatus- Optional parameter to filter list by plans with specified statusinterval- Optional parameter to filter list by plans with specified intervalamount- Optional parameter to filter list by plans with specified amount using the supported currency
§Returns
A Result containing a vector of plan response data or an error
Sourcepub async fn fetch_plan(
&self,
id_or_code: String,
) -> PaystackResult<PlanResponseData>
pub async fn fetch_plan( &self, id_or_code: String, ) -> PaystackResult<PlanResponseData>
Sourcepub async fn update_plan(
&self,
id_or_code: String,
plan_update_request: PlanUpdateRequest,
) -> PaystackResult<PhantomData<String>>
pub async fn update_plan( &self, id_or_code: String, plan_update_request: PlanUpdateRequest, ) -> PaystackResult<PhantomData<String>>
Update a plan details on your integration
§Arguments
id_or_code- the planIDorcodeyou want to updateplan_update_request- The request data to update the plan with. Should be created with aPlanUpdateRequestBuilderstruct.
§Returns
A Result containing a success message if the plan has been updated
Auto Trait Implementations§
impl<T> Freeze for PlansEndpoints<T>
impl<T> RefUnwindSafe for PlansEndpoints<T>where
T: RefUnwindSafe,
impl<T> Send for PlansEndpoints<T>where
T: Sync,
impl<T> Sync for PlansEndpoints<T>where
T: Sync,
impl<T> Unpin for PlansEndpoints<T>
impl<T> UnwindSafe for PlansEndpoints<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more