Skip to content

Commit 0b3d2a8

Browse files
committed
chore: change implementation of the array whitelistAPIKeysReq
1 parent f71d72e commit 0b3d2a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mongodbatlas/whitelist_api_keys.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const whitelistAPIKeysPath = "orgs/%s/apiKeys/%s/whitelist"
1414
type WhitelistAPIKeysService interface {
1515
List(context.Context, string, string) (*WhitelistAPIKeys, *Response, error)
1616
Get(context.Context, string, string, string) (*WhitelistAPIKey, *Response, error)
17-
Create(context.Context, string, string, *[]WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error)
17+
Create(context.Context, string, string, []*WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error)
1818
Delete(context.Context, string, string, string) (*Response, error)
1919
}
2020

@@ -111,7 +111,7 @@ func (s *WhitelistAPIKeysServiceOp) Get(ctx context.Context, orgID string, apiKe
111111

112112
// Create a submit a POST request containing ipAddress or cidrBlock values which are not already present in the whitelist, Atlas adds those entries to the list of existing entries in the whitelist.
113113
// See more: https://docs.atlas.mongodb.com/reference/api/apiKeys-org-whitelist-create/
114-
func (s *WhitelistAPIKeysServiceOp) Create(ctx context.Context, orgID string, apiKeyID string, createRequest *[]WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error) {
114+
func (s *WhitelistAPIKeysServiceOp) Create(ctx context.Context, orgID string, apiKeyID string, createRequest []*WhitelistAPIKeysReq) (*WhitelistAPIKeys, *Response, error) {
115115
if orgID == "" {
116116
return nil, nil, NewArgError("orgID", "must be set")
117117
}

mongodbatlas/whitelist_api_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestWhitelistAPIKeys_Create(t *testing.T) {
170170
orgID := "ORG-ID"
171171
apiKeyID := "API-KEY-ID"
172172

173-
createRequest := &[]WhitelistAPIKeysReq{
173+
createRequest := []*WhitelistAPIKeysReq{
174174
{
175175
IPAddress: "77.54.32.11",
176176
CidrBlock: "77.54.32.11/32",

0 commit comments

Comments
 (0)