Class: VisaAcceptanceMergedSpec::PtsV1TransactionBatchesGet200Response

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb

Overview

PtsV1TransactionBatchesGet200Response 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(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/visa_acceptance_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

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 18

def links
  @links
end

#submit_time_utcString

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 Visa Acceptance for all services.

Returns:

  • (String)


26
27
28
# File 'lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 26

def submit_time_utc
  @submit_time_utc
end

#transaction_batchesArray[TransactionBatch]

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 14

def transaction_batches
  @transaction_batches
end

Class Method Details

.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/visa_acceptance_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 = Links13.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

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/visa_acceptance_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

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



38
39
40
41
42
43
44
# File 'lib/visa_acceptance_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

#inspectObject

Provides a debugging-friendly string with detailed object information.



103
104
105
106
107
108
# File 'lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 103

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_sObject

Provides a human-readable string representation of the object.



96
97
98
99
100
# File 'lib/visa_acceptance_merged_spec/models/pts_v1_transaction_batches_get200_response.rb', line 96

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