Class: Schematic::Entitlements::Client
- Inherits:
-
Object
- Object
- Schematic::Entitlements::Client
- Defined in:
- lib/schematic/entitlements/client.rb
Instance Method Summary collapse
- #count_company_overrides(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountCompanyOverridesResponse
- #count_feature_companies(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountFeatureCompaniesResponse
- #count_feature_usage(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountFeatureUsageResponse
- #count_feature_users(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountFeatureUsersResponse
- #count_plan_entitlements(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountPlanEntitlementsResponse
- #create_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CreateCompanyOverrideResponse
- #create_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CreatePlanEntitlementResponse
- #delete_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::DeleteCompanyOverrideResponse
- #delete_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::DeletePlanEntitlementResponse
- #duplicate_plan_entitlements(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::DuplicatePlanEntitlementsResponse
- #get_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetCompanyOverrideResponse
- #get_feature_usage_by_company(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetFeatureUsageByCompanyResponse
- #get_feature_usage_time_series(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetFeatureUsageTimeSeriesResponse
- #get_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetPlanEntitlementResponse
- #get_user_usage_by_company(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetUserUsageByCompanyResponse
- #get_user_usage_detail(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetUserUsageDetailResponse
- #initialize(client:) ⇒ void constructor
- #list_company_overrides(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListCompanyOverridesResponse
- #list_feature_companies(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureCompaniesResponse
- #list_feature_usage(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureUsageResponse
- #list_feature_usage_history(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureUsageHistoryResponse
- #list_feature_users(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureUsersResponse
- #list_plan_entitlements(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListPlanEntitlementsResponse
- #update_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::UpdateCompanyOverrideResponse
- #update_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::UpdatePlanEntitlementResponse
- #upsert_plan_entitlement_for_billing_product(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::UpsertPlanEntitlementForBillingProductResponse
Constructor Details
#initialize(client:) ⇒ void
9 10 11 |
# File 'lib/schematic/entitlements/client.rb', line 9 def initialize(client:) @client = client end |
Instance Method Details
#count_company_overrides(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountCompanyOverridesResponse
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/schematic/entitlements/client.rb', line 261 def count_company_overrides(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["company_ids"] = params[:company_ids] if params.key?(:company_ids) query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["without_expired"] = params[:without_expired] if params.key?(:without_expired) query_params["q"] = params[:q] if params.key?(:q) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-overrides/count", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CountCompanyOverridesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_feature_companies(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountFeatureCompaniesResponse
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/schematic/entitlements/client.rb', line 366 def count_feature_companies(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["q"] = params[:q] if params.key?(:q) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-companies/count", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CountFeatureCompaniesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_feature_usage(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountFeatureUsageResponse
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/schematic/entitlements/client.rb', line 601 def count_feature_usage(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["company_keys"] = params[:company_keys] if params.key?(:company_keys) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["include_usage_aggregation"] = params[:include_usage_aggregation] if params.key?(:include_usage_aggregation) query_params["managed_by"] = params[:managed_by] if params.key?(:managed_by) query_params["q"] = params[:q] if params.key?(:q) query_params["without_negative_entitlements"] = params[:without_negative_entitlements] if params.key?(:without_negative_entitlements) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-usage/count", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CountFeatureUsageResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_feature_users(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountFeatureUsersResponse
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 |
# File 'lib/schematic/entitlements/client.rb', line 706 def count_feature_users(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["q"] = params[:q] if params.key?(:q) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-users/count", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CountFeatureUsersResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_plan_entitlements(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CountPlanEntitlementsResponse
1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 |
# File 'lib/schematic/entitlements/client.rb', line 1034 def count_plan_entitlements(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id) query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids) query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id) query_params["plan_version_ids"] = params[:plan_version_ids] if params.key?(:plan_version_ids) query_params["q"] = params[:q] if params.key?(:q) query_params["with_metered_products"] = params[:with_metered_products] if params.key?(:with_metered_products) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "plan-entitlements/count", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CountPlanEntitlementsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#create_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CreateCompanyOverrideResponse
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/schematic/entitlements/client.rb', line 94 def create_company_override(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "company-overrides", body: Schematic::Entitlements::Types::CreateCompanyOverrideRequestBody.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CreateCompanyOverrideResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#create_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::CreatePlanEntitlementResponse
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 |
# File 'lib/schematic/entitlements/client.rb', line 822 def create_plan_entitlement(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "plan-entitlements", body: Schematic::Entitlements::Types::CreatePlanEntitlementRequestBody.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::CreatePlanEntitlementResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::DeleteCompanyOverrideResponse
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/schematic/entitlements/client.rb', line 208 def delete_company_override(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "company-overrides/#{URI.encode_uri_component(params[:company_override_id].to_s)}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::DeleteCompanyOverrideResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::DeletePlanEntitlementResponse
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 |
# File 'lib/schematic/entitlements/client.rb', line 936 def delete_plan_entitlement(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "plan-entitlements/#{URI.encode_uri_component(params[:plan_entitlement_id].to_s)}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::DeletePlanEntitlementResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#duplicate_plan_entitlements(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::DuplicatePlanEntitlementsResponse
1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 |
# File 'lib/schematic/entitlements/client.rb', line 1085 def duplicate_plan_entitlements(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "plan-entitlements/duplicate", body: Schematic::Entitlements::Types::DuplicatePlanEntitlementsRequestBody.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::DuplicatePlanEntitlementsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetCompanyOverrideResponse
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/schematic/entitlements/client.rb', line 130 def get_company_override(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-overrides/#{URI.encode_uri_component(params[:company_override_id].to_s)}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::GetCompanyOverrideResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_feature_usage_by_company(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetFeatureUsageByCompanyResponse
1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/schematic/entitlements/client.rb', line 1123 def get_feature_usage_by_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["keys"] = params[:keys] if params.key?(:keys) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "usage-by-company", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::GetFeatureUsageByCompanyResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_feature_usage_time_series(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetFeatureUsageTimeSeriesResponse
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 |
# File 'lib/schematic/entitlements/client.rb', line 541 def get_feature_usage_time_series(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["end_time"] = params[:end_time] if params.key?(:end_time) query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["granularity"] = params[:granularity] if params.key?(:granularity) query_params["start_time"] = params[:start_time] if params.key?(:start_time) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-usage-timeseries", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::GetFeatureUsageTimeSeriesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetPlanEntitlementResponse
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
# File 'lib/schematic/entitlements/client.rb', line 858 def get_plan_entitlement(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "plan-entitlements/#{URI.encode_uri_component(params[:plan_entitlement_id].to_s)}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::GetPlanEntitlementResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_user_usage_by_company(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetUserUsageByCompanyResponse
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 |
# File 'lib/schematic/entitlements/client.rb', line 1170 def get_user_usage_by_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["end_time"] = params[:end_time] if params.key?(:end_time) query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["start_time"] = params[:start_time] if params.key?(:start_time) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "user-usage-by-company", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::GetUserUsageByCompanyResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_user_usage_detail(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::GetUserUsageDetailResponse
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 |
# File 'lib/schematic/entitlements/client.rb', line 1220 def get_user_usage_detail(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["end_time"] = params[:end_time] if params.key?(:end_time) query_params["start_time"] = params[:start_time] if params.key?(:start_time) query_params["user_id"] = params[:user_id] if params.key?(:user_id) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "user-usage-detail", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::GetUserUsageDetailResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_company_overrides(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListCompanyOverridesResponse
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 71 72 73 74 75 76 |
# File 'lib/schematic/entitlements/client.rb', line 44 def list_company_overrides(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["company_ids"] = params[:company_ids] if params.key?(:company_ids) query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["without_expired"] = params[:without_expired] if params.key?(:without_expired) query_params["q"] = params[:q] if params.key?(:q) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-overrides", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::ListCompanyOverridesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_feature_companies(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureCompaniesResponse
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/schematic/entitlements/client.rb', line 316 def list_feature_companies(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["q"] = params[:q] if params.key?(:q) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-companies", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::ListFeatureCompaniesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_feature_usage(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureUsageResponse
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/schematic/entitlements/client.rb', line 425 def list_feature_usage(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["company_keys"] = params[:company_keys] if params.key?(:company_keys) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["include_usage_aggregation"] = params[:include_usage_aggregation] if params.key?(:include_usage_aggregation) query_params["managed_by"] = params[:managed_by] if params.key?(:managed_by) query_params["q"] = params[:q] if params.key?(:q) query_params["without_negative_entitlements"] = params[:without_negative_entitlements] if params.key?(:without_negative_entitlements) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-usage", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::ListFeatureUsageResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_feature_usage_history(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureUsageHistoryResponse
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 |
# File 'lib/schematic/entitlements/client.rb', line 486 def list_feature_usage_history(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["company_ids"] = params[:company_ids] if params.key?(:company_ids) query_params["end_time"] = params[:end_time] if params.key?(:end_time) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["granularity"] = params[:granularity] if params.key?(:granularity) query_params["start_time"] = params[:start_time] if params.key?(:start_time) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-usage-history", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::ListFeatureUsageHistoryResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_feature_users(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListFeatureUsersResponse
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
# File 'lib/schematic/entitlements/client.rb', line 656 def list_feature_users(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["q"] = params[:q] if params.key?(:q) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "feature-users", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::ListFeatureUsersResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_plan_entitlements(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::ListPlanEntitlementsResponse
770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 |
# File 'lib/schematic/entitlements/client.rb', line 770 def list_plan_entitlements(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["feature_id"] = params[:feature_id] if params.key?(:feature_id) query_params["feature_ids"] = params[:feature_ids] if params.key?(:feature_ids) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id) query_params["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids) query_params["plan_version_id"] = params[:plan_version_id] if params.key?(:plan_version_id) query_params["plan_version_ids"] = params[:plan_version_ids] if params.key?(:plan_version_ids) query_params["q"] = params[:q] if params.key?(:q) query_params["with_metered_products"] = params[:with_metered_products] if params.key?(:with_metered_products) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "plan-entitlements", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::ListPlanEntitlementsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#update_company_override(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::UpdateCompanyOverrideResponse
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/schematic/entitlements/client.rb', line 168 def update_company_override(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request_data = Schematic::Entitlements::Types::UpdateCompanyOverrideRequestBody.new(params).to_h non_body_param_names = %w[company_override_id] body = request_data.except(*non_body_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "PUT", path: "company-overrides/#{URI.encode_uri_component(params[:company_override_id].to_s)}", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::UpdateCompanyOverrideResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#update_plan_entitlement(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::UpdatePlanEntitlementResponse
896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 |
# File 'lib/schematic/entitlements/client.rb', line 896 def update_plan_entitlement(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request_data = Schematic::Entitlements::Types::UpdatePlanEntitlementRequestBody.new(params).to_h non_body_param_names = %w[plan_entitlement_id] body = request_data.except(*non_body_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "PUT", path: "plan-entitlements/#{URI.encode_uri_component(params[:plan_entitlement_id].to_s)}", body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::UpdatePlanEntitlementResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#upsert_plan_entitlement_for_billing_product(request_options: {}, **params) ⇒ Schematic::Entitlements::Types::UpsertPlanEntitlementForBillingProductResponse
976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 |
# File 'lib/schematic/entitlements/client.rb', line 976 def upsert_plan_entitlement_for_billing_product(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "plan-entitlements/billing-linked", body: Schematic::Entitlements::Types::CreateBillingLinkedPlanEntitlementRequestBody.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Schematic::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Schematic::Entitlements::Types::UpsertPlanEntitlementForBillingProductResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |