Skip to content

Commit

Permalink
Add input for future backward compatibility
Browse files Browse the repository at this point in the history
Currently unused.
  • Loading branch information
fgsch committed Nov 15, 2023
1 parent 02b60d7 commit b01c462
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion fastly/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ func (s tokensByName) Less(i, j int) bool {
return s[i].Name < s[j].Name
}

// ListTokensInput is used as input to the ListTokens function.
type ListTokensInput struct {
// For backward compatibility.
}

// ListTokens retrieves all resources.
func (c *Client) ListTokens() ([]*Token, error) {
func (c *Client) ListTokens(i *ListTokensInput) ([]*Token, error) {
resp, err := c.Get("/tokens", nil)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion fastly/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func TestClient_ListTokens(t *testing.T) {
var tokens []*Token
var err error
record(t, "tokens/list", func(c *Client) {
tokens, err = c.ListTokens()
tokens, err = c.ListTokens(&ListTokensInput{})
})
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit b01c462

Please sign in to comment.