Class: CyberSourceMergedSpec::PtsV1TransactionBatchesGet200Response
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::PtsV1TransactionBatchesGet200Response
- Defined in:
- lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb
Overview
PtsV1TransactionBatchesGet200Response Model.
Instance Attribute Summary collapse
-
#links ⇒ Links17
TODO: Write general description for this method.
-
#submit_time_utc ⇒ String
Time of request in UTC.
-
#transaction_batches ⇒ Array[TransactionBatch]
TODO: Write general description for this method.
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(transaction_batches: SKIP, links: SKIP, submit_time_utc: SKIP, additional_properties: nil) ⇒ PtsV1TransactionBatchesGet200Response
constructor
A new instance of PtsV1TransactionBatchesGet200Response.
-
#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(transaction_batches: SKIP, links: SKIP, submit_time_utc: SKIP, additional_properties: nil) ⇒ PtsV1TransactionBatchesGet200Response
Returns a new instance of PtsV1TransactionBatchesGet200Response.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 51 def initialize(transaction_batches: SKIP, links: SKIP, submit_time_utc: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @transaction_batches = transaction_batches unless transaction_batches == SKIP @links = links unless links == SKIP @submit_time_utc = submit_time_utc unless submit_time_utc == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#links ⇒ Links17
TODO: Write general description for this method
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 18 def links @links end |
#submit_time_utc ⇒ String
Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ
Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57
(10:47:57 p.m.).
The T separates the date and the time. The Z indicates UTC.
Returned by Cybersource for all services.
26 27 28 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 26 def submit_time_utc @submit_time_utc end |
#transaction_batches ⇒ Array[TransactionBatch]
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 14 def transaction_batches @transaction_batches end |
Class Method Details
.from_element(root) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 95 def self.from_element(root) transaction_batches = XmlUtilities.from_element_to_array( root, 'TransactionBatch', TransactionBatch ) links = XmlUtilities.from_element(root, 'Links17', Links17) submit_time_utc = XmlUtilities.from_element(root, 'submitTimeUtc', String) new(transaction_batches: transaction_batches, links: links, submit_time_utc: submit_time_utc, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 63 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 transaction_batches = nil unless hash['transactionBatches'].nil? transaction_batches = [] hash['transactionBatches'].each do |structure| transaction_batches << (TransactionBatch.from_hash(structure) if structure) end end transaction_batches = SKIP unless hash.key?('transactionBatches') links = Links17.from_hash(hash['_links']) if hash['_links'] submit_time_utc = hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP # 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. PtsV1TransactionBatchesGet200Response.new(transaction_batches: transaction_batches, links: links, submit_time_utc: submit_time_utc, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['transaction_batches'] = 'transactionBatches' @_hash['links'] = '_links' @_hash['submit_time_utc'] = 'submitTimeUtc' @_hash end |
.nullables ⇒ Object
An array for nullable fields
47 48 49 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 47 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
38 39 40 41 42 43 44 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 38 def self.optionals %w[ transaction_batches links submit_time_utc ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
130 131 132 133 134 135 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} transaction_batches: #{@transaction_batches.inspect}, links:"\ " #{@links.inspect}, submit_time_utc: #{@submit_time_utc.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
123 124 125 126 127 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 123 def to_s class_name = self.class.name.split('::').last "<#{class_name} transaction_batches: #{@transaction_batches}, links: #{@links},"\ " submit_time_utc: #{@submit_time_utc}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/cyber_source_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 108 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_array_as_subelement(doc, root, 'TransactionBatch', transaction_batches) XmlUtilities.add_as_subelement(doc, root, 'Links17', links) XmlUtilities.add_as_subelement(doc, root, 'submitTimeUtc', submit_time_utc) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |