# # This code was generated by Enunciate. # http://enunciate.codehaus.org/ # require 'json' # adding necessary json serialization methods to standard classes. class Object def to_jaxb_json_hash return self end def self.from_json o return o end end class String def self.from_json o return o end end class Boolean def self.from_json o return o end end class Numeric def self.from_json o return o end end class Time #json time is represented as number of milliseconds since epoch def to_jaxb_json_hash return (to_i * 1000) + (usec / 1000) end def self.from_json o if o.nil? return nil else return Time.at(o / 1000, (o % 1000) * 1000) end end end class Array def to_jaxb_json_hash a = Array.new each { | _item | a.push _item.to_jaxb_json_hash } return a end end module Org module Familysearch module Ws module Identity module V2a module Schema # class Session # session id. attr_accessor :id # session values. attr_accessor :values # the json hash for this Session def to_jaxb_json_hash _h = {} _h['id'] = id.to_jaxb_json_hash unless id.nil? if !values.nil? _ha = Array.new values.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['values'] = _ha end return _h end # the json (string form) for this Session def to_json to_jaxb_json_hash.to_json end #initializes this Session with a json hash def init_jaxb_json_hash(_o) @id = String.from_json(_o['id']) unless _o['id'].nil? if !_o['values'].nil? @values = Array.new _oa = _o['values'] _oa.each { | _item | @values.push Org::Familysearch::Ws::Identity::V2a::Schema::SessionValue.from_json(_item) } end end # constructs a Session from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class Authentication # authentication status. attr_accessor :status # authentication resolution URI. attr_accessor :resolutionUri # the json hash for this Authentication def to_jaxb_json_hash _h = {} _h['status'] = status.to_jaxb_json_hash unless status.nil? _h['resolutionUri'] = resolutionUri.to_jaxb_json_hash unless resolutionUri.nil? return _h end # the json (string form) for this Authentication def to_json to_jaxb_json_hash.to_json end #initializes this Authentication with a json hash def init_jaxb_json_hash(_o) @status = String.from_json(_o['status']) unless _o['status'].nil? @resolutionUri = String.from_json(_o['resolutionUri']) unless _o['resolutionUri'].nil? end # constructs a Authentication from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class User # (no documentation provided) attr_accessor :id # (no documentation provided) attr_accessor :displayName # (no documentation provided) attr_accessor :email # the json hash for this User def to_jaxb_json_hash _h = {} _h['id'] = id.to_jaxb_json_hash unless id.nil? _h['displayName'] = displayName.to_jaxb_json_hash unless displayName.nil? _h['email'] = email.to_jaxb_json_hash unless email.nil? return _h end # the json (string form) for this User def to_json to_jaxb_json_hash.to_json end #initializes this User with a json hash def init_jaxb_json_hash(_o) @id = String.from_json(_o['id']) unless _o['id'].nil? @displayName = String.from_json(_o['displayName']) unless _o['displayName'].nil? @email = String.from_json(_o['email']) unless _o['email'].nil? end # constructs a User from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class SessionValue # session value name. attr_accessor :name # session value value. attr_accessor :value # the json hash for this SessionValue def to_jaxb_json_hash _h = {} _h['name'] = name.to_jaxb_json_hash unless name.nil? _h['value'] = value.to_jaxb_json_hash unless value.nil? return _h end # the json (string form) for this SessionValue def to_json to_jaxb_json_hash.to_json end #initializes this SessionValue with a json hash def init_jaxb_json_hash(_o) @name = String.from_json(_o['name']) unless _o['name'].nil? @value = String.from_json(_o['value']) unless _o['value'].nil? end # constructs a SessionValue from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V1 module Schema # A identity session. class Session # The id of the session. attr_accessor :id # the json hash for this Session def to_jaxb_json_hash _h = {} _h['id'] = id.to_jaxb_json_hash unless id.nil? return _h end # the json (string form) for this Session def to_json to_jaxb_json_hash.to_json end #initializes this Session with a json hash def init_jaxb_json_hash(_o) @id = String.from_json(_o['id']) unless _o['id'].nil? end # constructs a Session from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module V1 # class BasicProperty # (no documentation provided) attr_accessor :name # (no documentation provided) attr_accessor :value # the json hash for this BasicProperty def to_jaxb_json_hash _h = {} _h['name'] = name.to_jaxb_json_hash unless name.nil? _h['value'] = value.to_jaxb_json_hash unless value.nil? return _h end # the json (string form) for this BasicProperty def to_json to_jaxb_json_hash.to_json end #initializes this BasicProperty with a json hash def init_jaxb_json_hash(_o) @name = String.from_json(_o['name']) unless _o['name'].nil? @value = String.from_json(_o['value']) unless _o['value'].nil? end # constructs a BasicProperty from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class AuthenticationStatus # (no documentation provided) Success = "Success" # (no documentation provided) Failure = "Failure" # (no documentation provided) Resolution_Required = "Resolution_Required" # (no documentation provided) Invalid_Key = "Invalid_Key" # (no documentation provided) Other = "Other" end end end end end end end module Org module Familysearch module Ws module V1 # class ErrorLevel # (no documentation provided) Info = "Info" # (no documentation provided) Warn = "Warn" # (no documentation provided) Error = "Error" end end end end end module Org module Familysearch module Ws module V1 # class BasicError # (no documentation provided) attr_accessor :level # (no documentation provided) attr_accessor :subcode # (no documentation provided) attr_accessor :code # (no documentation provided) attr_accessor :message # (no documentation provided) attr_accessor :details # the json hash for this BasicError def to_jaxb_json_hash _h = {} _h['level'] = level.to_jaxb_json_hash unless level.nil? _h['subcode'] = subcode.to_jaxb_json_hash unless subcode.nil? _h['code'] = code.to_jaxb_json_hash unless code.nil? _h['message'] = message.to_jaxb_json_hash unless message.nil? _h['details'] = details.to_jaxb_json_hash unless details.nil? return _h end # the json (string form) for this BasicError def to_json to_jaxb_json_hash.to_json end #initializes this BasicError with a json hash def init_jaxb_json_hash(_o) @level = String.from_json(_o['level']) unless _o['level'].nil? @subcode = Fixnum.from_json(_o['subcode']) unless _o['subcode'].nil? @code = Fixnum.from_json(_o['code']) unless _o['code'].nil? @message = String.from_json(_o['message']) unless _o['message'].nil? @details = String.from_json(_o['details']) unless _o['details'].nil? end # constructs a BasicError from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end module Org module Familysearch module Ws module V1 # class BasicElement # (no documentation provided) attr_accessor :statusCode # (no documentation provided) attr_accessor :deprecated # (no documentation provided) attr_accessor :statusMessage # (no documentation provided) attr_accessor :version # (no documentation provided) attr_accessor :properties # (no documentation provided) attr_accessor :errors # the json hash for this BasicElement def to_jaxb_json_hash _h = {} _h['statusCode'] = statusCode.to_jaxb_json_hash unless statusCode.nil? _h['deprecated'] = deprecated.to_jaxb_json_hash unless deprecated.nil? _h['statusMessage'] = statusMessage.to_jaxb_json_hash unless statusMessage.nil? _h['version'] = version.to_jaxb_json_hash unless version.nil? if !properties.nil? _ha = Array.new properties.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['properties'] = _ha end if !errors.nil? _ha = Array.new errors.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['errors'] = _ha end return _h end # the json (string form) for this BasicElement def to_json to_jaxb_json_hash.to_json end #initializes this BasicElement with a json hash def init_jaxb_json_hash(_o) @statusCode = Fixnum.from_json(_o['statusCode']) unless _o['statusCode'].nil? @deprecated = Boolean.from_json(_o['deprecated']) unless _o['deprecated'].nil? @statusMessage = String.from_json(_o['statusMessage']) unless _o['statusMessage'].nil? @version = String.from_json(_o['version']) unless _o['version'].nil? if !_o['properties'].nil? @properties = Array.new _oa = _o['properties'] _oa.each { | _item | @properties.push Org::Familysearch::Ws::V1::BasicProperty.from_json(_item) } end if !_o['errors'].nil? @errors = Array.new _oa = _o['errors'] _oa.each { | _item | @errors.push Org::Familysearch::Ws::V1::BasicError.from_json(_item) } end end # constructs a BasicElement from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class IdentityStatus # (no documentation provided) attr_accessor :code # (no documentation provided) attr_accessor :subcode # (no documentation provided) attr_accessor :message # (no documentation provided) attr_accessor :details # the json hash for this IdentityStatus def to_jaxb_json_hash _h = {} _h['code'] = code.to_jaxb_json_hash unless code.nil? _h['subcode'] = subcode.to_jaxb_json_hash unless subcode.nil? _h['message'] = message.to_jaxb_json_hash unless message.nil? _h['details'] = details.to_jaxb_json_hash unless details.nil? return _h end # the json (string form) for this IdentityStatus def to_json to_jaxb_json_hash.to_json end #initializes this IdentityStatus with a json hash def init_jaxb_json_hash(_o) @code = Fixnum.from_json(_o['code']) unless _o['code'].nil? @subcode = Fixnum.from_json(_o['subcode']) unless _o['subcode'].nil? @message = String.from_json(_o['message']) unless _o['message'].nil? @details = String.from_json(_o['details']) unless _o['details'].nil? end # constructs a IdentityStatus from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class IdentityProperty # (no documentation provided) attr_accessor :name # (no documentation provided) attr_accessor :value # the json hash for this IdentityProperty def to_jaxb_json_hash _h = {} _h['name'] = name.to_jaxb_json_hash unless name.nil? _h['value'] = value.to_jaxb_json_hash unless value.nil? return _h end # the json (string form) for this IdentityProperty def to_json to_jaxb_json_hash.to_json end #initializes this IdentityProperty with a json hash def init_jaxb_json_hash(_o) @name = String.from_json(_o['name']) unless _o['name'].nil? @value = String.from_json(_o['value']) unless _o['value'].nil? end # constructs a IdentityProperty from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V1 module Schema # class Identity < Org::Familysearch::Ws::V1::BasicElement # The session associated with the identity. attr_accessor :session # the json hash for this Identity def to_jaxb_json_hash _h = super _h['session'] = session.to_jaxb_json_hash unless session.nil? return _h end #initializes this Identity with a json hash def init_jaxb_json_hash(_o) super _o @session = Org::Familysearch::Ws::Identity::V1::Schema::Session.from_json(_o['session']) unless _o['session'].nil? end # constructs a Identity from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end module Org module Familysearch module Ws module Identity module V2a module Schema # class Identity # (no documentation provided) attr_accessor :statusCode # (no documentation provided) attr_accessor :deprecated # (no documentation provided) attr_accessor :statusMessage # (no documentation provided) attr_accessor :version # authentication information. attr_accessor :authentication # session information. attr_accessor :session # The status list. attr_accessor :status # users. attr_accessor :users # The properties. attr_accessor :properties # the json hash for this Identity def to_jaxb_json_hash _h = {} _h['statusCode'] = statusCode.to_jaxb_json_hash unless statusCode.nil? _h['deprecated'] = deprecated.to_jaxb_json_hash unless deprecated.nil? _h['statusMessage'] = statusMessage.to_jaxb_json_hash unless statusMessage.nil? _h['version'] = version.to_jaxb_json_hash unless version.nil? _h['authentication'] = authentication.to_jaxb_json_hash unless authentication.nil? _h['session'] = session.to_jaxb_json_hash unless session.nil? if !status.nil? _ha = Array.new status.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['status'] = _ha end if !users.nil? _ha = Array.new users.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['users'] = _ha end if !properties.nil? _ha = Array.new properties.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['properties'] = _ha end return _h end # the json (string form) for this Identity def to_json to_jaxb_json_hash.to_json end #initializes this Identity with a json hash def init_jaxb_json_hash(_o) @statusCode = Fixnum.from_json(_o['statusCode']) unless _o['statusCode'].nil? @deprecated = Boolean.from_json(_o['deprecated']) unless _o['deprecated'].nil? @statusMessage = String.from_json(_o['statusMessage']) unless _o['statusMessage'].nil? @version = String.from_json(_o['version']) unless _o['version'].nil? @authentication = Org::Familysearch::Ws::Identity::V2a::Schema::Authentication.from_json(_o['authentication']) unless _o['authentication'].nil? @session = Org::Familysearch::Ws::Identity::V2a::Schema::Session.from_json(_o['session']) unless _o['session'].nil? if !_o['status'].nil? @status = Array.new _oa = _o['status'] _oa.each { | _item | @status.push Org::Familysearch::Ws::Identity::V2a::Schema::IdentityStatus.from_json(_item) } end if !_o['users'].nil? @users = Array.new _oa = _o['users'] _oa.each { | _item | @users.push Org::Familysearch::Ws::Identity::V2a::Schema::User.from_json(_item) } end if !_o['properties'].nil? @properties = Array.new _oa = _o['properties'] _oa.each { | _item | @properties.push Org::Familysearch::Ws::Identity::V2a::Schema::IdentityProperty.from_json(_item) } end end # constructs a Identity from a (parsed) JSON hash def self.from_json(o) if o.nil? return nil else inst = new inst.init_jaxb_json_hash o return inst end end end end end end end end end