Class: CyberSourceMergedSpec::TokenAuthenticationInformation
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::TokenAuthenticationInformation
- Defined in:
- lib/cyber_source_merged_spec/models/token_authentication_information.rb
Overview
Contains authentication information associated with the token, including details about authenticated identities.
Instance Attribute Summary collapse
-
#authenticated_identities ⇒ Array[AuthenticatedIdentity]
An array of authenticated identity objects containing verification data from identity providers.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(authenticated_identities: SKIP, additional_properties: nil) ⇒ TokenAuthenticationInformation
constructor
A new instance of TokenAuthenticationInformation.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(authenticated_identities: SKIP, additional_properties: nil) ⇒ TokenAuthenticationInformation
Returns a new instance of TokenAuthenticationInformation.
37 38 39 40 41 42 43 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 37 def initialize(authenticated_identities: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @authenticated_identities = authenticated_identities unless authenticated_identities == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#authenticated_identities ⇒ Array[AuthenticatedIdentity]
An array of authenticated identity objects containing verification data from identity providers.
16 17 18 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 16 def authenticated_identities @authenticated_identities end |
Class Method Details
.from_element(root) ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 73 def self.from_element(root) authenticated_identities = XmlUtilities.from_element_to_array( root, 'AuthenticatedIdentity', AuthenticatedIdentity ) new(authenticated_identities: authenticated_identities, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it authenticated_identities = nil unless hash['authenticatedIdentities'].nil? authenticated_identities = [] hash['authenticatedIdentities'].each do |structure| authenticated_identities << (AuthenticatedIdentity.from_hash(structure) if structure) end end authenticated_identities = SKIP unless hash.key?('authenticatedIdentities') # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. TokenAuthenticationInformation.new(authenticated_identities: authenticated_identities, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
19 20 21 22 23 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 19 def self.names @_hash = {} if @_hash.nil? @_hash['authenticated_identities'] = 'authenticatedIdentities' @_hash end |
.nullables ⇒ Object
An array for nullable fields
33 34 35 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 33 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
26 27 28 29 30 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 26 def self.optionals %w[ authenticated_identities ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
101 102 103 104 105 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} authenticated_identities: #{@authenticated_identities.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} authenticated_identities: #{@authenticated_identities},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/cyber_source_merged_spec/models/token_authentication_information.rb', line 82 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_array_as_subelement(doc, root, 'AuthenticatedIdentity', authenticated_identities) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |