v0.7.0: public domain types in rudder, hide OpenAPI names from callers
CI / build (push) Successful in 51s
CI / build (push) Successful in 51s
This commit is contained in:
+4
-4
@@ -18,7 +18,7 @@ type ListLeaderboardsParameters struct {
|
||||
Cursor *string
|
||||
}
|
||||
|
||||
func (s *LeaderboardsService) List(ctx context.Context, parameters ListLeaderboardsParameters) (*models.ListLeaderboardsResponse, error) {
|
||||
func (s *LeaderboardsService) List(ctx context.Context, parameters ListLeaderboardsParameters) (*LeaderboardList, error) {
|
||||
query := url.Values{}
|
||||
if parameters.Limit > 0 {
|
||||
query.Set("limit", strconv.Itoa(parameters.Limit))
|
||||
@@ -27,21 +27,21 @@ func (s *LeaderboardsService) List(ctx context.Context, parameters ListLeaderboa
|
||||
query.Set("cursor", *parameters.Cursor)
|
||||
}
|
||||
|
||||
var response models.ListLeaderboardsResponse
|
||||
var response LeaderboardList
|
||||
if err := s.transport.do(ctx, http.MethodGet, "/leaderboards", query, nil, &response); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
func (s *LeaderboardsService) Submit(ctx context.Context, slug string, items []models.BatchLeaderboardEntry) error {
|
||||
func (s *LeaderboardsService) Submit(ctx context.Context, slug string, items []LeaderboardScore) error {
|
||||
body := models.BatchSubmitLeaderboardEntriesRequest{
|
||||
Items: items,
|
||||
}
|
||||
return s.transport.do(ctx, http.MethodPost, "/leaderboards/"+url.PathEscape(slug)+"/entries", nil, body, nil)
|
||||
}
|
||||
|
||||
func (s *LeaderboardsService) Update(ctx context.Context, slug string, items []models.BatchLeaderboardEntry) error {
|
||||
func (s *LeaderboardsService) Update(ctx context.Context, slug string, items []LeaderboardScore) error {
|
||||
body := models.BatchUpdateLeaderboardEntriesRequest{
|
||||
Items: items,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user