Class: Schematic::Companies::Client
- Inherits:
-
Object
- Object
- Schematic::Companies::Client
- Defined in:
- lib/schematic/companies/client.rb
Instance Method Summary collapse
- #count_companies(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountCompaniesResponse
- #count_entity_key_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountEntityKeyDefinitionsResponse
- #count_entity_trait_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountEntityTraitDefinitionsResponse
- #count_plan_traits(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountPlanTraitsResponse
- #count_users(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountUsersResponse
- #create_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::CreateCompanyResponse
- #create_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::CreateUserResponse
- #delete_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteCompanyResponse
- #delete_company_by_keys(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteCompanyByKeysResponse
- #delete_company_membership(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteCompanyMembershipResponse
- #delete_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteUserResponse
- #delete_user_by_keys(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteUserByKeysResponse
- #get_active_company_subscription(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetActiveCompanySubscriptionResponse
- #get_billing_entity_child_subscriptions(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetBillingEntityChildSubscriptionsResponse
- #get_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetCompanyResponse
- #get_company_billing_entity(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetCompanyBillingEntityResponse
- #get_entity_trait_definition(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetEntityTraitDefinitionResponse
- #get_entity_trait_values(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetEntityTraitValuesResponse
- #get_or_create_company_membership(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetOrCreateCompanyMembershipResponse
- #get_or_create_entity_trait_definition(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetOrCreateEntityTraitDefinitionResponse
- #get_plan_change(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetPlanChangeResponse
- #get_plan_trait(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetPlanTraitResponse
- #get_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetUserResponse
- #initialize(client:) ⇒ void constructor
- #list_companies(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListCompaniesResponse
- #list_company_memberships(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListCompanyMembershipsResponse
- #list_entity_key_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListEntityKeyDefinitionsResponse
- #list_entity_trait_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListEntityTraitDefinitionsResponse
- #list_plan_changes(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListPlanChangesResponse
- #list_plan_traits(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListPlanTraitsResponse
- #list_users(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListUsersResponse
-
#lookup_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::LookupCompanyResponse
Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work.
- #lookup_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::LookupUserResponse
- #update_entity_trait_definition(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpdateEntityTraitDefinitionResponse
- #update_plan_traits_bulk(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpdatePlanTraitsBulkResponse
- #upsert_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertCompanyResponse
- #upsert_company_trait(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertCompanyTraitResponse
- #upsert_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertUserResponse
- #upsert_user_trait(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertUserTraitResponse
Constructor Details
#initialize(client:) ⇒ void
9 10 11 |
# File 'lib/schematic/companies/client.rb', line 9 def initialize(client:) @client = client end |
Instance Method Details
#count_companies(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountCompaniesResponse
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/schematic/companies/client.rb', line 223 def count_companies(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[credit_type_ids has_scheduled_downgrade ids monetized_subscriptions plan_id plan_ids plan_version_id plan_version_ids q sort_order_column sort_order_direction subscription_statuses subscription_types with_entitlement_for without_feature_override_for without_plan without_subscription with_subscription limit offset] query_params = {} query_params["credit_type_ids"] = params[:credit_type_ids] if params.key?(:credit_type_ids) query_params["has_scheduled_downgrade"] = params[:has_scheduled_downgrade] if params.key?(:has_scheduled_downgrade) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["monetized_subscriptions"] = params[:monetized_subscriptions] if params.key?(:monetized_subscriptions) 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["sort_order_column"] = params[:sort_order_column] if params.key?(:sort_order_column) query_params["sort_order_direction"] = params[:sort_order_direction] if params.key?(:sort_order_direction) query_params["subscription_statuses"] = params[:subscription_statuses] if params.key?(:subscription_statuses) query_params["subscription_types"] = params[:subscription_types] if params.key?(:subscription_types) query_params["with_entitlement_for"] = params[:with_entitlement_for] if params.key?(:with_entitlement_for) query_params["without_feature_override_for"] = params[:without_feature_override_for] if params.key?(:without_feature_override_for) query_params["without_plan"] = params[:without_plan] if params.key?(:without_plan) query_params["without_subscription"] = params[:without_subscription] if params.key?(:without_subscription) query_params["with_subscription"] = params[:with_subscription] if params.key?(:with_subscription) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "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::Companies::Types::CountCompaniesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_entity_key_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountEntityKeyDefinitionsResponse
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 |
# File 'lib/schematic/companies/client.rb', line 698 def count_entity_key_definitions(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[entity_type ids q limit offset] query_params = {} query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type) query_params["ids"] = params[:ids] if params.key?(:ids) 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) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "entity-key-definitions/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::Companies::Types::CountEntityKeyDefinitionsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_entity_trait_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountEntityTraitDefinitionsResponse
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 922 923 924 925 926 927 928 929 |
# File 'lib/schematic/companies/client.rb', line 897 def count_entity_trait_definitions(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[entity_type ids q trait_type trait_types limit offset] query_params = {} query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["q"] = params[:q] if params.key?(:q) query_params["trait_type"] = params[:trait_type] if params.key?(:trait_type) query_params["trait_types"] = params[:trait_types] if params.key?(:trait_types) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "entity-trait-definitions/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::Companies::Types::CountEntityTraitDefinitionsResponse.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_traits(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountPlanTraitsResponse
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 |
# File 'lib/schematic/companies/client.rb', line 1184 def count_plan_traits(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[ids plan_id trait_id trait_ids limit offset] query_params = {} query_params["ids"] = params[:ids] if params.key?(:ids) query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id) query_params["trait_id"] = params[:trait_id] if params.key?(:trait_id) query_params["trait_ids"] = params[:trait_ids] if params.key?(:trait_ids) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "plan-traits/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::Companies::Types::CountPlanTraitsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#count_users(request_options: {}, **params) ⇒ Schematic::Companies::Types::CountUsersResponse
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 |
# File 'lib/schematic/companies/client.rb', line 1408 def count_users(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[company_id ids plan_id q limit offset] query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["plan_id"] = params[:plan_id] if params.key?(:plan_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) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "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::Companies::Types::CountUsersResponse.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(request_options: {}, **params) ⇒ Schematic::Companies::Types::CreateCompanyResponse
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/schematic/companies/client.rb', line 279 def create_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "companies/create", body: Schematic::Types::UpsertCompanyRequestBody.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::Companies::Types::CreateCompanyResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#create_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::CreateUserResponse
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 |
# File 'lib/schematic/companies/client.rb', line 1450 def create_user(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "users/create", body: Schematic::Types::UpsertUserRequestBody.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::Companies::Types::CreateUserResponse.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(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteCompanyResponse
165 166 167 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 |
# File 'lib/schematic/companies/client.rb', line 165 def delete_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[cancel_subscription prorate] query_params = {} query_params["cancel_subscription"] = params[:cancel_subscription] if params.key?(:cancel_subscription) query_params["prorate"] = params[:prorate] if params.key?(:prorate) params = params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}", 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::Companies::Types::DeleteCompanyResponse.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_by_keys(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteCompanyByKeysResponse
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/schematic/companies/client.rb', line 311 def delete_company_by_keys(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "companies/delete", body: Schematic::Types::KeysRequestBody.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::Companies::Types::DeleteCompanyByKeysResponse.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_membership(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteCompanyMembershipResponse
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 |
# File 'lib/schematic/companies/client.rb', line 540 def delete_company_membership(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-memberships/#{URI.encode_uri_component(params[:company_membership_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::Companies::Types::DeleteCompanyMembershipResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteUserResponse
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 |
# File 'lib/schematic/companies/client.rb', line 1371 def delete_user(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "users/#{URI.encode_uri_component(params[:user_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::Companies::Types::DeleteUserResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete_user_by_keys(request_options: {}, **params) ⇒ Schematic::Companies::Types::DeleteUserByKeysResponse
1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 |
# File 'lib/schematic/companies/client.rb', line 1482 def delete_user_by_keys(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "users/delete", body: Schematic::Types::KeysRequestBody.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::Companies::Types::DeleteUserByKeysResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_active_company_subscription(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetActiveCompanySubscriptionResponse
575 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 603 604 |
# File 'lib/schematic/companies/client.rb', line 575 def get_active_company_subscription(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[company_id company_ids limit offset] 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["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-subscriptions", 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::Companies::Types::GetActiveCompanySubscriptionResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_billing_entity_child_subscriptions(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetBillingEntityChildSubscriptionsResponse
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 |
# File 'lib/schematic/companies/client.rb', line 426 def get_billing_entity_child_subscriptions(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[company_id] query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-billing-entity-subscriptions", 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::Companies::Types::GetBillingEntityChildSubscriptionsResponse.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(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetCompanyResponse
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/schematic/companies/client.rb', line 131 def get_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "companies/#{URI.encode_uri_component(params[:company_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::Companies::Types::GetCompanyResponse.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_billing_entity(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetCompanyBillingEntityResponse
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/schematic/companies/client.rb', line 388 def get_company_billing_entity(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[company_id] query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-billing-entity", 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::Companies::Types::GetCompanyBillingEntityResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_entity_trait_definition(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetEntityTraitDefinitionResponse
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 |
# File 'lib/schematic/companies/client.rb', line 822 def get_entity_trait_definition(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "entity-trait-definitions/#{URI.encode_uri_component(params[:entity_trait_definition_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::Companies::Types::GetEntityTraitDefinitionResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_entity_trait_values(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetEntityTraitValuesResponse
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 |
# File 'lib/schematic/companies/client.rb', line 944 def get_entity_trait_values(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[definition_id q limit offset] query_params = {} query_params["definition_id"] = params[:definition_id] if params.key?(:definition_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) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "entity-trait-values", 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::Companies::Types::GetEntityTraitValuesResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_or_create_company_membership(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetOrCreateCompanyMembershipResponse
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
# File 'lib/schematic/companies/client.rb', line 507 def get_or_create_company_membership(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-memberships", body: Schematic::Companies::Types::GetOrCreateCompanyMembershipRequestBody.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::Companies::Types::GetOrCreateCompanyMembershipResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_or_create_entity_trait_definition(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetOrCreateEntityTraitDefinitionResponse
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/schematic/companies/client.rb', line 789 def get_or_create_entity_trait_definition(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "entity-trait-definitions", body: Schematic::Companies::Types::CreateEntityTraitDefinitionRequestBody.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::Companies::Types::GetOrCreateEntityTraitDefinitionResponse.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_change(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetPlanChangeResponse
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 |
# File 'lib/schematic/companies/client.rb', line 1035 def get_plan_change(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-changes/#{URI.encode_uri_component(params[:plan_change_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::Companies::Types::GetPlanChangeResponse.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_trait(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetPlanTraitResponse
1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
# File 'lib/schematic/companies/client.rb', line 1115 def get_plan_trait(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-traits/#{URI.encode_uri_component(params[:plan_trait_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::Companies::Types::GetPlanTraitResponse.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(request_options: {}, **params) ⇒ Schematic::Companies::Types::GetUserResponse
1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 |
# File 'lib/schematic/companies/client.rb', line 1339 def get_user(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "users/#{URI.encode_uri_component(params[:user_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::Companies::Types::GetUserResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_companies(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListCompaniesResponse
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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/schematic/companies/client.rb', line 42 def list_companies(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[credit_type_ids has_scheduled_downgrade ids monetized_subscriptions plan_id plan_ids plan_version_id plan_version_ids q sort_order_column sort_order_direction subscription_statuses subscription_types with_entitlement_for without_feature_override_for without_plan without_subscription with_subscription limit offset] query_params = {} query_params["credit_type_ids"] = params[:credit_type_ids] if params.key?(:credit_type_ids) query_params["has_scheduled_downgrade"] = params[:has_scheduled_downgrade] if params.key?(:has_scheduled_downgrade) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["monetized_subscriptions"] = params[:monetized_subscriptions] if params.key?(:monetized_subscriptions) 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["sort_order_column"] = params[:sort_order_column] if params.key?(:sort_order_column) query_params["sort_order_direction"] = params[:sort_order_direction] if params.key?(:sort_order_direction) query_params["subscription_statuses"] = params[:subscription_statuses] if params.key?(:subscription_statuses) query_params["subscription_types"] = params[:subscription_types] if params.key?(:subscription_types) query_params["with_entitlement_for"] = params[:with_entitlement_for] if params.key?(:with_entitlement_for) query_params["without_feature_override_for"] = params[:without_feature_override_for] if params.key?(:without_feature_override_for) query_params["without_plan"] = params[:without_plan] if params.key?(:without_plan) query_params["without_subscription"] = params[:without_subscription] if params.key?(:without_subscription) query_params["with_subscription"] = params[:with_subscription] if params.key?(:with_subscription) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "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::Companies::Types::ListCompaniesResponse.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_memberships(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListCompanyMembershipsResponse
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/schematic/companies/client.rb', line 467 def list_company_memberships(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[company_id user_id limit offset] query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["user_id"] = params[:user_id] if params.key?(:user_id) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "company-memberships", 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::Companies::Types::ListCompanyMembershipsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_entity_key_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListEntityKeyDefinitionsResponse
652 653 654 655 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 |
# File 'lib/schematic/companies/client.rb', line 652 def list_entity_key_definitions(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[entity_type ids q limit offset] query_params = {} query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type) query_params["ids"] = params[:ids] if params.key?(:ids) 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) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "entity-key-definitions", 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::Companies::Types::ListEntityKeyDefinitionsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_entity_trait_definitions(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListEntityTraitDefinitionsResponse
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 |
# File 'lib/schematic/companies/client.rb', line 746 def list_entity_trait_definitions(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[entity_type ids q trait_type trait_types limit offset] query_params = {} query_params["entity_type"] = params[:entity_type] if params.key?(:entity_type) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["q"] = params[:q] if params.key?(:q) query_params["trait_type"] = params[:trait_type] if params.key?(:trait_type) query_params["trait_types"] = params[:trait_types] if params.key?(:trait_types) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "entity-trait-definitions", 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::Companies::Types::ListEntityTraitDefinitionsResponse.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_changes(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListPlanChangesResponse
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 |
# File 'lib/schematic/companies/client.rb', line 991 def list_plan_changes(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[action base_plan_action company_id company_ids plan_ids limit offset] query_params = {} query_params["action"] = params[:action] if params.key?(:action) query_params["base_plan_action"] = params[:base_plan_action] if params.key?(:base_plan_action) 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["plan_ids"] = params[:plan_ids] if params.key?(:plan_ids) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "plan-changes", 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::Companies::Types::ListPlanChangesResponse.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_traits(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListPlanTraitsResponse
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 |
# File 'lib/schematic/companies/client.rb', line 1072 def list_plan_traits(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[ids plan_id trait_id trait_ids limit offset] query_params = {} query_params["ids"] = params[:ids] if params.key?(:ids) query_params["plan_id"] = params[:plan_id] if params.key?(:plan_id) query_params["trait_id"] = params[:trait_id] if params.key?(:trait_id) query_params["trait_ids"] = params[:trait_ids] if params.key?(:trait_ids) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["offset"] = params[:offset] if params.key?(:offset) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "plan-traits", 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::Companies::Types::ListPlanTraitsResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_users(request_options: {}, **params) ⇒ Schematic::Companies::Types::ListUsersResponse
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 |
# File 'lib/schematic/companies/client.rb', line 1264 def list_users(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[company_id ids plan_id q limit offset] query_params = {} query_params["company_id"] = params[:company_id] if params.key?(:company_id) query_params["ids"] = params[:ids] if params.key?(:ids) query_params["plan_id"] = params[:plan_id] if params.key?(:plan_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) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "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::Companies::Types::ListUsersResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#lookup_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::LookupCompanyResponse
Company lookup is determined to resolve a company from its keys, similar to how many of our other apis work. The following approaches will all work to resolve a company and any of them are appropriate:
/companies/lookup?keys={"foo": "bar", "fizz": "buzz"}/companies/lookup?keys[foo]=bar&keys[fizz]=buzz/companies/lookup?foo=bar&fizz=buzz
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/schematic/companies/client.rb', line 350 def lookup_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[keys] query_params = {} query_params["keys"] = params[:keys] if params.key?(:keys) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "companies/lookup", 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::Companies::Types::LookupCompanyResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#lookup_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::LookupUserResponse
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 |
# File 'lib/schematic/companies/client.rb', line 1515 def lookup_user(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[keys] query_params = {} query_params["keys"] = params[:keys] if params.key?(:keys) params.except(*query_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "users/lookup", 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::Companies::Types::LookupUserResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#update_entity_trait_definition(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpdateEntityTraitDefinitionResponse
854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/schematic/companies/client.rb', line 854 def update_entity_trait_definition(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request_data = Schematic::Companies::Types::UpdateEntityTraitDefinitionRequestBody.new(params).to_h non_body_param_names = ["entity_trait_definition_id"] body = request_data.except(*non_body_param_names) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "PUT", path: "entity-trait-definitions/#{URI.encode_uri_component(params[:entity_trait_definition_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::Companies::Types::UpdateEntityTraitDefinitionResponse.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_traits_bulk(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpdatePlanTraitsBulkResponse
1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 |
# File 'lib/schematic/companies/client.rb', line 1146 def update_plan_traits_bulk(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-traits/bulk", body: Schematic::Companies::Types::UpdatePlanTraitBulkRequestBody.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::Companies::Types::UpdatePlanTraitsBulkResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#upsert_company(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertCompanyResponse
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/schematic/companies/client.rb', line 98 def upsert_company(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "companies", body: Schematic::Types::UpsertCompanyRequestBody.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::Companies::Types::UpsertCompanyResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#upsert_company_trait(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertCompanyTraitResponse
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 |
# File 'lib/schematic/companies/client.rb', line 615 def upsert_company_trait(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-traits", body: Schematic::Types::UpsertTraitRequestBody.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::Companies::Types::UpsertCompanyTraitResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#upsert_user(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertUserResponse
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 |
# File 'lib/schematic/companies/client.rb', line 1306 def upsert_user(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "users", body: Schematic::Types::UpsertUserRequestBody.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::Companies::Types::UpsertUserResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#upsert_user_trait(request_options: {}, **params) ⇒ Schematic::Companies::Types::UpsertUserTraitResponse
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/companies/client.rb', line 1226 def upsert_user_trait(request_options: {}, **params) params = Schematic::Internal::Types::Utils.normalize_keys(params) request = Schematic::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "user-traits", body: Schematic::Types::UpsertTraitRequestBody.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::Companies::Types::UpsertUserTraitResponse.load(response.body) else error_class = Schematic::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |