Class: CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb

Overview

The reason a given service line was denied within a given time range.

A service line may be denied for different reasons over time, but only one
reason at a time.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason: OMIT, additional_properties: nil) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason

Parameters:



28
29
30
31
32
33
34
# File 'lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb', line 28

def initialize(reason: OMIT, additional_properties: nil)
  @reason = reason if reason != OMIT
  @additional_properties = additional_properties
  @_field_set = { "reason": reason }.reject do |_k, v|
    v == OMIT
  end
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/service_lines/v_2/types/service_line_denial_reason.rb', line 18

def additional_properties
  @additional_properties
end

#reasonCandidApiClient::ServiceLines::V2::Types::DenialReasonContent (readonly)

Returns Text of the denial reason.

Returns:



16
17
18
# File 'lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb', line 16

def reason
  @reason
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::ServiceLines::V2::Types::ServiceLineDenialReason

Deserialize a JSON object to an instance of ServiceLineDenialReason

Parameters:

  • json_object (String)

Returns:



40
41
42
43
44
# File 'lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb', line 40

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  reason = struct["reason"]
  new(reason: reason, 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)


59
60
61
# File 'lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb', line 59

def self.validate_raw(obj:)
  obj.reason&.is_a?(CandidApiClient::ServiceLines::V2::Types::DenialReasonContent) != false || raise("Passed value for field obj.reason is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ServiceLineDenialReason to a JSON object

Returns:

  • (String)


49
50
51
# File 'lib/candidhealth/service_lines/v_2/types/service_line_denial_reason.rb', line 49

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