// Copyright 2019-2020 UPF-N4 authors. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.

package ie

func NewCreateURR(ies ...*IE) *IE {
	return newGroupedIE(CreateURR, 0, ies)
}

// CreateURR returns the IEs above CreateURR if the type of IE matches.
func (i *IE) CreateURR() ([]*IE, error) {
	if i.Type != CreateURR {
		return nil, &InvalidTypeError{Type: i.Type}
	}
	return ParseMultiIEs(i.Payload)
}