Class: Gusto::PayrollCreditBlockersTypeItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(blocker_type: OMIT, blocker_name: OMIT, unblock_options: OMIT, selected_option: OMIT, status: OMIT, additional_properties: nil) ⇒ Gusto::PayrollCreditBlockersTypeItem

Parameters:

  • blocker_type (String) (defaults to: OMIT)

    The type of blocker that’s blocking the payment from being credited.

  • blocker_name (String) (defaults to: OMIT)

    The name of the credit blocker.

  • unblock_options (Array<Gusto::PayrollCreditBlockersTypeItemUnblockOptionsItem>) (defaults to: OMIT)

    The available options to unblock a credit blocker.

  • selected_option (String) (defaults to: OMIT)

    The unblock option that’s been selected to resolve the credit blocker.

  • status (Gusto::PayrollCreditBlockersTypeItemStatus) (defaults to: OMIT)

    The status of the credit blocker

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/fern_gusto/types/payroll_credit_blockers_type_item.rb', line 34

def initialize(blocker_type: OMIT, blocker_name: OMIT, unblock_options: OMIT, selected_option: OMIT, status: OMIT, additional_properties: nil)
  @blocker_type = blocker_type if blocker_type != OMIT
  @blocker_name = blocker_name if blocker_name != OMIT
  @unblock_options = unblock_options if unblock_options != OMIT
  @selected_option = selected_option if selected_option != OMIT
  @status = status if status != OMIT
  @additional_properties = additional_properties
  @_field_set = { "blocker_type": blocker_type, "blocker_name": blocker_name, "unblock_options": unblock_options, "selected_option": selected_option, "status": status }.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



20
21
22
# File 'lib/fern_gusto/types/payroll_credit_blockers_type_item.rb', line 20

def additional_properties
  @additional_properties
end

#blocker_nameString (readonly)

Returns The name of the credit blocker.

Returns:

  • (String)

    The name of the credit blocker.



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

def blocker_name
  @blocker_name
end

#blocker_typeString (readonly)

Returns The type of blocker that’s blocking the payment from being credited.

Returns:

  • (String)

    The type of blocker that’s blocking the payment from being credited.



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

def blocker_type
  @blocker_type
end

#selected_optionString (readonly)

Returns The unblock option that’s been selected to resolve the credit blocker.

Returns:

  • (String)

    The unblock option that’s been selected to resolve the credit blocker.



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

def selected_option
  @selected_option
end

#statusGusto::PayrollCreditBlockersTypeItemStatus (readonly)

Returns The status of the credit blocker.

Returns:



18
19
20
# File 'lib/fern_gusto/types/payroll_credit_blockers_type_item.rb', line 18

def status
  @status
end

#unblock_optionsArray<Gusto::PayrollCreditBlockersTypeItemUnblockOptionsItem> (readonly)

Returns The available options to unblock a credit blocker.

Returns:



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

def unblock_options
  @unblock_options
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollCreditBlockersTypeItem

Parameters:

  • json_object (String)

Returns:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/fern_gusto/types/payroll_credit_blockers_type_item.rb', line 49

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  blocker_type = parsed_json["blocker_type"]
  blocker_name = parsed_json["blocker_name"]
  unblock_options = parsed_json["unblock_options"]&.map do | item |
  item = item.to_json
  Gusto::PayrollCreditBlockersTypeItemUnblockOptionsItem.from_json(json_object: item)
end
  selected_option = parsed_json["selected_option"]
  status = parsed_json["status"]
  new(
    blocker_type: blocker_type,
    blocker_name: blocker_name,
    unblock_options: unblock_options,
    selected_option: selected_option,
    status: status,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


81
82
83
84
85
86
87
# File 'lib/fern_gusto/types/payroll_credit_blockers_type_item.rb', line 81

def self.validate_raw(obj:)
  obj.blocker_type&.is_a?(String) != false || raise("Passed value for field obj.blocker_type is not the expected type, validation failed.")
  obj.blocker_name&.is_a?(String) != false || raise("Passed value for field obj.blocker_name is not the expected type, validation failed.")
  obj.unblock_options&.is_a?(Array) != false || raise("Passed value for field obj.unblock_options is not the expected type, validation failed.")
  obj.selected_option&.is_a?(String) != false || raise("Passed value for field obj.selected_option is not the expected type, validation failed.")
  obj.status&.is_a?(Gusto::PayrollCreditBlockersTypeItemStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


72
73
74
# File 'lib/fern_gusto/types/payroll_credit_blockers_type_item.rb', line 72

def to_json
  @_field_set&.to_json
end