//----------------------------------------------------
//
// Generated by www.easywsdl.com
// Version: 5.7.0.0
//
// Created by Quasar Development 
//
//---------------------------------------------------

import Foundation

/**
* This type represents an element with arbitrary attributes.
*/

public class EPA_FdV_AUTHN_AttributedString : NSObject ,EPA_FdV_AUTHN_ISerializableObject
{
    private var  __source:DDXMLNode? = nil
    

    var  value:String=""

	/**
	* This global attribute supports annotating arbitrary elements with an ID.
	*/
    var  Id:String=""

    public required override init()
    {
        super.init()
    }
    public func loadWithXml(__node: DDXMLElement, __request:EPA_FdV_AUTHN_RequestResultHandler)
    {
        __source=__node;

        self.value = __node.stringValue!;
        if EPA_FdV_AUTHN_Helper.hasAttribute(node: __node, name:"Id", url:"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")
        {
            self.Id = EPA_FdV_AUTHN_Helper.getAttribute(node: __node, name:"Id", url:"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")!.stringValue!
        }
    }

    public  func serialize(__parent:DDXMLElement, __request:EPA_FdV_AUTHN_RequestResultHandler)
    {
        
        __parent.stringValue = self.value;
        let __IdElement=__request.addAttribute(name: "Id", URI:"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", stringValue:"", element:__parent)
        __IdElement.stringValue = self.Id;

    }

    public   func loadProperty(__node: DDXMLElement, __request: EPA_FdV_AUTHN_RequestResultHandler ) -> Bool
    {
        if __node.localName=="value"
        {
            if EPA_FdV_AUTHN_Helper.isValue(node:__node, name: "value")
            {
                self.value = __node.stringValue!
            }
            return true;
        }
        if __node.localName=="Id"
        {
            if EPA_FdV_AUTHN_Helper.isValue(node:__node, name: "Id")
            {
                self.Id = __node.stringValue!
            }
            return true;
        }
        return false
    }
    public func getOriginalXmlSource() ->DDXMLNode? 
    {
        return __source
    }
}