Class: CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerUpdateRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: OMIT, description: OMIT, category: OMIT, address: OMIT, additional_properties: nil) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerUpdateRequest

Parameters:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 36

def initialize(name: OMIT, description: OMIT, category: OMIT, address: OMIT, additional_properties: nil)
  @name = name if name != OMIT
  @description = description if description != OMIT
  @category = category if category != OMIT
  @address = address if address != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "name": name,
    "description": description,
    "category": category,
    "address": address
  }.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



23
24
25
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 23

def additional_properties
  @additional_properties
end

#addressCandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerAddressUpdate (readonly)



21
22
23
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 21

def address
  @address
end

#categoryCandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerCategoryUpdate (readonly)



19
20
21
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 19

def category
  @category
end

#descriptionCandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerDescriptionUpdate (readonly)



17
18
19
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 17

def description
  @description
end

#nameString (readonly)

Returns Max 50 characters allowed.

Returns:

  • (String)

    Max 50 characters allowed



15
16
17
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 15

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerUpdateRequest

Deserialize a JSON object to an instance of NonInsurancePayerUpdateRequest



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 56

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  name = struct["name"]
  if parsed_json["description"].nil?
    description = nil
  else
    description = parsed_json["description"].to_json
    description = CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerDescriptionUpdate.from_json(json_object: description)
  end
  if parsed_json["category"].nil?
    category = nil
  else
    category = parsed_json["category"].to_json
    category = CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerCategoryUpdate.from_json(json_object: category)
  end
  if parsed_json["address"].nil?
    address = nil
  else
    address = parsed_json["address"].to_json
    address = CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerAddressUpdate.from_json(json_object: address)
  end
  new(
    name: name,
    description: description,
    category: category,
    address: address,
    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)


100
101
102
103
104
105
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 100

def self.validate_raw(obj:)
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.description.nil? || CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerDescriptionUpdate.validate_raw(obj: obj.description)
  obj.category.nil? || CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerCategoryUpdate.validate_raw(obj: obj.category)
  obj.address.nil? || CandidApiClient::NonInsurancePayers::V1::Types::NonInsurancePayerAddressUpdate.validate_raw(obj: obj.address)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of NonInsurancePayerUpdateRequest to a JSON object

Returns:

  • (String)


90
91
92
# File 'lib/candidhealth/non_insurance_payers/v_1/types/non_insurance_payer_update_request.rb', line 90

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