Method: Bitpesa::DebitRequestWrapper#valid?

Defined in:
lib/bitpesa-sdk/models/debit_request_wrapper.rb

#valid?Boolean

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

Returns:

  • true if the model is valid



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/bitpesa-sdk/models/debit_request_wrapper.rb', line 65

def valid?
  _one_of_found = false
  openapi_one_of.each do |_class|
    _one_of = Bitpesa.const_get(_class).build_from_hash(self.to_hash)
    if _one_of.valid?
      if _one_of_found?
        return false
      else
        _one_of_found = true
      end
    end
  end

  if !_one_of_found?
    return false
  end

  true
end