Class: Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditions
- Inherits:
-
Object
- Object
- Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditions
- Defined in:
- lib/ittybit/automations/types/automations_create_response_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::Automations::AutomationsCreateResponseWorkflowItemConditionsConditionsItem> readonly
- #kind ⇒ String readonly
- #next_ ⇒ Array<Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditionsNextItem> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditions
Deserialize a JSON object to an instance of AutomationsCreateResponseWorkflowItemConditions.
-
.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::Automations::AutomationsCreateResponseWorkflowItemConditions constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AutomationsCreateResponseWorkflowItemConditions to a JSON object.
Constructor Details
#initialize(kind:, conditions:, next_: OMIT, additional_properties: nil) ⇒ Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditions
30 31 32 33 34 35 36 37 38 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 30 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)
18 19 20 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 18 def additional_properties @additional_properties end |
#conditions ⇒ Array<Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditionsConditionsItem> (readonly)
14 15 16 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 14 def conditions @conditions end |
#kind ⇒ String (readonly)
12 13 14 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 12 def kind @kind end |
#next_ ⇒ Array<Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditionsNextItem> (readonly)
16 17 18 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 16 def next_ @next_ end |
Class Method Details
.from_json(json_object:) ⇒ Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditions
Deserialize a JSON object to an instance of
AutomationsCreateResponseWorkflowItemConditions
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 45 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::Automations::AutomationsCreateResponseWorkflowItemConditionsConditionsItem.from_json(json_object: item) end next_ = parsed_json["next"]&.map do |item| item = item.to_json Ittybit::Automations::AutomationsCreateResponseWorkflowItemConditionsNextItem.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.
79 80 81 82 83 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 79 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 AutomationsCreateResponseWorkflowItemConditions to a
JSON object
69 70 71 |
# File 'lib/ittybit/automations/types/automations_create_response_workflow_item_conditions.rb', line 69 def to_json(*_args) @_field_set&.to_json end |