Class: CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payer_plan_group_id:, payer:, is_active:, plan_group_name:, payer_uuid:, plan_type:, additional_properties: nil) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Parameters:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 41

def initialize(payer_plan_group_id:, payer:, is_active:, plan_group_name:, payer_uuid:, plan_type:,
               additional_properties: nil)
  @payer_plan_group_id = payer_plan_group_id
  @payer = payer
  @is_active = is_active
  @plan_group_name = plan_group_name
  @payer_uuid = payer_uuid
  @plan_type = plan_type
  @additional_properties = additional_properties
  @_field_set = {
    "payer_plan_group_id": payer_plan_group_id,
    "payer": payer,
    "is_active": is_active,
    "plan_group_name": plan_group_name,
    "payer_uuid": payer_uuid,
    "plan_type": plan_type
  }
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



26
27
28
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 26

def additional_properties
  @additional_properties
end

#is_activeBoolean (readonly)

Returns:

  • (Boolean)


18
19
20
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 18

def is_active
  @is_active
end

#payerCandidApiClient::Payers::V3::Types::Payer (readonly)



16
17
18
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 16

def payer
  @payer
end

#payer_plan_group_idString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 14

def payer_plan_group_id
  @payer_plan_group_id
end

#payer_uuidString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 22

def payer_uuid
  @payer_uuid
end

#plan_group_nameString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 20

def plan_group_name
  @plan_group_name
end

#plan_typeCandidApiClient::Commons::Types::SourceOfPaymentCode (readonly)



24
25
26
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 24

def plan_type
  @plan_type
end

Class Method Details

.from_json(json_object:) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Deserialize a JSON object to an instance of PayerPlanGroup

Parameters:

  • json_object (String)

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 64

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  payer_plan_group_id = struct["payer_plan_group_id"]
  if parsed_json["payer"].nil?
    payer = nil
  else
    payer = parsed_json["payer"].to_json
    payer = CandidApiClient::Payers::V3::Types::Payer.from_json(json_object: payer)
  end
  is_active = struct["is_active"]
  plan_group_name = struct["plan_group_name"]
  payer_uuid = struct["payer_uuid"]
  plan_type = struct["plan_type"]
  new(
    payer_plan_group_id: payer_plan_group_id,
    payer: payer,
    is_active: is_active,
    plan_group_name: plan_group_name,
    payer_uuid: payer_uuid,
    plan_type: plan_type,
    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)


102
103
104
105
106
107
108
109
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 102

def self.validate_raw(obj:)
  obj.payer_plan_group_id.is_a?(String) != false || raise("Passed value for field obj.payer_plan_group_id is not the expected type, validation failed.")
  CandidApiClient::Payers::V3::Types::Payer.validate_raw(obj: obj.payer)
  obj.is_active.is_a?(Boolean) != false || raise("Passed value for field obj.is_active is not the expected type, validation failed.")
  obj.plan_group_name.is_a?(String) != false || raise("Passed value for field obj.plan_group_name is not the expected type, validation failed.")
  obj.payer_uuid.is_a?(String) != false || raise("Passed value for field obj.payer_uuid is not the expected type, validation failed.")
  obj.plan_type.is_a?(CandidApiClient::Commons::Types::SourceOfPaymentCode) != false || raise("Passed value for field obj.plan_type is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of PayerPlanGroup to a JSON object

Returns:

  • (String)


92
93
94
# File 'lib/candidhealth/payer_plan_groups/v_1/types/payer_plan_group.rb', line 92

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