Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

ngs-archives/go-google-email-audit-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

17 Commits

Repository files navigation

go-google-email-audit-api

Build StatusGoDocGo Report CardCoverage Status

Go Client Library for Google Email Audit API

go get -u github.com/ngs/go-google-email-audit-api/emailaudit

Email Monitor API

import ( // ..."github.com/ngs/go-google-email-audit-api/emailaudit" ) funcmain(){// ...srv, err:=emailaudit.New(client) // client = http.Clientiferr!=nil{log.Fatalf("Unable to retrieve Email Audit API Client %v", err) } endDate:=time.Date(2116, time.October, 31, 23, 59, 59, 0, time.UTC) // Create or update Email Monitormonitor, err:=srv.MailMonitor.Update("example.com", "ngs", "kyohei", endDate, emailaudit.MailMonitorLevels{IncomingEmail: emailaudit.FullMessageLevel, OutgoingEmail: emailaudit.FullMessageLevel, Draft: emailaudit.FullMessageLevel, Chat: emailaudit.FullMessageLevel, }, ) iferr!=nil{log.Fatalf("Unable to update email monitor. %v", err) } // List Email Monitorsmonitors, err:=srv.MailMonitor.List("example.com", "ngs") iferr!=nil{log.Fatalf("Unable to list email monitor. %v", err) } for_, m:=rangemonitors{fmt.Printf("%v %v@%v chat:%v draft:%v incoming:%v outgoing:%v\n", m.Updated, m.DestUserName, m.DomainName, m.MonitorLevels.Chat, m.MonitorLevels.Draft, m.MonitorLevels.IncomingEmail, m.MonitorLevels.OutgoingEmail) } // Disable Email Monitorerr=srv.MailMonitor.Disable("example.com", "ngs", "kyohei") iferr!=nil{log.Fatalf("Unable to disable email monitor. %v", err) } }

Mailbox Download

Not yet implemented

Author

Atsushi Nagase

License

See LICENSE

About

Go Client Library for G Suite Email Audit API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages