Class: Gusto::EmployeeTaxSetup::EmployeeStateTaxAnswer

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value: OMIT, valid_from: OMIT, valid_up_to: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeTaxSetup::EmployeeStateTaxAnswer

Parameters:

  • valid_from (String) (defaults to: OMIT)

    The effective date of the answer - currently always “2010-01-01”.

  • valid_up_to (Object) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



29
30
31
32
33
34
35
36
37
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 29

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



16
17
18
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 16

def additional_properties
  @additional_properties
end

#valid_fromString (readonly)

Returns The effective date of the answer - currently always “2010-01-01”.

Returns:

  • (String)

    The effective date of the answer - currently always “2010-01-01”.



12
13
14
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 12

def valid_from
  @valid_from
end

#valid_up_toObject (readonly)

Returns:

  • (Object)


14
15
16
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 14

def valid_up_to
  @valid_up_to
end

#valueObject (readonly)

boolean, or null.



10
11
12
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 10

def value
  @value
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::EmployeeTaxSetup::EmployeeStateTaxAnswer

Parameters:

  • json_object (String)

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 42

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


67
68
69
70
71
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 67

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.valid_from&.is_a?(String) != false || raise("Passed value for field obj.valid_from is not the expected type, validation failed.")
  obj.valid_up_to&.is_a?(Object) != false || raise("Passed value for field obj.valid_up_to is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


58
59
60
# File 'lib/fern_gusto/employee_tax_setup/types/employee_state_tax_answer.rb', line 58

def to_json
  @_field_set&.to_json
end