Class: CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(encounter_id:, attachment_type:, attachment_id:, file_name:, description:, content_type:, authed_url:, additional_properties: nil) ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment

Parameters:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 43

def initialize(encounter_id:, attachment_type:, attachment_id:, file_name:, description:, content_type:,
               authed_url:, additional_properties: nil)
  @encounter_id = encounter_id
  @attachment_type = attachment_type
  @attachment_id = attachment_id
  @file_name = file_name
  @description = description
  @content_type = content_type
  @authed_url = authed_url
  @additional_properties = additional_properties
  @_field_set = {
    "encounter_id": encounter_id,
    "attachment_type": attachment_type,
    "attachment_id": attachment_id,
    "file_name": file_name,
    "description": description,
    "content_type": content_type,
    "authed_url": authed_url
  }
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



27
28
29
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 27

def additional_properties
  @additional_properties
end

#attachment_idString (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 17

def attachment_id
  @attachment_id
end

#attachment_typeCandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType (readonly)



15
16
17
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 15

def attachment_type
  @attachment_type
end

#authed_urlString (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 25

def authed_url
  @authed_url
end

#content_typeString (readonly)

Returns:

  • (String)


23
24
25
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 23

def content_type
  @content_type
end

#descriptionString (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 21

def description
  @description
end

#encounter_idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 13

def encounter_id
  @encounter_id
end

#file_nameString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 19

def file_name
  @file_name
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment

Deserialize a JSON object to an instance of EncounterAttachment

Parameters:

  • json_object (String)

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 68

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  encounter_id = struct["encounter_id"]
  attachment_type = struct["attachment_type"]
  attachment_id = struct["attachment_id"]
  file_name = struct["file_name"]
  description = struct["description"]
  content_type = struct["content_type"]
  authed_url = struct["authed_url"]
  new(
    encounter_id: encounter_id,
    attachment_type: attachment_type,
    attachment_id: attachment_id,
    file_name: file_name,
    description: description,
    content_type: content_type,
    authed_url: authed_url,
    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)


102
103
104
105
106
107
108
109
110
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 102

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.attachment_type.is_a?(CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType) != false || raise("Passed value for field obj.attachment_type is not the expected type, validation failed.")
  obj.attachment_id.is_a?(String) != false || raise("Passed value for field obj.attachment_id is not the expected type, validation failed.")
  obj.file_name.is_a?(String) != false || raise("Passed value for field obj.file_name 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.content_type.is_a?(String) != false || raise("Passed value for field obj.content_type is not the expected type, validation failed.")
  obj.authed_url.is_a?(String) != false || raise("Passed value for field obj.authed_url is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of EncounterAttachment to a JSON object

Returns:

  • (String)


92
93
94
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 92

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