Class: CandidApiClient::WriteOffs::V1::Types::CreateWriteOffsResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(write_offs:, additional_properties: nil) ⇒ CandidApiClient::WriteOffs::V1::Types::CreateWriteOffsResponse

Parameters:



25
26
27
28
29
# File 'lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb', line 25

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



15
16
17
# File 'lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb', line 15

def additional_properties
  @additional_properties
end

#write_offsArray<CandidApiClient::WriteOffs::V1::Types::WriteOff> (readonly)



13
14
15
# File 'lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb', line 13

def write_offs
  @write_offs
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::WriteOffs::V1::Types::CreateWriteOffsResponse

Deserialize a JSON object to an instance of CreateWriteOffsResponse

Parameters:

  • json_object (String)

Returns:



35
36
37
38
39
40
41
42
43
# File 'lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb', line 35

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  write_offs = parsed_json["write_offs"]&.map do |item|
    item = item.to_json
    CandidApiClient::WriteOffs::V1::Types::WriteOff.from_json(json_object: item)
  end
  new(write_offs: write_offs, 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)


58
59
60
# File 'lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb', line 58

def self.validate_raw(obj:)
  obj.write_offs.is_a?(Array) != false || raise("Passed value for field obj.write_offs is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of CreateWriteOffsResponse to a JSON object

Returns:

  • (String)


48
49
50
# File 'lib/candidhealth/write_offs/v_1/types/create_write_offs_response.rb', line 48

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