Class: NewDemoApiClient::AsyncBenchmarkClient
- Inherits:
-
Object
- Object
- NewDemoApiClient::AsyncBenchmarkClient
- Defined in:
- lib/test_sdk/benchmark/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#get_available_benchmark_categories(group_id:, request_options: nil) ⇒ NewDemoApiClient::AVAILABLE_CATEGORIES_RESPONSE
Get the list of categories with benchmark models available for the account.
-
#get_available_company_categories(group_id:, deal_id:, request_options: nil) ⇒ NewDemoApiClient::AVAILABLE_CATEGORIES_RESPONSE
Get the categories with benchmark models available for the company associated with the deal.
-
#get_available_models(group_id:, request_options: nil) ⇒ NewDemoApiClient::AvailableModelsResponse
Get the list of available scaling and tradeoff models for the account.
-
#get_categories_metadata(request_options: nil) ⇒ NewDemoApiClient::CategoriesMetadataResponse
Get the categories metadata.
-
#get_columns_metadata(request_options: nil) ⇒ NewDemoApiClient::ColumnsMetadataResponse
Get the columns metadata.
-
#get_combined_time_series(user_type:, group_id:, deal_id:, column: nil, request_options: nil) ⇒ Array<NewDemoApiClient::DealCombinedMetricsResponse>
Get the combined time series data for the deal.
-
#get_deal_benchmark_quantiles(group_id:, deal_id:, category:, column: nil, request_options: nil) ⇒ Array<NewDemoApiClient::BenchmarkQuantile>
Get the benchmark quantiles for a given category.
-
#get_deal_benchmark_tradeoff_at_scale(group_id:, deal_id:, category:, model: nil, request_options: nil) ⇒ NewDemoApiClient::TRADEOFF_MODELS_RESPONSE
Get the tradeoff models for a given category.
-
#get_models_metadata(request_options: nil) ⇒ Array<NewDemoApiClient::ModelsMetadataResponse>
Get the models metadata.
-
#get_quantiles(group_id:, category:, revenue:, column: nil, request_options: nil) ⇒ Array<NewDemoApiClient::BenchmarkQuantile>
Get the benchmark quantiles for a given category at a specified revenue scale.
-
#get_scaling(group_id:, category:, model: nil, request_options: nil) ⇒ NewDemoApiClient::SCALE_MODELS_RESPONSE
Get the scaling models for a given category.
-
#get_time_series_endpoint(user_type:, group_id:, deal_id:, column: nil, request_options: nil) ⇒ NewDemoApiClient::DealCombinedMetricsResponse
Get the time series data endpoint for the deal.
-
#get_tradeoff_at_scale(group_id:, category:, revenue:, model: nil, request_options: nil) ⇒ NewDemoApiClient::TRADEOFF_MODELS_RESPONSE
Get the tradeoff at scale model for a given category.
- #initialize(request_client:) ⇒ NewDemoApiClient::AsyncBenchmarkClient constructor
Constructor Details
#initialize(request_client:) ⇒ NewDemoApiClient::AsyncBenchmarkClient
517 518 519 |
# File 'lib/test_sdk/benchmark/client.rb', line 517 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ NewDemoApiClient::AsyncRequestClient (readonly)
513 514 515 |
# File 'lib/test_sdk/benchmark/client.rb', line 513 def request_client @request_client end |
Instance Method Details
#get_available_benchmark_categories(group_id:, request_options: nil) ⇒ NewDemoApiClient::AVAILABLE_CATEGORIES_RESPONSE
Get the list of categories with benchmark models available for the account.
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/test_sdk/benchmark/client.rb', line 533 def get_available_benchmark_categories(group_id:, request_options: nil) Async do 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: )}/api/v1/group/#{group_id}/data/benchmark/available-benchmark-categories" end parsed_json = JSON.parse(response.body) parsed_json end end |
#get_available_company_categories(group_id:, deal_id:, request_options: nil) ⇒ NewDemoApiClient::AVAILABLE_CATEGORIES_RESPONSE
Get the categories with benchmark models available for the company associated
with the deal.
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 |
# File 'lib/test_sdk/benchmark/client.rb', line 737 def get_available_company_categories(group_id:, deal_id:, request_options: nil) Async do 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: )}/api/v1/group/#{group_id}/deal/#{deal_id}/data/benchmark/available-categories" end parsed_json = JSON.parse(response.body) parsed_json end end |
#get_available_models(group_id:, request_options: nil) ⇒ NewDemoApiClient::AvailableModelsResponse
Get the list of available scaling and tradeoff models for the account.
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
# File 'lib/test_sdk/benchmark/client.rb', line 654 def get_available_models(group_id:, request_options: nil) Async do 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: )}/api/v1/group/#{group_id}/data/benchmark/available-models" end NewDemoApiClient::AvailableModelsResponse.from_json(json_object: response.body) end end |
#get_categories_metadata(request_options: nil) ⇒ NewDemoApiClient::CategoriesMetadataResponse
Get the categories metadata.
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 |
# File 'lib/test_sdk/benchmark/client.rb', line 1009 def (request_options: nil) Async do 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: )}/api/v1/data/benchmark/metadata/categories" end NewDemoApiClient::CategoriesMetadataResponse.from_json(json_object: response.body) end end |
#get_columns_metadata(request_options: nil) ⇒ NewDemoApiClient::ColumnsMetadataResponse
Get the columns metadata.
939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 |
# File 'lib/test_sdk/benchmark/client.rb', line 939 def (request_options: nil) Async do 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: )}/api/v1/data/benchmark/metadata/columns" end NewDemoApiClient::ColumnsMetadataResponse.from_json(json_object: response.body) end end |
#get_combined_time_series(user_type:, group_id:, deal_id:, column: nil, request_options: nil) ⇒ Array<NewDemoApiClient::DealCombinedMetricsResponse>
Get the combined time series data for the deal.
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 |
# File 'lib/test_sdk/benchmark/client.rb', line 779 def get_combined_time_series(user_type:, group_id:, deal_id:, column: nil, request_options: nil) Async do 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 || {}), "column": column }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{user_type}/deal/#{group_id}/data/benchmark/combined-time-series/#{deal_id}" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::DealCombinedMetricsResponse.from_json(json_object: item) end end end |
#get_deal_benchmark_quantiles(group_id:, deal_id:, category:, column: nil, request_options: nil) ⇒ Array<NewDemoApiClient::BenchmarkQuantile>
Get the benchmark quantiles for a given category.
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 |
# File 'lib/test_sdk/benchmark/client.rb', line 861 def get_deal_benchmark_quantiles(group_id:, deal_id:, category:, column: nil, request_options: nil) Async do 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 || {}), "column": column }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/deal/#{deal_id}/data/benchmark/quantiles/#{category}" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::BenchmarkQuantile.from_json(json_object: item) end end end |
#get_deal_benchmark_tradeoff_at_scale(group_id:, deal_id:, category:, model: nil, request_options: nil) ⇒ NewDemoApiClient::TRADEOFF_MODELS_RESPONSE
Get the tradeoff models for a given category.
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 |
# File 'lib/test_sdk/benchmark/client.rb', line 904 def get_deal_benchmark_tradeoff_at_scale(group_id:, deal_id:, category:, model: nil, request_options: nil) Async do 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 || {}), "model": model }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/deal/#{deal_id}/data/benchmark/tradeoff-at-scale/#{category}" end parsed_json = JSON.parse(response.body) parsed_json&.transform_values do |value| value = value.to_json NewDemoApiClient::TradeoffModel.from_json(json_object: value) end end end |
#get_models_metadata(request_options: nil) ⇒ Array<NewDemoApiClient::ModelsMetadataResponse>
Get the models metadata.
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 |
# File 'lib/test_sdk/benchmark/client.rb', line 972 def (request_options: nil) Async do 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: )}/api/v1/data/benchmark/metadata/models" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::ModelsMetadataResponse.from_json(json_object: item) end end end |
#get_quantiles(group_id:, category:, revenue:, column: nil, request_options: nil) ⇒ Array<NewDemoApiClient::BenchmarkQuantile>
Get the benchmark quantiles for a given category at a specified revenue scale.
If columns are specified, only those columns will be returned.
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/test_sdk/benchmark/client.rb', line 576 def get_quantiles(group_id:, category:, revenue:, column: nil, request_options: nil) Async do 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 || {}), "revenue": revenue, "column": column }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/data/benchmark/quantiles/#{category}" end parsed_json = JSON.parse(response.body) parsed_json&.map do |item| item = item.to_json NewDemoApiClient::BenchmarkQuantile.from_json(json_object: item) end end end |
#get_scaling(group_id:, category:, model: nil, request_options: nil) ⇒ NewDemoApiClient::SCALE_MODELS_RESPONSE
Get the scaling models for a given category. Multiple models can be specified.
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 |
# File 'lib/test_sdk/benchmark/client.rb', line 618 def get_scaling(group_id:, category:, model: nil, request_options: nil) Async do 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 || {}), "model": model }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/data/benchmark/scaling/#{category}" end parsed_json = JSON.parse(response.body) parsed_json&.transform_values do |value| value = value.to_json NewDemoApiClient::ScaleModel.from_json(json_object: value) end end end |
#get_time_series_endpoint(user_type:, group_id:, deal_id:, column: nil, request_options: nil) ⇒ NewDemoApiClient::DealCombinedMetricsResponse
Get the time series data endpoint for the deal.
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 |
# File 'lib/test_sdk/benchmark/client.rb', line 822 def get_time_series_endpoint(user_type:, group_id:, deal_id:, column: nil, request_options: nil) Async do 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 || {}), "column": column }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{user_type}/deal/#{group_id}/data/benchmark/time-series-endpoint/#{deal_id}" end NewDemoApiClient::DealCombinedMetricsResponse.from_json(json_object: response.body) end end |
#get_tradeoff_at_scale(group_id:, category:, revenue:, model: nil, request_options: nil) ⇒ NewDemoApiClient::TRADEOFF_MODELS_RESPONSE
Get the tradeoff at scale model for a given category.
695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 |
# File 'lib/test_sdk/benchmark/client.rb', line 695 def get_tradeoff_at_scale(group_id:, category:, revenue:, model: nil, request_options: nil) Async do 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 || {}), "revenue": revenue, "model": model }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/api/v1/group/#{group_id}/data/benchmark/tradeoff-at-scale/#{category}" end parsed_json = JSON.parse(response.body) parsed_json&.transform_values do |value| value = value.to_json NewDemoApiClient::TradeoffModel.from_json(json_object: value) end end end |