MCPcopy Create free account
hub / github.com/crewjam/saml / Element

Method Element

schema.go:959–977  ·  view source on GitHub ↗

Element returns an etree.Element representing the object in XML form.

()

Source from the content-addressed store, hash-verified

957
958// Element returns an etree.Element representing the object in XML form.
959func (c *Conditions) Element() *etree.Element {
960 el := etree.NewElement("saml:Conditions")
961 if !c.NotBefore.IsZero() {
962 el.CreateAttr("NotBefore", c.NotBefore.Format(timeFormat))
963 }
964 if !c.NotOnOrAfter.IsZero() {
965 el.CreateAttr("NotOnOrAfter", c.NotOnOrAfter.Format(timeFormat))
966 }
967 for _, v := range c.AudienceRestrictions {
968 el.AddChild(v.Element())
969 }
970 if c.OneTimeUse != nil {
971 el.AddChild(c.OneTimeUse.Element())
972 }
973 if c.ProxyRestriction != nil {
974 el.AddChild(c.ProxyRestriction.Element())
975 }
976 return el
977}
978
979// MarshalXML implements xml.Marshaler
980func (c *Conditions) MarshalXML(e *xml.Encoder, start xml.StartElement) error {

Callers

nothing calls this directly

Calls 1

ElementMethod · 0.45

Tested by

no test coverage detected