code: def _query_zendesk(self, endpoint, object_type, *endpoint_args, **endpoint_kwargs):
          
  
          _id = endpoint_kwargs.get('id', None)
          if _id:
              item = self.cache.get(object_type, _id)
              if item:
                  return item
              else:
                  return self._get(url=self._build_url(endpoint(*endpoint_args, **endpoint_kwargs)))
          elif 'ids' in endpoint_kwargs:
              cached_objects = []
              # Check to see if we have all objects in the cache.
              # If we are missing even one we request them all again.
              # This could be optimized to only request the missing objects.
              for _id in endpoint_kwargs['ids']:
                  obj = self.cache.get(object_type, _id)
                  if not obj:
                      return self._get(self._build_url(endpoint=endpoint(*endpoint_args, **endpoint_kwargs)))
                  cached_objects.append(obj)
              return ZendeskResultGenerator(self, {}, response_objects=cached_objects, object_type=object_type)
          else:
              return self._get(self._build_url(endpoint=endpoint(*endpoint_args, **endpoint_kwargs)))
docs: Query Zendesk for items. If an id or list of ids are passed, attempt to locate these items
           in the relevant cache. If they cannot be found, or no ids are passed, execute a call to Zendesk
           to retrieve the items.
  
          :param endpoint: target endpoint.
          :param object_type: object type we are expecting.
          :param endpoint_args: args for endpoint
          :param endpoint_kwargs: kwargs for endpoint
  
          :return: either a ResultGenerator or a Zenpy object.