Class: Telnyx::Resources::SessionAnalysis

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/session_analysis.rb,
lib/telnyx/resources/session_analysis/metadata.rb

Overview

Analyze voice AI sessions, costs, and event hierarchies across Telnyx products.

Defined Under Namespace

Classes: Metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SessionAnalysis

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SessionAnalysis.

Parameters:



55
56
57
58
# File 'lib/telnyx/resources/session_analysis.rb', line 55

def initialize(client:)
  @client = client
  @metadata = Telnyx::Resources::SessionAnalysis::Metadata.new(client: client)
end

Instance Attribute Details

#metadataTelnyx::Resources::SessionAnalysis::Metadata (readonly)

Analyze voice AI sessions, costs, and event hierarchies across Telnyx products.



9
10
11
# File 'lib/telnyx/resources/session_analysis.rb', line 9

def 
  @metadata
end

Instance Method Details

#retrieve(event_id, record_type:, date_time: nil, expand: nil, include_children: nil, max_depth: nil, request_options: {}) ⇒ Telnyx::Models::SessionAnalysisRetrieveResponse

Some parameter documentations has been truncated, see Models::SessionAnalysisRetrieveParams for more details.

Retrieves a full session analysis tree for a given event, including costs, child events, and product linkages.

Parameters:

  • event_id (String)

    Path param: The event identifier (UUID).

  • record_type (String)

    Path param: The record type identifier.

  • date_time (Time)

    Query param: ISO 8601 timestamp or date to narrow index selection for faster loo

  • expand (Symbol, Telnyx::Models::SessionAnalysisRetrieveParams::Expand)

    Query param: Controls what data to expand on each event node.

  • include_children (Boolean)

    Query param: Whether to include child events in the response.

  • max_depth (Integer)

    Query param: Maximum traversal depth for the event tree.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/telnyx/resources/session_analysis.rb', line 36

def retrieve(event_id, params)
  parsed, options = Telnyx::SessionAnalysisRetrieveParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  record_type =
    parsed.delete(:record_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["session_analysis/%1$s/%2$s", record_type, event_id],
    query: query,
    model: Telnyx::Models::SessionAnalysisRetrieveResponse,
    options: options
  )
end