Class: Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOptionDefaultValue

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value: OMIT, type: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOptionDefaultValue

Parameters:

  • value (String) (defaults to: OMIT)
  • type (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



24
25
26
27
28
29
30
31
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 24

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



13
14
15
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 13

def additional_properties
  @additional_properties
end

#typeString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 11

def type
  @type
end

#valueString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 9

def value
  @value
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::CompanyBenefits::BenefitTypeRequirementsLimitOptionDefaultValue



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 37

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  value = parsed_json["value"]
  type = parsed_json["type"]
  new(
    value: value,
    type: type,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


61
62
63
64
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 61

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


52
53
54
# File 'lib/fern_gusto/company_benefits/types/benefit_type_requirements_limit_option_default_value.rb', line 52

def to_json
  @_field_set&.to_json
end