Versions in this module Expand all Collapse all v0 v0.2.0 May 6, 2026 Changes in this version + type Date struct + func (d *Date) UnmarshalJSON(data []byte) error + func (d Date) MarshalJSON() ([]byte, error) v0.1.0 Apr 30, 2026 Changes in this version + var ErrAmbiguousContractNumber = errors.New("tesedi: ambiguous contract number") + var ErrContractNotFound = errors.New("tesedi: contract not found") + var ErrNotFound = errors.New("tesedi: not found") + var ErrUnauthorized = errors.New("tesedi: unauthorized") + type APIError struct + Body string + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type Asset struct + AssetName string + EndDate string + ProductSKU string + RetailPrice *float64 + SerialNumber string + ServiceGroup string + ServiceGroupSKU string + ServiceLevels []ServiceLevel + StartDate string + type AssetPage struct + Data []Asset + Meta PageMeta + type Client struct + func New(baseURL, authURL, apiKey string, opts ...Option) *Client + func (c *Client) GetContract(ctx context.Context, contractID string) (*Contract, error) + func (c *Client) GetContractAssets(ctx context.Context, contractID string, opts *ListOptions) (*AssetPage, error) + func (c *Client) GetContractByNumber(ctx context.Context, number string) (*Contract, error) + func (c *Client) SearchContracts(ctx context.Context, query string, opts *ListOptions) (*ContractPage, error) + type Contract struct + ContractID string + ContractNumber string + Currency string + Distributor string + EndCustomerID string + EndCustomerName string + EndDate string + GroupID string + Reseller string + ResellerPrice float64 + RetailPrice float64 + SAR string + StartDate string + Status string + Vendor string + type ContractPage struct + Data []Contract + Meta PageMeta + type ListOptions struct + Cursor string + Limit int + SortBy string + SortOrder string + type Logger interface + Printf func(format string, args ...any) + type Option func(*Client) + func WithHTTPClient(httpClient *http.Client) Option + func WithLogger(logger Logger) Option + func WithRateLimit(perMinute, perHour int) Option + func WithRetry(maxAttempts int, baseBackoff time.Duration) Option + type PageMeta struct + HasNextPage bool + NextCursor string + type ServiceLevel struct + RetailPrice float64 + ServiceLevel string + ServiceLevelSKU string