Skip to content

Commit

Permalink
prefix exported structs with Teams namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Dec 18, 2024
1 parent 7005664 commit 455002b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions teams_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ type TeamsAccountSettings struct {
ExtendedEmailMatching *TeamsExtendedEmailMatching `json:"extended_email_matching,omitempty"`
CustomCertificate *TeamsCustomCertificate `json:"custom_certificate,omitempty"`
Certificate *TeamsCertificateSetting `json:"certificate,omitempty"`
Sandbox *SandboxAccountSetting `json:"sandbox,omitempty"`
Sandbox *TeamsSandboxAccountSetting `json:"sandbox,omitempty"`
}

type SandboxAccountSetting struct {
type TeamsSandboxAccountSetting struct {
Enabled *bool `db:"enabled" json:"enabled" validate:"required"`
FallbackAction string `db:"fallback_action" json:"fallback_action" validate:"omitempty,oneof=allow block"`
}
Expand Down
52 changes: 26 additions & 26 deletions teams_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,51 @@ type TeamsLocationNetwork struct {
}

type TeamsLocation struct {
ID string `json:"id"`
Name string `json:"name"`
Networks []TeamsLocationNetwork `json:"networks"`
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"`
Endpoints *LocationEndpoints `json:"endpoints,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Networks []TeamsLocationNetwork `json:"networks"`
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"`
Endpoints *TeamsLocationEndpoints `json:"endpoints,omitempty"`

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

type LocationEndpoints struct {
IPv4Endpoint IPv4EndpointFields `json:"ipv4"`
IPv6Endpoint IPv6EndpointFields `json:"ipv6"`
DotEndpoint DotEndpointFields `json:"dot"`
DohEndpoint DohEndpointFields `json:"doh"`
type TeamsLocationEndpoints struct {
IPv4Endpoint TeamsLocationIPv4EndpointFields `json:"ipv4"`
IPv6Endpoint TeamsLocationIPv6EndpointFields `json:"ipv6"`
DotEndpoint TeamsLocationDotEndpointFields `json:"dot"`
DohEndpoint TeamsLocationDohEndpointFields `json:"doh"`
}

type IPv4EndpointFields struct {
type TeamsLocationIPv4EndpointFields struct {
Enabled bool `json:"enabled"`
AuthenticationEnabled bool `json:"authentication_enabled,omitempty"`
}

type IPv6EndpointFields struct {
EndpointFields
type TeamsLocationIPv6EndpointFields struct {
TeamsLocationEndpointFields
}

type DotEndpointFields struct {
type TeamsLocationDotEndpointFields struct {
RequireToken bool `json:"require_token"`
EndpointFields
TeamsLocationEndpointFields
}

type DohEndpointFields struct {
type TeamsLocationDohEndpointFields struct {
RequireToken bool `json:"require_token"`
EndpointFields
TeamsLocationEndpointFields
}

type EndpointFields struct {
type TeamsLocationEndpointFields struct {
Enabled bool `json:"enabled"`
AuthenticationEnabledUIHelper bool `json:"authentication_enabled,omitempty"`
Networks []TeamsLocationNetwork `json:"networks,omitempty"`
Expand Down
66 changes: 33 additions & 33 deletions teams_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ type TeamsRuleSettings struct {
DnsResolverSettings *TeamsDnsResolverSettings `json:"dns_resolvers,omitempty"`

NotificationSettings *TeamsNotificationSettings `json:"notification_settings"`
Quarantine *Quarantine `json:"quarantine,omitempty"`
ForensicCopySettings *ForensicCopySettings `json:"forensic_copy,omitempty"`
Quarantine *TeamsQuarantine `json:"quarantine,omitempty"`
ForensicCopySettings *TeamsForensicCopySettings `json:"forensic_copy,omitempty"`
}

type ForensicCopySettings struct {
type TeamsForensicCopySettings struct {
Enabled bool `json:"enabled"`
}

type Quarantine struct {
type TeamsQuarantine struct {
FileTypes []FileType `json:"file_types"`
}

Expand Down Expand Up @@ -216,43 +216,43 @@ func TeamsRulesUntrustedCertActionValues() []string {

// TeamsRule represents an Teams wirefilter rule.
type TeamsRule struct {
ID string `json:"id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Precedence uint64 `json:"precedence"`
Enabled bool `json:"enabled"`
Action TeamsGatewayAction `json:"action"`
Filters []TeamsFilterType `json:"filters"`
Traffic string `json:"traffic"`
Identity string `json:"identity"`
DevicePosture string `json:"device_posture"`
Version uint64 `json:"version"`
RuleSettings TeamsRuleSettings `json:"rule_settings,omitempty"`
Schedule *RuleSchedule `json:"schedule,omitempty"` // only available at DNS rules
Expiration *RuleExpiration `json:"expiration,omitempty"` // only available at DNS rules
ID string `json:"id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Name string `json:"name"`
Description string `json:"description"`
Precedence uint64 `json:"precedence"`
Enabled bool `json:"enabled"`
Action TeamsGatewayAction `json:"action"`
Filters []TeamsFilterType `json:"filters"`
Traffic string `json:"traffic"`
Identity string `json:"identity"`
DevicePosture string `json:"device_posture"`
Version uint64 `json:"version"`
RuleSettings TeamsRuleSettings `json:"rule_settings,omitempty"`
Schedule *TeamsRuleSchedule `json:"schedule,omitempty"` // only available at DNS rules
Expiration *TeamsRuleExpiration `json:"expiration,omitempty"` // only available at DNS rules
}

type RuleExpiration struct {
type TeamsRuleExpiration struct {
ExpiresAt *time.Time `json:"expires_at"`
Duration *uint64 `json:"duration,omitempty"` // read only
Expired bool `json:"expired"` // read only
}

// format HH:MM,HH:MM,....,HH:MM
type ScheduleTimes string

type RuleSchedule struct {
Monday ScheduleTimes `json:"mon,omitempty"`
Tuesday ScheduleTimes `json:"tue,omitempty"`
Wednesday ScheduleTimes `json:"wed,omitempty"`
Thursday ScheduleTimes `json:"thu,omitempty"`
Friday ScheduleTimes `json:"fri,omitempty"`
Saturday ScheduleTimes `json:"sat,omitempty"`
Sunday ScheduleTimes `json:"sun,omitempty"`
TimeZone string `json:"time_zone,omitempty"` // default to user TZ based on the user IP location, fall backs to colo TZ
type TeamsScheduleTimes string

type TeamsRuleSchedule struct {
Monday TeamsScheduleTimes `json:"mon,omitempty"`
Tuesday TeamsScheduleTimes `json:"tue,omitempty"`
Wednesday TeamsScheduleTimes `json:"wed,omitempty"`
Thursday TeamsScheduleTimes `json:"thu,omitempty"`
Friday TeamsScheduleTimes `json:"fri,omitempty"`
Saturday TeamsScheduleTimes `json:"sat,omitempty"`
Sunday TeamsScheduleTimes `json:"sun,omitempty"`
TimeZone string `json:"time_zone,omitempty"` // default to user TZ based on the user IP location, fall backs to colo TZ
}

// TeamsRuleResponse is the API response, containing a single rule.
Expand Down

0 comments on commit 455002b

Please sign in to comment.