Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
NamSor SAS committed Nov 24, 2019
1 parent e5d2887 commit 01ca5d5
Show file tree
Hide file tree
Showing 85 changed files with 553 additions and 330 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: namsor
Title: R Package Client for NamSor API v2
Version: 1.0.1
Version: 1.0.0
Authors@R: person("OpenAPI Generator community", email = "[email protected]", role = c("aut", "cre"))
Description: 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!
Depends: R (>= 3.3.3)
Encoding: UTF-8
License: Unlicense
LazyData: true
Suggests: testthat
Imports: jsonlite, httr, R6, caTools
Imports: jsonlite, httr, R6
RoxygenNote: 6.0.1.9000
14 changes: 3 additions & 11 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Generated by openapi-generator: https://openapi-generator.tech
# Do not edit by hand

# Core
export(ApiClient)
export(ApiResponse)

# Models
export(APIBillingPeriodUsageOut)
export(APIClassifierOut)
export(APIClassifierTaxonomyOut)
export(APIClassifiersStatusOut)
export(APICounterV2Out)
export(APIKeyOut)
export(APIPeriodUsageOut)
Expand Down Expand Up @@ -79,9 +77,3 @@ export(StripeCardOut)
export(StripeCustomerOut)
export(SystemMetricsOut)
export(UserInfoOut)

# APIs
export(AdminApi)
export(ChineseApi)
export(PersonalApi)
export(SocialApi)
2 changes: 1 addition & 1 deletion R/APIBillingPeriodUsageOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
110 changes: 110 additions & 0 deletions R/APIClassifierOut.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 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!
#
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech


#' APIClassifierOut Class
#'
#' @field classifierName
#' @field serving
#' @field learning
#' @field shuttingDown
#' @field probabilityCalibrated
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
APIClassifierOut <- R6::R6Class(
'APIClassifierOut',
public = list(
`classifierName` = NULL,
`serving` = NULL,
`learning` = NULL,
`shuttingDown` = NULL,
`probabilityCalibrated` = NULL,
initialize = function(`classifierName`, `serving`, `learning`, `shuttingDown`, `probabilityCalibrated`){
if (!missing(`classifierName`)) {
stopifnot(is.character(`classifierName`), length(`classifierName`) == 1)
self$`classifierName` <- `classifierName`
}
if (!missing(`serving`)) {
self$`serving` <- `serving`
}
if (!missing(`learning`)) {
self$`learning` <- `learning`
}
if (!missing(`shuttingDown`)) {
self$`shuttingDown` <- `shuttingDown`
}
if (!missing(`probabilityCalibrated`)) {
self$`probabilityCalibrated` <- `probabilityCalibrated`
}
},
toJSON = function() {
APIClassifierOutObject <- list()
if (!is.null(self$`classifierName`)) {
APIClassifierOutObject[['classifierName']] <- self$`classifierName`
}
if (!is.null(self$`serving`)) {
APIClassifierOutObject[['serving']] <- self$`serving`
}
if (!is.null(self$`learning`)) {
APIClassifierOutObject[['learning']] <- self$`learning`
}
if (!is.null(self$`shuttingDown`)) {
APIClassifierOutObject[['shuttingDown']] <- self$`shuttingDown`
}
if (!is.null(self$`probabilityCalibrated`)) {
APIClassifierOutObject[['probabilityCalibrated']] <- self$`probabilityCalibrated`
}

APIClassifierOutObject
},
fromJSON = function(APIClassifierOutJson) {
APIClassifierOutObject <- jsonlite::fromJSON(APIClassifierOutJson)
if (!is.null(APIClassifierOutObject$`classifierName`)) {
self$`classifierName` <- APIClassifierOutObject$`classifierName`
}
if (!is.null(APIClassifierOutObject$`serving`)) {
self$`serving` <- APIClassifierOutObject$`serving`
}
if (!is.null(APIClassifierOutObject$`learning`)) {
self$`learning` <- APIClassifierOutObject$`learning`
}
if (!is.null(APIClassifierOutObject$`shuttingDown`)) {
self$`shuttingDown` <- APIClassifierOutObject$`shuttingDown`
}
if (!is.null(APIClassifierOutObject$`probabilityCalibrated`)) {
self$`probabilityCalibrated` <- APIClassifierOutObject$`probabilityCalibrated`
}
},
toJSONString = function() {
sprintf(
'{
"classifierName": %s,
"serving": %s,
"learning": %s,
"shuttingDown": %s,
"probabilityCalibrated": %s
}',
self$`classifierName`,
self$`serving`,
self$`learning`,
self$`shuttingDown`,
self$`probabilityCalibrated`
)
},
fromJSONString = function(APIClassifierOutJson) {
APIClassifierOutObject <- jsonlite::fromJSON(APIClassifierOutJson)
self$`classifierName` <- APIClassifierOutObject$`classifierName`
self$`serving` <- APIClassifierOutObject$`serving`
self$`learning` <- APIClassifierOutObject$`learning`
self$`shuttingDown` <- APIClassifierOutObject$`shuttingDown`
self$`probabilityCalibrated` <- APIClassifierOutObject$`probabilityCalibrated`
}
)
)
70 changes: 70 additions & 0 deletions R/APIClassifierTaxonomyOut.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# 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!
#
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech


#' APIClassifierTaxonomyOut Class
#'
#' @field classifierName
#' @field taxonomyClasses
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
APIClassifierTaxonomyOut <- R6::R6Class(
'APIClassifierTaxonomyOut',
public = list(
`classifierName` = NULL,
`taxonomyClasses` = NULL,
initialize = function(`classifierName`, `taxonomyClasses`){
if (!missing(`classifierName`)) {
stopifnot(is.character(`classifierName`), length(`classifierName`) == 1)
self$`classifierName` <- `classifierName`
}
if (!missing(`taxonomyClasses`)) {
stopifnot(is.list(`taxonomyClasses`), length(`taxonomyClasses`) != 0)
lapply(`taxonomyClasses`, function(x) stopifnot(is.character(x)))
self$`taxonomyClasses` <- `taxonomyClasses`
}
},
toJSON = function() {
APIClassifierTaxonomyOutObject <- list()
if (!is.null(self$`classifierName`)) {
APIClassifierTaxonomyOutObject[['classifierName']] <- self$`classifierName`
}
if (!is.null(self$`taxonomyClasses`)) {
APIClassifierTaxonomyOutObject[['taxonomyClasses']] <- self$`taxonomyClasses`
}

APIClassifierTaxonomyOutObject
},
fromJSON = function(APIClassifierTaxonomyOutJson) {
APIClassifierTaxonomyOutObject <- jsonlite::fromJSON(APIClassifierTaxonomyOutJson)
if (!is.null(APIClassifierTaxonomyOutObject$`classifierName`)) {
self$`classifierName` <- APIClassifierTaxonomyOutObject$`classifierName`
}
if (!is.null(APIClassifierTaxonomyOutObject$`taxonomyClasses`)) {
self$`taxonomyClasses` <- APIClassifierTaxonomyOutObject$`taxonomyClasses`
}
},
toJSONString = function() {
sprintf(
'{
"classifierName": %s,
"taxonomyClasses": [%s]
}',
self$`classifierName`,
lapply(self$`taxonomyClasses`, function(x) paste(paste0('"', x, '"'), sep=","))
)
},
fromJSONString = function(APIClassifierTaxonomyOutJson) {
APIClassifierTaxonomyOutObject <- jsonlite::fromJSON(APIClassifierTaxonomyOutJson)
self$`classifierName` <- APIClassifierTaxonomyOutObject$`classifierName`
self$`taxonomyClasses` <- APIClassifierTaxonomyOutObject$`taxonomyClasses`
}
)
)
77 changes: 77 additions & 0 deletions R/APIClassifiersStatusOut.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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!
#
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech


#' APIClassifiersStatusOut Class
#'
#' @field softwareVersion
#' @field classifiers
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
APIClassifiersStatusOut <- R6::R6Class(
'APIClassifiersStatusOut',
public = list(
`softwareVersion` = NULL,
`classifiers` = NULL,
initialize = function(`softwareVersion`, `classifiers`){
if (!missing(`softwareVersion`)) {
stopifnot(R6::is.R6(`softwareVersion`))
self$`softwareVersion` <- `softwareVersion`
}
if (!missing(`classifiers`)) {
stopifnot(is.list(`classifiers`), length(`classifiers`) != 0)
lapply(`classifiers`, function(x) stopifnot(R6::is.R6(x)))
self$`classifiers` <- `classifiers`
}
},
toJSON = function() {
APIClassifiersStatusOutObject <- list()
if (!is.null(self$`softwareVersion`)) {
APIClassifiersStatusOutObject[['softwareVersion']] <- self$`softwareVersion`$toJSON()
}
if (!is.null(self$`classifiers`)) {
APIClassifiersStatusOutObject[['classifiers']] <- lapply(self$`classifiers`, function(x) x$toJSON())
}

APIClassifiersStatusOutObject
},
fromJSON = function(APIClassifiersStatusOutJson) {
APIClassifiersStatusOutObject <- jsonlite::fromJSON(APIClassifiersStatusOutJson)
if (!is.null(APIClassifiersStatusOutObject$`softwareVersion`)) {
softwareVersionObject <- SoftwareVersionOut$new()
softwareVersionObject$fromJSON(jsonlite::toJSON(APIClassifiersStatusOutObject$softwareVersion, auto_unbox = TRUE))
self$`softwareVersion` <- softwareVersionObject
}
if (!is.null(APIClassifiersStatusOutObject$`classifiers`)) {
self$`classifiers` <- lapply(APIClassifiersStatusOutObject$`classifiers`, function(x) {
classifiersObject <- APIClassifierOut$new()
classifiersObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
classifiersObject
})
}
},
toJSONString = function() {
sprintf(
'{
"softwareVersion": %s,
"classifiers": [%s]
}',
self$`softwareVersion`$toJSON(),
lapply(self$`classifiers`, function(x) paste(x$toJSON(), sep=","))
)
},
fromJSONString = function(APIClassifiersStatusOutJson) {
APIClassifiersStatusOutObject <- jsonlite::fromJSON(APIClassifiersStatusOutJson)
SoftwareVersionOutObject <- SoftwareVersionOut$new()
self$`softwareVersion` <- SoftwareVersionOutObject$fromJSON(jsonlite::toJSON(APIClassifiersStatusOutObject$softwareVersion, auto_unbox = TRUE))
self$`classifiers` <- lapply(APIClassifiersStatusOutObject$`classifiers`, function(x) APIClassifierOut$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
}
)
)
2 changes: 1 addition & 1 deletion R/APICounterV2Out.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIKeyOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIPeriodUsageOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIPlanOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIPlanSubscriptionOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIPlansOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIServiceOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIServicesOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
2 changes: 1 addition & 1 deletion R/APIUsageAggregatedOut.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 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!
#
# OpenAPI spec version: 2.0.6
# OpenAPI spec version: 2.0.7
# Contact: [email protected]
# Generated by: https://openapi-generator.tech

Expand Down
Loading

0 comments on commit 01ca5d5

Please sign in to comment.