Class: CandidApiClient::ExpectedNetworkStatus::V2::Types::InsuranceType

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line_of_business:, insurance_type_codes:, additional_properties: nil) ⇒ CandidApiClient::ExpectedNetworkStatus::V2::Types::InsuranceType

Parameters:



29
30
31
32
33
34
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 29

def initialize(line_of_business:, insurance_type_codes:, additional_properties: nil)
  @line_of_business = line_of_business
  @insurance_type_codes = insurance_type_codes
  @additional_properties = additional_properties
  @_field_set = { "line_of_business": line_of_business, "insurance_type_codes": insurance_type_codes }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



18
19
20
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 18

def additional_properties
  @additional_properties
end

#insurance_type_codesCandidApiClient::ExpectedNetworkStatus::V2::Types::InsuranceTypeCodes (readonly)



16
17
18
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 16

def insurance_type_codes
  @insurance_type_codes
end

#line_of_businessCandidApiClient::ExpectedNetworkStatus::V2::Types::LineOfBusiness (readonly)

Returns The line of business associated with the patient’s insurance.

Returns:



14
15
16
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 14

def line_of_business
  @line_of_business
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::ExpectedNetworkStatus::V2::Types::InsuranceType

Deserialize a JSON object to an instance of InsuranceType

Parameters:

  • json_object (String)

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 40

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  line_of_business = struct["line_of_business"]
  if parsed_json["insurance_type_codes"].nil?
    insurance_type_codes = nil
  else
    insurance_type_codes = parsed_json["insurance_type_codes"].to_json
    insurance_type_codes = CandidApiClient::ExpectedNetworkStatus::V2::Types::InsuranceTypeCodes.from_json(json_object: insurance_type_codes)
  end
  new(
    line_of_business: line_of_business,
    insurance_type_codes: insurance_type_codes,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


70
71
72
73
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 70

def self.validate_raw(obj:)
  obj.line_of_business.is_a?(CandidApiClient::ExpectedNetworkStatus::V2::Types::LineOfBusiness) != false || raise("Passed value for field obj.line_of_business is not the expected type, validation failed.")
  CandidApiClient::ExpectedNetworkStatus::V2::Types::InsuranceTypeCodes.validate_raw(obj: obj.insurance_type_codes)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of InsuranceType to a JSON object

Returns:

  • (String)


60
61
62
# File 'lib/candidhealth/expected_network_status/v_2/types/insurance_type.rb', line 60

def to_json(*_args)
  @_field_set&.to_json
end