R/user_info_out.R

# 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 UserInfoOut
#' @description UserInfoOut Class
#' @format An \code{R6Class} generator object
#' @field uid  character [optional]
#'
#' @field email  character [optional]
#'
#' @field phoneNumber  character [optional]
#'
#' @field emailVerified  character [optional]
#'
#' @field displayName  character [optional]
#'
#' @field photoUrl  character [optional]
#'
#' @field disabled  character [optional]
#'
#' @field firstKnownIpAddress  character [optional]
#'
#' @field providerId  character [optional]
#'
#' @field timeStamp  integer [optional]
#'
#' @field verifyToken  character [optional]
#'
#' @field apiKey  character [optional]
#'
#' @field stripePerishableKey  character [optional]
#'
#' @field stripeCustomerId  character [optional]
#'
#' @field otherInfos  list( \link{UserInfoOut} ) [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
UserInfoOut <- R6::R6Class(
  'UserInfoOut',
  public = list(
    `uid` = NULL,
    `email` = NULL,
    `phoneNumber` = NULL,
    `emailVerified` = NULL,
    `displayName` = NULL,
    `photoUrl` = NULL,
    `disabled` = NULL,
    `firstKnownIpAddress` = NULL,
    `providerId` = NULL,
    `timeStamp` = NULL,
    `verifyToken` = NULL,
    `apiKey` = NULL,
    `stripePerishableKey` = NULL,
    `stripeCustomerId` = NULL,
    `otherInfos` = NULL,
    initialize = function(`uid`=NULL, `email`=NULL, `phoneNumber`=NULL, `emailVerified`=NULL, `displayName`=NULL, `photoUrl`=NULL, `disabled`=NULL, `firstKnownIpAddress`=NULL, `providerId`=NULL, `timeStamp`=NULL, `verifyToken`=NULL, `apiKey`=NULL, `stripePerishableKey`=NULL, `stripeCustomerId`=NULL, `otherInfos`=NULL, ...){
      local.optional.var <- list(...)
      if (!is.null(`uid`)) {
        stopifnot(is.character(`uid`), length(`uid`) == 1)
        self$`uid` <- `uid`
      }
      if (!is.null(`email`)) {
        stopifnot(is.character(`email`), length(`email`) == 1)
        self$`email` <- `email`
      }
      if (!is.null(`phoneNumber`)) {
        stopifnot(is.character(`phoneNumber`), length(`phoneNumber`) == 1)
        self$`phoneNumber` <- `phoneNumber`
      }
      if (!is.null(`emailVerified`)) {
        self$`emailVerified` <- `emailVerified`
      }
      if (!is.null(`displayName`)) {
        stopifnot(is.character(`displayName`), length(`displayName`) == 1)
        self$`displayName` <- `displayName`
      }
      if (!is.null(`photoUrl`)) {
        stopifnot(is.character(`photoUrl`), length(`photoUrl`) == 1)
        self$`photoUrl` <- `photoUrl`
      }
      if (!is.null(`disabled`)) {
        self$`disabled` <- `disabled`
      }
      if (!is.null(`firstKnownIpAddress`)) {
        stopifnot(is.character(`firstKnownIpAddress`), length(`firstKnownIpAddress`) == 1)
        self$`firstKnownIpAddress` <- `firstKnownIpAddress`
      }
      if (!is.null(`providerId`)) {
        stopifnot(is.character(`providerId`), length(`providerId`) == 1)
        self$`providerId` <- `providerId`
      }
      if (!is.null(`timeStamp`)) {
        stopifnot(is.numeric(`timeStamp`), length(`timeStamp`) == 1)
        self$`timeStamp` <- `timeStamp`
      }
      if (!is.null(`verifyToken`)) {
        stopifnot(is.character(`verifyToken`), length(`verifyToken`) == 1)
        self$`verifyToken` <- `verifyToken`
      }
      if (!is.null(`apiKey`)) {
        stopifnot(is.character(`apiKey`), length(`apiKey`) == 1)
        self$`apiKey` <- `apiKey`
      }
      if (!is.null(`stripePerishableKey`)) {
        stopifnot(is.character(`stripePerishableKey`), length(`stripePerishableKey`) == 1)
        self$`stripePerishableKey` <- `stripePerishableKey`
      }
      if (!is.null(`stripeCustomerId`)) {
        stopifnot(is.character(`stripeCustomerId`), length(`stripeCustomerId`) == 1)
        self$`stripeCustomerId` <- `stripeCustomerId`
      }
      if (!is.null(`otherInfos`)) {
        stopifnot(is.vector(`otherInfos`), length(`otherInfos`) != 0)
        sapply(`otherInfos`, function(x) stopifnot(R6::is.R6(x)))
        self$`otherInfos` <- `otherInfos`
      }
    },
    toJSON = function() {
      UserInfoOutObject <- list()
      if (!is.null(self$`uid`)) {
        UserInfoOutObject[['uid']] <-
          self$`uid`
      }
      if (!is.null(self$`email`)) {
        UserInfoOutObject[['email']] <-
          self$`email`
      }
      if (!is.null(self$`phoneNumber`)) {
        UserInfoOutObject[['phoneNumber']] <-
          self$`phoneNumber`
      }
      if (!is.null(self$`emailVerified`)) {
        UserInfoOutObject[['emailVerified']] <-
          self$`emailVerified`
      }
      if (!is.null(self$`displayName`)) {
        UserInfoOutObject[['displayName']] <-
          self$`displayName`
      }
      if (!is.null(self$`photoUrl`)) {
        UserInfoOutObject[['photoUrl']] <-
          self$`photoUrl`
      }
      if (!is.null(self$`disabled`)) {
        UserInfoOutObject[['disabled']] <-
          self$`disabled`
      }
      if (!is.null(self$`firstKnownIpAddress`)) {
        UserInfoOutObject[['firstKnownIpAddress']] <-
          self$`firstKnownIpAddress`
      }
      if (!is.null(self$`providerId`)) {
        UserInfoOutObject[['providerId']] <-
          self$`providerId`
      }
      if (!is.null(self$`timeStamp`)) {
        UserInfoOutObject[['timeStamp']] <-
          self$`timeStamp`
      }
      if (!is.null(self$`verifyToken`)) {
        UserInfoOutObject[['verifyToken']] <-
          self$`verifyToken`
      }
      if (!is.null(self$`apiKey`)) {
        UserInfoOutObject[['apiKey']] <-
          self$`apiKey`
      }
      if (!is.null(self$`stripePerishableKey`)) {
        UserInfoOutObject[['stripePerishableKey']] <-
          self$`stripePerishableKey`
      }
      if (!is.null(self$`stripeCustomerId`)) {
        UserInfoOutObject[['stripeCustomerId']] <-
          self$`stripeCustomerId`
      }
      if (!is.null(self$`otherInfos`)) {
        UserInfoOutObject[['otherInfos']] <-
          lapply(self$`otherInfos`, function(x) x$toJSON())
      }

      UserInfoOutObject
    },
    fromJSON = function(UserInfoOutJson) {
      UserInfoOutObject <- jsonlite::fromJSON(UserInfoOutJson)
      if (!is.null(UserInfoOutObject$`uid`)) {
        self$`uid` <- UserInfoOutObject$`uid`
      }
      if (!is.null(UserInfoOutObject$`email`)) {
        self$`email` <- UserInfoOutObject$`email`
      }
      if (!is.null(UserInfoOutObject$`phoneNumber`)) {
        self$`phoneNumber` <- UserInfoOutObject$`phoneNumber`
      }
      if (!is.null(UserInfoOutObject$`emailVerified`)) {
        self$`emailVerified` <- UserInfoOutObject$`emailVerified`
      }
      if (!is.null(UserInfoOutObject$`displayName`)) {
        self$`displayName` <- UserInfoOutObject$`displayName`
      }
      if (!is.null(UserInfoOutObject$`photoUrl`)) {
        self$`photoUrl` <- UserInfoOutObject$`photoUrl`
      }
      if (!is.null(UserInfoOutObject$`disabled`)) {
        self$`disabled` <- UserInfoOutObject$`disabled`
      }
      if (!is.null(UserInfoOutObject$`firstKnownIpAddress`)) {
        self$`firstKnownIpAddress` <- UserInfoOutObject$`firstKnownIpAddress`
      }
      if (!is.null(UserInfoOutObject$`providerId`)) {
        self$`providerId` <- UserInfoOutObject$`providerId`
      }
      if (!is.null(UserInfoOutObject$`timeStamp`)) {
        self$`timeStamp` <- UserInfoOutObject$`timeStamp`
      }
      if (!is.null(UserInfoOutObject$`verifyToken`)) {
        self$`verifyToken` <- UserInfoOutObject$`verifyToken`
      }
      if (!is.null(UserInfoOutObject$`apiKey`)) {
        self$`apiKey` <- UserInfoOutObject$`apiKey`
      }
      if (!is.null(UserInfoOutObject$`stripePerishableKey`)) {
        self$`stripePerishableKey` <- UserInfoOutObject$`stripePerishableKey`
      }
      if (!is.null(UserInfoOutObject$`stripeCustomerId`)) {
        self$`stripeCustomerId` <- UserInfoOutObject$`stripeCustomerId`
      }
      if (!is.null(UserInfoOutObject$`otherInfos`)) {
        self$`otherInfos` <- ApiClient$new()$deserializeObj(UserInfoOutObject$`otherInfos`, "array[UserInfoOut]", loadNamespace("namsor"))
      }
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`uid`)) {
        sprintf(
        '"uid":
          "%s"
                ',
        self$`uid`
        )},
        if (!is.null(self$`email`)) {
        sprintf(
        '"email":
          "%s"
                ',
        self$`email`
        )},
        if (!is.null(self$`phoneNumber`)) {
        sprintf(
        '"phoneNumber":
          "%s"
                ',
        self$`phoneNumber`
        )},
        if (!is.null(self$`emailVerified`)) {
        sprintf(
        '"emailVerified":
          "%s"
                ',
        self$`emailVerified`
        )},
        if (!is.null(self$`displayName`)) {
        sprintf(
        '"displayName":
          "%s"
                ',
        self$`displayName`
        )},
        if (!is.null(self$`photoUrl`)) {
        sprintf(
        '"photoUrl":
          "%s"
                ',
        self$`photoUrl`
        )},
        if (!is.null(self$`disabled`)) {
        sprintf(
        '"disabled":
          "%s"
                ',
        self$`disabled`
        )},
        if (!is.null(self$`firstKnownIpAddress`)) {
        sprintf(
        '"firstKnownIpAddress":
          "%s"
                ',
        self$`firstKnownIpAddress`
        )},
        if (!is.null(self$`providerId`)) {
        sprintf(
        '"providerId":
          "%s"
                ',
        self$`providerId`
        )},
        if (!is.null(self$`timeStamp`)) {
        sprintf(
        '"timeStamp":
          %d
                ',
        self$`timeStamp`
        )},
        if (!is.null(self$`verifyToken`)) {
        sprintf(
        '"verifyToken":
          "%s"
                ',
        self$`verifyToken`
        )},
        if (!is.null(self$`apiKey`)) {
        sprintf(
        '"apiKey":
          "%s"
                ',
        self$`apiKey`
        )},
        if (!is.null(self$`stripePerishableKey`)) {
        sprintf(
        '"stripePerishableKey":
          "%s"
                ',
        self$`stripePerishableKey`
        )},
        if (!is.null(self$`stripeCustomerId`)) {
        sprintf(
        '"stripeCustomerId":
          "%s"
                ',
        self$`stripeCustomerId`
        )},
        if (!is.null(self$`otherInfos`)) {
        sprintf(
        '"otherInfos":
        [%s]
',
        paste(sapply(self$`otherInfos`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(UserInfoOutJson) {
      UserInfoOutObject <- jsonlite::fromJSON(UserInfoOutJson)
      self$`uid` <- UserInfoOutObject$`uid`
      self$`email` <- UserInfoOutObject$`email`
      self$`phoneNumber` <- UserInfoOutObject$`phoneNumber`
      self$`emailVerified` <- UserInfoOutObject$`emailVerified`
      self$`displayName` <- UserInfoOutObject$`displayName`
      self$`photoUrl` <- UserInfoOutObject$`photoUrl`
      self$`disabled` <- UserInfoOutObject$`disabled`
      self$`firstKnownIpAddress` <- UserInfoOutObject$`firstKnownIpAddress`
      self$`providerId` <- UserInfoOutObject$`providerId`
      self$`timeStamp` <- UserInfoOutObject$`timeStamp`
      self$`verifyToken` <- UserInfoOutObject$`verifyToken`
      self$`apiKey` <- UserInfoOutObject$`apiKey`
      self$`stripePerishableKey` <- UserInfoOutObject$`stripePerishableKey`
      self$`stripeCustomerId` <- UserInfoOutObject$`stripeCustomerId`
      self$`otherInfos` <- ApiClient$new()$deserializeObj(UserInfoOutObject$`otherInfos`, "array[UserInfoOut]", loadNamespace("namsor"))
      self
    }
  )
)
namsor/namsor-r-sdk2 documentation built on March 15, 2021, 7:12 p.m.