# NamSor API v2
#
# NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 100 names at a time). Need something you can't find here? We have many more features coming soon. Let us know, we'll do our best to add it!
#
# The version of the OpenAPI document: 2.0.10
# Contact: contact@namsor.com
# Generated by: https://openapi-generator.tech
#' @docType class
#' @title Japanese operations
#' @description namsor.Japanese
#' @format An \code{R6Class} generator object
#' @field apiClient Handles the client-server communication.
#'
#' @section Methods:
#' \describe{
#' \strong{ GenderJapaneseNameFull } \emph{ Infer the likely gender of a Japanese full name ex. 王晓明 }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.name character
#' \item \emph{ @returnType } \link{PersonalNameGenderedOut} \cr
#'
#'
#' \item status code : 200 | A genderized name.
#'
#' \item return type : PersonalNameGenderedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GenderJapaneseNameFullBatch } \emph{ Infer the likely gender of up to 100 full names }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.personal.name.in \link{BatchPersonalNameIn}
#' \item \emph{ @returnType } \link{BatchPersonalNameGenderedOut} \cr
#'
#'
#' \item status code : 200 | A list of genderized names.
#'
#' \item return type : BatchPersonalNameGenderedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GenderJapaneseNamePinyin } \emph{ Infer the likely gender of a Japanese name in LATIN (Pinyin). }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.surname character
#' \item \emph{ @param } japanese.given.name character
#' \item \emph{ @returnType } \link{FirstLastNameGenderedOut} \cr
#'
#'
#' \item status code : 200 | A genderized name.
#'
#' \item return type : FirstLastNameGenderedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ GenderJapaneseNamePinyinBatch } \emph{ Infer the likely gender of up to 100 Japanese names in LATIN (Pinyin). }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.first.last.name.in \link{BatchFirstLastNameIn}
#' \item \emph{ @returnType } \link{BatchFirstLastNameGenderedOut} \cr
#'
#'
#' \item status code : 200 | A list of genderized names.
#'
#' \item return type : BatchFirstLastNameGenderedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameKanjiCandidates } \emph{ Identify japanese name candidates in KANJI, based on the romanized name ex. Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.surname.latin character
#' \item \emph{ @param } japanese.given.name.latin character
#' \item \emph{ @returnType } \link{RomanizedNameOut} \cr
#'
#'
#' \item status code : 200 | A romanized name.
#'
#' \item return type : RomanizedNameOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameKanjiCandidatesBatch } \emph{ Identify japanese name candidates in KANJI, based on the romanized name (firstName = japaneseGivenName; lastName=japaneseSurname), ex. Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.first.last.name.in \link{BatchFirstLastNameIn}
#' \item \emph{ @returnType } \link{BatchNameMatchCandidatesOut} \cr
#'
#'
#' \item status code : 200 | A list of genderized names.
#'
#' \item return type : BatchNameMatchCandidatesOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameLatinCandidates } \emph{ Romanize japanese name, based on the name in Kanji. }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.surname.kanji character
#' \item \emph{ @param } japanese.given.name.kanji character
#' \item \emph{ @returnType } \link{RomanizedNameOut} \cr
#'
#'
#' \item status code : 200 | A romanized name.
#'
#' \item return type : RomanizedNameOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameLatinCandidatesBatch } \emph{ Romanize japanese names, based on the name in KANJI }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.first.last.name.in \link{BatchFirstLastNameIn}
#' \item \emph{ @returnType } \link{BatchNameMatchCandidatesOut} \cr
#'
#'
#' \item status code : 200 | A list of genderized names.
#'
#' \item return type : BatchNameMatchCandidatesOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameMatch } \emph{ Return a score for matching Japanese name in KANJI ex. 山本 早苗 with a romanized name ex. Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.surname.latin character
#' \item \emph{ @param } japanese.given.name.latin character
#' \item \emph{ @param } japanese.name character
#' \item \emph{ @returnType } \link{RomanizedNameOut} \cr
#'
#'
#' \item status code : 200 | A romanized name.
#'
#' \item return type : RomanizedNameOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameMatchBatch } \emph{ Return a score for matching a list of Japanese names in KANJI ex. 山本 早苗 with romanized names ex. Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.first.last.name.in \link{BatchFirstLastNameIn}
#' \item \emph{ @returnType } \link{BatchNameMatchCandidatesOut} \cr
#'
#'
#' \item status code : 200 | A list of matched names.
#'
#' \item return type : BatchNameMatchCandidatesOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ JapaneseNameMatchFeedbackLoop } \emph{ [CREDITS 1 UNIT] Feedback loop to better perform matching Japanese name in KANJI ex. 山本 早苗 with a romanized name ex. Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.surname.latin character
#' \item \emph{ @param } japanese.given.name.latin character
#' \item \emph{ @param } japanese.name character
#' \item \emph{ @returnType } \link{RomanizedNameOut} \cr
#'
#'
#' \item status code : 200 | A romanized name.
#'
#' \item return type : RomanizedNameOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ParseJapaneseName } \emph{ Infer the likely first/last name structure of a name, ex. 山本 早苗 or Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } japanese.name character
#' \item \emph{ @returnType } \link{PersonalNameParsedOut} \cr
#'
#'
#' \item status code : 200 | A origined name.
#'
#' \item return type : PersonalNameParsedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' \strong{ ParseJapaneseNameBatch } \emph{ Infer the likely first/last name structure of a name, ex. 山本 早苗 or Yamamoto Sanae }
#'
#'
#' \itemize{
#' \item \emph{ @param } batch.personal.name.in \link{BatchPersonalNameIn}
#' \item \emph{ @returnType } \link{BatchPersonalNameParsedOut} \cr
#'
#'
#' \item status code : 200 | A list of parsed names.
#'
#' \item return type : BatchPersonalNameParsedOut
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 401 | Missing or incorrect API Key
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' \item status code : 403 | API Limit Reached or API Key Disabled
#'
#'
#' \item response headers :
#'
#' \tabular{ll}{
#' }
#' }
#'
#' }
#'
#'
#' @examples
#' \dontrun{
#' #################### GenderJapaneseNameFull ####################
#'
#' library(namsor)
#' var.japanese.name <- 'japanese.name_example' # character |
#'
#' #Infer the likely gender of a Japanese full name ex. 王晓明
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$GenderJapaneseNameFull(var.japanese.name)
#'
#'
#' #################### GenderJapaneseNameFullBatch ####################
#'
#' library(namsor)
#' var.batch.personal.name.in <- BatchPersonalNameIn$new() # BatchPersonalNameIn | A list of personal names
#'
#' #Infer the likely gender of up to 100 full names
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$GenderJapaneseNameFullBatch(batch.personal.name.in=var.batch.personal.name.in)
#'
#'
#' #################### GenderJapaneseNamePinyin ####################
#'
#' library(namsor)
#' var.japanese.surname <- 'japanese.surname_example' # character |
#' var.japanese.given.name <- 'japanese.given.name_example' # character |
#'
#' #Infer the likely gender of a Japanese name in LATIN (Pinyin).
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$GenderJapaneseNamePinyin(var.japanese.surname, var.japanese.given.name)
#'
#'
#' #################### GenderJapaneseNamePinyinBatch ####################
#'
#' library(namsor)
#' var.batch.first.last.name.in <- BatchFirstLastNameIn$new() # BatchFirstLastNameIn | A list of names, with country code.
#'
#' #Infer the likely gender of up to 100 Japanese names in LATIN (Pinyin).
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$GenderJapaneseNamePinyinBatch(batch.first.last.name.in=var.batch.first.last.name.in)
#'
#'
#' #################### JapaneseNameKanjiCandidates ####################
#'
#' library(namsor)
#' var.japanese.surname.latin <- 'japanese.surname.latin_example' # character |
#' var.japanese.given.name.latin <- 'japanese.given.name.latin_example' # character |
#'
#' #Identify japanese name candidates in KANJI, based on the romanized name ex. Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameKanjiCandidates(var.japanese.surname.latin, var.japanese.given.name.latin)
#'
#'
#' #################### JapaneseNameKanjiCandidatesBatch ####################
#'
#' library(namsor)
#' var.batch.first.last.name.in <- BatchFirstLastNameIn$new() # BatchFirstLastNameIn | A list of personal japanese names in LATIN, firstName = japaneseGivenName; lastName=japaneseSurname
#'
#' #Identify japanese name candidates in KANJI, based on the romanized name (firstName = japaneseGivenName; lastName=japaneseSurname), ex. Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameKanjiCandidatesBatch(batch.first.last.name.in=var.batch.first.last.name.in)
#'
#'
#' #################### JapaneseNameLatinCandidates ####################
#'
#' library(namsor)
#' var.japanese.surname.kanji <- 'japanese.surname.kanji_example' # character |
#' var.japanese.given.name.kanji <- 'japanese.given.name.kanji_example' # character |
#'
#' #Romanize japanese name, based on the name in Kanji.
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameLatinCandidates(var.japanese.surname.kanji, var.japanese.given.name.kanji)
#'
#'
#' #################### JapaneseNameLatinCandidatesBatch ####################
#'
#' library(namsor)
#' var.batch.first.last.name.in <- BatchFirstLastNameIn$new() # BatchFirstLastNameIn | A list of personal japanese names in KANJI, firstName = japaneseGivenName; lastName=japaneseSurname
#'
#' #Romanize japanese names, based on the name in KANJI
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameLatinCandidatesBatch(batch.first.last.name.in=var.batch.first.last.name.in)
#'
#'
#' #################### JapaneseNameMatch ####################
#'
#' library(namsor)
#' var.japanese.surname.latin <- 'japanese.surname.latin_example' # character |
#' var.japanese.given.name.latin <- 'japanese.given.name.latin_example' # character |
#' var.japanese.name <- 'japanese.name_example' # character |
#'
#' #Return a score for matching Japanese name in KANJI ex. 山本 早苗 with a romanized name ex. Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameMatch(var.japanese.surname.latin, var.japanese.given.name.latin, var.japanese.name)
#'
#'
#' #################### JapaneseNameMatchBatch ####################
#'
#' library(namsor)
#' var.batch.first.last.name.in <- BatchFirstLastNameIn$new() # BatchFirstLastNameIn | A list of personal Japanese names in LATIN, firstName = japaneseGivenName; lastName=japaneseSurname
#'
#' #Return a score for matching a list of Japanese names in KANJI ex. 山本 早苗 with romanized names ex. Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameMatchBatch(batch.first.last.name.in=var.batch.first.last.name.in)
#'
#'
#' #################### JapaneseNameMatchFeedbackLoop ####################
#'
#' library(namsor)
#' var.japanese.surname.latin <- 'japanese.surname.latin_example' # character |
#' var.japanese.given.name.latin <- 'japanese.given.name.latin_example' # character |
#' var.japanese.name <- 'japanese.name_example' # character |
#'
#' #[CREDITS 1 UNIT] Feedback loop to better perform matching Japanese name in KANJI ex. 山本 早苗 with a romanized name ex. Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$JapaneseNameMatchFeedbackLoop(var.japanese.surname.latin, var.japanese.given.name.latin, var.japanese.name)
#'
#'
#' #################### ParseJapaneseName ####################
#'
#' library(namsor)
#' var.japanese.name <- 'japanese.name_example' # character |
#'
#' #Infer the likely first/last name structure of a name, ex. 山本 早苗 or Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ParseJapaneseName(var.japanese.name)
#'
#'
#' #################### ParseJapaneseNameBatch ####################
#'
#' library(namsor)
#' var.batch.personal.name.in <- BatchPersonalNameIn$new() # BatchPersonalNameIn | A list of personal names
#'
#' #Infer the likely first/last name structure of a name, ex. 山本 早苗 or Yamamoto Sanae
#' api.instance <- JapaneseApi$new()
#'
#' #Configure API key authorization: api_key
#' api.instance$apiClient$apiKeys['X-API-KEY'] <- 'TODO_YOUR_API_KEY';
#'
#' result <- api.instance$ParseJapaneseNameBatch(batch.personal.name.in=var.batch.personal.name.in)
#'
#'
#' }
#' @importFrom R6 R6Class
#' @importFrom base64enc base64encode
#' @export
JapaneseApi <- R6::R6Class(
'JapaneseApi',
public = list(
apiClient = NULL,
initialize = function(apiClient){
if (!missing(apiClient)) {
self$apiClient <- apiClient
}
else {
self$apiClient <- ApiClient$new()
}
},
GenderJapaneseNameFull = function(japanese.name, ...){
apiResponse <- self$GenderJapaneseNameFullWithHttpInfo(japanese.name, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
GenderJapaneseNameFullWithHttpInfo = function(japanese.name, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.name`)) {
stop("Missing required parameter `japanese.name`.")
}
urlPath <- "/api2/json/genderJapaneseNameFull/{japaneseName}"
if (!missing(`japanese.name`)) {
urlPath <- gsub(paste0("\\{", "japaneseName", "\\}"), URLencode(as.character(`japanese.name`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "PersonalNameGenderedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
GenderJapaneseNameFullBatch = function(batch.personal.name.in=NULL, ...){
apiResponse <- self$GenderJapaneseNameFullBatchWithHttpInfo(batch.personal.name.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
GenderJapaneseNameFullBatchWithHttpInfo = function(batch.personal.name.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.personal.name.in`)) {
body <- `batch.personal.name.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/genderJapaneseNameFullBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchPersonalNameGenderedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
GenderJapaneseNamePinyin = function(japanese.surname, japanese.given.name, ...){
apiResponse <- self$GenderJapaneseNamePinyinWithHttpInfo(japanese.surname, japanese.given.name, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
GenderJapaneseNamePinyinWithHttpInfo = function(japanese.surname, japanese.given.name, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.surname`)) {
stop("Missing required parameter `japanese.surname`.")
}
if (missing(`japanese.given.name`)) {
stop("Missing required parameter `japanese.given.name`.")
}
urlPath <- "/api2/json/genderJapaneseName/{japaneseSurname}/{japaneseGivenName}"
if (!missing(`japanese.surname`)) {
urlPath <- gsub(paste0("\\{", "japaneseSurname", "\\}"), URLencode(as.character(`japanese.surname`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.given.name`)) {
urlPath <- gsub(paste0("\\{", "japaneseGivenName", "\\}"), URLencode(as.character(`japanese.given.name`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "FirstLastNameGenderedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
GenderJapaneseNamePinyinBatch = function(batch.first.last.name.in=NULL, ...){
apiResponse <- self$GenderJapaneseNamePinyinBatchWithHttpInfo(batch.first.last.name.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
GenderJapaneseNamePinyinBatchWithHttpInfo = function(batch.first.last.name.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.first.last.name.in`)) {
body <- `batch.first.last.name.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/genderJapaneseNameBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchFirstLastNameGenderedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameKanjiCandidates = function(japanese.surname.latin, japanese.given.name.latin, ...){
apiResponse <- self$JapaneseNameKanjiCandidatesWithHttpInfo(japanese.surname.latin, japanese.given.name.latin, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameKanjiCandidatesWithHttpInfo = function(japanese.surname.latin, japanese.given.name.latin, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.surname.latin`)) {
stop("Missing required parameter `japanese.surname.latin`.")
}
if (missing(`japanese.given.name.latin`)) {
stop("Missing required parameter `japanese.given.name.latin`.")
}
urlPath <- "/api2/json/japaneseNameKanjiCandidates/{japaneseSurnameLatin}/{japaneseGivenNameLatin}"
if (!missing(`japanese.surname.latin`)) {
urlPath <- gsub(paste0("\\{", "japaneseSurnameLatin", "\\}"), URLencode(as.character(`japanese.surname.latin`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.given.name.latin`)) {
urlPath <- gsub(paste0("\\{", "japaneseGivenNameLatin", "\\}"), URLencode(as.character(`japanese.given.name.latin`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "RomanizedNameOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameKanjiCandidatesBatch = function(batch.first.last.name.in=NULL, ...){
apiResponse <- self$JapaneseNameKanjiCandidatesBatchWithHttpInfo(batch.first.last.name.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameKanjiCandidatesBatchWithHttpInfo = function(batch.first.last.name.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.first.last.name.in`)) {
body <- `batch.first.last.name.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/japaneseNameKanjiCandidatesBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchNameMatchCandidatesOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameLatinCandidates = function(japanese.surname.kanji, japanese.given.name.kanji, ...){
apiResponse <- self$JapaneseNameLatinCandidatesWithHttpInfo(japanese.surname.kanji, japanese.given.name.kanji, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameLatinCandidatesWithHttpInfo = function(japanese.surname.kanji, japanese.given.name.kanji, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.surname.kanji`)) {
stop("Missing required parameter `japanese.surname.kanji`.")
}
if (missing(`japanese.given.name.kanji`)) {
stop("Missing required parameter `japanese.given.name.kanji`.")
}
urlPath <- "/api2/json/japaneseNameLatinCandidates/{japaneseSurnameKanji}/{japaneseGivenNameKanji}"
if (!missing(`japanese.surname.kanji`)) {
urlPath <- gsub(paste0("\\{", "japaneseSurnameKanji", "\\}"), URLencode(as.character(`japanese.surname.kanji`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.given.name.kanji`)) {
urlPath <- gsub(paste0("\\{", "japaneseGivenNameKanji", "\\}"), URLencode(as.character(`japanese.given.name.kanji`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "RomanizedNameOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameLatinCandidatesBatch = function(batch.first.last.name.in=NULL, ...){
apiResponse <- self$JapaneseNameLatinCandidatesBatchWithHttpInfo(batch.first.last.name.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameLatinCandidatesBatchWithHttpInfo = function(batch.first.last.name.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.first.last.name.in`)) {
body <- `batch.first.last.name.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/japaneseNameLatinCandidatesBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchNameMatchCandidatesOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameMatch = function(japanese.surname.latin, japanese.given.name.latin, japanese.name, ...){
apiResponse <- self$JapaneseNameMatchWithHttpInfo(japanese.surname.latin, japanese.given.name.latin, japanese.name, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameMatchWithHttpInfo = function(japanese.surname.latin, japanese.given.name.latin, japanese.name, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.surname.latin`)) {
stop("Missing required parameter `japanese.surname.latin`.")
}
if (missing(`japanese.given.name.latin`)) {
stop("Missing required parameter `japanese.given.name.latin`.")
}
if (missing(`japanese.name`)) {
stop("Missing required parameter `japanese.name`.")
}
urlPath <- "/api2/json/japaneseNameMatch/{japaneseSurnameLatin}/{japaneseGivenNameLatin}/{japaneseName}"
if (!missing(`japanese.surname.latin`)) {
urlPath <- gsub(paste0("\\{", "japaneseSurnameLatin", "\\}"), URLencode(as.character(`japanese.surname.latin`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.given.name.latin`)) {
urlPath <- gsub(paste0("\\{", "japaneseGivenNameLatin", "\\}"), URLencode(as.character(`japanese.given.name.latin`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.name`)) {
urlPath <- gsub(paste0("\\{", "japaneseName", "\\}"), URLencode(as.character(`japanese.name`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "RomanizedNameOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameMatchBatch = function(batch.first.last.name.in=NULL, ...){
apiResponse <- self$JapaneseNameMatchBatchWithHttpInfo(batch.first.last.name.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameMatchBatchWithHttpInfo = function(batch.first.last.name.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.first.last.name.in`)) {
body <- `batch.first.last.name.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/japaneseNameMatchBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchNameMatchCandidatesOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
JapaneseNameMatchFeedbackLoop = function(japanese.surname.latin, japanese.given.name.latin, japanese.name, ...){
apiResponse <- self$JapaneseNameMatchFeedbackLoopWithHttpInfo(japanese.surname.latin, japanese.given.name.latin, japanese.name, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
JapaneseNameMatchFeedbackLoopWithHttpInfo = function(japanese.surname.latin, japanese.given.name.latin, japanese.name, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.surname.latin`)) {
stop("Missing required parameter `japanese.surname.latin`.")
}
if (missing(`japanese.given.name.latin`)) {
stop("Missing required parameter `japanese.given.name.latin`.")
}
if (missing(`japanese.name`)) {
stop("Missing required parameter `japanese.name`.")
}
urlPath <- "/api2/json/japaneseNameMatchFeedbackLoop/{japaneseSurnameLatin}/{japaneseGivenNameLatin}/{japaneseName}"
if (!missing(`japanese.surname.latin`)) {
urlPath <- gsub(paste0("\\{", "japaneseSurnameLatin", "\\}"), URLencode(as.character(`japanese.surname.latin`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.given.name.latin`)) {
urlPath <- gsub(paste0("\\{", "japaneseGivenNameLatin", "\\}"), URLencode(as.character(`japanese.given.name.latin`), reserved = TRUE), urlPath)
}
if (!missing(`japanese.name`)) {
urlPath <- gsub(paste0("\\{", "japaneseName", "\\}"), URLencode(as.character(`japanese.name`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "RomanizedNameOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ParseJapaneseName = function(japanese.name, ...){
apiResponse <- self$ParseJapaneseNameWithHttpInfo(japanese.name, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ParseJapaneseNameWithHttpInfo = function(japanese.name, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (missing(`japanese.name`)) {
stop("Missing required parameter `japanese.name`.")
}
urlPath <- "/api2/json/parseJapaneseName/{japaneseName}"
if (!missing(`japanese.name`)) {
urlPath <- gsub(paste0("\\{", "japaneseName", "\\}"), URLencode(as.character(`japanese.name`), reserved = TRUE), urlPath)
}
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "GET",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "PersonalNameParsedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
},
ParseJapaneseNameBatch = function(batch.personal.name.in=NULL, ...){
apiResponse <- self$ParseJapaneseNameBatchWithHttpInfo(batch.personal.name.in, ...)
resp <- apiResponse$response
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
apiResponse$content
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
apiResponse
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
apiResponse
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
apiResponse
}
},
ParseJapaneseNameBatchWithHttpInfo = function(batch.personal.name.in=NULL, ...){
args <- list(...)
queryParams <- list()
headerParams <- c()
if (!missing(`batch.personal.name.in`)) {
body <- `batch.personal.name.in`$toJSONString()
} else {
body <- NULL
}
urlPath <- "/api2/json/parseJapaneseNameBatch"
# API key authentication
if ("X-API-KEY" %in% names(self$apiClient$apiKeys) && nchar(self$apiClient$apiKeys["X-API-KEY"]) > 0) {
headerParams['X-API-KEY'] <- paste(unlist(self$apiClient$apiKeys["X-API-KEY"]), collapse='')
}
resp <- self$apiClient$CallApi(url = paste0(self$apiClient$basePath, urlPath),
method = "POST",
queryParams = queryParams,
headerParams = headerParams,
body = body,
...)
if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) {
deserializedRespObj <- tryCatch(
self$apiClient$deserialize(resp, "BatchPersonalNameParsedOut", loadNamespace("namsor")),
error = function(e){
stop("Failed to deserialize response")
}
)
ApiResponse$new(deserializedRespObj, resp)
} else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) {
ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp)
} else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) {
ApiResponse$new("API client error", resp)
} else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {
ApiResponse$new("API server error", resp)
}
}
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.