Class: Vapi::ServerMessageResponseCallEndpointingRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timeout_seconds:, additional_properties: nil) ⇒ Vapi::ServerMessageResponseCallEndpointingRequest

Parameters:

  • timeout_seconds (Float)

    This is the timeout in seconds to wait before considering the user’s speech as finished.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



23
24
25
26
27
# File 'lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb', line 23

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



12
13
14
# File 'lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb', line 12

def additional_properties
  @additional_properties
end

#timeout_secondsFloat (readonly)

Returns This is the timeout in seconds to wait before considering the user’s speech as finished.

Returns:

  • (Float)

    This is the timeout in seconds to wait before considering the user’s speech as finished.



10
11
12
# File 'lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb', line 10

def timeout_seconds
  @timeout_seconds
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::ServerMessageResponseCallEndpointingRequest

Deserialize a JSON object to an instance of

ServerMessageResponseCallEndpointingRequest

Parameters:

  • json_object (String)

Returns:



34
35
36
37
38
39
# File 'lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb', line 34

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  timeout_seconds = parsed_json["timeoutSeconds"]
  new(timeout_seconds: timeout_seconds, 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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


55
56
57
# File 'lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb', line 55

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

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ServerMessageResponseCallEndpointingRequest to a JSON

object

Returns:

  • (String)


45
46
47
# File 'lib/vapi_server_sdk/types/server_message_response_call_endpointing_request.rb', line 45

def to_json(*_args)
  @_field_set&.to_json
end