Class: Gusto::Companies::CompaniesCreateRequestUser
- Inherits:
-
Object
- Object
- Gusto::Companies::CompaniesCreateRequestUser
- Defined in:
- lib/fern_gusto/companies/types/companies_create_request_user.rb
Overview
new company.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#email ⇒ String
readonly
The email of the user who will be the primary payroll admin.
-
#first_name ⇒ String
readonly
The first name of the user who will be the primary payroll admin.
-
#last_name ⇒ String
readonly
The last name of the user who will be the primary payroll admin.
-
#phone ⇒ String
readonly
The phone number of the user who will be the primary payroll admin.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(first_name:, last_name:, email:, phone: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompaniesCreateRequestUser constructor
- #to_json ⇒ String
Constructor Details
#initialize(first_name:, last_name:, email:, phone: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompaniesCreateRequestUser
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 32 def initialize(first_name:, last_name:, email:, phone: OMIT, additional_properties: nil) @first_name = first_name @last_name = last_name @email = email @phone = phone if phone != OMIT @additional_properties = additional_properties @_field_set = { "first_name": first_name, "last_name": last_name, "email": email, "phone": phone }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 19 def additional_properties @additional_properties end |
#email ⇒ String (readonly)
Returns The email of the user who will be the primary payroll admin.
15 16 17 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 15 def email @email end |
#first_name ⇒ String (readonly)
Returns The first name of the user who will be the primary payroll admin.
11 12 13 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 11 def first_name @first_name end |
#last_name ⇒ String (readonly)
Returns The last name of the user who will be the primary payroll admin.
13 14 15 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 13 def last_name @last_name end |
#phone ⇒ String (readonly)
Returns The phone number of the user who will be the primary payroll admin.
17 18 19 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 17 def phone @phone end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Companies::CompaniesCreateRequestUser
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) first_name = parsed_json["first_name"] last_name = parsed_json["last_name"] email = parsed_json["email"] phone = parsed_json["phone"] new( first_name: first_name, last_name: last_name, email: email, phone: phone, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
73 74 75 76 77 78 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 73 def self.validate_raw(obj:) 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.email.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.") obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
64 65 66 |
# File 'lib/fern_gusto/companies/types/companies_create_request_user.rb', line 64 def to_json @_field_set&.to_json end |