Class: CandidApiClient::PreEncounter::Appointments::V1::Types::Service
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Appointments::V1::Types::Service
- Defined in:
- lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #start_timestamp ⇒ DateTime readonly
-
#universal_service_identifier ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::UniversalServiceIdentifier
readonly
Contains the code describing the activity type that is being scheduled.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Service
Deserialize a JSON object to an instance of Service.
-
.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(universal_service_identifier: OMIT, start_timestamp: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Service constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Service to a JSON object.
Constructor Details
#initialize(universal_service_identifier: OMIT, start_timestamp: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Service
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 30 def initialize(universal_service_identifier: OMIT, start_timestamp: OMIT, additional_properties: nil) @universal_service_identifier = universal_service_identifier if universal_service_identifier != OMIT @start_timestamp = if != OMIT @additional_properties = additional_properties @_field_set = { "universal_service_identifier": universal_service_identifier, "start_timestamp": }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 19 def additional_properties @additional_properties end |
#start_timestamp ⇒ DateTime (readonly)
17 18 19 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 17 def @start_timestamp end |
#universal_service_identifier ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::UniversalServiceIdentifier (readonly)
Returns Contains the code describing the activity type that is being scheduled.
15 16 17 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 15 def universal_service_identifier @universal_service_identifier end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Appointments::V1::Types::Service
Deserialize a JSON object to an instance of Service
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) universal_service_identifier = struct["universal_service_identifier"] = unless parsed_json["start_timestamp"].nil? DateTime.parse(parsed_json["start_timestamp"]) end new( universal_service_identifier: universal_service_identifier, start_timestamp: , 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.
73 74 75 76 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 73 def self.validate_raw(obj:) obj.universal_service_identifier&.is_a?(CandidApiClient::PreEncounter::Appointments::V1::Types::UniversalServiceIdentifier) != false || raise("Passed value for field obj.universal_service_identifier is not the expected type, validation failed.") obj.&.is_a?(DateTime) != false || raise("Passed value for field obj.start_timestamp is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Service to a JSON object
63 64 65 |
# File 'lib/candidhealth/pre_encounter/appointments/v_1/types/service.rb', line 63 def to_json(*_args) @_field_set&.to_json end |