Class: Vapi::UpdateCustomKnowledgeBaseDto
- Inherits:
-
Object
- Object
- Vapi::UpdateCustomKnowledgeBaseDto
- Defined in:
- lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#server ⇒ Vapi::Server
readonly
This is where the knowledge base request will be sent.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::UpdateCustomKnowledgeBaseDto
Deserialize a JSON object to an instance of UpdateCustomKnowledgeBaseDto.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(server: OMIT, additional_properties: nil) ⇒ Vapi::UpdateCustomKnowledgeBaseDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCustomKnowledgeBaseDto to a JSON object.
Constructor Details
#initialize(server: OMIT, additional_properties: nil) ⇒ Vapi::UpdateCustomKnowledgeBaseDto
96 97 98 99 100 101 102 |
# File 'lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb', line 96 def initialize(server: OMIT, additional_properties: nil) @server = server if server != OMIT @additional_properties = additional_properties @_field_set = { "server": server }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
49 50 51 |
# File 'lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb', line 49 def additional_properties @additional_properties end |
#server ⇒ Vapi::Server (readonly)
47 48 49 |
# File 'lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb', line 47 def server @server end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::UpdateCustomKnowledgeBaseDto
Deserialize a JSON object to an instance of UpdateCustomKnowledgeBaseDto
108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb', line 108 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) if parsed_json["server"].nil? server = nil else server = parsed_json["server"].to_json server = Vapi::Server.from_json(json_object: server) end new(server: server, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
133 134 135 |
# File 'lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb', line 133 def self.validate_raw(obj:) obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of UpdateCustomKnowledgeBaseDto to a JSON object
123 124 125 |
# File 'lib/vapi_server_sdk/types/update_custom_knowledge_base_dto.rb', line 123 def to_json(*_args) @_field_set&.to_json end |