ProviderRegistry::setProviderRequestAuthentication( string|WordPressAiClientProvidersclass-string $idOrClassName, WordPressAiClientProvidersHttpContractsRequestAuthenticationInterface $requestAuthentication )

In this article

Sets the request authentication instance for the given provider.

Parameters

$idOrClassNamestring|<span class="WordPressAiClientProvidersclass-string”>WordPressAiClientProvidersclass-stringrequired
The provider ID or class name.
$requestAuthenticationWordPressAiClientProvidersHttpContractsRequestAuthenticationInterfacerequired
The request authentication instance.

Source

public function setProviderRequestAuthentication(string $idOrClassName, RequestAuthenticationInterface $requestAuthentication): void
{
    $className = $this->resolveProviderClassName($idOrClassName);
    $this->providerAuthenticationInstances[$className] = $requestAuthentication;
    $this->setRequestAuthenticationForProvider($className, $requestAuthentication);
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.