Skip to content

Commit

Permalink
feature: Add BYOIPv6 block id to team locations
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex Scaria committed Dec 16, 2024
1 parent 6010ac2 commit aee63ec
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
25 changes: 13 additions & 12 deletions teams_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
30 changes: 16 additions & 14 deletions teams_locations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand Down

0 comments on commit aee63ec

Please sign in to comment.