Class: Vellum::UploadDocumentResponse

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_id:, additional_properties: nil) ⇒ Vellum::UploadDocumentResponse

Parameters:

  • document_id (String)

    The ID of the newly created document.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



20
21
22
23
24
# File 'lib/vellum_ai/types/upload_document_response.rb', line 20

def initialize(document_id:, additional_properties: nil)
  @document_id = document_id
  @additional_properties = additional_properties
  @_field_set = { "document_id": document_id }
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



10
11
12
# File 'lib/vellum_ai/types/upload_document_response.rb', line 10

def additional_properties
  @additional_properties
end

#document_idString (readonly)

Returns The ID of the newly created document.

Returns:

  • (String)

    The ID of the newly created document.



8
9
10
# File 'lib/vellum_ai/types/upload_document_response.rb', line 8

def document_id
  @document_id
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::UploadDocumentResponse

Parameters:

  • json_object (String)

Returns:



29
30
31
32
33
34
# File 'lib/vellum_ai/types/upload_document_response.rb', line 29

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  document_id = parsed_json["document_id"]
  new(document_id: document_id, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


47
48
49
# File 'lib/vellum_ai/types/upload_document_response.rb', line 47

def self.validate_raw(obj:)
  obj.document_id.is_a?(String) != false || raise("Passed value for field obj.document_id is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


38
39
40
# File 'lib/vellum_ai/types/upload_document_response.rb', line 38

def to_json
  @_field_set&.to_json
end