Class: DocuSign_WebForms::OAuth::UserInfo
- Inherits:
-
Object
- Object
- DocuSign_WebForms::OAuth::UserInfo
- Defined in:
- lib/docusign_webforms/client/auth/oauth.rb
Instance Attribute Summary collapse
-
#accounts ⇒ Object
Returns the value of attribute accounts.
-
#created ⇒ Object
Returns the value of attribute created.
-
#email ⇒ Object
Returns the value of attribute email.
-
#error_details ⇒ Object
Returns the value of attribute error_details.
-
#family_name ⇒ Object
Returns the value of attribute family_name.
-
#given_name ⇒ Object
Returns the value of attribute given_name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sub ⇒ Object
Returns the value of attribute sub.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ UserInfo
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ UserInfo
Initializes the object
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 871 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'sub') self.sub = attributes[:'sub'] end if attributes.has_key?(:'email') self.email = attributes[:'email'] end if attributes.has_key?(:'errorDetails') self.error_details = attributes[:'errorDetails'] end if attributes.has_key?(:'accounts') if (value = attributes[:'accounts']).is_a?(Array) self.accounts = value end end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'givenName') self.given_name = attributes[:'givenName'] end if attributes.has_key?(:'familyName') self.family_name = attributes[:'familyName'] end if attributes.has_key?(:'created') self.created = attributes[:'created'] end end |
Instance Attribute Details
#accounts ⇒ Object
Returns the value of attribute accounts.
826 827 828 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 826 def accounts @accounts end |
#created ⇒ Object
Returns the value of attribute created.
838 839 840 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 838 def created @created end |
#email ⇒ Object
Returns the value of attribute email.
821 822 823 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 821 def email @email end |
#error_details ⇒ Object
Returns the value of attribute error_details.
823 824 825 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 823 def error_details @error_details end |
#family_name ⇒ Object
Returns the value of attribute family_name.
835 836 837 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 835 def family_name @family_name end |
#given_name ⇒ Object
Returns the value of attribute given_name.
832 833 834 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 832 def given_name @given_name end |
#name ⇒ Object
Returns the value of attribute name.
829 830 831 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 829 def name @name end |
#sub ⇒ Object
Returns the value of attribute sub.
818 819 820 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 818 def sub @sub end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
842 843 844 845 846 847 848 849 850 851 852 853 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 842 def self.attribute_map { :'sub' => :'sub', :'email' => :'email', :'error_details' => :'error_details', :'accounts' => :'accounts', :'name' => :'name', :'given_name' => :'given_name', :'family_name' => :'family_name', :'created' => :'created' } end |
.swagger_types ⇒ Object
Attribute type mapping.
856 857 858 859 860 861 862 863 864 865 866 867 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 856 def self.swagger_types { :'sub' => :'String', :'email' => :'String', :'error_details' => :'ErrorDetails', :'accounts' => :'Array<OAuth::Account>', :'name' => :'String', :'given_name' => :'String', :'family_name' => :'String', :'created' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
928 929 930 931 932 933 934 935 936 937 938 939 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 928 def ==(o) return true if self.equal?(o) self.class == o.class && sub == o.sub && email == o.email && error_details == o.error_details && accounts == o.accounts && name == o.name && family_name == o.family_name && given_name == o.given_name && created == o.created end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 977 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = DocuSign_WebForms.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 1043 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 956 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
943 944 945 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 943 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
949 950 951 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 949 def hash [sub, email, error_details, accounts, name, family_name, given_name, created].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
915 916 917 918 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 915 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
1023 1024 1025 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 1023 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
1029 1030 1031 1032 1033 1034 1035 1036 1037 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 1029 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
1017 1018 1019 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 1017 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
922 923 924 |
# File 'lib/docusign_webforms/client/auth/oauth.rb', line 922 def valid? return true end |