<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_url(self, endpoint):
 """ Build complete URL """

        if not issubclass(type(self), ChatApiBase) and not self.subdomain:
            raise ZenpyException("subdomain is required when accessing the Zendesk API!")

        if self.subdomain:
            endpoint.netloc = '{}.{}'.format(self.subdomain, self.domain)
        else:
            endpoint.netloc = self.domain

        endpoint.prefix_path(self.api_prefix)
        return endpoint.build()