Class: Gusto::ContractorBody
- Inherits:
-
Object
- Object
- Gusto::ContractorBody
- Defined in:
- lib/fern_gusto/types/contractor_body.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#business_name ⇒ Object
readonly
contractors and will be ignored for ‘Individual` contractors.
-
#ein ⇒ Object
readonly
‘Individual` contractors.
-
#email ⇒ String
readonly
The contractor’s email address.
-
#file_new_hire_report ⇒ Object
readonly
‘Business` contractors.
-
#first_name ⇒ Object
readonly
‘Business` contractors.
-
#hourly_rate ⇒ Object
readonly
‘Hourly`.
-
#is_active ⇒ Object
readonly
updating this field to true means we are setting the start date to today.
-
#last_name ⇒ Object
readonly
‘Business` contractors.
-
#middle_initial ⇒ Object
readonly
‘Business` contractors.
-
#self_onboarding ⇒ Object
readonly
If self_onboarding is true, then email is required.
-
#ssn ⇒ Object
readonly
Social security number is needed to file the annual 1099 tax form.
-
#start_date ⇒ String
readonly
The day when the contractor will start working for the company.
-
#type ⇒ Gusto::ContractorBodyType
readonly
The contractor type.
-
#wage_type ⇒ Gusto::ContractorBodyWageType
readonly
The contractor’s wage type.
-
#work_state ⇒ Object
readonly
‘file_new_hire_report` is true and will be ignored for `Business` contractors.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(type: OMIT, wage_type: OMIT, start_date: OMIT, hourly_rate: OMIT, self_onboarding: OMIT, email: OMIT, first_name: OMIT, last_name: OMIT, middle_initial: OMIT, file_new_hire_report: OMIT, work_state: OMIT, ssn: OMIT, business_name: OMIT, ein: OMIT, is_active: OMIT, additional_properties: nil) ⇒ Gusto::ContractorBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(type: OMIT, wage_type: OMIT, start_date: OMIT, hourly_rate: OMIT, self_onboarding: OMIT, email: OMIT, first_name: OMIT, last_name: OMIT, middle_initial: OMIT, file_new_hire_report: OMIT, work_state: OMIT, ssn: OMIT, business_name: OMIT, ein: OMIT, is_active: OMIT, additional_properties: nil) ⇒ Gusto::ContractorBody
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 108 def initialize(type: OMIT, wage_type: OMIT, start_date: OMIT, hourly_rate: OMIT, self_onboarding: OMIT, email: OMIT, first_name: OMIT, last_name: OMIT, middle_initial: OMIT, file_new_hire_report: OMIT, work_state: OMIT, ssn: OMIT, business_name: OMIT, ein: OMIT, is_active: OMIT, additional_properties: nil) @type = type if type != OMIT @wage_type = wage_type if wage_type != OMIT @start_date = start_date if start_date != OMIT @hourly_rate = hourly_rate if hourly_rate != OMIT @self_onboarding = self_onboarding if self_onboarding != OMIT @email = email if email != OMIT @first_name = first_name if first_name != OMIT @last_name = last_name if last_name != OMIT @middle_initial = middle_initial if middle_initial != OMIT @file_new_hire_report = file_new_hire_report if file_new_hire_report != OMIT @work_state = work_state if work_state != OMIT @ssn = ssn if ssn != OMIT @business_name = business_name if business_name != OMIT @ein = ein if ein != OMIT @is_active = is_active if is_active != OMIT @additional_properties = additional_properties @_field_set = { "type": type, "wage_type": wage_type, "start_date": start_date, "hourly_rate": hourly_rate, "self_onboarding": self_onboarding, "email": email, "first_name": first_name, "last_name": last_name, "middle_initial": middle_initial, "file_new_hire_report": file_new_hire_report, "work_state": work_state, "ssn": ssn, "business_name": business_name, "ein": ein, "is_active": is_active }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
62 63 64 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 62 def additional_properties @additional_properties end |
#business_name ⇒ Object (readonly)
contractors and will be ignored for ‘Individual` contractors.
53 54 55 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 53 def business_name @business_name end |
#ein ⇒ Object (readonly)
‘Individual` contractors.
57 58 59 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 57 def ein @ein end |
#email ⇒ String (readonly)
Returns The contractor’s email address.
23 24 25 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 23 def email @email end |
#file_new_hire_report ⇒ Object (readonly)
‘Business` contractors.
40 41 42 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 40 def file_new_hire_report @file_new_hire_report end |
#first_name ⇒ Object (readonly)
‘Business` contractors.
27 28 29 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 27 def first_name @first_name end |
#hourly_rate ⇒ Object (readonly)
‘Hourly`.
17 18 19 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 17 def hourly_rate @hourly_rate end |
#is_active ⇒ Object (readonly)
updating this field to true means we are setting the start date to today.
60 61 62 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 60 def is_active @is_active end |
#last_name ⇒ Object (readonly)
‘Business` contractors.
31 32 33 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 31 def last_name @last_name end |
#middle_initial ⇒ Object (readonly)
‘Business` contractors.
35 36 37 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 35 def middle_initial @middle_initial end |
#self_onboarding ⇒ Object (readonly)
If self_onboarding is true, then email is required.
21 22 23 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 21 def self_onboarding @self_onboarding end |
#ssn ⇒ Object (readonly)
Social security number is needed to file the annual 1099 tax form.
50 51 52 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 50 def ssn @ssn end |
#start_date ⇒ String (readonly)
Returns The day when the contractor will start working for the company.
14 15 16 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 14 def start_date @start_date end |
#type ⇒ Gusto::ContractorBodyType (readonly)
Returns The contractor type.
10 11 12 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 10 def type @type end |
#wage_type ⇒ Gusto::ContractorBodyWageType (readonly)
Returns The contractor’s wage type.
12 13 14 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 12 def wage_type @wage_type end |
#work_state ⇒ Object (readonly)
‘file_new_hire_report` is true and will be ignored for `Business` contractors.
46 47 48 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 46 def work_state @work_state end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ContractorBody
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 133 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) type = parsed_json["type"] wage_type = parsed_json["wage_type"] start_date = parsed_json["start_date"] hourly_rate = parsed_json["hourly_rate"] self_onboarding = parsed_json["self_onboarding"] email = parsed_json["email"] first_name = parsed_json["first_name"] last_name = parsed_json["last_name"] middle_initial = parsed_json["middle_initial"] file_new_hire_report = parsed_json["file_new_hire_report"] work_state = parsed_json["work_state"] ssn = parsed_json["ssn"] business_name = parsed_json["business_name"] ein = parsed_json["ein"] is_active = parsed_json["is_active"] new( type: type, wage_type: wage_type, start_date: start_date, hourly_rate: hourly_rate, self_onboarding: self_onboarding, email: email, first_name: first_name, last_name: last_name, middle_initial: middle_initial, file_new_hire_report: file_new_hire_report, work_state: work_state, ssn: ssn, business_name: business_name, ein: ein, is_active: is_active, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 182 def self.validate_raw(obj:) obj.type&.is_a?(Gusto::ContractorBodyType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.wage_type&.is_a?(Gusto::ContractorBodyWageType) != false || raise("Passed value for field obj.wage_type is not the expected type, validation failed.") obj.start_date&.is_a?(String) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.hourly_rate&.is_a?(String) != false || raise("Passed value for field obj.hourly_rate is not the expected type, validation failed.") obj.self_onboarding&.is_a?(Boolean) != false || raise("Passed value for field obj.self_onboarding is not the expected type, validation failed.") obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.") obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.") obj.middle_initial&.is_a?(String) != false || raise("Passed value for field obj.middle_initial is not the expected type, validation failed.") obj.file_new_hire_report&.is_a?(Boolean) != false || raise("Passed value for field obj.file_new_hire_report is not the expected type, validation failed.") obj.work_state&.is_a?(String) != false || raise("Passed value for field obj.work_state is not the expected type, validation failed.") obj.ssn&.is_a?(String) != false || raise("Passed value for field obj.ssn is not the expected type, validation failed.") obj.business_name&.is_a?(String) != false || raise("Passed value for field obj.business_name is not the expected type, validation failed.") obj.ein&.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.") obj.is_active&.is_a?(Boolean) != false || raise("Passed value for field obj.is_active is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
173 174 175 |
# File 'lib/fern_gusto/types/contractor_body.rb', line 173 def to_json @_field_set&.to_json end |