Class: Vellum::FolderEntityDocumentIndexData

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/folder_entity_document_index_data.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, label:, created:, modified:, status:, indexing_config:, additional_properties: nil) ⇒ Vellum::FolderEntityDocumentIndexData

Parameters:



39
40
41
42
43
44
45
46
47
48
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 39

def initialize(id:, label:, created:, modified:, status:, indexing_config:, additional_properties: nil)
  @id = id
  @label = label
  @created = created
  @modified = modified
  @status = status
  @indexing_config = indexing_config
  @additional_properties = additional_properties
  @_field_set = { "id": id, "label": label, "created": created, "modified": modified, "status": status, "indexing_config": indexing_config }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



24
25
26
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 24

def additional_properties
  @additional_properties
end

#createdDateTime (readonly)

Returns:

  • (DateTime)


16
17
18
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 16

def created
  @created
end

#idString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 12

def id
  @id
end

#indexing_configVellum::DocumentIndexIndexingConfig (readonly)



22
23
24
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 22

def indexing_config
  @indexing_config
end

#labelString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 14

def label
  @label
end

#modifiedDateTime (readonly)

Returns:

  • (DateTime)


18
19
20
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 18

def modified
  @modified
end

#statusVellum::EntityStatus (readonly)



20
21
22
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 20

def status
  @status
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::FolderEntityDocumentIndexData

Parameters:

  • json_object (String)

Returns:



53
54
55
56
57
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
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 53

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
  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,
    label: label,
    created: created,
    modified: modified,
    status: status,
    indexing_config: indexing_config,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


97
98
99
100
101
102
103
104
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 97

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.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_jsonString

Returns:

  • (String)


88
89
90
# File 'lib/vellum_ai/types/folder_entity_document_index_data.rb', line 88

def to_json
  @_field_set&.to_json
end