Class: CandidApiClient::FeeSchedules::V3::Types::MatchGeo
- Inherits:
-
Object
- Object
- CandidApiClient::FeeSchedules::V3::Types::MatchGeo
- Defined in:
- lib/candidhealth/fee_schedules/v_3/types/match_geo.rb
Overview
Match information for state or zip code
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #explanation ⇒ String readonly
- #match ⇒ Boolean readonly
- #state ⇒ CandidApiClient::Commons::Types::State readonly
- #zip_code ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchGeo
Deserialize a JSON object to an instance of MatchGeo.
-
.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(match:, explanation:, zip_code: OMIT, state: OMIT, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchGeo constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of MatchGeo to a JSON object.
Constructor Details
#initialize(match:, explanation:, zip_code: OMIT, state: OMIT, additional_properties: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchGeo
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 35 def initialize(match:, explanation:, zip_code: OMIT, state: OMIT, additional_properties: nil) @zip_code = zip_code if zip_code != OMIT @state = state if state != OMIT @match = match @explanation = explanation @additional_properties = additional_properties @_field_set = { "zip_code": zip_code, "state": state, "match": match, "explanation": explanation }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 22 def additional_properties @additional_properties end |
#explanation ⇒ String (readonly)
20 21 22 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 20 def explanation @explanation end |
#match ⇒ Boolean (readonly)
18 19 20 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 18 def match @match end |
#state ⇒ CandidApiClient::Commons::Types::State (readonly)
16 17 18 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 16 def state @state end |
#zip_code ⇒ String (readonly)
14 15 16 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 14 def zip_code @zip_code end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchGeo
Deserialize a JSON object to an instance of MatchGeo
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 55 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) zip_code = struct["zip_code"] state = struct["state"] match = struct["match"] explanation = struct["explanation"] new( zip_code: zip_code, state: state, 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.
83 84 85 86 87 88 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 83 def self.validate_raw(obj:) obj.zip_code&.is_a?(String) != false || raise("Passed value for field obj.zip_code is not the expected type, validation failed.") obj.state&.is_a?(CandidApiClient::Commons::Types::State) != false || raise("Passed value for field obj.state 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 MatchGeo to a JSON object
73 74 75 |
# File 'lib/candidhealth/fee_schedules/v_3/types/match_geo.rb', line 73 def to_json(*_args) @_field_set&.to_json end |