@@ -38,11 +38,16 @@ type TeamsConfiguration struct {
3838}
3939
4040type TeamsAccountSettings struct {
41- Antivirus * TeamsAntivirus `json:"antivirus,omitempty"`
42- TLSDecrypt * TeamsTLSDecrypt `json:"tls_decrypt,omitempty"`
43- ActivityLog * TeamsActivityLog `json:"activity_log,omitempty"`
44- BlockPage * TeamsBlockPage `json:"block_page,omitempty"`
45- FIPS * TeamsFIPS `json:"fips,omitempty"`
41+ Antivirus * TeamsAntivirus `json:"antivirus,omitempty"`
42+ TLSDecrypt * TeamsTLSDecrypt `json:"tls_decrypt,omitempty"`
43+ ActivityLog * TeamsActivityLog `json:"activity_log,omitempty"`
44+ BlockPage * TeamsBlockPage `json:"block_page,omitempty"`
45+ BrowserIsolation * BrowserIsolation `json:"browser_isolation,omitempty"`
46+ FIPS * TeamsFIPS `json:"fips,omitempty"`
47+ }
48+
49+ type BrowserIsolation struct {
50+ UrlBrowserIsolationEnabled bool `json:"url_browser_isolation_enabled"`
4651}
4752
4853type TeamsAntivirus struct {
@@ -72,6 +77,29 @@ type TeamsBlockPage struct {
7277 Name string `json:"name,omitempty"`
7378}
7479
80+ type TeamsRuleType = string
81+
82+ const (
83+ TeamsHttpRuleType TeamsRuleType = "http"
84+ TeamsDnsRuleType TeamsRuleType = "dns"
85+ TeamsL4RuleType TeamsRuleType = "l4"
86+ )
87+
88+ type TeamsAccountLoggingConfiguration struct {
89+ LogAll bool `json:"log_all"`
90+ LogBlocks bool `json:"log_blocks"`
91+ }
92+
93+ type TeamsLoggingSettings struct {
94+ LoggingSettingsByRuleType map [TeamsRuleType ]TeamsAccountLoggingConfiguration `json:"settings_by_rule_type"`
95+ RedactPii bool `json:"redact_pii,omitempty"`
96+ }
97+
98+ type TeamsLoggingSettingsResponse struct {
99+ Response
100+ Result TeamsLoggingSettings `json:"result"`
101+ }
102+
75103// TeamsAccount returns teams account information with internal and external ID.
76104//
77105// API reference: TBA.
@@ -112,6 +140,26 @@ func (api *API) TeamsAccountConfiguration(ctx context.Context, accountID string)
112140 return teamsConfigResponse .Result , nil
113141}
114142
143+ // TeamsAccountLoggingConfiguration returns teams account logging configuration.
144+ //
145+ // API reference: TBA.
146+ func (api * API ) TeamsAccountLoggingConfiguration (ctx context.Context , accountID string ) (TeamsLoggingSettings , error ) {
147+ uri := fmt .Sprintf ("/accounts/%s/gateway/logging" , accountID )
148+
149+ res , err := api .makeRequestContext (ctx , http .MethodGet , uri , nil )
150+ if err != nil {
151+ return TeamsLoggingSettings {}, err
152+ }
153+
154+ var teamsConfigResponse TeamsLoggingSettingsResponse
155+ err = json .Unmarshal (res , & teamsConfigResponse )
156+ if err != nil {
157+ return TeamsLoggingSettings {}, errors .Wrap (err , errUnmarshalError )
158+ }
159+
160+ return teamsConfigResponse .Result , nil
161+ }
162+
115163// TeamsAccountUpdateConfiguration updates a teams account configuration.
116164//
117165// API reference: TBA.
@@ -131,3 +179,23 @@ func (api *API) TeamsAccountUpdateConfiguration(ctx context.Context, accountID s
131179
132180 return teamsConfigResponse .Result , nil
133181}
182+
183+ // TeamsAccountUpdateLoggingConfiguration updates the log settings and returns new teams account logging configuration.
184+ //
185+ // API reference: TBA.
186+ func (api * API ) TeamsAccountUpdateLoggingConfiguration (ctx context.Context , accountID string , config TeamsLoggingSettings ) (TeamsLoggingSettings , error ) {
187+ uri := fmt .Sprintf ("/accounts/%s/gateway/logging" , accountID )
188+
189+ res , err := api .makeRequestContext (ctx , http .MethodPut , uri , config )
190+ if err != nil {
191+ return TeamsLoggingSettings {}, err
192+ }
193+
194+ var teamsConfigResponse TeamsLoggingSettingsResponse
195+ err = json .Unmarshal (res , & teamsConfigResponse )
196+ if err != nil {
197+ return TeamsLoggingSettings {}, errors .Wrap (err , errUnmarshalError )
198+ }
199+
200+ return teamsConfigResponse .Result , nil
201+ }
0 commit comments