Repository: cloudflare/cloudflare-go
Pull request #3738 (2024-12-16 14:19:51)

feature: Add BYOIPv6 block id to team locations
This change adds new parameter to teams location payload. Unit tested.


Patch:
diff --git a/.changelog/3738.txt b/.changelog/3738.txt
new file mode 100644
index 000000000..4eae3579c
--- /dev/null
+++ b/.changelog/3738.txt
@@ -0,0 +1,3 @@
+```release-note:enhancement
+teams_location: add support for `dns_destination_ipv6_block_id` to the location payload
+```
diff --git a/teams_locations.go b/teams_locations.go
index 5d3402311..c15ff4552 100644
--- a/teams_locations.go
+++ b/teams_locations.go
@@ -26,18 +26,19 @@ type TeamsLocationNetwork struct {
 }
 
 type TeamsLocation struct {
-	ID                    string                 `json:"id"`
-	Name                  string                 `json:"name"`
-	Networks              []TeamsLocationNetwork `json:"networks"`
-	PolicyIDs             []string               `json:"policy_ids"`
-	Ip                    string                 `json:"ip,omitempty"`
-	Subdomain             string                 `json:"doh_subdomain"`
-	AnonymizedLogsEnabled bool                   `json:"anonymized_logs_enabled"`
-	IPv4Destination       string                 `json:"ipv4_destination"`
-	IPv4DestinationBackup string                 `json:"ipv4_destination_backup"`
-	DNSDestinationIPsID   string                 `json:"dns_destination_ips_id"`
-	ClientDefault         bool                   `json:"client_default"`
-	ECSSupport            *bool                  `json:"ecs_support,omitempty"`
+	ID                        string                 `json:"id"`
+	Name                      string                 `json:"name"`
+	Networks                  []TeamsLocationNetwork `json:"networks"`
+	PolicyIDs                 []string               `json:"policy_ids"`
+	Ip                        string                 `json:"ip,omitempty"`
+	Subdomain                 string                 `json:"doh_subdomain"`
+	AnonymizedLogsEnabled     bool                   `json:"anonymized_logs_enabled"`
+	IPv4Destination           string                 `json:"ipv4_destination"`
+	IPv4DestinationBackup     string                 `json:"ipv4_destination_backup"`
+	DNSDestinationIPsID       string                 `json:"dns_destination_ips_id"`
+	DNSDestinationIPv6BlockID string                 `json:"dns_destination_ipv6_block_id"`
+	ClientDefault             bool                   `json:"client_default"`
+	ECSSupport                *bool                  `json:"ecs_support,omitempty"`
 
 	CreatedAt *time.Time `json:"created_at,omitempty"`
 	UpdatedAt *time.Time `json:"updated_at,omitempty"`


Test patch:
diff --git a/teams_locations_test.go b/teams_locations_test.go
index 51ab7cf59..1c5c255c5 100644
--- a/teams_locations_test.go
+++ b/teams_locations_test.go
@@ -39,6 +39,7 @@ func TestTeamsLocations(t *testing.T) {
 					"ipv4_destination": "1.2.3.4",
 					"ipv4_destination_backup": "1.2.3.5",
 					"dns_destination_ips_id": "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
+					"dns_destination_ipv6_block_id": "8da8e0c9-e9cc-4bbd-85c5-b351fc373354",
 					"client_default": false,
 					"ecs_support": false,
 					"created_at": "2020-05-18T22:07:03Z",
@@ -54,20 +55,21 @@ func TestTeamsLocations(t *testing.T) {
 	updatedAt, _ := time.Parse(time.RFC3339, "2020-05-18T22:07:05Z")
 
 	want := []TeamsLocation{{
-		ID:                    "0f8185414dec4a5e9034f3d917c17890",
-		Name:                  "home",
-		Networks:              []TeamsLocationNetwork{{ID: "8e4c7835436345f0ab395429b187a076", Network: "198.51.100.1/32"}},
-		PolicyIDs:             []string{},
-		Ip:                    "2a06:98c1:54::2419",
-		Subdomain:             "q15l7x2lbw",
-		AnonymizedLogsEnabled: false,
-		IPv4Destination:       "1.2.3.4",
-		IPv4DestinationBackup: "1.2.3.5",
-		DNSDestinationIPsID:   "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
-		ClientDefault:         false,
-		ECSSupport:            BoolPtr(false),
-		CreatedAt:             &createdAt,
-		UpdatedAt:             &updatedAt,
+		ID:                        "0f8185414dec4a5e9034f3d917c17890",
+		Name:                      "home",
+		Networks:                  []TeamsLocationNetwork{{ID: "8e4c7835436345f0ab395429b187a076", Network: "198.51.100.1/32"}},
+		PolicyIDs:                 []string{},
+		Ip:                        "2a06:98c1:54::2419",
+		Subdomain:                 "q15l7x2lbw",
+		AnonymizedLogsEnabled:     false,
+		IPv4Destination:           "1.2.3.4",
+		IPv4DestinationBackup:     "1.2.3.5",
+		DNSDestinationIPsID:       "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
+		DNSDestinationIPv6BlockID: "8da8e0c9-e9cc-4bbd-85c5-b351fc373354",
+		ClientDefault:             false,
+		ECSSupport:                BoolPtr(false),
+		CreatedAt:                 &createdAt,
+		UpdatedAt:                 &updatedAt,
 	}}
 
 	mux.HandleFunc(fmt.Sprintf("/accounts/%s/gateway/locations", testAccountID), handler)