mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-21 11:38:45 +00:00
docs: Add Ruby SDK README with comprehensive API documentation and implement modular architecture with HTTParty integration
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Refactor TelecomSDK::Client to use modular API clients (SubscriberAPI, UsageAPI, PaymentAPI, RatingPlanAPI, SystemAPI, GraphQLAPI) - Add AuthProvider class with API key and JWT token support (generate_jwt_token, validate_jwt_token methods) - Add HTTPClient base class with retry
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
module TelecomSDK
|
||||
# API for subscriber management
|
||||
class SubscriberAPI
|
||||
def initialize(client)
|
||||
@client = client
|
||||
end
|
||||
|
||||
def get(id)
|
||||
@client.get("/v1/subscribers/#{id}")
|
||||
end
|
||||
|
||||
def list(page: 1, page_size: 50, status: nil)
|
||||
params = { page: page, page_size: page_size }
|
||||
params[:status] = status if status
|
||||
@client.get("/v1/subscribers", params)
|
||||
end
|
||||
|
||||
def create(request)
|
||||
@client.post("/v1/subscribers", request)
|
||||
end
|
||||
|
||||
def update(id, request)
|
||||
@client.put("/v1/subscribers/#{id}", request)
|
||||
end
|
||||
|
||||
def delete(id)
|
||||
@client.delete("/v1/subscribers/#{id}")
|
||||
end
|
||||
|
||||
def suspend(id)
|
||||
@client.post("/v1/subscribers/#{id}/suspend")
|
||||
end
|
||||
|
||||
def activate(id)
|
||||
@client.post("/v1/subscribers/#{id}/activate")
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user