Class: Vapi::LogsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/logs/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Vapi::LogsClient

Parameters:



18
19
20
# File 'lib/vapi_server_sdk/logs/client.rb', line 18

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientVapi::RequestClient (readonly)

Returns:



14
15
16
# File 'lib/vapi_server_sdk/logs/client.rb', line 14

def request_client
  @request_client
end

Instance Method Details

#get(type: nil, webhook_type: nil, assistant_id: nil, phone_number_id: nil, customer_id: nil, squad_id: nil, call_id: nil, page: nil, sort_order: nil, limit: nil, created_at_gt: nil, created_at_lt: nil, created_at_ge: nil, created_at_le: nil, updated_at_gt: nil, updated_at_lt: nil, updated_at_ge: nil, updated_at_le: nil, request_options: nil) ⇒ Vapi::LogsPaginatedResponse

Parameters:

  • type (Vapi::Logs::LogsGetRequestType) (defaults to: nil)

    This is the type of the log.

  • webhook_type (String) (defaults to: nil)

    This is the type of the webhook, given the log is from a webhook.

  • assistant_id (String) (defaults to: nil)

    This is the ID of the assistant.

  • phone_number_id (String) (defaults to: nil)

    This is the ID of the phone number.

  • customer_id (String) (defaults to: nil)

    This is the ID of the customer.

  • squad_id (String) (defaults to: nil)

    This is the ID of the squad.

  • call_id (String) (defaults to: nil)

    This is the ID of the call.

  • page (Float) (defaults to: nil)

    This is the page number to return. Defaults to 1.

  • sort_order (Vapi::Logs::LogsGetRequestSortOrder) (defaults to: nil)

    This is the sort order for pagination. Defaults to ‘DESC’.

  • limit (Float) (defaults to: nil)

    This is the maximum number of items to return. Defaults to 100.

  • created_at_gt (DateTime) (defaults to: nil)

    This will return items where the createdAt is greater than the specified value.

  • created_at_lt (DateTime) (defaults to: nil)

    This will return items where the createdAt is less than the specified value.

  • created_at_ge (DateTime) (defaults to: nil)

    This will return items where the createdAt is greater than or equal to the specified value.

  • created_at_le (DateTime) (defaults to: nil)

    This will return items where the createdAt is less than or equal to the specified value.

  • updated_at_gt (DateTime) (defaults to: nil)

    This will return items where the updatedAt is greater than the specified value.

  • updated_at_lt (DateTime) (defaults to: nil)

    This will return items where the updatedAt is less than the specified value.

  • updated_at_ge (DateTime) (defaults to: nil)

    This will return items where the updatedAt is greater than or equal to the specified value.

  • updated_at_le (DateTime) (defaults to: nil)

    This will return items where the updatedAt is less than or equal to the specified value.

  • request_options (Vapi::RequestOptions) (defaults to: nil)

Returns:



46
47
48
49
50
51
52
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
# File 'lib/vapi_server_sdk/logs/client.rb', line 46

def get(type: nil, webhook_type: nil, assistant_id: nil, phone_number_id: nil, customer_id: nil, squad_id: nil,
        call_id: nil, page: nil, sort_order: nil, limit: nil, created_at_gt: nil, created_at_lt: nil, created_at_ge: nil, created_at_le: nil, updated_at_gt: nil, updated_at_lt: nil, updated_at_ge: nil, updated_at_le: nil, request_options: nil)
  response = @request_client.conn.get do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "type": type,
      "webhookType": webhook_type,
      "assistantId": assistant_id,
      "phoneNumberId": phone_number_id,
      "customerId": customer_id,
      "squadId": squad_id,
      "callId": call_id,
      "page": page,
      "sortOrder": sort_order,
      "limit": limit,
      "createdAtGt": created_at_gt,
      "createdAtLt": created_at_lt,
      "createdAtGe": created_at_ge,
      "createdAtLe": created_at_le,
      "updatedAtGt": updated_at_gt,
      "updatedAtLt": updated_at_lt,
      "updatedAtGe": updated_at_ge,
      "updatedAtLe": updated_at_le
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/logs"
  end
  Vapi::LogsPaginatedResponse.from_json(json_object: response.body)
end

#logging_controller_logs_delete_query(type: nil, assistant_id: nil, phone_number_id: nil, customer_id: nil, squad_id: nil, call_id: nil, request_options: nil) ⇒ Void

Parameters:

  • type (Vapi::Logs::LoggingControllerLogsDeleteQueryRequestType) (defaults to: nil)

    This is the type of the log.

  • assistant_id (String) (defaults to: nil)
  • phone_number_id (String) (defaults to: nil)

    This is the ID of the phone number.

  • customer_id (String) (defaults to: nil)

    This is the ID of the customer.

  • squad_id (String) (defaults to: nil)

    This is the ID of the squad.

  • call_id (String) (defaults to: nil)

    This is the ID of the call.

  • request_options (Vapi::RequestOptions) (defaults to: nil)

Returns:

  • (Void)


93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/vapi_server_sdk/logs/client.rb', line 93

def logging_controller_logs_delete_query(type: nil, assistant_id: nil, phone_number_id: nil, customer_id: nil,
                                         squad_id: nil, call_id: nil, request_options: nil)
  @request_client.conn.delete do |req|
    req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
    req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
    req.headers = {
  **(req.headers || {}),
  **@request_client.get_headers,
  **(request_options&.additional_headers || {})
    }.compact
    req.params = {
      **(request_options&.additional_query_parameters || {}),
      "type": type,
      "assistantId": assistant_id,
      "phoneNumberId": phone_number_id,
      "customerId": customer_id,
      "squadId": squad_id,
      "callId": call_id
    }.compact
    unless request_options.nil? || request_options&.additional_body_parameters.nil?
      req.body = { **(request_options&.additional_body_parameters || {}) }.compact
    end
    req.url "#{@request_client.get_url(request_options: request_options)}/logs"
  end
end