mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-19 19:34:25 +00:00
- Add hmac, sha2, and base64 dependencies to Cargo.toml for JWT support - Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token, get_headers, clear_token_cache methods) - Add HTTPClient base class with retry logic, error handling, and timeout management - Add SubscriberAPI module
24 lines
573 B
Rust
24 lines
573 B
Rust
use crate::client::HTTPClient;
|
|
use crate::error::TelecomError;
|
|
use crate::types::RatingPlan;
|
|
|
|
pub struct RatingPlanAPI {
|
|
client: HTTPClient,
|
|
}
|
|
|
|
impl RatingPlanAPI {
|
|
pub fn new(client: HTTPClient) -> Self {
|
|
Self { client }
|
|
}
|
|
|
|
pub async fn list(&self) -> Result<Vec<RatingPlan>, TelecomError> {
|
|
self.client.get("/v1/rating-plans", None).await
|
|
}
|
|
|
|
pub async fn get(&self, plan_id: &str) -> Result<RatingPlan, TelecomError> {
|
|
self.client
|
|
.get(&format!("/v1/rating-plans/{}", plan_id), None)
|
|
.await
|
|
}
|
|
}
|