Class: Vapi::AsyncTestSuiteRunsClient

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ Vapi::AsyncTestSuiteRunsClient

Parameters:



171
172
173
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 171

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientVapi::AsyncRequestClient (readonly)



167
168
169
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 167

def request_client
  @request_client
end

Instance Method Details

#test_suite_run_controller_create(test_suite_id:, name: nil, request_options: nil) ⇒ Vapi::TestSuiteRun

Parameters:

  • test_suite_id (String)
  • name (String) (defaults to: nil)

    This is the name of the test suite run.

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

Returns:



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 231

def test_suite_run_controller_create(test_suite_id:, name: nil, request_options: nil)
  Async do
    response = @request_client.conn.post 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
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      req.body = { **(request_options&.additional_body_parameters || {}), name: name }.compact
      req.url "#{@request_client.get_url(request_options: request_options)}/test-suite/#{test_suite_id}/run"
    end
    Vapi::TestSuiteRun.from_json(json_object: response.body)
  end
end

#test_suite_run_controller_find_all_paginated(test_suite_id:, 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::TestSuiteRunsPaginatedResponse

Parameters:

  • test_suite_id (String)
  • page (Float) (defaults to: nil)

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

  • sort_order (Vapi::TestSuiteRuns::TestSuiteRunControllerFindAllPaginatedRequestSortOrder) (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:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 193

def test_suite_run_controller_find_all_paginated(test_suite_id:, 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)
  Async do
    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 || {}),
        "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)}/test-suite/#{test_suite_id}/run"
    end
    Vapi::TestSuiteRunsPaginatedResponse.from_json(json_object: response.body)
  end
end

#test_suite_run_controller_find_one(test_suite_id:, id:, request_options: nil) ⇒ Vapi::TestSuiteRun

Parameters:

Returns:



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 255

def test_suite_run_controller_find_one(test_suite_id:, id:, request_options: nil)
  Async do
    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
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      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)}/test-suite/#{test_suite_id}/run/#{id}"
    end
    Vapi::TestSuiteRun.from_json(json_object: response.body)
  end
end

#test_suite_run_controller_remove(test_suite_id:, id:, request_options: nil) ⇒ Vapi::TestSuiteRun

Parameters:

Returns:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 281

def test_suite_run_controller_remove(test_suite_id:, id:, request_options: nil)
  Async do
    response = @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
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      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)}/test-suite/#{test_suite_id}/run/#{id}"
    end
    Vapi::TestSuiteRun.from_json(json_object: response.body)
  end
end

#test_suite_run_controller_update(test_suite_id:, id:, name: nil, request_options: nil) ⇒ Vapi::TestSuiteRun

Parameters:

  • test_suite_id (String)
  • id (String)
  • name (String) (defaults to: nil)

    This is the name of the test suite run.

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

Returns:



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/vapi_server_sdk/test_suite_runs/client.rb', line 308

def test_suite_run_controller_update(test_suite_id:, id:, name: nil, request_options: nil)
  Async do
    response = @request_client.conn.patch 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
      unless request_options.nil? || request_options&.additional_query_parameters.nil?
        req.params = { **(request_options&.additional_query_parameters || {}) }.compact
      end
      req.body = { **(request_options&.additional_body_parameters || {}), name: name }.compact
      req.url "#{@request_client.get_url(request_options: request_options)}/test-suite/#{test_suite_id}/run/#{id}"
    end
    Vapi::TestSuiteRun.from_json(json_object: response.body)
  end
end