protected function getEnvironmentEndpoint(?string $group = null): ?string
    {
        $environment = $this->getEnvironment();

        if (\is_null($group) || empty($group)) {
            return static::$endpoints[$environment];
        }

        return static::$endpoints[$environment][$group] ?? null;
    }