Class: CandidApiClient::BillingNotes::V2::Types::BillingNote
- Inherits:
-
Object
- Object
- CandidApiClient::BillingNotes::V2::Types::BillingNote
- Defined in:
- lib/candidhealth/billing_notes/v_2/types/billing_note.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #author_auth_0_id ⇒ String readonly
- #author_name ⇒ String readonly
- #billing_note_id ⇒ String readonly
-
#created_at ⇒ DateTime
readonly
An [RFC 3339, section 5.6 datetime](ijmacd.github.io/rfc3339-iso8601/).
- #encounter_id ⇒ String readonly
-
#text ⇒ String
readonly
Empty string not allowed.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::BillingNotes::V2::Types::BillingNote
Deserialize a JSON object to an instance of BillingNote.
-
.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(billing_note_id:, encounter_id:, created_at:, text:, author_auth_0_id: OMIT, author_name: OMIT, additional_properties: nil) ⇒ CandidApiClient::BillingNotes::V2::Types::BillingNote constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of BillingNote to a JSON object.
Constructor Details
#initialize(billing_note_id:, encounter_id:, created_at:, text:, author_auth_0_id: OMIT, author_name: OMIT, additional_properties: nil) ⇒ CandidApiClient::BillingNotes::V2::Types::BillingNote
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 42 def initialize(billing_note_id:, encounter_id:, created_at:, text:, author_auth_0_id: OMIT, author_name: OMIT, additional_properties: nil) @billing_note_id = billing_note_id @encounter_id = encounter_id @created_at = created_at @author_auth_0_id = if != OMIT @author_name = if != OMIT @text = text @additional_properties = additional_properties @_field_set = { "billing_note_id": billing_note_id, "encounter_id": encounter_id, "created_at": created_at, "author_auth0_id": , "author_name": , "text": text }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 26 def additional_properties @additional_properties end |
#author_auth_0_id ⇒ String (readonly)
20 21 22 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 20 def @author_auth_0_id end |
#author_name ⇒ String (readonly)
22 23 24 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 22 def @author_name end |
#billing_note_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 13 def billing_note_id @billing_note_id end |
#created_at ⇒ DateTime (readonly)
Returns An [RFC 3339, section 5.6 datetime](ijmacd.github.io/rfc3339-iso8601/). For example, 2017-07-21T17:32:28Z.
18 19 20 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 18 def created_at @created_at end |
#encounter_id ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 15 def encounter_id @encounter_id end |
#text ⇒ String (readonly)
Returns Empty string not allowed.
24 25 26 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 24 def text @text end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::BillingNotes::V2::Types::BillingNote
Deserialize a JSON object to an instance of BillingNote
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 67 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) billing_note_id = struct["billing_note_id"] encounter_id = struct["encounter_id"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) = struct["author_auth0_id"] = struct["author_name"] text = struct["text"] new( billing_note_id: billing_note_id, encounter_id: encounter_id, created_at: created_at, author_auth_0_id: , author_name: , text: text, 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.
100 101 102 103 104 105 106 107 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 100 def self.validate_raw(obj:) obj.billing_note_id.is_a?(String) != false || raise("Passed value for field obj.billing_note_id is not the expected type, validation failed.") obj.encounter_id.is_a?(String) != false || raise("Passed value for field obj.encounter_id is not the expected type, validation failed.") obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.author_auth_0_id is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.author_name is not the expected type, validation failed.") obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of BillingNote to a JSON object
90 91 92 |
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 90 def to_json(*_args) @_field_set&.to_json end |