lib/intercom/service/company.rb in intercom-3.5.26 vs lib/intercom/service/company.rb in intercom-3.6.0
- old
+ new
@@ -3,11 +3,10 @@
require 'intercom/api_operations/scroll'
require 'intercom/api_operations/find'
require 'intercom/api_operations/find_all'
require 'intercom/api_operations/save'
require 'intercom/api_operations/load'
-require 'intercom/extended_api_operations/users'
require 'intercom/extended_api_operations/tags'
require 'intercom/extended_api_operations/segments'
module Intercom
module Service
@@ -16,15 +15,26 @@
include ApiOperations::FindAll
include ApiOperations::Load
include ApiOperations::List
include ApiOperations::Scroll
include ApiOperations::Save
- include ExtendedApiOperations::Users
include ExtendedApiOperations::Tags
include ExtendedApiOperations::Segments
def collection_class
Intercom::Company
+ end
+
+ def users_by_intercom_company_id(id)
+ get_users(url: "/companies/#{id}/users")
+ end
+
+ def users_by_company_id(id)
+ get_users(url: "/companies", params: { company_id: id, type: "user" })
+ end
+
+ private def get_users(url:, params: {})
+ ClientCollectionProxy.new("users", finder_details: { url: url, params: params }, client: @client)
end
end
end
end