Class: VoucherifySdk::FiltersCondition

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/models/filters_condition.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FiltersCondition

Initializes the object

Parameters:

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

    Model attributes in the form of hash



168
169
170
171
172
173
174
175
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
211
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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 168

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?(:'_in')
    self._in = attributes[:'_in']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#_inObject

Returns the value of attribute _in.



18
19
20
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 18

def _in
  @_in
end

#afterObject

Returns the value of attribute after.



58
59
60
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 58

def after
  @after
end

#beforeObject

Returns the value of attribute before.



60
61
62
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 60

def before
  @before
end

#containsObject

Returns the value of attribute contains.



34
35
36
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 34

def contains
  @contains
end

#countObject

Returns the value of attribute count.



62
63
64
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 62

def count
  @count
end

#count_lessObject

Returns the value of attribute count_less.



64
65
66
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 64

def count_less
  @count_less
end

#count_moreObject

Returns the value of attribute count_more.



66
67
68
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 66

def count_more
  @count_more
end

#ends_withObject

Returns the value of attribute ends_with.



40
41
42
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 40

def ends_with
  @ends_with
end

#has_valueObject

Returns the value of attribute has_value.



30
31
32
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 30

def has_value
  @has_value
end

#isObject

Returns the value of attribute is.



22
23
24
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 22

def is
  @is
end

#is_days_agoObject

Returns the value of attribute is_days_ago.



24
25
26
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 24

def is_days_ago
  @is_days_ago
end

#is_days_in_futureObject

Returns the value of attribute is_days_in_future.



26
27
28
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 26

def is_days_in_future
  @is_days_in_future
end

#is_notObject

Returns the value of attribute is_not.



28
29
30
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 28

def is_not
  @is_not
end

#is_unknownObject

Returns the value of attribute is_unknown.



32
33
34
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 32

def is_unknown
  @is_unknown
end

#less_thanObject

Returns the value of attribute less_than.



44
45
46
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 44

def less_than
  @less_than
end

#less_than_agoObject

Returns the value of attribute less_than_ago.



48
49
50
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 48

def less_than_ago
  @less_than_ago
end

#less_than_equalObject

Returns the value of attribute less_than_equal.



56
57
58
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 56

def less_than_equal
  @less_than_equal
end

#less_than_futureObject

Returns the value of attribute less_than_future.



52
53
54
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 52

def less_than_future
  @less_than_future
end

#more_thanObject

Returns the value of attribute more_than.



42
43
44
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 42

def more_than
  @more_than
end

#more_than_agoObject

Returns the value of attribute more_than_ago.



46
47
48
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 46

def more_than_ago
  @more_than_ago
end

#more_than_equalObject

Returns the value of attribute more_than_equal.



54
55
56
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 54

def more_than_equal
  @more_than_equal
end

#more_than_futureObject

Returns the value of attribute more_than_future.



50
51
52
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 50

def more_than_future
  @more_than_future
end

#not_containObject

Returns the value of attribute not_contain.



36
37
38
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 36

def not_contain
  @not_contain
end

#not_inObject

Returns the value of attribute not_in.



20
21
22
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 20

def not_in
  @not_in
end

#starts_withObject

Returns the value of attribute starts_with.



38
39
40
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 38

def starts_with
  @starts_with
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 361

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = VoucherifySdk.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



100
101
102
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 100

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
94
95
96
97
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 69

def self.attribute_map
  {
    :'_in' => :'$in',
    :'not_in' => :'$not_in',
    :'is' => :'$is',
    :'is_days_ago' => :'$is_days_ago',
    :'is_days_in_future' => :'$is_days_in_future',
    :'is_not' => :'$is_not',
    :'has_value' => :'$has_value',
    :'is_unknown' => :'$is_unknown',
    :'contains' => :'$contains',
    :'not_contain' => :'$not_contain',
    :'starts_with' => :'$starts_with',
    :'ends_with' => :'$ends_with',
    :'more_than' => :'$more_than',
    :'less_than' => :'$less_than',
    :'more_than_ago' => :'$more_than_ago',
    :'less_than_ago' => :'$less_than_ago',
    :'more_than_future' => :'$more_than_future',
    :'less_than_future' => :'$less_than_future',
    :'more_than_equal' => :'$more_than_equal',
    :'less_than_equal' => :'$less_than_equal',
    :'after' => :'$after',
    :'before' => :'$before',
    :'count' => :'$count',
    :'count_less' => :'$count_less',
    :'count_more' => :'$count_more'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 337

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



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
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 136

def self.openapi_nullable
  Set.new([
    :'_in',
    :'not_in',
    :'is',
    :'is_days_ago',
    :'is_days_in_future',
    :'is_not',
    :'has_value',
    :'is_unknown',
    :'contains',
    :'not_contain',
    :'starts_with',
    :'ends_with',
    :'more_than',
    :'less_than',
    :'more_than_ago',
    :'less_than_ago',
    :'more_than_future',
    :'less_than_future',
    :'more_than_equal',
    :'less_than_equal',
    :'after',
    :'before',
    :'count',
    :'count_less',
    :'count_more'
  ])
end

.openapi_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 105

def self.openapi_types
  {
    :'_in' => :'Object',
    :'not_in' => :'Object',
    :'is' => :'Object',
    :'is_days_ago' => :'Object',
    :'is_days_in_future' => :'Object',
    :'is_not' => :'Object',
    :'has_value' => :'Object',
    :'is_unknown' => :'Object',
    :'contains' => :'Object',
    :'not_contain' => :'Object',
    :'starts_with' => :'Object',
    :'ends_with' => :'Object',
    :'more_than' => :'Object',
    :'less_than' => :'Object',
    :'more_than_ago' => :'Object',
    :'less_than_ago' => :'Object',
    :'more_than_future' => :'Object',
    :'less_than_future' => :'Object',
    :'more_than_equal' => :'Object',
    :'less_than_equal' => :'Object',
    :'after' => :'Object',
    :'before' => :'Object',
    :'count' => :'Object',
    :'count_less' => :'Object',
    :'count_more' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 292

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      _in == o._in &&
      not_in == o.not_in &&
      is == o.is &&
      is_days_ago == o.is_days_ago &&
      is_days_in_future == o.is_days_in_future &&
      is_not == o.is_not &&
      has_value == o.has_value &&
      is_unknown == o.is_unknown &&
      contains == o.contains &&
      not_contain == o.not_contain &&
      starts_with == o.starts_with &&
      ends_with == o.ends_with &&
      more_than == o.more_than &&
      less_than == o.less_than &&
      more_than_ago == o.more_than_ago &&
      less_than_ago == o.less_than_ago &&
      more_than_future == o.more_than_future &&
      less_than_future == o.less_than_future &&
      more_than_equal == o.more_than_equal &&
      less_than_equal == o.less_than_equal &&
      after == o.after &&
      before == o.before &&
      count == o.count &&
      count_less == o.count_less &&
      count_more == o.count_more
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 432

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


324
325
326
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 324

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



330
331
332
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 330

def hash
  [_in, not_in, is, is_days_ago, is_days_in_future, is_not, has_value, is_unknown, contains, not_contain, starts_with, ends_with, more_than, less_than, more_than_ago, less_than_ago, more_than_future, less_than_future, more_than_equal, less_than_equal, after, before, count, count_less, count_more].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



277
278
279
280
281
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 277

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



408
409
410
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 408

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 414

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



402
403
404
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 402

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



285
286
287
288
# File 'lib/VoucherifySdk/models/filters_condition.rb', line 285

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end