lib/jss/api_object/scopable/scope.rb
def fetch_subsets(ident)
        id = @target_class.valid_id ident, api: container.api
        raise JSS::NoSuchItemError, "No #{@target_class} matching #{machine}" unless id

        if @target_class == JSS::MobileDevice
          grp_subset = 'MobileDeviceGroups'
          top_key = :mobile_device
        else
          grp_subset = 'GroupsAccounts'
          top_key = :computer
        end
        subset_rsrc = "#{@target_class::RSRC_BASE}/id/#{id}/subset/General&Location&#{grp_subset}"
        data = container.api.get_rsrc(subset_rsrc)[top_key]
        grp_data =
          if @target_class == JSS::MobileDevice
            data[:mobile_device_groups]
          else
            data[:groups_accounts][:computer_group_memberships]
          end

        [data[:general], data[:location], group_ids(grp_data)]
      end
# When we are given an indentifier for a machine,
# fetch just the subsets of API data we need to
# determine if the machine is in this scope
#
# @param ident[String, Integer]
#
# @return [Array] the general, locacation, and parsed group IDs
#
When we are given an indentifier for a machine,
fetch just the subsets of API data we need to
determine if the machine is in this scope
When we are given an indentifier for a machine fetch just the subsets of API data we need to determine if the machine is in this scope
def fetch_subsets(ident)
        id = @target_class.valid_id ident, api: container.api
        raise JSS::NoSuchItemError, "No #{@target_class} matching #{machine}" unless id
        if @target_class == JSS::MobileDevice
          grp_subset = 'MobileDeviceGroups'
          top_key = :mobile_device
        else
          grp_subset = 'GroupsAccounts'
          top_key = :computer
        end
        subset_rsrc = "#{@target_class::RSRC_BASE}/id/#{id}/subset/General&Location&#{grp_subset}"
        data = container.api.get_rsrc(subset_rsrc)[top_key]
        grp_data =
          if @target_class == JSS::MobileDevice
            data[:mobile_device_groups]
          else
            data[:groups_accounts][:computer_group_memberships]
          end
        [data[:general], data[:location], group_ids(grp_data)]
      end
def fetch_subsets ( ident ) id = @target_class . valid_id ident , api : container . api raise JSS :: NoSuchItemError , "No #{@target_class} matching #{machine}" unless id if @target_class == JSS :: MobileDevice grp_subset = 'MobileDeviceGroups' top_key = :mobile_device else grp_subset = 'GroupsAccounts' top_key = :computer end subset_rsrc = "#{@target_class::RSRC_BASE}/id/#{id}/subset/General&Location&#{grp_subset}" data = container . api . get_rsrc ( subset_rsrc ) [ top_key ] grp_data = if @target_class == JSS :: MobileDevice data [ :mobile_device_groups ] else data [ :groups_accounts ] [ :computer_group_memberships ] end [ data [ :general ] , data [ :location ] , group_ids ( grp_data ) ] end
When we are given an indentifier for a machine,
fetch just the subsets of API data we need to
determine if the machine is in this scope
When we are given an indentifier for a machine fetch just the subsets of API data we need to determine if the machine is in this scope
the general, locacation, and parsed group IDs
the general locacation and parsed group IDs
Array
ident
None