Class: Gusto::CompanyAttachment::CompanyAttachment
- Inherits:
-
Object
- Object
- Gusto::CompanyAttachment::CompanyAttachment
- Defined in:
- lib/fern_gusto/company_attachment/types/company_attachment.rb
Overview
The company attachment
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#category ⇒ Gusto::CompanyAttachment::CompanyAttachmentCategory
readonly
The category of the company attachment.
-
#name ⇒ String
readonly
Name of the file uploaded.
-
#upload_time ⇒ String
readonly
The ISO 8601 timestamp of when an attachment was uploaded.
-
#uuid ⇒ String
readonly
UUID of the company attachment.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(uuid: OMIT, name: OMIT, category: OMIT, upload_time: OMIT, additional_properties: nil) ⇒ Gusto::CompanyAttachment::CompanyAttachment constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid: OMIT, name: OMIT, category: OMIT, upload_time: OMIT, additional_properties: nil) ⇒ Gusto::CompanyAttachment::CompanyAttachment
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 32 def initialize(uuid: OMIT, name: OMIT, category: OMIT, upload_time: OMIT, additional_properties: nil) @uuid = uuid if uuid != OMIT @name = name if name != OMIT @category = category if category != OMIT @upload_time = upload_time if upload_time != OMIT @additional_properties = additional_properties @_field_set = { "uuid": uuid, "name": name, "category": category, "upload_time": upload_time }.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/company_attachment/types/company_attachment.rb', line 19 def additional_properties @additional_properties end |
#category ⇒ Gusto::CompanyAttachment::CompanyAttachmentCategory (readonly)
Returns The category of the company attachment.
15 16 17 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 15 def category @category end |
#name ⇒ String (readonly)
Returns name of the file uploaded.
13 14 15 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 13 def name @name end |
#upload_time ⇒ String (readonly)
Returns The ISO 8601 timestamp of when an attachment was uploaded.
17 18 19 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 17 def upload_time @upload_time end |
#uuid ⇒ String (readonly)
Returns UUID of the company attachment.
11 12 13 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 11 def uuid @uuid end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::CompanyAttachment::CompanyAttachment
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) uuid = parsed_json["uuid"] name = parsed_json["name"] category = parsed_json["category"] upload_time = parsed_json["upload_time"] new( uuid: uuid, name: name, category: category, upload_time: upload_time, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
73 74 75 76 77 78 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 73 def self.validate_raw(obj:) obj.uuid&.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.") obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.category&.is_a?(Gusto::CompanyAttachment::CompanyAttachmentCategory) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") obj.upload_time&.is_a?(String) != false || raise("Passed value for field obj.upload_time is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
64 65 66 |
# File 'lib/fern_gusto/company_attachment/types/company_attachment.rb', line 64 def to_json @_field_set&.to_json end |