Class: CyberSourceMergedSpec::CreateBinLookupRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb

Overview

CreateBinLookupRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(client_reference_information: SKIP, payment_information: SKIP, token_information: SKIP, processing_information: SKIP, additional_properties: nil) ⇒ CreateBinLookupRequest

Returns a new instance of CreateBinLookupRequest.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 53

def initialize(client_reference_information: SKIP,
               payment_information: SKIP, token_information: SKIP,
               processing_information: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  unless client_reference_information == SKIP
    @client_reference_information =
      client_reference_information
  end
  @payment_information = payment_information unless payment_information == SKIP
  @token_information = token_information unless token_information == SKIP
  @processing_information = processing_information unless processing_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_reference_informationClientReferenceInformation74

TODO: Write general description for this method



14
15
16
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 14

def client_reference_information
  @client_reference_information
end

#payment_informationPaymentInformation42

TODO: Write general description for this method



18
19
20
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 18

def payment_information
  @payment_information
end

#processing_informationProcessingInformation68

TODO: Write general description for this method



26
27
28
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 26

def processing_information
  @processing_information
end

#token_informationTokenInformation10

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 22

def token_information
  @token_information
end

Class Method Details

.from_element(root) ⇒ Object



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 99

def self.from_element(root)
  client_reference_information = XmlUtilities.from_element(
    root, 'ClientReferenceInformation74',
    ClientReferenceInformation74
  )
  payment_information = XmlUtilities.from_element(root,
                                                  'PaymentInformation42',
                                                  PaymentInformation42)
  token_information = XmlUtilities.from_element(root, 'TokenInformation10',
                                                TokenInformation10)
  processing_information = XmlUtilities.from_element(
    root, 'ProcessingInformation68', ProcessingInformation68
  )

  new(client_reference_information: client_reference_information,
      payment_information: payment_information,
      token_information: token_information,
      processing_information: processing_information,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 70

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  if hash['clientReferenceInformation']
    client_reference_information = ClientReferenceInformation74.from_hash(hash['clientReferenceInformation'])
  end
  payment_information = PaymentInformation42.from_hash(hash['paymentInformation']) if
    hash['paymentInformation']
  token_information = TokenInformation10.from_hash(hash['tokenInformation']) if
    hash['tokenInformation']
  processing_information = ProcessingInformation68.from_hash(hash['processingInformation']) if
    hash['processingInformation']

  # 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.
  CreateBinLookupRequest.new(client_reference_information: client_reference_information,
                             payment_information: payment_information,
                             token_information: token_information,
                             processing_information: processing_information,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_reference_information'] = 'clientReferenceInformation'
  @_hash['payment_information'] = 'paymentInformation'
  @_hash['token_information'] = 'tokenInformation'
  @_hash['processing_information'] = 'processingInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 39

def self.optionals
  %w[
    client_reference_information
    payment_information
    token_information
    processing_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



147
148
149
150
151
152
153
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 147

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_reference_information: #{@client_reference_information.inspect},"\
  " payment_information: #{@payment_information.inspect}, token_information:"\
  " #{@token_information.inspect}, processing_information: #{@processing_information.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



138
139
140
141
142
143
144
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 138

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_reference_information: #{@client_reference_information},"\
  " payment_information: #{@payment_information}, token_information: #{@token_information},"\
  " processing_information: #{@processing_information}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/cyber_source_merged_spec/models/create_bin_lookup_request.rb', line 120

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'ClientReferenceInformation74',
                                 client_reference_information)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentInformation42',
                                 payment_information)
  XmlUtilities.add_as_subelement(doc, root, 'TokenInformation10',
                                 token_information)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessingInformation68',
                                 processing_information)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end