Class: Vellum::DocumentIndexRead
- Inherits:
-
Object
- Object
- Vellum::DocumentIndexRead
- Defined in:
- lib/vellum_ai/types/document_index_read.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
- #id ⇒ String readonly
- #indexing_config ⇒ Vellum::DocumentIndexIndexingConfig readonly
-
#label ⇒ String
readonly
A human-readable label for the document index.
-
#name ⇒ String
readonly
A name that uniquely identifies this index within its workspace.
-
#status ⇒ Object
readonly
-
‘ARCHIVED` - Archived.
-
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, created:, label:, name:, status: OMIT, indexing_config:, additional_properties: nil) ⇒ Vellum::DocumentIndexRead constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, created:, label:, name:, status: OMIT, indexing_config:, additional_properties: nil) ⇒ Vellum::DocumentIndexRead
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 42 def initialize(id:, created:, label:, name:, status: OMIT, indexing_config:, additional_properties: nil) @id = id @created = created @label = label @name = name @status = status if status != OMIT @indexing_config = indexing_config @additional_properties = additional_properties @_field_set = { "id": id, "created": created, "label": label, "name": name, "status": status, "indexing_config": indexing_config }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
25 26 27 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 25 def additional_properties @additional_properties end |
#created ⇒ DateTime (readonly)
13 14 15 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 13 def created @created end |
#id ⇒ String (readonly)
11 12 13 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 11 def id @id end |
#indexing_config ⇒ Vellum::DocumentIndexIndexingConfig (readonly)
23 24 25 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 23 def indexing_config @indexing_config end |
#label ⇒ String (readonly)
Returns A human-readable label for the document index.
15 16 17 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 15 def label @label end |
#name ⇒ String (readonly)
Returns A name that uniquely identifies this index within its workspace.
17 18 19 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 17 def name @name end |
#status ⇒ Object (readonly)
-
‘ARCHIVED` - Archived
21 22 23 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 21 def status @status end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::DocumentIndexRead
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] created = unless parsed_json["created"].nil? DateTime.parse(parsed_json["created"]) else nil end label = parsed_json["label"] name = parsed_json["name"] status = parsed_json["status"] unless parsed_json["indexing_config"].nil? indexing_config = parsed_json["indexing_config"].to_json indexing_config = Vellum::DocumentIndexIndexingConfig.from_json(json_object: indexing_config) else indexing_config = nil end new( id: id, created: created, label: label, name: name, status: status, indexing_config: indexing_config, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
98 99 100 101 102 103 104 105 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 98 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.created.is_a?(DateTime) != false || raise("Passed value for field obj.created 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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.status&.is_a?(Vellum::EntityStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") Vellum::DocumentIndexIndexingConfig.validate_raw(obj: obj.indexing_config) end |
Instance Method Details
#to_json ⇒ String
89 90 91 |
# File 'lib/vellum_ai/types/document_index_read.rb', line 89 def to_json @_field_set&.to_json end |