R/first_last_name_phone_coded_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 FirstLastNamePhoneCodedOut
#' @description FirstLastNamePhoneCodedOut Class
#' @format An \code{R6Class} generator object
#' @field id  character [optional]
#'
#' @field firstName  character [optional]
#'
#' @field lastName  character [optional]
#'
#' @field internationalPhoneNumberVerified  character [optional]
#'
#' @field phoneCountryIso2Verified  character [optional]
#'
#' @field phoneCountryCode  integer [optional]
#'
#' @field phoneCountryCodeAlt  integer [optional]
#'
#' @field phoneCountryIso2  character [optional]
#'
#' @field phoneCountryIso2Alt  character [optional]
#'
#' @field originCountryIso2  character [optional]
#'
#' @field originCountryIso2Alt  character [optional]
#'
#' @field phoneNumber  character [optional]
#'
#' @field verified  character [optional]
#'
#' @field score  numeric [optional]
#'
#' @field countryIso2  character [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
FirstLastNamePhoneCodedOut <- R6::R6Class(
  'FirstLastNamePhoneCodedOut',
  public = list(
    `id` = NULL,
    `firstName` = NULL,
    `lastName` = NULL,
    `internationalPhoneNumberVerified` = NULL,
    `phoneCountryIso2Verified` = NULL,
    `phoneCountryCode` = NULL,
    `phoneCountryCodeAlt` = NULL,
    `phoneCountryIso2` = NULL,
    `phoneCountryIso2Alt` = NULL,
    `originCountryIso2` = NULL,
    `originCountryIso2Alt` = NULL,
    `phoneNumber` = NULL,
    `verified` = NULL,
    `score` = NULL,
    `countryIso2` = NULL,
    initialize = function(`id`=NULL, `firstName`=NULL, `lastName`=NULL, `internationalPhoneNumberVerified`=NULL, `phoneCountryIso2Verified`=NULL, `phoneCountryCode`=NULL, `phoneCountryCodeAlt`=NULL, `phoneCountryIso2`=NULL, `phoneCountryIso2Alt`=NULL, `originCountryIso2`=NULL, `originCountryIso2Alt`=NULL, `phoneNumber`=NULL, `verified`=NULL, `score`=NULL, `countryIso2`=NULL, ...){
      local.optional.var <- list(...)
      if (!is.null(`id`)) {
        stopifnot(is.character(`id`), length(`id`) == 1)
        self$`id` <- `id`
      }
      if (!is.null(`firstName`)) {
        stopifnot(is.character(`firstName`), length(`firstName`) == 1)
        self$`firstName` <- `firstName`
      }
      if (!is.null(`lastName`)) {
        stopifnot(is.character(`lastName`), length(`lastName`) == 1)
        self$`lastName` <- `lastName`
      }
      if (!is.null(`internationalPhoneNumberVerified`)) {
        stopifnot(is.character(`internationalPhoneNumberVerified`), length(`internationalPhoneNumberVerified`) == 1)
        self$`internationalPhoneNumberVerified` <- `internationalPhoneNumberVerified`
      }
      if (!is.null(`phoneCountryIso2Verified`)) {
        stopifnot(is.character(`phoneCountryIso2Verified`), length(`phoneCountryIso2Verified`) == 1)
        self$`phoneCountryIso2Verified` <- `phoneCountryIso2Verified`
      }
      if (!is.null(`phoneCountryCode`)) {
        stopifnot(is.numeric(`phoneCountryCode`), length(`phoneCountryCode`) == 1)
        self$`phoneCountryCode` <- `phoneCountryCode`
      }
      if (!is.null(`phoneCountryCodeAlt`)) {
        stopifnot(is.numeric(`phoneCountryCodeAlt`), length(`phoneCountryCodeAlt`) == 1)
        self$`phoneCountryCodeAlt` <- `phoneCountryCodeAlt`
      }
      if (!is.null(`phoneCountryIso2`)) {
        stopifnot(is.character(`phoneCountryIso2`), length(`phoneCountryIso2`) == 1)
        self$`phoneCountryIso2` <- `phoneCountryIso2`
      }
      if (!is.null(`phoneCountryIso2Alt`)) {
        stopifnot(is.character(`phoneCountryIso2Alt`), length(`phoneCountryIso2Alt`) == 1)
        self$`phoneCountryIso2Alt` <- `phoneCountryIso2Alt`
      }
      if (!is.null(`originCountryIso2`)) {
        stopifnot(is.character(`originCountryIso2`), length(`originCountryIso2`) == 1)
        self$`originCountryIso2` <- `originCountryIso2`
      }
      if (!is.null(`originCountryIso2Alt`)) {
        stopifnot(is.character(`originCountryIso2Alt`), length(`originCountryIso2Alt`) == 1)
        self$`originCountryIso2Alt` <- `originCountryIso2Alt`
      }
      if (!is.null(`phoneNumber`)) {
        stopifnot(is.character(`phoneNumber`), length(`phoneNumber`) == 1)
        self$`phoneNumber` <- `phoneNumber`
      }
      if (!is.null(`verified`)) {
        self$`verified` <- `verified`
      }
      if (!is.null(`score`)) {
        stopifnot(is.numeric(`score`), length(`score`) == 1)
        self$`score` <- `score`
      }
      if (!is.null(`countryIso2`)) {
        stopifnot(is.character(`countryIso2`), length(`countryIso2`) == 1)
        self$`countryIso2` <- `countryIso2`
      }
    },
    toJSON = function() {
      FirstLastNamePhoneCodedOutObject <- list()
      if (!is.null(self$`id`)) {
        FirstLastNamePhoneCodedOutObject[['id']] <-
          self$`id`
      }
      if (!is.null(self$`firstName`)) {
        FirstLastNamePhoneCodedOutObject[['firstName']] <-
          self$`firstName`
      }
      if (!is.null(self$`lastName`)) {
        FirstLastNamePhoneCodedOutObject[['lastName']] <-
          self$`lastName`
      }
      if (!is.null(self$`internationalPhoneNumberVerified`)) {
        FirstLastNamePhoneCodedOutObject[['internationalPhoneNumberVerified']] <-
          self$`internationalPhoneNumberVerified`
      }
      if (!is.null(self$`phoneCountryIso2Verified`)) {
        FirstLastNamePhoneCodedOutObject[['phoneCountryIso2Verified']] <-
          self$`phoneCountryIso2Verified`
      }
      if (!is.null(self$`phoneCountryCode`)) {
        FirstLastNamePhoneCodedOutObject[['phoneCountryCode']] <-
          self$`phoneCountryCode`
      }
      if (!is.null(self$`phoneCountryCodeAlt`)) {
        FirstLastNamePhoneCodedOutObject[['phoneCountryCodeAlt']] <-
          self$`phoneCountryCodeAlt`
      }
      if (!is.null(self$`phoneCountryIso2`)) {
        FirstLastNamePhoneCodedOutObject[['phoneCountryIso2']] <-
          self$`phoneCountryIso2`
      }
      if (!is.null(self$`phoneCountryIso2Alt`)) {
        FirstLastNamePhoneCodedOutObject[['phoneCountryIso2Alt']] <-
          self$`phoneCountryIso2Alt`
      }
      if (!is.null(self$`originCountryIso2`)) {
        FirstLastNamePhoneCodedOutObject[['originCountryIso2']] <-
          self$`originCountryIso2`
      }
      if (!is.null(self$`originCountryIso2Alt`)) {
        FirstLastNamePhoneCodedOutObject[['originCountryIso2Alt']] <-
          self$`originCountryIso2Alt`
      }
      if (!is.null(self$`phoneNumber`)) {
        FirstLastNamePhoneCodedOutObject[['phoneNumber']] <-
          self$`phoneNumber`
      }
      if (!is.null(self$`verified`)) {
        FirstLastNamePhoneCodedOutObject[['verified']] <-
          self$`verified`
      }
      if (!is.null(self$`score`)) {
        FirstLastNamePhoneCodedOutObject[['score']] <-
          self$`score`
      }
      if (!is.null(self$`countryIso2`)) {
        FirstLastNamePhoneCodedOutObject[['countryIso2']] <-
          self$`countryIso2`
      }

      FirstLastNamePhoneCodedOutObject
    },
    fromJSON = function(FirstLastNamePhoneCodedOutJson) {
      FirstLastNamePhoneCodedOutObject <- jsonlite::fromJSON(FirstLastNamePhoneCodedOutJson)
      if (!is.null(FirstLastNamePhoneCodedOutObject$`id`)) {
        self$`id` <- FirstLastNamePhoneCodedOutObject$`id`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`firstName`)) {
        self$`firstName` <- FirstLastNamePhoneCodedOutObject$`firstName`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`lastName`)) {
        self$`lastName` <- FirstLastNamePhoneCodedOutObject$`lastName`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`internationalPhoneNumberVerified`)) {
        self$`internationalPhoneNumberVerified` <- FirstLastNamePhoneCodedOutObject$`internationalPhoneNumberVerified`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`phoneCountryIso2Verified`)) {
        self$`phoneCountryIso2Verified` <- FirstLastNamePhoneCodedOutObject$`phoneCountryIso2Verified`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`phoneCountryCode`)) {
        self$`phoneCountryCode` <- FirstLastNamePhoneCodedOutObject$`phoneCountryCode`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`phoneCountryCodeAlt`)) {
        self$`phoneCountryCodeAlt` <- FirstLastNamePhoneCodedOutObject$`phoneCountryCodeAlt`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`phoneCountryIso2`)) {
        self$`phoneCountryIso2` <- FirstLastNamePhoneCodedOutObject$`phoneCountryIso2`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`phoneCountryIso2Alt`)) {
        self$`phoneCountryIso2Alt` <- FirstLastNamePhoneCodedOutObject$`phoneCountryIso2Alt`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`originCountryIso2`)) {
        self$`originCountryIso2` <- FirstLastNamePhoneCodedOutObject$`originCountryIso2`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`originCountryIso2Alt`)) {
        self$`originCountryIso2Alt` <- FirstLastNamePhoneCodedOutObject$`originCountryIso2Alt`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`phoneNumber`)) {
        self$`phoneNumber` <- FirstLastNamePhoneCodedOutObject$`phoneNumber`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`verified`)) {
        self$`verified` <- FirstLastNamePhoneCodedOutObject$`verified`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`score`)) {
        self$`score` <- FirstLastNamePhoneCodedOutObject$`score`
      }
      if (!is.null(FirstLastNamePhoneCodedOutObject$`countryIso2`)) {
        self$`countryIso2` <- FirstLastNamePhoneCodedOutObject$`countryIso2`
      }
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`id`)) {
        sprintf(
        '"id":
          "%s"
                ',
        self$`id`
        )},
        if (!is.null(self$`firstName`)) {
        sprintf(
        '"firstName":
          "%s"
                ',
        self$`firstName`
        )},
        if (!is.null(self$`lastName`)) {
        sprintf(
        '"lastName":
          "%s"
                ',
        self$`lastName`
        )},
        if (!is.null(self$`internationalPhoneNumberVerified`)) {
        sprintf(
        '"internationalPhoneNumberVerified":
          "%s"
                ',
        self$`internationalPhoneNumberVerified`
        )},
        if (!is.null(self$`phoneCountryIso2Verified`)) {
        sprintf(
        '"phoneCountryIso2Verified":
          "%s"
                ',
        self$`phoneCountryIso2Verified`
        )},
        if (!is.null(self$`phoneCountryCode`)) {
        sprintf(
        '"phoneCountryCode":
          %d
                ',
        self$`phoneCountryCode`
        )},
        if (!is.null(self$`phoneCountryCodeAlt`)) {
        sprintf(
        '"phoneCountryCodeAlt":
          %d
                ',
        self$`phoneCountryCodeAlt`
        )},
        if (!is.null(self$`phoneCountryIso2`)) {
        sprintf(
        '"phoneCountryIso2":
          "%s"
                ',
        self$`phoneCountryIso2`
        )},
        if (!is.null(self$`phoneCountryIso2Alt`)) {
        sprintf(
        '"phoneCountryIso2Alt":
          "%s"
                ',
        self$`phoneCountryIso2Alt`
        )},
        if (!is.null(self$`originCountryIso2`)) {
        sprintf(
        '"originCountryIso2":
          "%s"
                ',
        self$`originCountryIso2`
        )},
        if (!is.null(self$`originCountryIso2Alt`)) {
        sprintf(
        '"originCountryIso2Alt":
          "%s"
                ',
        self$`originCountryIso2Alt`
        )},
        if (!is.null(self$`phoneNumber`)) {
        sprintf(
        '"phoneNumber":
          "%s"
                ',
        self$`phoneNumber`
        )},
        if (!is.null(self$`verified`)) {
        sprintf(
        '"verified":
          "%s"
                ',
        self$`verified`
        )},
        if (!is.null(self$`score`)) {
        sprintf(
        '"score":
          %d
                ',
        self$`score`
        )},
        if (!is.null(self$`countryIso2`)) {
        sprintf(
        '"countryIso2":
          "%s"
                ',
        self$`countryIso2`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(FirstLastNamePhoneCodedOutJson) {
      FirstLastNamePhoneCodedOutObject <- jsonlite::fromJSON(FirstLastNamePhoneCodedOutJson)
      self$`id` <- FirstLastNamePhoneCodedOutObject$`id`
      self$`firstName` <- FirstLastNamePhoneCodedOutObject$`firstName`
      self$`lastName` <- FirstLastNamePhoneCodedOutObject$`lastName`
      self$`internationalPhoneNumberVerified` <- FirstLastNamePhoneCodedOutObject$`internationalPhoneNumberVerified`
      self$`phoneCountryIso2Verified` <- FirstLastNamePhoneCodedOutObject$`phoneCountryIso2Verified`
      self$`phoneCountryCode` <- FirstLastNamePhoneCodedOutObject$`phoneCountryCode`
      self$`phoneCountryCodeAlt` <- FirstLastNamePhoneCodedOutObject$`phoneCountryCodeAlt`
      self$`phoneCountryIso2` <- FirstLastNamePhoneCodedOutObject$`phoneCountryIso2`
      self$`phoneCountryIso2Alt` <- FirstLastNamePhoneCodedOutObject$`phoneCountryIso2Alt`
      self$`originCountryIso2` <- FirstLastNamePhoneCodedOutObject$`originCountryIso2`
      self$`originCountryIso2Alt` <- FirstLastNamePhoneCodedOutObject$`originCountryIso2Alt`
      self$`phoneNumber` <- FirstLastNamePhoneCodedOutObject$`phoneNumber`
      self$`verified` <- FirstLastNamePhoneCodedOutObject$`verified`
      self$`score` <- FirstLastNamePhoneCodedOutObject$`score`
      self$`countryIso2` <- FirstLastNamePhoneCodedOutObject$`countryIso2`
      self
    }
  )
)
namsor/namsor-r-sdk2 documentation built on March 15, 2021, 7:12 p.m.