Class: DigifiApi::MLModel
Class Method Summary collapse
-
.submit(model_name, inputs_hash, options = {}) ⇒ Object
model_name:string required inputs:object required client_transaction_id opt.
Methods inherited from Base
Class Method Details
.submit(model_name, inputs_hash, options = {}) ⇒ Object
model_name:string required inputs:object required client_transaction_id opt
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/digifi_api/ml_model.rb', line 12 def self.submit(model_name, inputs_hash, ={}) return { error: "model_name is required" } if model_name.nil? return { error: "inputs_hash is required" } if inputs_hash.nil? elements = Hash.new # Required Elements elements['model_name'] = model_name elements['inputs_hash'] = inputs_hash # Optional Elements if ['client_transaction_id'] elements['client_transaction_id'] = ['client_transaction_id'] end response = self.post(@resource_uri, elements) end |