WordPress\AiClient\Providers\DTO

ProviderMetadata::__construct │ public │ WP 0.1.0

Constructor.

Метод класса: ProviderMetadata{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$ProviderMetadata = new ProviderMetadata();
$ProviderMetadata->__construct( $id, $name, $type, ?string $credentialsUrl, ?RequestAuthenticationMethod $authenticationMethod, ?string $description, ?string $logoPath );
$id(строка) (обязательный)
The provider's unique identifier.
$name(строка) (обязательный)
The provider's display name.
$type(ProviderTypeEnum) (обязательный)
The provider type.
?string $credentialsUrl
.
По умолчанию: null
?RequestAuthenticationMethod $authenticationMethod
.
По умолчанию: null
?string $description
.
По умолчанию: null
?string $logoPath
.
По умолчанию: null

Список изменений

С версии 0.1.0 Введена.
С версии 1.2.0 Added optional $description parameter.
С версии 1.3.0 Added optional $logoPath parameter.

Код ProviderMetadata::__construct() WP 7.1.2

public function __construct(string $id, string $name, ProviderTypeEnum $type, ?string $credentialsUrl = null, ?RequestAuthenticationMethod $authenticationMethod = null, ?string $description = null, ?string $logoPath = null)
{
    if (!preg_match('/^[a-z0-9\-_]+$/', $id)) {
        throw new InvalidArgumentException(sprintf(
            // phpcs:ignore Generic.Files.LineLength.TooLong
            'Invalid provider ID "%s". Only lowercase alphanumeric characters, hyphens, and underscores are allowed.',
            $id
        ));
    }
    $this->id = $id;
    $this->name = $name;
    $this->description = $description;
    $this->type = $type;
    $this->credentialsUrl = $credentialsUrl;
    $this->authenticationMethod = $authenticationMethod;
    $this->logoPath = $logoPath;
}