Class: CyberSourceMergedSpec::AgreementInformation8

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

Overview

AgreementInformation8 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(id: SKIP, e_sign_indicator: SKIP, type: SKIP, frequency: SKIP, date_revoked: SKIP, additional_properties: nil) ⇒ AgreementInformation8

Returns a new instance of AgreementInformation8.



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 64

def initialize(id: SKIP, e_sign_indicator: SKIP, type: SKIP,
               frequency: SKIP, date_revoked: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @e_sign_indicator = e_sign_indicator unless e_sign_indicator == SKIP
  @type = type unless type == SKIP
  @frequency = frequency unless frequency == SKIP
  @date_revoked = date_revoked unless date_revoked == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#date_revokedString

Date the agreement was revoked (YYYYMMDD)

Returns:

  • (String)


35
36
37
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 35

def date_revoked
  @date_revoked
end

#e_sign_indicatorString

Identifier for the mandate.

SEPA/BACS

Required for mandates services

Returns:

  • (String)


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

def e_sign_indicator
  @e_sign_indicator
end

#frequencyFrequency

Regularity with which the event occurs.

Returns:



31
32
33
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 31

def frequency
  @frequency
end

#idString

Identifier for the mandate.

SEPA/BACS

Required for mandates services

Returns:

  • (String)


16
17
18
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 16

def id
  @id
end

#typeType1

Identifies the type of schedule as either recurring, one-off, split or usage.

Returns:



27
28
29
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 27

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 106

def self.from_element(root)
  id = XmlUtilities.from_element(root, 'id', String)
  e_sign_indicator = XmlUtilities.from_element(root, 'eSignIndicator',
                                               String)
  type = XmlUtilities.from_element(root, 'type', String)
  frequency = XmlUtilities.from_element(root, 'frequency', String)
  date_revoked = XmlUtilities.from_element(root, 'dateRevoked', String)

  new(id: id,
      e_sign_indicator: e_sign_indicator,
      type: type,
      frequency: frequency,
      date_revoked: date_revoked,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 79

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  e_sign_indicator =
    hash.key?('eSignIndicator') ? hash['eSignIndicator'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  frequency = hash.key?('frequency') ? hash['frequency'] : SKIP
  date_revoked = hash.key?('dateRevoked') ? hash['dateRevoked'] : 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.
  AgreementInformation8.new(id: id,
                            e_sign_indicator: e_sign_indicator,
                            type: type,
                            frequency: frequency,
                            date_revoked: date_revoked,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['e_sign_indicator'] = 'eSignIndicator'
  @_hash['type'] = 'type'
  @_hash['frequency'] = 'frequency'
  @_hash['date_revoked'] = 'dateRevoked'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 60

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 49

def self.optionals
  %w[
    id
    e_sign_indicator
    type
    frequency
    date_revoked
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



146
147
148
149
150
151
# File 'lib/cyber_source_merged_spec/models/agreement_information8.rb', line 146

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, e_sign_indicator: #{@e_sign_indicator.inspect}, type:"\
  " #{@type.inspect}, frequency: #{@frequency.inspect}, date_revoked:"\
  " #{@date_revoked.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, e_sign_indicator: #{@e_sign_indicator}, type: #{@type},"\
  " frequency: #{@frequency}, date_revoked: #{@date_revoked}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



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

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

  XmlUtilities.add_as_subelement(doc, root, 'id', id)
  XmlUtilities.add_as_subelement(doc, root, 'eSignIndicator',
                                 e_sign_indicator)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'frequency', frequency)
  XmlUtilities.add_as_subelement(doc, root, 'dateRevoked', date_revoked)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end