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

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