Class: CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment
- Inherits:
-
Object
- Object
- CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment
- Defined in:
- lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #attachment_id ⇒ String readonly
- #attachment_type ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType readonly
- #authed_url ⇒ String readonly
- #content_type ⇒ String readonly
- #description ⇒ String readonly
- #encounter_id ⇒ String readonly
- #file_name ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment
Deserialize a JSON object to an instance of EncounterAttachment.
-
.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(encounter_id:, attachment_type:, attachment_id:, file_name:, description:, content_type:, authed_url:, additional_properties: nil) ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of EncounterAttachment to a JSON object.
Constructor Details
#initialize(encounter_id:, attachment_type:, attachment_id:, file_name:, description:, content_type:, authed_url:, additional_properties: nil) ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachment
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_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_id": , "file_name": file_name, "description": description, "content_type": content_type, "authed_url": authed_url } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns 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_id ⇒ String (readonly)
17 18 19 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 17 def @attachment_id end |
#attachment_type ⇒ CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType (readonly)
15 16 17 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 15 def @attachment_type end |
#authed_url ⇒ String (readonly)
25 26 27 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 25 def authed_url @authed_url end |
#content_type ⇒ String (readonly)
23 24 25 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 23 def content_type @content_type end |
#description ⇒ String (readonly)
21 22 23 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 21 def description @description end |
#encounter_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/encounter_attachment.rb', line 13 def encounter_id @encounter_id end |
#file_name ⇒ String (readonly)
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
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"] = struct["attachment_type"] = 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_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.
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..is_a?(CandidApiClient::EncounterAttachments::V1::Types::EncounterAttachmentType) != false || raise("Passed value for field obj.attachment_type is not the expected type, validation failed.") obj..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
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 |