Skip to content

Commit

Permalink
chore: fix case for count
Browse files Browse the repository at this point in the history
  • Loading branch information
rocribera committed Nov 20, 2024
1 parent 8f966c2 commit c8f7004
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions subscribers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const subscriberEndpoint = "/subscribers"
// SubscriberService defines an interface for subscriber-related operations.
type SubscriberService interface {
List(ctx context.Context, options *ListSubscriberOptions) (*RootSubscribers, *Response, error)
Count(ctx context.Context) (*count, *Response, error)
Count(ctx context.Context) (*Count, *Response, error)
Get(ctx context.Context, options *GetSubscriberOptions) (*RootSubscriber, *Response, error)
Create(ctx context.Context, subscriber *Subscriber) (*RootSubscriber, *Response, error)
Update(ctx context.Context, subscriber *Subscriber) (*RootSubscriber, *Response, error)
Expand All @@ -36,7 +36,7 @@ type RootSubscriber struct {
Data Subscriber `json:"data"`
}

type count struct {
type Count struct {
Total int `json:"total"`
}

Expand Down Expand Up @@ -90,14 +90,14 @@ func (s *subscriberService) List(ctx context.Context, options *ListSubscriberOpt
}

// Count - get a count of subscribers
func (s *subscriberService) Count(ctx context.Context) (*count, *Response, error) {
func (s *subscriberService) Count(ctx context.Context) (*Count, *Response, error) {
path := fmt.Sprintf("%s?limit=0", subscriberEndpoint)
req, err := s.client.newRequest(http.MethodGet, path, nil)
if err != nil {
return nil, nil, err
}

root := new(count)
root := new(Count)
res, err := s.client.do(ctx, req, root)
if err != nil {
return nil, res, err
Expand Down

0 comments on commit c8f7004

Please sign in to comment.