Class: Ittybit::AutomationWorkflowItemConditions
- Inherits:
-
Object
- Object
- Ittybit::AutomationWorkflowItemConditions
- Defined in:
- lib/ittybit/types/automation_workflow_item_conditions.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #conditions ⇒ Array<Ittybit::AutomationWorkflowItemConditionsConditionsItem> readonly
- #kind ⇒ String readonly
- #next_ ⇒ Array<Ittybit::AutomationWorkflowItemConditionsNextItem> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Ittybit::AutomationWorkflowItemConditions
Deserialize a JSON object to an instance of AutomationWorkflowItemConditions.
-
.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:, conditions:, next_: OMIT, additional_properties: nil) ⇒ Ittybit::AutomationWorkflowItemConditions constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AutomationWorkflowItemConditions to a JSON object.
Constructor Details
#initialize(kind:, conditions:, next_: OMIT, additional_properties: nil) ⇒ Ittybit::AutomationWorkflowItemConditions
29 30 31 32 33 34 35 36 37 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.rb', line 29 def initialize(kind:, conditions:, next_: OMIT, additional_properties: nil) @kind = kind @conditions = conditions @next_ = next_ if next_ != OMIT @additional_properties = additional_properties @_field_set = { "kind": kind, "conditions": conditions, "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/automation_workflow_item_conditions.rb', line 17 def additional_properties @additional_properties end |
#conditions ⇒ Array<Ittybit::AutomationWorkflowItemConditionsConditionsItem> (readonly)
13 14 15 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.rb', line 13 def conditions @conditions end |
#kind ⇒ String (readonly)
11 12 13 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.rb', line 11 def kind @kind end |
#next_ ⇒ Array<Ittybit::AutomationWorkflowItemConditionsNextItem> (readonly)
15 16 17 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.rb', line 15 def next_ @next_ end |
Class Method Details
.from_json(json_object:) ⇒ Ittybit::AutomationWorkflowItemConditions
Deserialize a JSON object to an instance of AutomationWorkflowItemConditions
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.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"] conditions = parsed_json["conditions"]&.map do |item| item = item.to_json Ittybit::AutomationWorkflowItemConditionsConditionsItem.from_json(json_object: item) end next_ = parsed_json["next"]&.map do |item| item = item.to_json Ittybit::AutomationWorkflowItemConditionsNextItem.from_json(json_object: item) end new( kind: kind, conditions: conditions, 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.
76 77 78 79 80 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.rb', line 76 def self.validate_raw(obj:) obj.kind.is_a?(String) != false || raise("Passed value for field obj.kind is not the expected type, validation failed.") obj.conditions.is_a?(Array) != false || raise("Passed value for field obj.conditions 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 AutomationWorkflowItemConditions to a JSON object
66 67 68 |
# File 'lib/ittybit/types/automation_workflow_item_conditions.rb', line 66 def to_json(*_args) @_field_set&.to_json end |