Class: Ittybit::WorkflowTaskStep
- Inherits:
-
Object
- Object
- Ittybit::WorkflowTaskStep
- Defined in:
- lib/ittybit/types/workflow_task_step.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #kind ⇒ Ittybit::WorkflowTaskStepKind readonly
- #next_ ⇒ Array<Ittybit::WorkflowTaskStepNextItem> readonly
- #ref ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Ittybit::WorkflowTaskStep
Deserialize a JSON object to an instance of WorkflowTaskStep.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(kind:, ref: OMIT, next_: OMIT, additional_properties: nil) ⇒ Ittybit::WorkflowTaskStep constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of WorkflowTaskStep to a JSON object.
Constructor Details
#initialize(kind:, ref: OMIT, next_: OMIT, additional_properties: nil) ⇒ Ittybit::WorkflowTaskStep
29 30 31 32 33 34 35 36 37 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 29 def initialize(kind:, ref: OMIT, next_: OMIT, additional_properties: nil) @kind = kind @ref = ref if ref != OMIT @next_ = next_ if next_ != OMIT @additional_properties = additional_properties @_field_set = { "kind": kind, "ref": ref, "next": next_ }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 17 def additional_properties @additional_properties end |
#kind ⇒ Ittybit::WorkflowTaskStepKind (readonly)
11 12 13 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 11 def kind @kind end |
#next_ ⇒ Array<Ittybit::WorkflowTaskStepNextItem> (readonly)
15 16 17 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 15 def next_ @next_ end |
#ref ⇒ String (readonly)
13 14 15 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 13 def ref @ref end |
Class Method Details
.from_json(json_object:) ⇒ Ittybit::WorkflowTaskStep
Deserialize a JSON object to an instance of WorkflowTaskStep
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) kind = parsed_json["kind"] ref = parsed_json["ref"] next_ = parsed_json["next"]&.map do |item| item = item.to_json Ittybit::WorkflowTaskStepNextItem.from_json(json_object: item) end new( kind: kind, ref: ref, next_: next_, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
73 74 75 76 77 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 73 def self.validate_raw(obj:) obj.kind.is_a?(Ittybit::WorkflowTaskStepKind) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.") obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.") obj.next_&.is_a?(Array) != false || raise("Passed value for field obj.next_ is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of WorkflowTaskStep to a JSON object
63 64 65 |
# File 'lib/ittybit/types/workflow_task_step.rb', line 63 def to_json(*_args) @_field_set&.to_json end |