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:
+7
-7
@@ -20,7 +20,7 @@ type ListLeaderboardEntriesParameters struct {
|
||||
Cursor *string
|
||||
}
|
||||
|
||||
func (h *LeaderboardHandle) List(ctx context.Context, parameters ListLeaderboardEntriesParameters) (*models.ListLeaderboardEntriesResponse, error) {
|
||||
func (h *LeaderboardHandle) List(ctx context.Context, parameters ListLeaderboardEntriesParameters) (*RankList, error) {
|
||||
query := url.Values{}
|
||||
if parameters.Limit > 0 {
|
||||
query.Set("limit", strconv.Itoa(parameters.Limit))
|
||||
@@ -29,22 +29,22 @@ func (h *LeaderboardHandle) List(ctx context.Context, parameters ListLeaderboard
|
||||
query.Set("cursor", *parameters.Cursor)
|
||||
}
|
||||
|
||||
var response models.ListLeaderboardEntriesResponse
|
||||
var response RankList
|
||||
if err := h.transport.do(ctx, http.MethodGet, "/leaderboards/"+url.PathEscape(h.slug)+"/entries", query, nil, &response); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
func (h *LeaderboardHandle) Get(ctx context.Context, playerID string) (*models.RankEntry, error) {
|
||||
var response models.RankEntry
|
||||
func (h *LeaderboardHandle) Get(ctx context.Context, playerID string) (*Rank, error) {
|
||||
var response Rank
|
||||
if err := h.transport.do(ctx, http.MethodGet, "/leaderboards/"+url.PathEscape(h.slug)+"/entries/"+url.PathEscape(playerID), nil, nil, &response); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &response, nil
|
||||
}
|
||||
|
||||
func (h *LeaderboardHandle) GetAround(ctx context.Context, playerID string, limit int) ([]models.RankEntry, error) {
|
||||
func (h *LeaderboardHandle) GetAround(ctx context.Context, playerID string, limit int) ([]Rank, error) {
|
||||
query := url.Values{}
|
||||
if limit > 0 {
|
||||
query.Set("limit", strconv.Itoa(limit))
|
||||
@@ -57,11 +57,11 @@ func (h *LeaderboardHandle) GetAround(ctx context.Context, playerID string, limi
|
||||
return response.Entries, nil
|
||||
}
|
||||
|
||||
func (h *LeaderboardHandle) Submit(ctx context.Context, items []models.BatchLeaderboardEntry) error {
|
||||
func (h *LeaderboardHandle) Submit(ctx context.Context, items []LeaderboardScore) error {
|
||||
return h.leaderboards.Submit(ctx, h.slug, items)
|
||||
}
|
||||
|
||||
func (h *LeaderboardHandle) Update(ctx context.Context, items []models.BatchLeaderboardEntry) error {
|
||||
func (h *LeaderboardHandle) Update(ctx context.Context, items []LeaderboardScore) error {
|
||||
return h.leaderboards.Update(ctx, h.slug, items)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user