Class: CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment
- Inherits:
-
Object
- Object
- CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment
- Defined in:
- lib/candidhealth/encounter_attachments/v_1/types/base_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
- #authed_url ⇒ String readonly
- #content_type ⇒ String readonly
- #description ⇒ String readonly
- #file_name ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment
Deserialize a JSON object to an instance of BaseAttachment.
-
.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(attachment_id:, file_name:, description:, content_type:, authed_url:, additional_properties: nil) ⇒ CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of BaseAttachment to a JSON object.
Constructor Details
#initialize(attachment_id:, file_name:, description:, content_type:, authed_url:, additional_properties: nil) ⇒ CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 36 def initialize(attachment_id:, file_name:, description:, content_type:, authed_url:, additional_properties: nil) = @file_name = file_name @description = description @content_type = content_type @authed_url = authed_url @additional_properties = additional_properties @_field_set = { "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.
22 23 24 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 22 def additional_properties @additional_properties end |
#attachment_id ⇒ String (readonly)
12 13 14 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 12 def end |
#authed_url ⇒ String (readonly)
20 21 22 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 20 def authed_url @authed_url end |
#content_type ⇒ String (readonly)
18 19 20 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 18 def content_type @content_type end |
#description ⇒ String (readonly)
16 17 18 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 16 def description @description end |
#file_name ⇒ String (readonly)
14 15 16 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 14 def file_name @file_name end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::EncounterAttachments::V1::Types::BaseAttachment
Deserialize a JSON object to an instance of BaseAttachment
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) = struct["attachment_id"] file_name = struct["file_name"] description = struct["description"] content_type = struct["content_type"] authed_url = struct["authed_url"] new( 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.
87 88 89 90 91 92 93 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 87 def self.validate_raw(obj:) 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 BaseAttachment to a JSON object
77 78 79 |
# File 'lib/candidhealth/encounter_attachments/v_1/types/base_attachment.rb', line 77 def to_json(*_args) @_field_set&.to_json end |