diff --git a/udr/udr.go b/udr/udr.go index fcd02eb..a79460a 100644 --- a/udr/udr.go +++ b/udr/udr.go @@ -36,6 +36,18 @@ type UDRService struct { Endpoint string } +// PostRecords takes a set of UDRRecords and posts them to the UDR endpoint +func (u *UDRService) PostRecords(records []UDRRecord) (success bool, err error) { + success = true + for _, r := range records { + success, err = u.PostRecord(r) + if !success { + return + } + } + return +} + // PostRecord takes a UDRRecord and posts it to the UDR endpoint func (u *UDRService) PostRecord(r UDRRecord) (success bool, err error) { val, _ := json.Marshal(r)