Class: Vellum::FolderEntityFolderData
- Inherits:
-
Object
- Object
- Vellum::FolderEntityFolderData
- Defined in:
- lib/vellum_ai/types/folder_entity_folder_data.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #created ⇒ DateTime readonly
- #has_contents ⇒ Boolean readonly
- #id ⇒ String readonly
- #label ⇒ String readonly
- #modified ⇒ DateTime readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, label:, created:, modified:, has_contents:, additional_properties: nil) ⇒ Vellum::FolderEntityFolderData constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, label:, created:, modified:, has_contents:, additional_properties: nil) ⇒ Vellum::FolderEntityFolderData
34 35 36 37 38 39 40 41 42 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 34 def initialize(id:, label:, created:, modified:, has_contents:, additional_properties: nil) @id = id @label = label @created = created @modified = modified @has_contents = has_contents @additional_properties = additional_properties @_field_set = { "id": id, "label": label, "created": created, "modified": modified, "has_contents": has_contents } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 20 def additional_properties @additional_properties end |
#created ⇒ DateTime (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 14 def created @created end |
#has_contents ⇒ Boolean (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 18 def has_contents @has_contents end |
#id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 10 def id @id end |
#label ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 12 def label @label end |
#modified ⇒ DateTime (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 16 def modified @modified end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::FolderEntityFolderData
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 47 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] label = parsed_json["label"] created = unless parsed_json["created"].nil? DateTime.parse(parsed_json["created"]) else nil end modified = unless parsed_json["modified"].nil? DateTime.parse(parsed_json["modified"]) else nil end has_contents = parsed_json["has_contents"] new( id: id, label: label, created: created, modified: modified, has_contents: has_contents, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
84 85 86 87 88 89 90 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 84 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.") obj.modified.is_a?(DateTime) != false || raise("Passed value for field obj.modified is not the expected type, validation failed.") obj.has_contents.is_a?(Boolean) != false || raise("Passed value for field obj.has_contents is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
75 76 77 |
# File 'lib/vellum_ai/types/folder_entity_folder_data.rb', line 75 def to_json @_field_set&.to_json end |