Class: CandidApiClient::Tasks::V3::Types::TaskCreateV3

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encounter_id:, task_type:, description:, work_queue_id:, blocks_claim_submission: OMIT, assignee_user_id: OMIT, category: OMIT, additional_properties: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskCreateV3

Parameters:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 44

def initialize(encounter_id:, task_type:, description:, work_queue_id:, blocks_claim_submission: OMIT,
               assignee_user_id: OMIT, category: OMIT, additional_properties: nil)
  @encounter_id = encounter_id
  @task_type = task_type
  @description = description
  @blocks_claim_submission = blocks_claim_submission if blocks_claim_submission != OMIT
  @assignee_user_id = assignee_user_id if assignee_user_id != OMIT
  @category = category if category != OMIT
  @work_queue_id = work_queue_id
  @additional_properties = additional_properties
  @_field_set = {
    "encounter_id": encounter_id,
    "task_type": task_type,
    "description": description,
    "blocks_claim_submission": blocks_claim_submission,
    "assignee_user_id": assignee_user_id,
    "category": category,
    "work_queue_id": work_queue_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



28
29
30
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 28

def additional_properties
  @additional_properties
end

#assignee_user_idString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 22

def assignee_user_id
  @assignee_user_id
end

#blocks_claim_submissionBoolean (readonly)

Returns:

  • (Boolean)


20
21
22
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 20

def blocks_claim_submission
  @blocks_claim_submission
end

#categoryCandidApiClient::Tasks::Commons::Types::TaskCategory (readonly)



24
25
26
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 24

def category
  @category
end

#descriptionString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 18

def description
  @description
end

#encounter_idString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 14

def encounter_id
  @encounter_id
end

#task_typeCandidApiClient::Tasks::Commons::Types::TaskType (readonly)



16
17
18
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 16

def task_type
  @task_type
end

#work_queue_idString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 26

def work_queue_id
  @work_queue_id
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::Tasks::V3::Types::TaskCreateV3

Deserialize a JSON object to an instance of TaskCreateV3

Parameters:

  • json_object (String)

Returns:



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 71

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  encounter_id = struct["encounter_id"]
  task_type = struct["task_type"]
  description = struct["description"]
  blocks_claim_submission = struct["blocks_claim_submission"]
  assignee_user_id = struct["assignee_user_id"]
  category = struct["category"]
  work_queue_id = struct["work_queue_id"]
  new(
    encounter_id: encounter_id,
    task_type: task_type,
    description: description,
    blocks_claim_submission: blocks_claim_submission,
    assignee_user_id: assignee_user_id,
    category: category,
    work_queue_id: work_queue_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)


105
106
107
108
109
110
111
112
113
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 105

def self.validate_raw(obj:)
  obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.")
  obj.task_type.is_a?(CandidApiClient::Tasks::Commons::Types::TaskType) != false || raise("Passed value for field obj.task_type is not the expected type, validation failed.")
  obj.description.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.blocks_claim_submission&.is_a?(Boolean) != false || raise("Passed value for field obj.blocks_claim_submission 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.")
  obj.category&.is_a?(CandidApiClient::Tasks::Commons::Types::TaskCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
  obj.work_queue_id.is_a?(String) != false || raise("Passed value for field obj.work_queue_id is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of TaskCreateV3 to a JSON object

Returns:

  • (String)


95
96
97
# File 'lib/candidhealth/tasks/v_3/types/task_create_v_3.rb', line 95

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