Class: CandidApiClient::FeeSchedules::V3::Types::OverlappingRateEntriesError

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

Overview

This error is thrown when two rate entries have time ranges that overlap.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, rate_a:, rate_b:, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::OverlappingRateEntriesError

Parameters:



32
33
34
35
36
37
38
# File 'lib/candidhealth/fee_schedules/v_3/types/overlapping_rate_entries_error.rb', line 32

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



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

def additional_properties
  @additional_properties
end

#messageString (readonly)

Returns:

  • (String)


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

def message
  @message
end

#rate_aCandidApiClient::FeeSchedules::V3::Types::RateEntry (readonly)



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

def rate_a
  @rate_a
end

#rate_bCandidApiClient::FeeSchedules::V3::Types::RateEntry (readonly)



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

def rate_b
  @rate_b
end

Class Method Details

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

Deserialize a JSON object to an instance of OverlappingRateEntriesError

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/candidhealth/fee_schedules/v_3/types/overlapping_rate_entries_error.rb', line 44

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


81
82
83
84
85
# File 'lib/candidhealth/fee_schedules/v_3/types/overlapping_rate_entries_error.rb', line 81

def self.validate_raw(obj:)
  obj.message.is_a?(String) != false || raise("Passed value for field obj.message is not the expected type, validation failed.")
  CandidApiClient::FeeSchedules::V3::Types::RateEntry.validate_raw(obj: obj.rate_a)
  CandidApiClient::FeeSchedules::V3::Types::RateEntry.validate_raw(obj: obj.rate_b)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of OverlappingRateEntriesError to a JSON object

Returns:

  • (String)


71
72
73
# File 'lib/candidhealth/fee_schedules/v_3/types/overlapping_rate_entries_error.rb', line 71

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