Files
telecom-platform/sdk/go/rating_plans_api.go
T
nutcas3 d846c304a4 docs: Add Go SDK README with comprehensive API documentation and implement modular architecture with authentication provider
- 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 (GenerateJWTToken, ValidateJWTToken, GetHeaders, ClearTokenCache methods)
- Add HTTPClient base class with retry logic, error handling, and timeout management
- Add GraphQLAPI, PaymentsAPI, RatingPlansAPI
2026-04-25 04:56:33 +03:00

31 lines
764 B
Go

package telecom
import (
"context"
"fmt"
)
// RatingPlanAPI handles rating plan-related API calls
type RatingPlanAPI struct {
client *HTTPClient
}
// NewRatingPlanAPI creates a new RatingPlanAPI
func NewRatingPlanAPI(client *HTTPClient) *RatingPlanAPI {
return &RatingPlanAPI{client: client}
}
// List retrieves all available rating plans
func (r *RatingPlanAPI) List(ctx context.Context) ([]RatingPlan, error) {
var plans []RatingPlan
err := r.client.Get(ctx, "/v1/rating-plans", &plans)
return plans, err
}
// Get retrieves a rating plan by ID
func (r *RatingPlanAPI) Get(ctx context.Context, planID string) (*RatingPlan, error) {
var plan RatingPlan
err := r.client.Get(ctx, fmt.Sprintf("/v1/rating-plans/%s", planID), &plan)
return &plan, err
}