Class: CandidApiClient::Tasks::V3::Types::TaskActions
- Inherits:
-
Object
- Object
- CandidApiClient::Tasks::V3::Types::TaskActions
- Defined in:
- lib/candidhealth/tasks/v_3/types/task_actions.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #actions ⇒ Array<CandidApiClient::Tasks::V3::Types::TaskAction> readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions
Deserialize a JSON object to an instance of TaskActions.
-
.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(actions:, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TaskActions to a JSON object.
Constructor Details
#initialize(actions:, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions
25 26 27 28 29 |
# File 'lib/candidhealth/tasks/v_3/types/task_actions.rb', line 25 def initialize(actions:, additional_properties: nil) @actions = actions @additional_properties = additional_properties @_field_set = { "actions": actions } end |
Instance Attribute Details
#actions ⇒ Array<CandidApiClient::Tasks::V3::Types::TaskAction> (readonly)
13 14 15 |
# File 'lib/candidhealth/tasks/v_3/types/task_actions.rb', line 13 def actions @actions end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/candidhealth/tasks/v_3/types/task_actions.rb', line 15 def additional_properties @additional_properties end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions
Deserialize a JSON object to an instance of TaskActions
35 36 37 38 39 40 41 42 43 |
# File 'lib/candidhealth/tasks/v_3/types/task_actions.rb', line 35 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) actions = parsed_json["actions"]&.map do |item| item = item.to_json CandidApiClient::Tasks::V3::Types::TaskAction.from_json(json_object: item) end new(actions: actions, 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.
58 59 60 |
# File 'lib/candidhealth/tasks/v_3/types/task_actions.rb', line 58 def self.validate_raw(obj:) obj.actions.is_a?(Array) != false || raise("Passed value for field obj.actions is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TaskActions to a JSON object
48 49 50 |
# File 'lib/candidhealth/tasks/v_3/types/task_actions.rb', line 48 def to_json(*_args) @_field_set&.to_json end |