Method: VoucherifySdk::ValidationRulesGetResponseBody#initialize

Defined in:
lib/VoucherifySdk/models/validation_rules_get_response_body.rb

#initialize(attributes = {}) ⇒ ValidationRulesGetResponseBody

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



129
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
175
176
177
178
179
180
181
182
183
184
# File 'lib/VoucherifySdk/models/validation_rules_get_response_body.rb', line 129

def initialize(attributes = {})
  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    h[k.to_sym] = v
  }

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'rules')
    self.rules = attributes[:'rules']
  end

  if attributes.key?(:'error')
    self.error = attributes[:'error']
  end

  if attributes.key?(:'applicable_to')
    self.applicable_to = attributes[:'applicable_to']
  end

  if attributes.key?(:'type')
    self.type = attributes[:'type']
  else
    self.type = 'expression'
  end

  if attributes.key?(:'context_type')
    self.context_type = attributes[:'context_type']
  else
    self.context_type = 'global'
  end

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end

  if attributes.key?(:'assignments_count')
    self.assignments_count = attributes[:'assignments_count']
  end

  if attributes.key?(:'object')
    self.object = attributes[:'object']
  else
    self.object = 'validation_rules'
  end
end