Class: CandidApiClient::Remits::V1::Types::Payee

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/remits/v_1/types/payee.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payee_name:, payee_identifier:, additional_properties: nil) ⇒ CandidApiClient::Remits::V1::Types::Payee

Parameters:



28
29
30
31
32
33
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 28

def initialize(payee_name:, payee_identifier:, additional_properties: nil)
  @payee_name = payee_name
  @payee_identifier = payee_identifier
  @additional_properties = additional_properties
  @_field_set = { "payee_name": payee_name, "payee_identifier": payee_identifier }
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



17
18
19
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 17

def additional_properties
  @additional_properties
end

#payee_identifierCandidApiClient::Remits::V1::Types::PayeeIdentifier (readonly)



15
16
17
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 15

def payee_identifier
  @payee_identifier
end

#payee_nameString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 13

def payee_name
  @payee_name
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::Remits::V1::Types::Payee

Deserialize a JSON object to an instance of Payee

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  payee_name = struct["payee_name"]
  if parsed_json["payee_identifier"].nil?
    payee_identifier = nil
  else
    payee_identifier = parsed_json["payee_identifier"].to_json
    payee_identifier = CandidApiClient::Remits::V1::Types::PayeeIdentifier.from_json(json_object: payee_identifier)
  end
  new(
    payee_name: payee_name,
    payee_identifier: payee_identifier,
    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)


69
70
71
72
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 69

def self.validate_raw(obj:)
  obj.payee_name.is_a?(String) != false || raise("Passed value for field obj.payee_name is not the expected type, validation failed.")
  CandidApiClient::Remits::V1::Types::PayeeIdentifier.validate_raw(obj: obj.payee_identifier)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of Payee to a JSON object

Returns:

  • (String)


59
60
61
# File 'lib/candidhealth/remits/v_1/types/payee.rb', line 59

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