R/nam_sor_counter_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 NamSorCounterOut
#' @description NamSorCounterOut Class
#' @format An \code{R6Class} generator object
#' @field counter  integer [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
NamSorCounterOut <- R6::R6Class(
  'NamSorCounterOut',
  public = list(
    `counter` = NULL,
    initialize = function(`counter`=NULL, ...){
      local.optional.var <- list(...)
      if (!is.null(`counter`)) {
        stopifnot(is.numeric(`counter`), length(`counter`) == 1)
        self$`counter` <- `counter`
      }
    },
    toJSON = function() {
      NamSorCounterOutObject <- list()
      if (!is.null(self$`counter`)) {
        NamSorCounterOutObject[['counter']] <-
          self$`counter`
      }

      NamSorCounterOutObject
    },
    fromJSON = function(NamSorCounterOutJson) {
      NamSorCounterOutObject <- jsonlite::fromJSON(NamSorCounterOutJson)
      if (!is.null(NamSorCounterOutObject$`counter`)) {
        self$`counter` <- NamSorCounterOutObject$`counter`
      }
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`counter`)) {
        sprintf(
        '"counter":
          %d
                ',
        self$`counter`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(NamSorCounterOutJson) {
      NamSorCounterOutObject <- jsonlite::fromJSON(NamSorCounterOutJson)
      self$`counter` <- NamSorCounterOutObject$`counter`
      self
    }
  )
)
namsor/namsor-r-sdk2 documentation built on March 15, 2021, 7:12 p.m.