Class: CandidApiClient::Tasks::V3::Types::TaskAssignment
- Inherits:
-
Object
- Object
- CandidApiClient::Tasks::V3::Types::TaskAssignment
- Defined in:
- lib/candidhealth/tasks/v_3/types/task_assignment.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #assignee_user_id ⇒ String readonly
- #task_assignment_id ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskAssignment
Deserialize a JSON object to an instance of TaskAssignment.
-
.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(task_assignment_id:, assignee_user_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskAssignment constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TaskAssignment to a JSON object.
Constructor Details
#initialize(task_assignment_id:, assignee_user_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskAssignment
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 27 def initialize(task_assignment_id:, assignee_user_id: OMIT, additional_properties: nil) @task_assignment_id = task_assignment_id @assignee_user_id = assignee_user_id if assignee_user_id != OMIT @additional_properties = additional_properties @_field_set = { "task_assignment_id": task_assignment_id, "assignee_user_id": assignee_user_id }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 16 def additional_properties @additional_properties end |
#assignee_user_id ⇒ String (readonly)
14 15 16 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 14 def assignee_user_id @assignee_user_id end |
#task_assignment_id ⇒ String (readonly)
12 13 14 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 12 def task_assignment_id @task_assignment_id end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskAssignment
Deserialize a JSON object to an instance of TaskAssignment
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) task_assignment_id = struct["task_assignment_id"] assignee_user_id = struct["assignee_user_id"] new( task_assignment_id: task_assignment_id, assignee_user_id: assignee_user_id, 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.
67 68 69 70 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 67 def self.validate_raw(obj:) obj.task_assignment_id.is_a?(String) != false || raise("Passed value for field obj.task_assignment_id is not the expected type, validation failed.") obj.assignee_user_id&.is_a?(String) != false || raise("Passed value for field obj.assignee_user_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TaskAssignment to a JSON object
57 58 59 |
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 57 def to_json(*_args) @_field_set&.to_json end |