// itemFromSAMLConnector attempts to encode the supplied connector as an
// instance of `backend.Item` suitable for storage.
itemFromSAMLConnector attempts to encode the supplied connector as an
instance of `backend.Item` suitable for storage.
// itemFromSAMLConnector attempts to encode the supplied connector as an // instance of ` backend . Item ` suitable for storage .
func itemFromSAMLConnector(connector services.SAMLConnector) (*backend.Item, error) {
	if err := services.ValidateSAMLConnector(connector); err != nil {
		return nil, trace.Wrap(err)
	}
	value, err := services.GetSAMLConnectorMarshaler().MarshalSAMLConnector(connector)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	item := &backend.Item{
		Key:     backend.Key(webPrefix, connectorsPrefix, samlPrefix, connectorsPrefix, connector.GetName()),
		Value:   value,
		Expires: connector.Expiry(),
		ID:      connector.GetResourceID(),
	}
	return item, nil
}
func itemFromSAMLConnector ( connector services . SAMLConnector ) ( * backend . Item , error ) { if err := services . ValidateSAMLConnector ( connector ) ; err != nil { return nil , trace . Wrap ( err ) } value , err := services . GetSAMLConnectorMarshaler ( ) . MarshalSAMLConnector ( connector ) if err != nil { return nil , trace . Wrap ( err ) } item := & backend . Item { Key : backend . Key ( webPrefix , connectorsPrefix , samlPrefix , connectorsPrefix , connector . GetName ( ) ) , Value : value , Expires : connector . Expiry ( ) , ID : connector . GetResourceID ( ) , } return item , nil }
itemFromSAMLConnector attempts to encode the supplied connector as an
instance of `backend.Item` suitable for storage.
itemFromSAMLConnector attempts to encode the supplied connector as an instance of ` backend . Item ` suitable for storage .