Class: CandidApiClient::BillingNotes::V2::Types::BillingNote

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/billing_notes/v_2/types/billing_note.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • billing_note_id (String)
  • encounter_id (String)
  • created_at (DateTime)

    An [RFC 3339, section 5.6 datetime](ijmacd.github.io/rfc3339-iso8601/). For example, 2017-07-21T17:32:28Z.

  • author_auth_0_id (String) (defaults to: OMIT)
  • author_name (String) (defaults to: OMIT)
  • text (String)

    Empty string not allowed.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 = author_auth_0_id if author_auth_0_id != OMIT
  @author_name = author_name if author_name != 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_auth_0_id,
    "author_name": author_name,
    "text": text
  }.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



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_idString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 20

def author_auth_0_id
  @author_auth_0_id
end

#author_nameString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 22

def author_name
  @author_name
end

#billing_note_idString (readonly)

Returns:

  • (String)


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_atDateTime (readonly)

Returns An [RFC 3339, section 5.6 datetime](ijmacd.github.io/rfc3339-iso8601/). For example, 2017-07-21T17:32:28Z.

Returns:



18
19
20
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 18

def created_at
  @created_at
end

#encounter_idString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/candidhealth/billing_notes/v_2/types/billing_note.rb', line 15

def encounter_id
  @encounter_id
end

#textString (readonly)

Returns Empty string not allowed.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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?)
  author_auth_0_id = struct["author_auth0_id"]
  author_name = 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_auth_0_id,
    author_name: 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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.author_auth_0_id&.is_a?(String) != false || raise("Passed value for field obj.author_auth_0_id is not the expected type, validation failed.")
  obj.author_name&.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

Returns:

  • (String)


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