Class: Gusto::ContractorAddressInfo
- Inherits:
-
Object
- Object
- Gusto::ContractorAddressInfo
- Defined in:
- lib/fern_gusto/types/contractor_address_info.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
have historical data associated with them.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #city ⇒ String readonly
-
#contractor_uuid ⇒ Integer
readonly
The UUID of the contractor.
- #country ⇒ String readonly
- #state ⇒ String readonly
- #street1 ⇒ String readonly
- #street2 ⇒ String readonly
-
#version ⇒ Object
readonly
on how to use this field.
- #zip ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(contractor_uuid: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, active: OMIT, version: OMIT, additional_properties: nil) ⇒ Gusto::ContractorAddressInfo constructor
- #to_json ⇒ String
Constructor Details
#initialize(contractor_uuid: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, active: OMIT, version: OMIT, additional_properties: nil) ⇒ Gusto::ContractorAddressInfo
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 50 def initialize(contractor_uuid: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, active: OMIT, version: OMIT, additional_properties: nil) @contractor_uuid = contractor_uuid if contractor_uuid != OMIT @street1 = street1 if street1 != OMIT @street2 = street2 if street2 != OMIT @city = city if city != OMIT @state = state if state != OMIT @zip = zip if zip != OMIT @country = country if country != OMIT @active = active if active != OMIT @version = version if version != OMIT @additional_properties = additional_properties @_field_set = { "contractor_uuid": contractor_uuid, "street_1": street1, "street_2": street2, "city": city, "state": state, "zip": zip, "country": country, "active": active, "version": version }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#active ⇒ Object (readonly)
have historical data associated with them.
23 24 25 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 23 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
29 30 31 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 29 def additional_properties @additional_properties end |
#city ⇒ String (readonly)
14 15 16 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 14 def city @city end |
#contractor_uuid ⇒ Integer (readonly)
Returns The UUID of the contractor.
8 9 10 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 8 def contractor_uuid @contractor_uuid end |
#country ⇒ String (readonly)
20 21 22 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 20 def country @country end |
#state ⇒ String (readonly)
16 17 18 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 16 def state @state end |
#street1 ⇒ String (readonly)
10 11 12 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 10 def street1 @street1 end |
#street2 ⇒ String (readonly)
12 13 14 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 12 def street2 @street2 end |
#version ⇒ Object (readonly)
on how to use this field.
27 28 29 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 27 def version @version end |
#zip ⇒ String (readonly)
18 19 20 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 18 def zip @zip end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ContractorAddressInfo
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 69 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) contractor_uuid = parsed_json["contractor_uuid"] street1 = parsed_json["street_1"] street2 = parsed_json["street_2"] city = parsed_json["city"] state = parsed_json["state"] zip = parsed_json["zip"] country = parsed_json["country"] active = parsed_json["active"] version = parsed_json["version"] new( contractor_uuid: contractor_uuid, street1: street1, street2: street2, city: city, state: state, zip: zip, country: country, active: active, version: version, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 106 def self.validate_raw(obj:) obj.contractor_uuid&.is_a?(Integer) != false || raise("Passed value for field obj.contractor_uuid is not the expected type, validation failed.") obj.street1&.is_a?(String) != false || raise("Passed value for field obj.street1 is not the expected type, validation failed.") obj.street2&.is_a?(String) != false || raise("Passed value for field obj.street2 is not the expected type, validation failed.") obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.") obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.zip&.is_a?(String) != false || raise("Passed value for field obj.zip is not the expected type, validation failed.") obj.country&.is_a?(String) != false || raise("Passed value for field obj.country is not the expected type, validation failed.") obj.active&.is_a?(Boolean) != false || raise("Passed value for field obj.active is not the expected type, validation failed.") obj.version&.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
97 98 99 |
# File 'lib/fern_gusto/types/contractor_address_info.rb', line 97 def to_json @_field_set&.to_json end |