def get_rsrc(rsrc, format = :json)
      # puts object_id
      validate_connected

      raise JSS::InvalidDataError, 'format must be :json or :xml' unless %i[json xml].include? format

      # TODO: fix what rubocop is complaining about in the line below.
      # (I doubt we want to CGI.escape the whole resource)
      rsrc = URI.encode rsrc
      begin
        @last_http_response = @cnx[rsrc].get(accept: format)
      rescue RestClient::ExceptionWithResponse => e
        handle_http_error e
      end
      # TODO: make sure we're returning the String version of the
      # response (i.e. its body) here and in POST, PUT, DELETE.
      format == :json ? JSON.parse(@last_http_response, symbolize_names: true) : @last_http_response
    end
def get_rsrc(rsrc, format = :json)
      # puts object_id
      validate_connected

      raise JSS::InvalidDataError, 'format must be :json or :xml' unless %i[json xml].include? format

      # TODO: fix what rubocop is complaining about in the line below.
      # (I doubt we want to CGI.escape the whole resource)
      rsrc = URI.encode rsrc
      begin
        @last_http_response = @cnx[rsrc].get(accept: format)
      rescue RestClient::ExceptionWithResponse => e
        handle_http_error e
      end
      # TODO: make sure we're returning the String version of the
      # response (i.e. its body) here and in POST, PUT, DELETE.
      format == :json ? JSON.parse(@last_http_response, symbolize_names: true) : @last_http_response
    end
disconnect
 Get an arbitrary JSS resource

 The first argument is the resource to get (the part of the API url
 after the 'JSSResource/' )

 By default we get the data in JSON, and parse it
 into a ruby data structure (arrays, hashes, strings, etc)
 with symbolized Hash keys.

 @param rsrc[String] the resource to get
   (the part of the API url after the 'JSSResource/' )

 @param format[Symbol] either ;json or :xml
  If the second argument is :xml, the XML data is returned as a String.

 @return [Hash,String] the result of the get