Class: CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError
- Inherits:
-
Object
- Object
- CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError
- Defined in:
- lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #expected_value_type ⇒ CandidApiClient::Commons::Types::Primitive readonly
- #key ⇒ String readonly
- #schema_id ⇒ String readonly
- #value ⇒ Object readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError
Deserialize a JSON object to an instance of ValueDoesNotMatchKeyTypeError.
-
.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(schema_id:, key:, expected_value_type:, value:, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ValueDoesNotMatchKeyTypeError to a JSON object.
Constructor Details
#initialize(schema_id:, key:, expected_value_type:, value:, additional_properties: nil) ⇒ CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 34 def initialize(schema_id:, key:, expected_value_type:, value:, additional_properties: nil) @schema_id = schema_id @key = key @expected_value_type = expected_value_type @value = value @additional_properties = additional_properties @_field_set = { "schema_id": schema_id, "key": key, "expected_value_type": expected_value_type, "value": value } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 21 def additional_properties @additional_properties end |
#expected_value_type ⇒ CandidApiClient::Commons::Types::Primitive (readonly)
17 18 19 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 17 def expected_value_type @expected_value_type end |
#key ⇒ String (readonly)
15 16 17 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 15 def key @key end |
#schema_id ⇒ String (readonly)
13 14 15 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 13 def schema_id @schema_id end |
#value ⇒ Object (readonly)
19 20 21 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 19 def value @value end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Encounters::V4::Types::ValueDoesNotMatchKeyTypeError
Deserialize a JSON object to an instance of ValueDoesNotMatchKeyTypeError
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) schema_id = struct["schema_id"] key = struct["key"] expected_value_type = struct["expected_value_type"] value = struct["value"] new( schema_id: schema_id, key: key, expected_value_type: expected_value_type, value: value, 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.
80 81 82 83 84 85 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 80 def self.validate_raw(obj:) obj.schema_id.is_a?(String) != false || raise("Passed value for field obj.schema_id is not the expected type, validation failed.") obj.key.is_a?(String) != false || raise("Passed value for field obj.key is not the expected type, validation failed.") obj.expected_value_type.is_a?(CandidApiClient::Commons::Types::Primitive) != false || raise("Passed value for field obj.expected_value_type is not the expected type, validation failed.") obj.value.is_a?(Object) != false || raise("Passed value for field obj.value is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ValueDoesNotMatchKeyTypeError to a JSON object
70 71 72 |
# File 'lib/candidhealth/encounters/v_4/types/value_does_not_match_key_type_error.rb', line 70 def to_json(*_args) @_field_set&.to_json end |