diff --git a/account_notifications.go b/account_notifications.go
index df65bd3e8..3820f0904 100644
--- a/account_notifications.go
+++ b/account_notifications.go
@@ -5,7 +5,6 @@ import (
"encoding/json"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -57,40 +56,18 @@ const (
NotificationMaintenance NotificationType = "maintenance"
)
-// NotificationsPagedResponse represents a paginated Notifications API response
-type NotificationsPagedResponse struct {
- *PageOptions
- Data []Notification `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Notification
-func (NotificationsPagedResponse) endpoint(_ ...any) string {
- return "account/notifications"
-}
-
-func (resp *NotificationsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(NotificationsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*NotificationsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListNotifications gets a collection of Notification objects representing important,
// often time-sensitive items related to the Account. An account cannot interact directly with
// Notifications, and a Notification will disappear when the circumstances causing it
// have been resolved. For example, if the account has an important Ticket open, a response
// to the Ticket will dismiss the Notification.
func (c *Client) ListNotifications(ctx context.Context, opts *ListOptions) ([]Notification, error) {
- response := NotificationsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Notification](ctx, c, "account/notifications", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// UnmarshalJSON implements the json.Unmarshaler interface
diff --git a/account_oauth_client.go b/account_oauth_client.go
index dba898d29..6f2a57a1c 100644
--- a/account_oauth_client.go
+++ b/account_oauth_client.go
@@ -2,11 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
-
- "github.com/go-resty/resty/v2"
)
// OAuthClientStatus constants start with OAuthClient and include Linode API Instance Status values
@@ -85,92 +80,52 @@ func (i OAuthClient) GetUpdateOptions() (o OAuthClientUpdateOptions) {
return
}
-// OAuthClientsPagedResponse represents a paginated OAuthClient API response
-type OAuthClientsPagedResponse struct {
- *PageOptions
- Data []OAuthClient `json:"data"`
-}
-
-// endpoint gets the endpoint URL for OAuthClient
-func (OAuthClientsPagedResponse) endpoint(_ ...any) string {
- return "account/oauth-clients"
-}
-
-func (resp *OAuthClientsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(OAuthClientsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*OAuthClientsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListOAuthClients lists OAuthClients
func (c *Client) ListOAuthClients(ctx context.Context, opts *ListOptions) ([]OAuthClient, error) {
- response := OAuthClientsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[OAuthClient](ctx, c, "account/oauth-clients", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetOAuthClient gets the OAuthClient with the provided ID
func (c *Client) GetOAuthClient(ctx context.Context, clientID string) (*OAuthClient, error) {
- req := c.R(ctx).SetResult(&OAuthClient{})
- clientID = url.PathEscape(clientID)
- e := fmt.Sprintf("account/oauth-clients/%s", clientID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/oauth-clients/%s", clientID)
+ response, err := doGETRequest[OAuthClient](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*OAuthClient), nil
+ return response, nil
}
// CreateOAuthClient creates an OAuthClient
func (c *Client) CreateOAuthClient(ctx context.Context, opts OAuthClientCreateOptions) (*OAuthClient, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&OAuthClient{}).SetBody(string(body))
e := "account/oauth-clients"
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[OAuthClient](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*OAuthClient), nil
+ return response, nil
}
// UpdateOAuthClient updates the OAuthClient with the specified id
func (c *Client) UpdateOAuthClient(ctx context.Context, clientID string, opts OAuthClientUpdateOptions) (*OAuthClient, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&OAuthClient{}).SetBody(string(body))
-
- clientID = url.PathEscape(clientID)
-
- e := fmt.Sprintf("account/oauth-clients/%s", clientID)
- r, err := coupleAPIErrors(req.Put(e))
+ e := formatAPIPath("account/oauth-clients/%s", clientID)
+ response, err := doPUTRequest[OAuthClient](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*OAuthClient), nil
+ return response, nil
}
// DeleteOAuthClient deletes the OAuthClient with the specified id
func (c *Client) DeleteOAuthClient(ctx context.Context, clientID string) error {
- clientID = url.PathEscape(clientID)
- e := fmt.Sprintf("account/oauth-clients/%s", clientID)
- _, err := coupleAPIErrors(c.R(ctx).Delete(e))
+ e := formatAPIPath("account/oauth-clients/%s", clientID)
+ err := doDELETERequest(ctx, c, e)
return err
}
diff --git a/account_payments.go b/account_payments.go
index a2fe17b64..452f53f16 100644
--- a/account_payments.go
+++ b/account_payments.go
@@ -3,10 +3,8 @@ package linodego
import (
"context"
"encoding/json"
- "fmt"
"time"
- "github.com/go-resty/resty/v2"
"github.com/linode/linodego/internal/parseabletime"
)
@@ -57,63 +55,34 @@ func (i Payment) GetCreateOptions() (o PaymentCreateOptions) {
return
}
-// PaymentsPagedResponse represents a paginated Payment API response
-type PaymentsPagedResponse struct {
- *PageOptions
- Data []Payment `json:"data"`
-}
-
-// endpoint gets the endpoint URL for Payment
-func (PaymentsPagedResponse) endpoint(_ ...any) string {
- return "account/payments"
-}
-
-func (resp *PaymentsPagedResponse) castResult(r *resty.Request, e string) (int, int, error) {
- res, err := coupleAPIErrors(r.SetResult(PaymentsPagedResponse{}).Get(e))
- if err != nil {
- return 0, 0, err
- }
- castedRes := res.Result().(*PaymentsPagedResponse)
- resp.Data = append(resp.Data, castedRes.Data...)
- return castedRes.Pages, castedRes.Results, nil
-}
-
// ListPayments lists Payments
func (c *Client) ListPayments(ctx context.Context, opts *ListOptions) ([]Payment, error) {
- response := PaymentsPagedResponse{}
- err := c.listHelper(ctx, &response, opts)
+ response, err := getPaginatedResults[Payment](ctx, c, "account/payments", opts)
if err != nil {
return nil, err
}
- return response.Data, nil
+ return response, nil
}
// GetPayment gets the payment with the provided ID
func (c *Client) GetPayment(ctx context.Context, paymentID int) (*Payment, error) {
- req := c.R(ctx).SetResult(&Payment{})
- e := fmt.Sprintf("account/payments/%d", paymentID)
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/payments/%d", paymentID)
+ response, err := doGETRequest[Payment](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*Payment), nil
+ return response, nil
}
// CreatePayment creates a Payment
func (c *Client) CreatePayment(ctx context.Context, opts PaymentCreateOptions) (*Payment, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&Payment{}).SetBody(string(body))
e := "accounts/payments"
- r, err := coupleAPIErrors(req.Post(e))
+ response, err := doPOSTRequest[Payment](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*Payment), nil
+ return response, nil
}
diff --git a/account_settings.go b/account_settings.go
index 9a4b1362b..5edef5beb 100644
--- a/account_settings.go
+++ b/account_settings.go
@@ -2,7 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
)
// AccountSettings are the account wide flags or plans that effect new resources
@@ -38,29 +37,24 @@ type AccountSettingsUpdateOptions struct {
// GetAccountSettings gets the account wide flags or plans that effect new resources
func (c *Client) GetAccountSettings(ctx context.Context) (*AccountSettings, error) {
- req := c.R(ctx).SetResult(&AccountSettings{})
e := "account/settings"
- r, err := coupleAPIErrors(req.Get(e))
+
+ response, err := doGETRequest[AccountSettings](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*AccountSettings), nil
+ return response, nil
}
// UpdateAccountSettings updates the settings associated with the account
func (c *Client) UpdateAccountSettings(ctx context.Context, opts AccountSettingsUpdateOptions) (*AccountSettings, error) {
- body, err := json.Marshal(opts)
- if err != nil {
- return nil, err
- }
-
- req := c.R(ctx).SetResult(&AccountSettings{}).SetBody(string(body))
e := "account/settings"
- r, err := coupleAPIErrors(req.Put(e))
+
+ response, err := doPUTRequest[AccountSettings](ctx, c, e, opts)
if err != nil {
return nil, err
}
- return r.Result().(*AccountSettings), nil
+ return response, nil
}
diff --git a/account_transfer.go b/account_transfer.go
index 115573021..1420f2781 100644
--- a/account_transfer.go
+++ b/account_transfer.go
@@ -22,12 +22,12 @@ type AccountTransferRegion struct {
// GetAccountTransfer gets current Account's network utilization for the current month.
func (c *Client) GetAccountTransfer(ctx context.Context) (*AccountTransfer, error) {
- req := c.R(ctx).SetResult(&AccountTransfer{})
e := "account/transfer"
- r, err := coupleAPIErrors(req.Get(e))
+
+ response, err := doGETRequest[AccountTransfer](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*AccountTransfer), nil
+ return response, nil
}
diff --git a/account_user_grants.go b/account_user_grants.go
index 221fb5f7b..f0ca1dc7b 100644
--- a/account_user_grants.go
+++ b/account_user_grants.go
@@ -2,9 +2,6 @@ package linodego
import (
"context"
- "encoding/json"
- "fmt"
- "net/url"
)
type GrantPermissionLevel string
@@ -69,30 +66,21 @@ type UserGrantsUpdateOptions struct {
}
func (c *Client) GetUserGrants(ctx context.Context, username string) (*UserGrants, error) {
- username = url.PathEscape(username)
- e := fmt.Sprintf("account/users/%s/grants", username)
- req := c.R(ctx).SetResult(&UserGrants{})
- r, err := coupleAPIErrors(req.Get(e))
+ e := formatAPIPath("account/users/%s/grants", username)
+ response, err := doGETRequest[UserGrants](ctx, c, e)
if err != nil {
return nil, err
}
- return r.Result().(*UserGrants), nil
+ return response, nil
}
func (c *Client) UpdateUserGrants(ctx context.Context, username string, opts UserGrantsUpdateOptions) (*UserGrants, error) {
- body, err := json.Marshal(opts)
+ e := formatAPIPath("account/users/%s/grants", username)
+ response, err := doPUTRequest[UserGrants](ctx, c, e, opts)
if err != nil {
return nil, err
}
- username = url.PathEscape(username)
- e := fmt.Sprintf("account/users/%s/grants", username)
- req := c.R(ctx).SetResult(&UserGrants{}).SetBody(string(body))
- r, err := coupleAPIErrors(req.Put(e))
- if err != nil {
- return nil, err
- }
-
- return r.Result().(*UserGrants), nil
+ return response, nil
}
diff --git a/test/integration/fixtures/TestAccountNotifications_List.yaml b/test/integration/fixtures/TestAccountNotifications_List.yaml
index e81648a08..312bf7946 100644
--- a/test/integration/fixtures/TestAccountNotifications_List.yaml
+++ b/test/integration/fixtures/TestAccountNotifications_List.yaml
@@ -11,10 +11,14 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
- url: https://api.linode.com/v4beta/account/notifications
+ url: https://api.linode.com/v4beta/account/notifications?page=1
method: GET
response:
- body: '{"pages": 1, "page": 1, "results": 0, "data": []}'
+ body: '{"pages": 1, "page": 1, "results": 1, "data": [{"type": "notice", "entity":
+ null, "when": null, "message": "To use the Linode DNS Manager to serve your
+ domains, you must have an active Linode on your account. See https://www.linode.com/docs/platform/manager/dns-manager/
+ for more information.", "label": "Your domains are not being served.", "severity":
+ "major", "until": null, "body": null}]}'
headers:
Access-Control-Allow-Credentials:
- "true"
@@ -31,13 +35,13 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - "49"
+ - "465"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- - Tue, 13 Feb 2024 18:57:42 GMT
+ - Mon, 17 Jun 2024 19:46:05 GMT
Pragma:
- no-cache
Strict-Transport-Security:
@@ -53,10 +57,7 @@ interactions:
- DENY
- DENY
X-Oauth-Scopes:
- - account:read_write databases:read_write domains:read_write events:read_write
- firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write
- longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write
- volumes:read_write vpc:read_write
+ - '*'
X-Ratelimit-Limit:
- "400"
X-Xss-Protection:
diff --git a/test/integration/fixtures/TestOAuthClients_List.yaml b/test/integration/fixtures/TestOAuthClients_List.yaml
index 975054613..199db0d5b 100644
--- a/test/integration/fixtures/TestOAuthClients_List.yaml
+++ b/test/integration/fixtures/TestOAuthClients_List.yaml
@@ -14,8 +14,8 @@ interactions:
url: https://api.linode.com/v4beta/account/oauth-clients
method: POST
response:
- body: '{"id": "b3418cf8e53201b4ee30", "redirect_uri": "https://example.com", "label":
- "go-client-test", "status": "active", "secret": "9646fa9be07dc54d2b4870d051f6f5d051e3ab4884519c5c2308cd29ca82dc60",
+ body: '{"id": "4a48ff5903b62d743bf0", "redirect_uri": "https://example.com", "label":
+ "go-client-test", "status": "active", "secret": "3e1d30e5a0a3e350ba7231cf4ba2c0863880007d62be38ebdf89fda9d2aadaff",
"thumbnail_url": null, "public": true}'
headers:
Access-Control-Allow-Credentials:
@@ -39,7 +39,7 @@ interactions:
Content-Type:
- application/json
Expires:
- - Thu, 30 May 2024 23:12:10 GMT
+ - Mon, 17 Jun 2024 19:45:25 GMT
Pragma:
- no-cache
Strict-Transport-Security:
@@ -54,10 +54,7 @@ interactions:
- DENY
- DENY
X-Oauth-Scopes:
- - account:read_write databases:read_write domains:read_write events:read_write
- firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write
- longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write
- volumes:read_write vpc:read_write
+ - '*'
X-Ratelimit-Limit:
- "400"
X-Xss-Protection:
@@ -75,17 +72,16 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
- url: https://api.linode.com/v4beta/account/oauth-clients
+ url: https://api.linode.com/v4beta/account/oauth-clients?page=1
method: GET
response:
- body: '{"data": [{"id": "80178debe3621b53e09b", "redirect_uri": "http://localhost:5000/auth_callback",
- "label": "oauth_test", "status": "active", "secret": "", "thumbnail_url":
- null, "public": false}, {"id": "662f47e526a88d728761", "redirect_uri": "https://localhost/oauth/callback",
- "label": "test-oauth-client-3", "status": "active", "secret": "",
- "thumbnail_url": null, "public": true}, {"id": "b3418cf8e53201b4ee30", "redirect_uri":
- "https://example.com", "label": "go-client-test", "status": "active", "secret":
- "", "thumbnail_url": null, "public": true}], "page": 1, "pages": 1,
- "results": 3}'
+ body: '{"data": [{"id": "644f910542377876eaab", "redirect_uri": "https://localhost",
+ "label": "asd", "status": "active", "secret": "", "thumbnail_url":
+ null, "public": false}, {"id": "8839550c17ba6c006e90", "redirect_uri": "http://localhost:5000/auth_callback",
+ "label": "sdf", "status": "active", "secret": "", "thumbnail_url":
+ null, "public": false}, {"id": "4a48ff5903b62d743bf0", "redirect_uri": "https://example.com",
+ "label": "go-client-test", "status": "active", "secret": "", "thumbnail_url":
+ null, "public": true}], "page": 1, "pages": 1, "results": 3}'
headers:
Access-Control-Allow-Credentials:
- "true"
@@ -102,13 +98,13 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - "621"
+ - "584"
Content-Security-Policy:
- default-src 'none'
Content-Type:
- application/json
Expires:
- - Thu, 30 May 2024 23:12:10 GMT
+ - Mon, 17 Jun 2024 19:45:26 GMT
Pragma:
- no-cache
Strict-Transport-Security:
@@ -124,10 +120,7 @@ interactions:
- DENY
- DENY
X-Oauth-Scopes:
- - account:read_write databases:read_write domains:read_write events:read_write
- firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write
- longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write
- volumes:read_write vpc:read_write
+ - '*'
X-Ratelimit-Limit:
- "400"
X-Xss-Protection:
@@ -145,7 +138,7 @@ interactions:
- application/json
User-Agent:
- linodego/dev https://github.com/linode/linodego
- url: https://api.linode.com/v4beta/account/oauth-clients/b3418cf8e53201b4ee30
+ url: https://api.linode.com/v4beta/account/oauth-clients/4a48ff5903b62d743bf0
method: DELETE
response:
body: '{}'
@@ -171,7 +164,7 @@ interactions:
Content-Type:
- application/json
Expires:
- - Thu, 30 May 2024 23:12:10 GMT
+ - Mon, 17 Jun 2024 19:45:26 GMT
Pragma:
- no-cache
Strict-Transport-Security:
@@ -186,10 +179,7 @@ interactions:
- DENY
- DENY
X-Oauth-Scopes:
- - account:read_write databases:read_write domains:read_write events:read_write
- firewall:read_write images:read_write ips:read_write linodes:read_write lke:read_write
- longview:read_write nodebalancers:read_write object_storage:read_write stackscripts:read_write
- volumes:read_write vpc:read_write
+ - '*'
X-Ratelimit-Limit:
- "400"
X-Xss-Protection:
diff --git a/test/integration/fixtures/TestPayment_GetFound.yaml b/test/integration/fixtures/TestPayment_GetFound.yaml
index 23e6d454f..8e1474f7d 100644
--- a/test/integration/fixtures/TestPayment_GetFound.yaml
+++ b/test/integration/fixtures/TestPayment_GetFound.yaml
@@ -1,61 +1,64 @@
---
version: 1
interactions:
- - request:
- body: ""
- form: {}
- headers:
- Accept:
- - application/json
- Content-Type:
- - application/json
- User-Agent:
- - linodego/dev https://github.com/linode/linodego
- url: https://api.linode.com/v4beta/account/payments
- method: GET
- response:
- body: '{"data": [{"id": 12065587, "date": "2018-01-02T03:04:05", "usd": 25.0}],
+- request:
+ body: ""
+ form: {}
+ headers:
+ Accept:
+ - application/json
+ Content-Type:
+ - application/json
+ User-Agent:
+ - linodego/dev https://github.com/linode/linodego
+ url: https://api.linode.com/v4beta/account/payments?page=1
+ method: GET
+ response:
+ body: '{"data": [{"id": 12065587, "date": "2018-01-02T03:04:05", "usd": 25.0}],
"page": 1, "pages": 1, "results": 1}'
- headers:
- Access-Control-Allow-Credentials:
- - "true"
- Access-Control-Allow-Headers:
- - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
- Access-Control-Allow-Methods:
- - HEAD, GET, OPTIONS, POST, PUT, DELETE
- Access-Control-Allow-Origin:
- - '*'
- Access-Control-Expose-Headers:
- - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
- Cache-Control:
- - private, max-age=0, s-maxage=0, no-cache, no-store
- - private, max-age=60, s-maxage=60
- Content-Length:
- - "109"
- Content-Security-Policy:
- - default-src 'none'
- Content-Type:
- - application/json
- Server:
- - nginx
- Strict-Transport-Security:
- - max-age=31536000
- Vary:
- - Authorization, X-Filter
- - Authorization, X-Filter
- X-Accepted-Oauth-Scopes:
- - account:read_only
- X-Content-Type-Options:
- - nosniff
- X-Frame-Options:
- - DENY
- - DENY
- X-Oauth-Scopes:
- - '*'
- X-Ratelimit-Limit:
- - "800"
- X-Xss-Protection:
- - 1; mode=block
- status: 200 OK
- code: 200
- duration: ""
\ No newline at end of file
+ headers:
+ Access-Control-Allow-Credentials:
+ - "true"
+ Access-Control-Allow-Headers:
+ - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
+ Access-Control-Allow-Methods:
+ - HEAD, GET, OPTIONS, POST, PUT, DELETE
+ Access-Control-Allow-Origin:
+ - '*'
+ Access-Control-Expose-Headers:
+ - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
+ Cache-Control:
+ - max-age=0, no-cache, no-store
+ Connection:
+ - keep-alive
+ Content-Length:
+ - "49"
+ Content-Security-Policy:
+ - default-src 'none'
+ Content-Type:
+ - application/json
+ Expires:
+ - Mon, 17 Jun 2024 19:36:20 GMT
+ Pragma:
+ - no-cache
+ Strict-Transport-Security:
+ - max-age=31536000
+ Vary:
+ - Authorization, X-Filter
+ - Authorization, X-Filter
+ X-Accepted-Oauth-Scopes:
+ - account:read_only
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - DENY
+ - DENY
+ X-Oauth-Scopes:
+ - '*'
+ X-Ratelimit-Limit:
+ - "400"
+ X-Xss-Protection:
+ - 1; mode=block
+ status: 200 OK
+ code: 200
+ duration: ""
diff --git a/test/integration/fixtures/TestPayments_List.yaml b/test/integration/fixtures/TestPayments_List.yaml
index f80f19d2d..acaae8383 100644
--- a/test/integration/fixtures/TestPayments_List.yaml
+++ b/test/integration/fixtures/TestPayments_List.yaml
@@ -1,61 +1,64 @@
---
version: 1
interactions:
- - request:
- body: ""
- form: {}
- headers:
- Accept:
- - application/json
- Content-Type:
- - application/json
- User-Agent:
- - linodego/dev https://github.com/linode/linodego
- url: https://api.linode.com/v4beta/account/payments
- method: GET
- response:
- body: '{"data": [{"id": 12065587, "date": "2018-01-02T03:04:05", "usd": 25.0}],
+- request:
+ body: ""
+ form: {}
+ headers:
+ Accept:
+ - application/json
+ Content-Type:
+ - application/json
+ User-Agent:
+ - linodego/dev https://github.com/linode/linodego
+ url: https://api.linode.com/v4beta/account/payments?page=1
+ method: GET
+ response:
+ body: '{"data": [{"id": 12065587, "date": "2018-01-02T03:04:05", "usd": 25.0}],
"page": 1, "pages": 1, "results": 1}'
- headers:
- Access-Control-Allow-Credentials:
- - "true"
- Access-Control-Allow-Headers:
- - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
- Access-Control-Allow-Methods:
- - HEAD, GET, OPTIONS, POST, PUT, DELETE
- Access-Control-Allow-Origin:
- - '*'
- Access-Control-Expose-Headers:
- - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
- Cache-Control:
- - private, max-age=0, s-maxage=0, no-cache, no-store
- - private, max-age=60, s-maxage=60
- Content-Length:
- - "109"
- Content-Security-Policy:
- - default-src 'none'
- Content-Type:
- - application/json
- Server:
- - nginx
- Strict-Transport-Security:
- - max-age=31536000
- Vary:
- - Authorization, X-Filter
- - Authorization, X-Filter
- X-Accepted-Oauth-Scopes:
- - account:read_only
- X-Content-Type-Options:
- - nosniff
- X-Frame-Options:
- - DENY
- - DENY
- X-Oauth-Scopes:
- - '*'
- X-Ratelimit-Limit:
- - "800"
- X-Xss-Protection:
- - 1; mode=block
- status: 200 OK
- code: 200
- duration: ""
+ headers:
+ Access-Control-Allow-Credentials:
+ - "true"
+ Access-Control-Allow-Headers:
+ - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter
+ Access-Control-Allow-Methods:
+ - HEAD, GET, OPTIONS, POST, PUT, DELETE
+ Access-Control-Allow-Origin:
+ - '*'
+ Access-Control-Expose-Headers:
+ - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status
+ Cache-Control:
+ - max-age=0, no-cache, no-store
+ Connection:
+ - keep-alive
+ Content-Length:
+ - "49"
+ Content-Security-Policy:
+ - default-src 'none'
+ Content-Type:
+ - application/json
+ Expires:
+ - Mon, 17 Jun 2024 19:44:27 GMT
+ Pragma:
+ - no-cache
+ Strict-Transport-Security:
+ - max-age=31536000
+ Vary:
+ - Authorization, X-Filter
+ - Authorization, X-Filter
+ X-Accepted-Oauth-Scopes:
+ - account:read_only
+ X-Content-Type-Options:
+ - nosniff
+ X-Frame-Options:
+ - DENY
+ - DENY
+ X-Oauth-Scopes:
+ - '*'
+ X-Ratelimit-Limit:
+ - "400"
+ X-Xss-Protection:
+ - 1; mode=block
+ status: 200 OK
+ code: 200
+ duration: ""