@param BunqEnumApiEnvironmentType $environmentType
@param string $apiKey
@param string $description
@param string[] $allPermittedIp
@param string|null $proxyUrl

@return static
500280
public static function create(
        BunqEnumApiEnvironmentType $environmentType,
        string $apiKey,
        string $description,
        array $allPermittedIp = [],
        string $proxyUrl = null
    ): ApiContext {
        InstallationUtil::assertDeviceDescriptionIsValid($description);
        InstallationUtil::assertAllIpIsValid($allPermittedIp);

        $apiContext = new static();
        $apiContext->environmentType = $environmentType;
        $apiContext->apiKey = $apiKey;
        $apiContext->proxyUrl = $proxyUrl;
        $apiContext->initialize($description, $allPermittedIp);

        return $apiContext;
    }
947241
protected void bindToSpringApplication(ConfigurableEnvironment environment) {
		try {
			Binder.get(environment).bind("spring.main", Bindable.ofInstance(this));
		}
		catch (Exception ex) {
			throw new IllegalStateException("Cannot bind to SpringApplication", ex);
		}
	}
1323243
public static Context getContext( String jdniInitialContextFactoryName , String providerURL , Hashtable<String,Object> extraEnv ) throws NamingException
    {
    	Hashtable<String,Object> env = new Hashtable<>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, jdniInitialContextFactoryName);
        env.put(Context.PROVIDER_URL, providerURL);
        if (extraEnv != null)
            env.putAll(extraEnv);
        return createJndiContext(env);
    }
13831
public function Code(Environment $environment, $name, $type, $version = 'latest', $params = null)
    {
        $type = strtolower($type);

        //Gets type for local file
        $local = false;
        if ('local' == $type) {
            $local = true;
            $type = strtolower(substr($name, strrpos($name, '.') + 1));
        }

        //Defines fragment to use
        $fragment = null;
        if ('css' == $type) {
            $fragment = '@c975LIncludeLibrary/fragments/css.html.twig';
        } elseif ('js' == $type || 'javascript' == $type || 'jscript' == $type || 'script' == $type) {
            $fragment = '@c975LIncludeLibrary/fragments/javascript.html.twig';
            $type = 'javascript';
        }

        //Gets data for local file
        if ($local) {
            $data = 'css' == $type ? array('href' => $name) : array('src' => $name);
        //Gets data for external library
        } else {
            $data = $this->includeLibraryService->getData($name, $type, $version);
        }

        //Returns xhtml code
        if (null != $fragment && null != $data) {
            $render = $environment->render($fragment, array(
                'data' => $data,
                'params' => $params,
                ));

            return str_replace(array("\n", '  ', '  ', '  ', '  ', '  '), ' ', $render);
        }

        //Throws an error if not found
        throw new Error('The Library "' . $name . ' (' . $type . ') version ' . $version . '" requested via "inc_lib()" was not found. Please check name and supported library/versions.');
    }
12832
private static function shouldSandboxUserBeCreated(
        BunqEnumApiEnvironmentType $environmentType,
        string $apiKey = null
    ): bool {
        return $environmentType->equals(BunqEnumApiEnvironmentType::SANDBOX()) && is_null($apiKey);
    }
566153
@Override
    public RepositoryInfo describeRepository(Context context)
            throws ServerException {
        m_authorizationModule.enforceDescribeRepository(context);
        RepositoryInfo repositoryInfo = new RepositoryInfo();
        repositoryInfo.repositoryName =
                getServer().getParameter("repositoryName");
        String reposBaseURL =
                getReposBaseURL(context
                                        .getEnvironmentValue(Constants.HTTP_REQUEST.SECURITY.attributeId)
                                        .equals(Constants.HTTP_REQUEST.SECURE.uri) ? "https"
                                                                                   : "http",
                                context
                                        .getEnvironmentValue(Constants.HTTP_REQUEST.SERVER_PORT.attributeId));
        repositoryInfo.repositoryBaseURL =
                reposBaseURL + "/" + context.getEnvironmentValue(Constants.FEDORA_APP_CONTEXT_NAME);

        repositoryInfo.repositoryVersion = Server.VERSION;
        Module domgr = getServer().getModule("org.fcrepo.server.storage.DOManager");
        repositoryInfo.repositoryPIDNamespace =
                domgr.getParameter("pidNamespace");
        repositoryInfo.defaultExportFormat =
                domgr.getParameter("defaultExportFormat");
        repositoryInfo.OAINamespace = m_repositoryDomainName;
        repositoryInfo.adminEmailList = getAdminEmails();
        repositoryInfo.samplePID =
                repositoryInfo.repositoryPIDNamespace + ":100";
        repositoryInfo.sampleOAIIdentifer =
                "oai:" + repositoryInfo.OAINamespace + ":"
                + repositoryInfo.samplePID;
        repositoryInfo.sampleSearchURL =
                repositoryInfo.repositoryBaseURL + "/objects";
        repositoryInfo.sampleAccessURL =
                repositoryInfo.repositoryBaseURL + "/objects/" + "demo:5"; // PID should be URL-encoded, but nothing to encode in this case
        repositoryInfo.sampleOAIURL =
                repositoryInfo.repositoryBaseURL + "/oai?verb=Identify";
        repositoryInfo.retainPIDs = getRetainPIDs();
        return repositoryInfo;
    }
383019
protected function proxy() {
        if (!$this->context) {
            $this->context = new EnvironmentContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
556522
@XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", name = "Environments")
    public JAXBElement<EnvironmentsType> createEnvironments(EnvironmentsType value) {
        return new JAXBElement<EnvironmentsType>(_Environments_QNAME, EnvironmentsType.class, null, value);
    }
436890
protected static <T extends Manifest> T removeFromEnvironment(Environment environment, Class<T> type) {
        String identifier = type.getName();
        Object manifest = environment.get(identifier);
        if (manifest != null) {
            environment.set(identifier, null);
        }
        return type.cast(manifest);
    }
113393
public function makeFromEnvironment()
    {
        $env = new EnvUtils();

        // Check that we have all variables we need
        if (!$env->hasBearerKey()) {
            throw new Exception(
                'TUTUM_AUTH is not set. Unable to create from environment'
            );
        }

        $client = new Client('', '');
        $client->setBearerKey($env->getBearerKey());

        return $client;
    }
65783
public function getWidgetUrlFor($region, $environment, $merchantId, $overrideUrl)
	{
		return sprintf(self::WIDGET_FORMAT_STRING, 
					$this->_getWidgetHostFor($region, $overrideUrl), 
					$this->_getWidgetRegionFor($region), 
			    	$this->_getWidgetEnvironmentFor($environment),
					urlencode($merchantId));
	}
1179942
public static function fromJson(string $jsonString): ApiContext
    {
        $apiContext = new static();
        $contextJson = \GuzzleHttp\json_decode($jsonString, true);
        $apiContext->environmentType = new BunqEnumApiEnvironmentType($contextJson[self::FIELD_ENVIRONMENT_TYPE]);
        $apiContext->apiKey = $contextJson[self::FIELD_API_KEY];
        $apiContext->proxyUrl = static::restoreProxyUrl($contextJson);
        $apiContext->installationContext = InstallationContext::restore($contextJson[self::FIELD_INSTALLATION_CONTEXT]);
        $apiContext->sessionContext = SessionContext::restore($contextJson[self::FIELD_SESSION_CONTEXT]);

        return $apiContext;
    }
718314
public function save(Model\EnvironmentInterface $environment, Model\EnvironmentInterface $cloneFrom = null)
    {
        $content = $this->getEnvironmentHydrator()->extract($environment);
        if ($cloneFrom != null) {
            $content['cloneFrom'] = strval($cloneFrom->getNormalizedName());
        }
        $this->pmProxyClient->put('/environments/' . $environment->getNormalizedName(), $content);
        if ($environment->hasChildren()) {
            foreach ($environment->getChildren() as $child) {
                /** @var Model\EnvironmentInterface $child */
                if ($cloneFrom) {
                    $this->save($child, $cloneFrom->getChildByName($child->getName()));
                } else {
                    $this->save($child);
                }
            }
        }
        return $this;
    }
129971
def associate_interface_environments(self, int_env_map):
        

        data = {'interface_environments': int_env_map}
        return super(ApiInterfaceRequest, self).post('api/v3/interface/environments/', data)
1320198
public static function fromEnvironment(): UriInterface
    {
        parse_str($_SERVER['QUERY_STRING'] ?? '', $query);

        $uri = (new static())
            ->withScheme((isset($_SERVER['HTTPS']) === true && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http')
            ->withHost($_SERVER['HTTP_HOST'])
            ->withPort((int)$_SERVER['SERVER_PORT'])
            ->withPath(strtok($_SERVER['REQUEST_URI'], '?'))
            ->withQuery($query);

        if (array_key_exists('PHP_AUTH_USER', $_SERVER) === true) {
            $uri = $uri->withUser($_SERVER['PHP_AUTH_USER']);
        }

        if (array_key_exists('PHP_AUTH_PW', $_SERVER) === true) {
            $uri = $uri->withPass($_SERVER['PHP_AUTH_PW']);
        }

        return $uri;
    }
37568
private function setPropertyLabelFormatter($providerName, EnvironmentInterface $environment)
    {
        $properties = $environment->getDataDefinition()->getPropertiesDefinition();

        $labelFormatter = (new DefaultModelFormatterConfig())
            ->setPropertyNames(['name', 'description'])
            ->setFormat('%s <span style="color:#b3b3b3; padding-left:3px">[%s]</span>');

        $this->getViewSection($environment->getDataDefinition())
            ->getListingConfig()
            ->setLabelFormatter($providerName, $labelFormatter);

        // If property name not exits create dummy property for it.
        foreach (['name', 'description'] as $dummyName) {
            if (!$properties->hasProperty($dummyName)) {
                $dummyProperty = new DefaultProperty($dummyName);
                $dummyProperty->setWidgetType('dummyProperty');

                $properties->addProperty($dummyProperty);
            }
        }
    }
498785
@Override
    public void setEnvironment(ConfigurableEnvironment environment) {
        Assert.isInstanceOf(ConfigurablePortletEnvironment.class, environment,
                "ContribDispatcherPortlet environment must be of type " +
                "ConfigurablePortletEnvironment");
        
        super.setEnvironment(environment);
    }