This commit is contained in:
Hong Ooi 2019-09-23 12:52:50 +10:00
Родитель cdd5ebcc80
Коммит a2360040a2
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -3,7 +3,7 @@
#' @param url The URL of the endpoint.
#' @param service_type What type (or kind) of service the endpoint provides. See below for the services that AzureCognitive currently recognises.
#' @param key The key to use to authenticate with the endpoint.
#' @param aad_token. An Azure Active Directory (AAD) OAuth token, as an alternative to a key for the services that allow AAD authentication.
#' @param aad_token An Azure Active Directory (AAD) OAuth token, as an alternative to a key for the services that allow AAD authentication.
#' @param cognitive_token A Cognitive Service token, as another alternative to a key for the services that accept it.
#' @details
#' Currently, `cognitive_endpoint` recognises the following service types:
@ -92,7 +92,7 @@ add_cognitive_auth <- function(endpoint, headers)
{
headers <- if(!is.null(endpoint$key))
c(headers, `Ocp-Apim-Subscription-Key`=unname(endpoint$key))
else if(is_azure_auth(endpoint$aad_token))
else if(is_azure_token(endpoint$aad_token))
{
token <- endpoint$aad_token
if(!token$validate())

Просмотреть файл

@ -14,9 +14,9 @@ cognitive_endpoint(url, service_type, key = NULL, aad_token = NULL,
\item{key}{The key to use to authenticate with the endpoint.}
\item{cognitive_token}{A Cognitive Service token, as another alternative to a key for the services that accept it.}
\item{aad_token}{An Azure Active Directory (AAD) OAuth token, as an alternative to a key for the services that allow AAD authentication.}
\item{aad_token.}{An Azure Active Directory (AAD) OAuth token, as an alternative to a key for the services that allow AAD authentication.}
\item{cognitive_token}{A Cognitive Service token, as another alternative to a key for the services that accept it.}
}
\value{
An object inheriting from class \code{cognitive_endpoint}, that can be used to communicate with the REST endpoint. The object will have a subclass based on the type of the service.