':param service_type: Service type.
:type service_type: ``str``
:param endpoints: Endpoints belonging to this entry.
:type endpoints: ``list``
:param service_name: Optional service name.
:type service_name: ``str``'

def __init__(self, service_type, endpoints=None, service_name=None):

    self.service_type = service_type
    self.endpoints = (endpoints or [])
    self.service_name = service_name
    self.endpoints = sorted(self.endpoints, key=(lambda x: (x.url or '')))
