def _query_zendesk(self, endpoint, object_type, *endpoint_args, **endpoint_kwargs):
_id = endpoint_kwargs.get('<STR_LIT:id>', None)<EOL>if _id:<EOL><INDENT>item = self.cache.get(object_type, _id)<EOL>if item:<EOL><INDENT>return item<EOL><DEDENT>else:<EOL><INDENT>return self._get(url=self._build_url(endpoint(*endpoint_args, **endpoint_kwargs)))<EOL><DEDENT><DEDENT>elif '<STR_LIT>' in endpoint_kwargs:<EOL><INDENT>cached_objects = []<EOL>for _id in endpoint_kwargs['<STR_LIT>']:<EOL><INDENT>obj = self.cache.get(object_type, _id)<EOL>if not obj:<EOL><INDENT>return self._get(self._build_url(endpoint=endpoint(*endpoint_args, **endpoint_kwargs)))<EOL><DEDENT>cached_objects.append(obj)<EOL><DEDENT>return ZendeskResultGenerator(self, {}, response_objects=cached_objects, object_type=object_type)<EOL><DEDENT>else:<EOL><INDENT>return self._get(self._build_url(endpoint=endpoint(*endpoint_args, **endpoint_kwargs)))<EOL><DEDENT>
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.