@classmethod
def by_name(cls, name: str):
    """Get service type by its name."""
    if name is None:
        return cls.GITHUB
    name = name.lower()
    if name == 'github':
        return cls.GITHUB
    elif name == 'gitlab':
        return cls.GITLAB
    else:
        raise NotImplementedError(
            f"Unsupported service {name!r}, available ones are 'github' and 'gitlab'"
            )
