Class: Gusto::EmployeePaymentMethod::EmployeePaymentMethodInfo
- Inherits:
-
Object
- Object
- Gusto::EmployeePaymentMethod::EmployeePaymentMethodInfo
- Defined in:
- lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#split_by ⇒ Object
readonly
split amount must be nil to capture the remainder.
- #splits ⇒ Array<Gusto::PaymentMethodBankAccount> readonly
-
#type ⇒ Object
readonly
to be populated.
-
#version ⇒ Object
readonly
on how to use this field.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::EmployeePaymentMethod::EmployeePaymentMethodInfo
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(version: OMIT, type: OMIT, split_by: OMIT, splits: OMIT, additional_properties: nil) ⇒ Gusto::EmployeePaymentMethod::EmployeePaymentMethodInfo constructor
- #to_json ⇒ String
Constructor Details
#initialize(version: OMIT, type: OMIT, split_by: OMIT, splits: OMIT, additional_properties: nil) ⇒ Gusto::EmployeePaymentMethod::EmployeePaymentMethodInfo
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 44 def initialize(version: OMIT, type: OMIT, split_by: OMIT, splits: OMIT, additional_properties: nil) @version = version if version != OMIT @type = type if type != OMIT @split_by = split_by if split_by != OMIT @splits = splits if splits != OMIT @additional_properties = additional_properties @_field_set = { "version": version, "type": type, "split_by": split_by, "splits": splits }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 26 def additional_properties @additional_properties end |
#split_by ⇒ Object (readonly)
split amount must be nil to capture the remainder.
22 23 24 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 22 def split_by @split_by end |
#splits ⇒ Array<Gusto::PaymentMethodBankAccount> (readonly)
24 25 26 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 24 def splits @splits end |
#type ⇒ Object (readonly)
to be populated. If type is Direct Deposit, split_by and splits are required.
18 19 20 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 18 def type @type end |
#version ⇒ Object (readonly)
on how to use this field.
15 16 17 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 15 def version @version end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::EmployeePaymentMethod::EmployeePaymentMethodInfo
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) version = parsed_json["version"] type = parsed_json["type"] split_by = parsed_json["split_by"] splits = parsed_json["splits"]&.map do | item | item = item.to_json Gusto::PaymentMethodBankAccount.from_json(json_object: item) end new( version: version, type: type, split_by: split_by, splits: splits, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
88 89 90 91 92 93 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 88 def self.validate_raw(obj:) obj.version&.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.") obj.type&.is_a?(Gusto::EmployeePaymentMethod::EmployeePaymentMethodType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.split_by&.is_a?(Gusto::EmployeePaymentMethod::EmployeePaymentMethodSplitBy) != false || raise("Passed value for field obj.split_by is not the expected type, validation failed.") obj.splits&.is_a?(Array) != false || raise("Passed value for field obj.splits is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
79 80 81 |
# File 'lib/fern_gusto/employee_payment_method/types/employee_payment_method_info.rb', line 79 def to_json @_field_set&.to_json end |