Class: Vapi::TestSuitesClient
- Inherits:
-
Object
- Object
- Vapi::TestSuitesClient
- Defined in:
- lib/vapi_server_sdk/test_suites/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #initialize(request_client:) ⇒ Vapi::TestSuitesClient constructor
- #test_suite_controller_create(name: nil, phone_number_id: nil, tester_plan: nil, target_plan: nil, request_options: nil) ⇒ Vapi::TestSuite
- #test_suite_controller_find_all_paginated(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::TestSuitesPaginatedResponse
- #test_suite_controller_find_one(id:, request_options: nil) ⇒ Vapi::TestSuite
- #test_suite_controller_remove(id:, request_options: nil) ⇒ Vapi::TestSuite
- #test_suite_controller_update(id:, name: nil, phone_number_id: nil, tester_plan: nil, target_plan: nil, request_options: nil) ⇒ Vapi::TestSuite
Constructor Details
#initialize(request_client:) ⇒ Vapi::TestSuitesClient
19 20 21 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 19 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Vapi::RequestClient (readonly)
15 16 17 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 15 def request_client @request_client end |
Instance Method Details
#test_suite_controller_create(name: nil, phone_number_id: nil, tester_plan: nil, target_plan: nil, request_options: nil) ⇒ Vapi::TestSuite
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 438 def test_suite_controller_create(name: nil, phone_number_id: nil, tester_plan: nil, target_plan: nil, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), name: name, phoneNumberId: phone_number_id, testerPlan: tester_plan, targetPlan: target_plan }.compact req.url "#{@request_client.get_url(request_options: )}/test-suite" end Vapi::TestSuite.from_json(json_object: response.body) end |
#test_suite_controller_find_all_paginated(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::TestSuitesPaginatedResponse
40 41 42 43 44 45 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 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 40 def test_suite_controller_find_all_paginated(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..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.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 .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/test-suite" end Vapi::TestSuitesPaginatedResponse.from_json(json_object: response.body) end |
#test_suite_controller_find_one(id:, request_options: nil) ⇒ Vapi::TestSuite
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 466 def test_suite_controller_find_one(id:, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/test-suite/#{id}" end Vapi::TestSuite.from_json(json_object: response.body) end |
#test_suite_controller_remove(id:, request_options: nil) ⇒ Vapi::TestSuite
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 489 def test_suite_controller_remove(id:, request_options: nil) response = @request_client.conn.delete do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/test-suite/#{id}" end Vapi::TestSuite.from_json(json_object: response.body) end |
#test_suite_controller_update(id:, name: nil, phone_number_id: nil, tester_plan: nil, target_plan: nil, request_options: nil) ⇒ Vapi::TestSuite
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/vapi_server_sdk/test_suites/client.rb', line 876 def test_suite_controller_update(id:, name: nil, phone_number_id: nil, tester_plan: nil, target_plan: nil, request_options: nil) response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(&.additional_body_parameters || {}), name: name, phoneNumberId: phone_number_id, testerPlan: tester_plan, targetPlan: target_plan }.compact req.url "#{@request_client.get_url(request_options: )}/test-suite/#{id}" end Vapi::TestSuite.from_json(json_object: response.body) end |