Class: CandidApiClient::FeeSchedules::V3::Types::MatchResult
- Inherits:
-
Object
- Object
- CandidApiClient::FeeSchedules::V3::Types::MatchResult
- Defined in:
- lib/candidhealth/fee_schedules/v_3/types/match_result.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #rate_id ⇒ String readonly
- #threshold ⇒ CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchResult
Deserialize a JSON object to an instance of MatchResult.
-
.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(threshold:, rate_id:, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchResult constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of MatchResult to a JSON object.
Constructor Details
#initialize(threshold:, rate_id:, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchResult
28 29 30 31 32 33 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 28 def initialize(threshold:, rate_id:, additional_properties: nil) @threshold = threshold @rate_id = rate_id @additional_properties = additional_properties @_field_set = { "threshold": threshold, "rate_id": rate_id } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 17 def additional_properties @additional_properties end |
#rate_id ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 15 def rate_id @rate_id end |
#threshold ⇒ CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch (readonly)
13 14 15 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 13 def threshold @threshold end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchResult
Deserialize a JSON object to an instance of MatchResult
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 39 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::ThresholdMatch.from_json(json_object: threshold) end rate_id = struct["rate_id"] new( threshold: threshold, rate_id: rate_id, 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.
69 70 71 72 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 69 def self.validate_raw(obj:) CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch.validate_raw(obj: obj.threshold) obj.rate_id.is_a?(String) != false || raise("Passed value for field obj.rate_id is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of MatchResult to a JSON object
59 60 61 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_result.rb', line 59 def to_json(*_args) @_field_set&.to_json end |