Skip to content

Commit 908c053

Browse files
INTMDB-173: Update the path of AccessListAPIKeys service (#178)
1 parent 0c9dbf6 commit 908c053

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

mongodbatlas/accesslist_api_keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"net/http"
2121
)
2222

23-
const accessListAPIKeysPath = "orgs/%s/apiKeys/%s/accesslist"
23+
const accessListAPIKeysPath = "orgs/%s/apiKeys/%s/accessList"
2424

2525
// AccessListAPIKeysService is an interface for interfacing with the AccessList API Keys
2626
// endpoints of the MongoDB Atlas API.

mongodbatlas/accesslist_api_keys_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestAccessListAPIKeys_List(t *testing.T) {
3535
fmt.Fprint(w, `{
3636
"links": [
3737
{
38-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accesslist/?pretty=true&pageNum=1&itemsPerPage=100",
38+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accessList/?pretty=true&pageNum=1&itemsPerPage=100",
3939
"rel": "self"
4040
}
4141
],
@@ -49,7 +49,7 @@ func TestAccessListAPIKeys_List(t *testing.T) {
4949
"lastUsedAddress": "147.58.184.16",
5050
"links": [
5151
{
52-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/147.58.184.16",
52+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/147.58.184.16",
5353
"rel": "self"
5454
}
5555
]
@@ -63,7 +63,7 @@ func TestAccessListAPIKeys_List(t *testing.T) {
6363
"lastUsedAddress": "84.255.48.125",
6464
"links": [
6565
{
66-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/206.252.195.126",
66+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/206.252.195.126",
6767
"rel": "self"
6868
}
6969
]
@@ -81,7 +81,7 @@ func TestAccessListAPIKeys_List(t *testing.T) {
8181
expected := &AccessListAPIKeys{
8282
Links: []*Link{
8383
{
84-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accesslist/?pretty=true&pageNum=1&itemsPerPage=100",
84+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accessList/?pretty=true&pageNum=1&itemsPerPage=100",
8585
Rel: "self",
8686
},
8787
},
@@ -95,7 +95,7 @@ func TestAccessListAPIKeys_List(t *testing.T) {
9595
LastUsedAddress: "147.58.184.16",
9696
Links: []*Link{
9797
{
98-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/147.58.184.16",
98+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/147.58.184.16",
9999
Rel: "self",
100100
},
101101
},
@@ -109,7 +109,7 @@ func TestAccessListAPIKeys_List(t *testing.T) {
109109
LastUsedAddress: "84.255.48.125",
110110
Links: []*Link{
111111
{
112-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/206.252.195.126",
112+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/206.252.195.126",
113113
Rel: "self",
114114
},
115115
},
@@ -140,14 +140,14 @@ func TestAccessListAPIKeys_Get(t *testing.T) {
140140
"ipAddress": "147.58.184.16",
141141
"links": [
142142
{
143-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/147.58.184.16",
143+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/147.58.184.16",
144144
"rel": "self"
145145
}
146146
]
147147
}`)
148148
})
149149

150-
accesslistAPIKey, _, err := client.AccessListAPIKeys.Get(ctx, orgID, apiKeyID, ipAddress)
150+
accessListAPIKey, _, err := client.AccessListAPIKeys.Get(ctx, orgID, apiKeyID, ipAddress)
151151
if err != nil {
152152
t.Fatalf("AccessListAPIKeys.Get returned error: %v", err)
153153
}
@@ -159,13 +159,13 @@ func TestAccessListAPIKeys_Get(t *testing.T) {
159159
IPAddress: "147.58.184.16",
160160
Links: []*Link{
161161
{
162-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/147.58.184.16",
162+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/147.58.184.16",
163163
Rel: "self",
164164
},
165165
},
166166
}
167167

168-
if diff := deep.Equal(accesslistAPIKey, expected); diff != nil {
168+
if diff := deep.Equal(accessListAPIKey, expected); diff != nil {
169169
t.Error(diff)
170170
}
171171
}
@@ -205,7 +205,7 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
205205
fmt.Fprint(w, `{
206206
"links": [
207207
{
208-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accesslist/?pretty=true&pageNum=1&itemsPerPage=100",
208+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accessList/?pretty=true&pageNum=1&itemsPerPage=100",
209209
"rel": "self"
210210
}
211211
],
@@ -219,7 +219,7 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
219219
"lastUsedAddress": "147.58.184.16",
220220
"links": [
221221
{
222-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/147.58.184.16",
222+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/147.58.184.16",
223223
"rel": "self"
224224
}
225225
]
@@ -233,7 +233,7 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
233233
"lastUsedAddress": "77.54.32.11",
234234
"links": [
235235
{
236-
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/77.54.32.11",
236+
"href": "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/77.54.32.11",
237237
"rel": "self"
238238
}
239239
]
@@ -243,15 +243,15 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
243243
}`)
244244
})
245245

246-
accesslistAPIKey, _, err := client.AccessListAPIKeys.Create(ctx, orgID, apiKeyID, createRequest)
246+
accessListAPIKey, _, err := client.AccessListAPIKeys.Create(ctx, orgID, apiKeyID, createRequest)
247247
if err != nil {
248248
t.Fatalf("AccessListAPIKeys.Create returned error: %v", err)
249249
}
250250

251251
expected := &AccessListAPIKeys{
252252
Links: []*Link{
253253
{
254-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accesslist/?pretty=true&pageNum=1&itemsPerPage=100",
254+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/599c510c80eef518f3b63fe1/apiKeys/5c49e72980eef544a218f8f8/accessList/?pretty=true&pageNum=1&itemsPerPage=100",
255255
Rel: "self",
256256
},
257257
},
@@ -265,7 +265,7 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
265265
LastUsedAddress: "147.58.184.16",
266266
Links: []*Link{
267267
{
268-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/147.58.184.16",
268+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/147.58.184.16",
269269
Rel: "self",
270270
},
271271
},
@@ -279,7 +279,7 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
279279
LastUsedAddress: "77.54.32.11",
280280
Links: []*Link{
281281
{
282-
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist/77.54.32.11",
282+
Href: "https://cloud.mongodb.com/api/atlas/v1.0/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accessList/77.54.32.11",
283283
Rel: "self",
284284
},
285285
},
@@ -288,7 +288,7 @@ func TestAccessListAPIKeys_Create(t *testing.T) {
288288
TotalCount: 2,
289289
}
290290

291-
if diff := deep.Equal(accesslistAPIKey, expected); diff != nil {
291+
if diff := deep.Equal(accessListAPIKey, expected); diff != nil {
292292
t.Error(diff)
293293
}
294294
}

0 commit comments

Comments
 (0)