@@ -17,7 +17,7 @@ func TestReservedIPAddress_ReserveWithTags(t *testing.T) {
1717 defer teardown ()
1818
1919 resIP , err := client .ReserveIPAddress (context .Background (), linodego.ReserveIPOptions {
20- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
20+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
2121 Tags : []string {"lb" },
2222 })
2323 if err != nil {
@@ -72,7 +72,7 @@ func TestReservedIPAddress_UpdateTags(t *testing.T) {
7272
7373 // Reserve without tags first
7474 resIP , err := client .ReserveIPAddress (context .Background (), linodego.ReserveIPOptions {
75- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
75+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
7676 })
7777 if err != nil {
7878 t .Fatalf ("Failed to reserve IP: %v" , err )
@@ -144,9 +144,9 @@ func TestReservedIPAddresses_InsufficientPermissions(t *testing.T) {
144144 defer teardown ()
145145 defer func () { validTestAPIKey = original }()
146146
147- region := getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ]
147+ region := getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ]
148148 filter := ""
149- ips , listErr := client .ListReservedIPAddresses (context .Background (), NewListOptions (0 , filter ))
149+ ips , listErr := client .ListReservedIPAddresses (context .Background (), linodego . NewListOptions (0 , filter ))
150150 if listErr == nil {
151151 t .Errorf ("Expected error due to insufficient permissions, but got none %v" , ips )
152152 } else {
@@ -158,7 +158,7 @@ func TestReservedIPAddresses_InsufficientPermissions(t *testing.T) {
158158 }
159159
160160 // Attempt to reserve an IP address
161- resIP , resErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {
161+ resIP , resErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {
162162 Region : region ,
163163 })
164164 if resErr == nil {
@@ -194,16 +194,16 @@ func TestReservedIPAddresses_EndToEndTest(t *testing.T) {
194194
195195 filter := ""
196196
197- ipList , err := client .ListReservedIPAddresses (context .Background (), NewListOptions (0 , filter ))
197+ ipList , err := client .ListReservedIPAddresses (context .Background (), linodego . NewListOptions (0 , filter ))
198198 if err != nil {
199199 t .Fatalf ("Error listing IP addresses: %v" , err )
200200 }
201201
202202 initialCount := len (ipList )
203203
204204 // Attempt to reserve an IP
205- resIP , resErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {
206- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
205+ resIP , resErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {
206+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
207207 Tags : []string {"lb" },
208208 })
209209
@@ -227,7 +227,7 @@ func TestReservedIPAddresses_EndToEndTest(t *testing.T) {
227227 }
228228
229229 // Verify the list of IPs has increased
230- verifyList , verifyErr := client .ListReservedIPAddresses (context .Background (), NewListOptions (0 , filter ))
230+ verifyList , verifyErr := client .ListReservedIPAddresses (context .Background (), linodego . NewListOptions (0 , filter ))
231231 if verifyErr != nil {
232232 t .Fatalf ("Error listing IP addresses after reservation: %v" , verifyErr )
233233 }
@@ -257,7 +257,7 @@ func TestReservedIPAddresses_EndToEndTest(t *testing.T) {
257257 t .Errorf ("Expected error when fetching %s, got nil" , resIP .Address )
258258 }
259259
260- verifyDelList , verifyDelErr := client .ListReservedIPAddresses (context .Background (), NewListOptions (0 , filter ))
260+ verifyDelList , verifyDelErr := client .ListReservedIPAddresses (context .Background (), linodego . NewListOptions (0 , filter ))
261261 if verifyDelErr != nil {
262262 t .Fatalf ("Error listing IP addresses after deletion: %v" , verifyDelErr )
263263 }
@@ -273,7 +273,7 @@ func TestReservedIPAddresses_ListIPAddressesVariants(t *testing.T) {
273273 defer teardown ()
274274
275275 expectedIPs := 2
276- region := getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ]
276+ region := getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ]
277277
278278 // Reserve two IP addresses in region
279279 reservedIPs := make ([]string , expectedIPs )
@@ -340,8 +340,8 @@ func TestReservedIPAddresses_GetIPAddressVariants(t *testing.T) {
340340 defer teardown ()
341341
342342 // Reserve an IP for testing
343- resIP , resErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {
344- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
343+ resIP , resErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {
344+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
345345 })
346346
347347 if resErr != nil {
@@ -405,27 +405,27 @@ func TestReservedIPAddresses_ReserveIPAddressVariants(t *testing.T) {
405405 defer cleanupIPs ()
406406
407407 // Test reserving IP with omitted region
408- _ , omitErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {})
408+ _ , omitErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {})
409409 if omitErr == nil {
410410 t .Errorf ("Expected error when reserving IP with omitted region, got nil" )
411411 }
412412
413413 // Test reserving IP with invalid region
414- _ , invalidErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {Region : "us" })
414+ _ , invalidErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {Region : "us" })
415415 if invalidErr == nil {
416416 t .Errorf ("Expected error when reserving IP with invalid region, got nil" )
417417 }
418418
419419 // Test reserving IP with empty region
420- _ , emptyErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {Region : "" })
420+ _ , emptyErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {Region : "" })
421421 if emptyErr == nil {
422422 t .Errorf ("Expected error when reserving IP with empty region, got nil" )
423423 }
424424
425425 // Make 2 valid IP Reservations
426426 for i := 0 ; i < 2 ; i ++ {
427427 reserveIP , err := client .ReserveIPAddress (context .Background (), linodego.ReserveIPOptions {
428- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
428+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
429429 })
430430 if err != nil {
431431 t .Fatalf ("Failed to reserve IP %d: %v" , i + 1 , err )
@@ -456,7 +456,7 @@ func TestReservedIPAddresses_ExceedLimit(t *testing.T) {
456456 // Reserve IPs until the limit is reached and assert the error message
457457 for i := 0 ; i < 100 ; i ++ {
458458 reservedIP , err := client .ReserveIPAddress (context .Background (), linodego.ReserveIPOptions {
459- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
459+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
460460 })
461461 if err != nil {
462462 expectedErrorMessage := "[400] Additional Reserved IPv4 addresses require technical justification."
@@ -481,8 +481,8 @@ func TestReservedIPAddresses_DeleteIPAddressVariants(t *testing.T) {
481481 client , teardown := createTestClient (t , "fixtures/TestReservedIPAddresses_DeleteIPAddressVariants" )
482482 defer teardown ()
483483
484- validRes , validErr := client .ReserveIPAddress (context .Background (), ReserveIPOptions {
485- Region : getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
484+ validRes , validErr := client .ReserveIPAddress (context .Background (), linodego. ReserveIPOptions {
485+ Region : getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ],
486486 })
487487 if validErr != nil {
488488 t .Fatalf ("Failed to reserve IP. This test should start with 0 reservations or reservations < limit. Error from the API: %v" , validErr )
@@ -495,7 +495,7 @@ func TestReservedIPAddresses_DeleteIPAddressVariants(t *testing.T) {
495495 t .Logf ("Successfully reserved IP: %+v" , validRes )
496496
497497 filter := ""
498- ipList , listErr := client .ListReservedIPAddresses (context .Background (), NewListOptions (0 , filter ))
498+ ipList , listErr := client .ListReservedIPAddresses (context .Background (), linodego . NewListOptions (0 , filter ))
499499 if listErr != nil {
500500 t .Fatalf ("Error listing IP addresses: %v" , listErr )
501501 }
@@ -510,7 +510,7 @@ func TestReservedIPAddresses_DeleteIPAddressVariants(t *testing.T) {
510510 }
511511
512512 // Verify deletion
513- verifyDelList , verifyDelErr := client .ListReservedIPAddresses (context .Background (), NewListOptions (0 , filter ))
513+ verifyDelList , verifyDelErr := client .ListReservedIPAddresses (context .Background (), linodego . NewListOptions (0 , filter ))
514514 if verifyDelErr != nil {
515515 t .Fatalf ("Error listing IP addresses after deletion: %v" , verifyDelErr )
516516 }
@@ -536,7 +536,7 @@ func TestReservedIPAddresses_GetIPReservationStatus(t *testing.T) {
536536 client , teardown := createTestClient (t , "fixtures/TestReservedIPAddresses_GetIPReservationStatus" )
537537 defer teardown ()
538538
539- region := getRegionsWithCaps (t , client , []string {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ]
539+ region := getRegionsWithCaps (t , client , []linodego. RegionCapability {linodego .CapabilityLinodes , linodego .CapabilityCloudFirewall })[0 ]
540540
541541 // Create a Linode with a reserved IP
542542 reservedIP , err := client .ReserveIPAddress (context .Background (), linodego.ReserveIPOptions {Region : region })
0 commit comments