class Vellum::SandboxScenario
def self.from_json(json_object:)
-
(SandboxScenario)-
Parameters:
-
json_object(JSON) --
def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) label = struct.label inputs = parsed_json["inputs"].map do |v| v = v.to_json ScenarioInput.from_json(json_object: v) end id = struct.id new(label: label, inputs: inputs, id: id, additional_properties: struct) end
def self.validate_raw(obj:)
-
(Void)-
Parameters:
-
obj(Object) --
def self.validate_raw(obj:) obj.label&.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.inputs.is_a?(Array) != false || raise("Passed value for field obj.inputs is not the expected type, validation failed.") obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") end
def initialize(inputs:, id:, label: nil, additional_properties: nil)
-
(SandboxScenario)-
Parameters:
-
additional_properties(OpenStruct) -- Additional properties unmapped to the current class definition -
id(String) -- The id of the scenario -
inputs(Array) -- The inputs for the scenario -
label(String) --
def initialize(inputs:, id:, label: nil, additional_properties: nil) # @type [String] @label = label # @type [Array<ScenarioInput>] The inputs for the scenario @inputs = inputs # @type [String] The id of the scenario @id = id # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end
def to_json(*_args)
-
(JSON)-
def to_json(*_args) { "label": @label, "inputs": @inputs, "id": @id }.to_json end