Class: CandidApiClient::Identifiers::Types::IdentifierUpdate
- Inherits:
-
Object
- Object
- CandidApiClient::Identifiers::Types::IdentifierUpdate
- Defined in:
- lib/candidhealth/identifiers/types/identifier_update.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #identifier_code ⇒ CandidApiClient::Identifiers::Types::IdentifierCode readonly
- #identifier_id ⇒ String readonly
- #identifier_value ⇒ CandidApiClient::Identifiers::Types::IdentifierValue readonly
- #period ⇒ CandidApiClient::Commons::Types::RemovableDateRangeOptionalEnd readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::Identifiers::Types::IdentifierUpdate
Deserialize a JSON object to an instance of IdentifierUpdate.
-
.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(identifier_id:, identifier_code: OMIT, identifier_value: OMIT, period: OMIT, additional_properties: nil) ⇒ CandidApiClient::Identifiers::Types::IdentifierUpdate constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of IdentifierUpdate to a JSON object.
Constructor Details
#initialize(identifier_id:, identifier_code: OMIT, identifier_value: OMIT, period: OMIT, additional_properties: nil) ⇒ CandidApiClient::Identifiers::Types::IdentifierUpdate
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 35 def initialize(identifier_id:, identifier_code: OMIT, identifier_value: OMIT, period: OMIT, additional_properties: nil) @identifier_id = identifier_id @identifier_code = identifier_code if identifier_code != OMIT @identifier_value = identifier_value if identifier_value != OMIT @period = period if period != OMIT @additional_properties = additional_properties @_field_set = { "identifier_id": identifier_id, "identifier_code": identifier_code, "identifier_value": identifier_value, "period": period }.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/identifiers/types/identifier_update.rb', line 22 def additional_properties @additional_properties end |
#identifier_code ⇒ CandidApiClient::Identifiers::Types::IdentifierCode (readonly)
16 17 18 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 16 def identifier_code @identifier_code end |
#identifier_id ⇒ String (readonly)
14 15 16 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 14 def identifier_id @identifier_id end |
#identifier_value ⇒ CandidApiClient::Identifiers::Types::IdentifierValue (readonly)
18 19 20 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 18 def identifier_value @identifier_value end |
#period ⇒ CandidApiClient::Commons::Types::RemovableDateRangeOptionalEnd (readonly)
20 21 22 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 20 def period @period end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::Identifiers::Types::IdentifierUpdate
Deserialize a JSON object to an instance of IdentifierUpdate
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 56 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) identifier_id = struct["identifier_id"] identifier_code = struct["identifier_code"] if parsed_json["identifier_value"].nil? identifier_value = nil else identifier_value = parsed_json["identifier_value"].to_json identifier_value = CandidApiClient::Identifiers::Types::IdentifierValue.from_json(json_object: identifier_value) end if parsed_json["period"].nil? period = nil else period = parsed_json["period"].to_json period = CandidApiClient::Commons::Types::RemovableDateRangeOptionalEnd.from_json(json_object: period) end new( identifier_id: identifier_id, identifier_code: identifier_code, identifier_value: identifier_value, period: period, 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.
95 96 97 98 99 100 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 95 def self.validate_raw(obj:) obj.identifier_id.is_a?(String) != false || raise("Passed value for field obj.identifier_id is not the expected type, validation failed.") obj.identifier_code&.is_a?(CandidApiClient::Identifiers::Types::IdentifierCode) != false || raise("Passed value for field obj.identifier_code is not the expected type, validation failed.") obj.identifier_value.nil? || CandidApiClient::Identifiers::Types::IdentifierValue.validate_raw(obj: obj.identifier_value) obj.period.nil? || CandidApiClient::Commons::Types::RemovableDateRangeOptionalEnd.validate_raw(obj: obj.period) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of IdentifierUpdate to a JSON object
85 86 87 |
# File 'lib/candidhealth/identifiers/types/identifier_update.rb', line 85 def to_json(*_args) @_field_set&.to_json end |