Class: CandidApiClient::FeeSchedules::V3::Types::MatchTestResult

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dimensions:, threshold:, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchTestResult

Parameters:



29
30
31
32
33
34
# File 'lib/candidhealth/fee_schedules/v_3/types/match_test_result.rb', line 29

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



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

def additional_properties
  @additional_properties
end

#dimensionsCandidApiClient::FeeSchedules::V3::Types::DimensionMatch (readonly)



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

def dimensions
  @dimensions
end

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



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

def threshold
  @threshold
end

Class Method Details

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

Deserialize a JSON object to an instance of MatchTestResult

Parameters:

  • json_object (String)

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/candidhealth/fee_schedules/v_3/types/match_test_result.rb', line 40

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


75
76
77
78
# File 'lib/candidhealth/fee_schedules/v_3/types/match_test_result.rb', line 75

def self.validate_raw(obj:)
  CandidApiClient::FeeSchedules::V3::Types::DimensionMatch.validate_raw(obj: obj.dimensions)
  CandidApiClient::FeeSchedules::V3::Types::ThresholdMatch.validate_raw(obj: obj.threshold)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of MatchTestResult to a JSON object

Returns:

  • (String)


65
66
67
# File 'lib/candidhealth/fee_schedules/v_3/types/match_test_result.rb', line 65

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