Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make teams location params optional #3758

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3758.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_location: make location parameters optional
```
13 changes: 6 additions & 7 deletions teams_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ type TeamsLocation struct {
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"`
IPv4Destination string `json:"ipv4_destination,omitempty"`
IPv4DestinationBackup string `json:"ipv4_destination_backup,omitempty"`
DNSDestinationIPsID *string `json:"dns_destination_ips_id,omitempty"`
DNSDestinationIPv6BlockID *string `json:"dns_destination_ipv6_block_id,omitempty"`
ClientDefault bool `json:"client_default"`
ECSSupport *bool `json:"ecs_support,omitempty"`
Endpoints *TeamsLocationEndpoints `json:"endpoints,omitempty"`

CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type TeamsLocationEndpoints struct {
Expand Down
6 changes: 4 additions & 2 deletions teams_locations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func TestTeamsLocations(t *testing.T) {
createdAt, _ := time.Parse(time.RFC3339, "2020-05-18T22:07:03Z")
updatedAt, _ := time.Parse(time.RFC3339, "2020-05-18T22:07:05Z")

ipv4Id := "9da8e0c9-e9cc-4bbd-85c5-b351fc373354"
ipv6Id := "8da8e0c9-e9cc-4bbd-85c5-b351fc373354"
want := []TeamsLocation{{
ID: "0f8185414dec4a5e9034f3d917c17890",
Name: "home",
Expand All @@ -63,8 +65,8 @@ func TestTeamsLocations(t *testing.T) {
AnonymizedLogsEnabled: false,
IPv4Destination: "1.2.3.4",
IPv4DestinationBackup: "1.2.3.5",
DNSDestinationIPsID: "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
DNSDestinationIPv6BlockID: "8da8e0c9-e9cc-4bbd-85c5-b351fc373354",
DNSDestinationIPsID: &ipv4Id,
DNSDestinationIPv6BlockID: &ipv6Id,
ClientDefault: false,
ECSSupport: BoolPtr(false),
CreatedAt: &createdAt,
Expand Down
Loading