Class: CandidApiClient::FeeSchedules::V3::Types::RateEntry
- Inherits:
-
Object
- Object
- CandidApiClient::FeeSchedules::V3::Types::RateEntry
- Defined in:
- lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb
Overview
A rate value in cents for a specific time range. Rate entries can be
deactivated, which is set by using the deelte_rate endpoint. Deactivated rate
entries are not considered when matching against service lines.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #end_date ⇒ Date readonly
- #is_deactivated ⇒ Boolean readonly
- #rate_cents ⇒ Integer readonly
- #start_date ⇒ Date readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::RateEntry
Deserialize a JSON object to an instance of RateEntry.
-
.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(start_date:, rate_cents:, is_deactivated:, end_date: OMIT, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::RateEntry constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of RateEntry to a JSON object.
Constructor Details
#initialize(start_date:, rate_cents:, is_deactivated:, end_date: OMIT, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::RateEntry
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 37 def initialize(start_date:, rate_cents:, is_deactivated:, end_date: OMIT, additional_properties: nil) @start_date = start_date @end_date = end_date if end_date != OMIT @rate_cents = rate_cents @is_deactivated = is_deactivated @additional_properties = additional_properties @_field_set = { "start_date": start_date, "end_date": end_date, "rate_cents": rate_cents, "is_deactivated": is_deactivated }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 24 def additional_properties @additional_properties end |
#end_date ⇒ Date (readonly)
18 19 20 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 18 def end_date @end_date end |
#is_deactivated ⇒ Boolean (readonly)
22 23 24 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 22 def is_deactivated @is_deactivated end |
#rate_cents ⇒ Integer (readonly)
20 21 22 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 20 def rate_cents @rate_cents end |
#start_date ⇒ Date (readonly)
16 17 18 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 16 def start_date @start_date end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::RateEntry
Deserialize a JSON object to an instance of RateEntry
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) start_date = (Date.parse(parsed_json["start_date"]) unless parsed_json["start_date"].nil?) end_date = (Date.parse(parsed_json["end_date"]) unless parsed_json["end_date"].nil?) rate_cents = struct["rate_cents"] is_deactivated = struct["is_deactivated"] new( start_date: start_date, end_date: end_date, rate_cents: rate_cents, is_deactivated: is_deactivated, 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.
86 87 88 89 90 91 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 86 def self.validate_raw(obj:) obj.start_date.is_a?(Date) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.end_date&.is_a?(Date) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.") obj.rate_cents.is_a?(Integer) != false || raise("Passed value for field obj.rate_cents is not the expected type, validation failed.") obj.is_deactivated.is_a?(Boolean) != false || raise("Passed value for field obj.is_deactivated is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of RateEntry to a JSON object
76 77 78 |
# File 'lib/candidhealth/fee_schedules/v_3/types/rate_entry.rb', line 76 def to_json(*_args) @_field_set&.to_json end |