File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -34,5 +34,6 @@ type APIKeyWithSecret struct {
3434// APIKeyList represents a list of API keys without secrets.
3535type APIKeyList struct {
3636 APIResource
37- APIKeys []* APIKey `json:"api_keys"`
37+ APIKeys []* APIKey `json:"data"`
38+ TotalCount int64 `json:"total_count"`
3839}
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ func TestPackageList(t *testing.T) {
7272 t .Parallel ()
7373
7474 response := map [string ]interface {}{
75- "api_keys " : []map [string ]interface {}{
75+ "data " : []map [string ]interface {}{
7676 {
7777 "object" : "api_key" ,
7878 "id" : "ak_test123" ,
@@ -92,6 +92,7 @@ func TestPackageList(t *testing.T) {
9292 "updated_at" : 1640995200 ,
9393 },
9494 },
95+ "total_count" : int64 (1 ),
9596 }
9697
9798 responseJSON , _ := json .Marshal (response )
@@ -120,6 +121,7 @@ func TestPackageList(t *testing.T) {
120121
121122 apiKeys , err := List (context .Background (), params )
122123 require .NoError (t , err )
124+ assert .Equal (t , int64 (1 ), apiKeys .TotalCount )
123125 assert .Len (t , apiKeys .APIKeys , 1 )
124126 assert .Equal (t , "ak_test123" , apiKeys .APIKeys [0 ].ID )
125127}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ func TestList(t *testing.T) {
6868 t .Parallel ()
6969
7070 response := map [string ]interface {}{
71- "api_keys " : []map [string ]interface {}{
71+ "data " : []map [string ]interface {}{
7272 {
7373 "object" : "api_key" ,
7474 "id" : "ak_test123" ,
@@ -88,6 +88,7 @@ func TestList(t *testing.T) {
8888 "updated_at" : 1640995200 ,
8989 },
9090 },
91+ "total_count" : int64 (1 ),
9192 }
9293
9394 responseJSON , _ := json .Marshal (response )
@@ -114,6 +115,7 @@ func TestList(t *testing.T) {
114115
115116 apiKeys , err := client .List (context .Background (), params )
116117 require .NoError (t , err )
118+ assert .Equal (t , int64 (1 ), apiKeys .TotalCount )
117119 assert .Len (t , apiKeys .APIKeys , 1 )
118120 assert .Equal (t , "ak_test123" , apiKeys .APIKeys [0 ].ID )
119121}
You can’t perform that action at this time.
0 commit comments