Class: CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb

Overview

Threshold and dollar amount matching for a service line

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(threshold:, rate_cents:, match:, explanation:, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch

Parameters:



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 35

def initialize(threshold:, rate_cents:, match:, explanation:, additional_properties: nil)
  @threshold = threshold
  @rate_cents = rate_cents
  @match = match
  @explanation = explanation
  @additional_properties = additional_properties
  @_field_set = {
    "threshold": threshold,
    "rate_cents": rate_cents,
    "match": match,
    "explanation": explanation
  }
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



22
23
24
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 22

def additional_properties
  @additional_properties
end

#explanationString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 20

def explanation
  @explanation
end

#matchBoolean (readonly)

Returns:

  • (Boolean)


18
19
20
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 18

def match
  @match
end

#rate_centsInteger (readonly)

Returns:

  • (Integer)


16
17
18
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 16

def rate_cents
  @rate_cents
end

#thresholdCandidApiClient::FeeSchedules::V3::Types::PayerThreshold (readonly)



14
15
16
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 14

def threshold
  @threshold
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch

Deserialize a JSON object to an instance of ThresholdMatch

Parameters:

  • json_object (String)

Returns:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 53

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  if parsed_json["threshold"].nil?
    threshold = nil
  else
    threshold = parsed_json["threshold"].to_json
    threshold = CandidApiClient::FeeSchedules::V3::Types::PayerThreshold.from_json(json_object: threshold)
  end
  rate_cents = struct["rate_cents"]
  match = struct["match"]
  explanation = struct["explanation"]
  new(
    threshold: threshold,
    rate_cents: rate_cents,
    match: match,
    explanation: explanation,
    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)


87
88
89
90
91
92
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 87

def self.validate_raw(obj:)
  CandidApiClient::FeeSchedules::V3::Types::PayerThreshold.validate_raw(obj: obj.threshold)
  obj.rate_cents.is_a?(Integer) != false || raise("Passed value for field obj.rate_cents is not the expected type, validation failed.")
  obj.match.is_a?(Boolean) != false || raise("Passed value for field obj.match is not the expected type, validation failed.")
  obj.explanation.is_a?(String) != false || raise("Passed value for field obj.explanation is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ThresholdMatch to a JSON object

Returns:

  • (String)


77
78
79
# File 'lib/candidhealth/fee_schedules/v_3/types/threshold_match.rb', line 77

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