Class: CandidApiClient::Tasks::V3::Types::TaskAssignment

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/tasks/v_3/types/task_assignment.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(task_assignment_id:, assignee_user_id: OMIT, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskAssignment

Parameters:

  • task_assignment_id (String)
  • assignee_user_id (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_idString (readonly)

Returns:

  • (String)


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_idString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


57
58
59
# File 'lib/candidhealth/tasks/v_3/types/task_assignment.rb', line 57

def to_json(*_args)
  @_field_set&.to_json
end