From 4af2cc73e085263f1668b23e5a6e3fac17703ef1 Mon Sep 17 00:00:00 2001 From: Anirudh Jagadish Date: Mon, 18 Nov 2024 15:18:44 -0500 Subject: [PATCH] Changed struct name from LinodeReserveIPOptions to AllocateReserveIPOptions --- network_ips.go | 4 ++-- test/integration/network_ips_test.go | 30 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/network_ips.go b/network_ips.go index d64a01ae9..ad622cdf8 100644 --- a/network_ips.go +++ b/network_ips.go @@ -17,7 +17,7 @@ type LinodeIPAssignment struct { LinodeID int `json:"linode_id"` } -type LinodeReserveIPOptions struct { +type AllocateReserveIPOptions struct { Type string `json:"type"` Public bool `json:"public"` Reserved bool `json:"reserved,omitempty"` @@ -100,7 +100,7 @@ func (c *Client) ShareIPAddresses(ctx context.Context, opts IPAddressesShareOpti // AllocateReserveIP allocates a new IPv4 address to the Account, with the option to reserve it // and optionally assign it to a Linode. -func (c *Client) AllocateReserveIP(ctx context.Context, opts LinodeReserveIPOptions) (*InstanceIP, error) { +func (c *Client) AllocateReserveIP(ctx context.Context, opts AllocateReserveIPOptions) (*InstanceIP, error) { e := "networking/ips" result, err := doPOSTRequest[InstanceIP](ctx, c, e, opts) if err != nil { diff --git a/test/integration/network_ips_test.go b/test/integration/network_ips_test.go index 00b0d9ef0..4dc93c472 100644 --- a/test/integration/network_ips_test.go +++ b/test/integration/network_ips_test.go @@ -517,7 +517,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 1: Valid request - opts := LinodeReserveIPOptions{ + opts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true, @@ -534,7 +534,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { } // Scenario 2: Non-owned Linode - nonOwnedLinodeOpts := LinodeReserveIPOptions{ + nonOwnedLinodeOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true, @@ -548,7 +548,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 3: Omit Linode ID - omitLinodeIDOpts := LinodeReserveIPOptions{ + omitLinodeIDOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true, @@ -564,7 +564,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 4: Account at reserved IP limit - resLimitoOpts := linodego.LinodeReserveIPOptions{ + resLimitoOpts := linodego.AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true, @@ -581,7 +581,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // // Scenario 5: Linode at IPMax limit - // opts = linodego.LinodeReserveIPOptions{ + // opts = linodego.AllocateReserveIPOptions{ // Type: "ipv4", // Public: true, // Reserved: true, @@ -595,7 +595,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 6: Omit Region - omitRegionOpts := LinodeReserveIPOptions{ + omitRegionOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true, @@ -614,7 +614,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 7: Omit both Region and Linode ID - omitRegionAndLinodeIDopts := LinodeReserveIPOptions{ + omitRegionAndLinodeIDopts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true, @@ -627,7 +627,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 8: Reserved true, Public false - publicFalseOpts := LinodeReserveIPOptions{ + publicFalseOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: false, Reserved: true, @@ -641,7 +641,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 9: Reserved false - reservedFalseOpts := LinodeReserveIPOptions{ + reservedFalseOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: false, @@ -660,7 +660,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 10: Omit Reserved field - omitReservedOpts := LinodeReserveIPOptions{ + omitReservedOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Region: instance.Region, @@ -678,7 +678,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 11: Omit Linode ID, Reserved false - omitOpts := LinodeReserveIPOptions{ + omitOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: false, @@ -691,7 +691,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 12: Omit Linode ID and Reserved fields - omitIDResopts := LinodeReserveIPOptions{ + omitIDResopts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Region: instance.Region, @@ -703,7 +703,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 13: Reserved true, Type IPv6 - typeIPv6opts := LinodeReserveIPOptions{ + typeIPv6opts := AllocateReserveIPOptions{ Type: "ipv6", Public: true, Reserved: true, @@ -717,7 +717,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 14: Reserved false, Type IPv6 - resFalseIPv6opts := LinodeReserveIPOptions{ + resFalseIPv6opts := AllocateReserveIPOptions{ Type: "ipv6", Public: true, Reserved: false, @@ -731,7 +731,7 @@ func TestIPAddress_Instance_Allocate(t *testing.T) { // Scenario 15: Region mismatch - regionMismatchOpts := LinodeReserveIPOptions{ + regionMismatchOpts := AllocateReserveIPOptions{ Type: "ipv4", Public: true, Reserved: true,