Class: DocuSign_eSign::OAuth::UserInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/docusign_esign/client/auth/oauth.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserInfo

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash


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
912
913
# File 'lib/docusign_esign/client/auth/oauth.rb', line 873

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

#accountsObject

Returns the value of attribute accounts


828
829
830
# File 'lib/docusign_esign/client/auth/oauth.rb', line 828

def accounts
  @accounts
end

#createdObject

Returns the value of attribute created


840
841
842
# File 'lib/docusign_esign/client/auth/oauth.rb', line 840

def created
  @created
end

#emailObject

Returns the value of attribute email


823
824
825
# File 'lib/docusign_esign/client/auth/oauth.rb', line 823

def email
  @email
end

#error_detailsObject

Returns the value of attribute error_details


825
826
827
# File 'lib/docusign_esign/client/auth/oauth.rb', line 825

def error_details
  @error_details
end

#family_nameObject

Returns the value of attribute family_name


837
838
839
# File 'lib/docusign_esign/client/auth/oauth.rb', line 837

def family_name
  @family_name
end

#given_nameObject

Returns the value of attribute given_name


834
835
836
# File 'lib/docusign_esign/client/auth/oauth.rb', line 834

def given_name
  @given_name
end

#nameObject

Returns the value of attribute name


831
832
833
# File 'lib/docusign_esign/client/auth/oauth.rb', line 831

def name
  @name
end

#subObject

Returns the value of attribute sub


820
821
822
# File 'lib/docusign_esign/client/auth/oauth.rb', line 820

def sub
  @sub
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.


844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/docusign_esign/client/auth/oauth.rb', line 844

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_typesObject

Attribute type mapping.


858
859
860
861
862
863
864
865
866
867
868
869
# File 'lib/docusign_esign/client/auth/oauth.rb', line 858

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.

Parameters:

  • Object (Object)

    to be compared


930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/docusign_esign/client/auth/oauth.rb', line 930

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

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data


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
1014
1015
# File 'lib/docusign_esign/client/auth/oauth.rb', line 979

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_eSign.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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash


1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/docusign_esign/client/auth/oauth.rb', line 1045

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself


958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
# File 'lib/docusign_esign/client/auth/oauth.rb', line 958

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method

945
946
947
# File 'lib/docusign_esign/client/auth/oauth.rb', line 945

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code


951
952
953
# File 'lib/docusign_esign/client/auth/oauth.rb', line 951

def hash
  [sub, email, error_details, accounts, name, family_name, given_name, created].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons


917
918
919
920
# File 'lib/docusign_esign/client/auth/oauth.rb', line 917

def list_invalid_properties
  invalid_properties = Array.new
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash


1025
1026
1027
# File 'lib/docusign_esign/client/auth/oauth.rb', line 1025

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash


1031
1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/docusign_esign/client/auth/oauth.rb', line 1031

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object


1019
1020
1021
# File 'lib/docusign_esign/client/auth/oauth.rb', line 1019

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid


924
925
926
# File 'lib/docusign_esign/client/auth/oauth.rb', line 924

def valid?
  return true
end