Class: CyberSourceMergedSpec::PutMerchantDefinedFieldsDefinitionsResponse

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

Overview

PutMerchantDefinedFieldsDefinitionsResponse 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, field_type: SKIP, label: SKIP, customer_visible: SKIP, text_min_length: SKIP, text_max_length: SKIP, possible_values: SKIP, text_default_value: SKIP, merchant_id: SKIP, reference_type: SKIP, read_only: SKIP, merchant_defined_data_index: SKIP, additional_properties: nil) ⇒ PutMerchantDefinedFieldsDefinitionsResponse

Returns a new instance of PutMerchantDefinedFieldsDefinitionsResponse.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 101

def initialize(id: SKIP, field_type: SKIP, label: SKIP,
               customer_visible: SKIP, text_min_length: SKIP,
               text_max_length: SKIP, possible_values: SKIP,
               text_default_value: SKIP, merchant_id: SKIP,
               reference_type: SKIP, read_only: SKIP,
               merchant_defined_data_index: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @field_type = field_type unless field_type == SKIP
  @label = label unless label == SKIP
  @customer_visible = customer_visible unless customer_visible == SKIP
  @text_min_length = text_min_length unless text_min_length == SKIP
  @text_max_length = text_max_length unless text_max_length == SKIP
  @possible_values = possible_values unless possible_values == SKIP
  @text_default_value = text_default_value unless text_default_value == SKIP
  @merchant_id = merchant_id unless merchant_id == SKIP
  @reference_type = reference_type unless reference_type == SKIP
  @read_only = read_only unless read_only == SKIP
  unless merchant_defined_data_index == SKIP
    @merchant_defined_data_index =
      merchant_defined_data_index
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#customer_visibleTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def customer_visible
  @customer_visible
end

#field_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def field_type
  @field_type
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def id
  @id
end

#labelString

TODO: Write general description for this method

Returns:

  • (String)


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

def label
  @label
end

#merchant_defined_data_indexInteger

TODO: Write general description for this method

Returns:

  • (Integer)


58
59
60
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 58

def merchant_defined_data_index
  @merchant_defined_data_index
end

#merchant_idString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 46

def merchant_id
  @merchant_id
end

#possible_valuesString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 38

def possible_values
  @possible_values
end

#read_onlyTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


54
55
56
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 54

def read_only
  @read_only
end

#reference_typeString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 50

def reference_type
  @reference_type
end

#text_default_valueString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 42

def text_default_value
  @text_default_value
end

#text_max_lengthInteger

TODO: Write general description for this method

Returns:

  • (Integer)


34
35
36
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 34

def text_max_length
  @text_max_length
end

#text_min_lengthInteger

TODO: Write general description for this method

Returns:

  • (Integer)


30
31
32
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 30

def text_min_length
  @text_min_length
end

Class Method Details

.from_element(root) ⇒ Object



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 176

def self.from_element(root)
  id = XmlUtilities.from_element(root, 'id', Integer)
  field_type = XmlUtilities.from_element(root, 'fieldType', String)
  label = XmlUtilities.from_element(root, 'label', String)
  customer_visible = XmlUtilities.from_element(root, 'customerVisible',
                                               TrueClass)
  text_min_length = XmlUtilities.from_element(root, 'textMinLength',
                                              Integer)
  text_max_length = XmlUtilities.from_element(root, 'textMaxLength',
                                              Integer)
  possible_values = XmlUtilities.from_element(root, 'possibleValues',
                                              String)
  text_default_value = XmlUtilities.from_element(root, 'textDefaultValue',
                                                 String)
  merchant_id = XmlUtilities.from_element(root, 'merchantId', String)
  reference_type = XmlUtilities.from_element(root, 'referenceType', String)
  read_only = XmlUtilities.from_element(root, 'readOnly', TrueClass)
  merchant_defined_data_index = XmlUtilities.from_element(
    root, 'merchantDefinedDataIndex', Integer
  )

  new(id: id,
      field_type: field_type,
      label: label,
      customer_visible: customer_visible,
      text_min_length: text_min_length,
      text_max_length: text_max_length,
      possible_values: possible_values,
      text_default_value: text_default_value,
      merchant_id: merchant_id,
      reference_type: reference_type,
      read_only: read_only,
      merchant_defined_data_index: merchant_defined_data_index,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 130

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  field_type = hash.key?('fieldType') ? hash['fieldType'] : SKIP
  label = hash.key?('label') ? hash['label'] : SKIP
  customer_visible =
    hash.key?('customerVisible') ? hash['customerVisible'] : SKIP
  text_min_length =
    hash.key?('textMinLength') ? hash['textMinLength'] : SKIP
  text_max_length =
    hash.key?('textMaxLength') ? hash['textMaxLength'] : SKIP
  possible_values =
    hash.key?('possibleValues') ? hash['possibleValues'] : SKIP
  text_default_value =
    hash.key?('textDefaultValue') ? hash['textDefaultValue'] : SKIP
  merchant_id = hash.key?('merchantId') ? hash['merchantId'] : SKIP
  reference_type = hash.key?('referenceType') ? hash['referenceType'] : SKIP
  read_only = hash.key?('readOnly') ? hash['readOnly'] : SKIP
  merchant_defined_data_index =
    hash.key?('merchantDefinedDataIndex') ? hash['merchantDefinedDataIndex'] : 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.
  PutMerchantDefinedFieldsDefinitionsResponse.new(id: id,
                                                  field_type: field_type,
                                                  label: label,
                                                  customer_visible: customer_visible,
                                                  text_min_length: text_min_length,
                                                  text_max_length: text_max_length,
                                                  possible_values: possible_values,
                                                  text_default_value: text_default_value,
                                                  merchant_id: merchant_id,
                                                  reference_type: reference_type,
                                                  read_only: read_only,
                                                  merchant_defined_data_index: merchant_defined_data_index,
                                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['field_type'] = 'fieldType'
  @_hash['label'] = 'label'
  @_hash['customer_visible'] = 'customerVisible'
  @_hash['text_min_length'] = 'textMinLength'
  @_hash['text_max_length'] = 'textMaxLength'
  @_hash['possible_values'] = 'possibleValues'
  @_hash['text_default_value'] = 'textDefaultValue'
  @_hash['merchant_id'] = 'merchantId'
  @_hash['reference_type'] = 'referenceType'
  @_hash['read_only'] = 'readOnly'
  @_hash['merchant_defined_data_index'] = 'merchantDefinedDataIndex'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 79

def self.optionals
  %w[
    id
    field_type
    label
    customer_visible
    text_min_length
    text_max_length
    possible_values
    text_default_value
    merchant_id
    reference_type
    read_only
    merchant_defined_data_index
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



251
252
253
254
255
256
257
258
259
260
261
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 251

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, field_type: #{@field_type.inspect}, label:"\
  " #{@label.inspect}, customer_visible: #{@customer_visible.inspect}, text_min_length:"\
  " #{@text_min_length.inspect}, text_max_length: #{@text_max_length.inspect},"\
  " possible_values: #{@possible_values.inspect}, text_default_value:"\
  " #{@text_default_value.inspect}, merchant_id: #{@merchant_id.inspect}, reference_type:"\
  " #{@reference_type.inspect}, read_only: #{@read_only.inspect}, merchant_defined_data_index:"\
  " #{@merchant_defined_data_index.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



240
241
242
243
244
245
246
247
248
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 240

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, field_type: #{@field_type}, label: #{@label}, customer_visible:"\
  " #{@customer_visible}, text_min_length: #{@text_min_length}, text_max_length:"\
  " #{@text_max_length}, possible_values: #{@possible_values}, text_default_value:"\
  " #{@text_default_value}, merchant_id: #{@merchant_id}, reference_type: #{@reference_type},"\
  " read_only: #{@read_only}, merchant_defined_data_index: #{@merchant_defined_data_index},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/cyber_source_merged_spec/models/put_merchant_defined_fields_definitions_response.rb', line 212

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, 'fieldType', field_type)
  XmlUtilities.add_as_subelement(doc, root, 'label', label)
  XmlUtilities.add_as_subelement(doc, root, 'customerVisible',
                                 customer_visible)
  XmlUtilities.add_as_subelement(doc, root, 'textMinLength',
                                 text_min_length)
  XmlUtilities.add_as_subelement(doc, root, 'textMaxLength',
                                 text_max_length)
  XmlUtilities.add_as_subelement(doc, root, 'possibleValues',
                                 possible_values)
  XmlUtilities.add_as_subelement(doc, root, 'textDefaultValue',
                                 text_default_value)
  XmlUtilities.add_as_subelement(doc, root, 'merchantId', merchant_id)
  XmlUtilities.add_as_subelement(doc, root, 'referenceType', reference_type)
  XmlUtilities.add_as_subelement(doc, root, 'readOnly', read_only)
  XmlUtilities.add_as_subelement(doc, root, 'merchantDefinedDataIndex',
                                 merchant_defined_data_index)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end