R/billing_info_in_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 BillingInfoInOut
#' @description BillingInfoInOut Class
#' @format An \code{R6Class} generator object
#' @field billingEmail  character [optional]
#'
#' @field preferredCurrency  character [optional]
#'
#' @field customerName  character [optional]
#'
#' @field customerPhone  character [optional]
#'
#' @field addressLine1  character [optional]
#'
#' @field addressLine2  character [optional]
#'
#' @field addressCity  character [optional]
#'
#' @field addressPostalCode  character [optional]
#'
#' @field addressState  character [optional]
#'
#' @field addressCountry  character [optional]
#'
#' @field vatID  character [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
BillingInfoInOut <- R6::R6Class(
  'BillingInfoInOut',
  public = list(
    `billingEmail` = NULL,
    `preferredCurrency` = NULL,
    `customerName` = NULL,
    `customerPhone` = NULL,
    `addressLine1` = NULL,
    `addressLine2` = NULL,
    `addressCity` = NULL,
    `addressPostalCode` = NULL,
    `addressState` = NULL,
    `addressCountry` = NULL,
    `vatID` = NULL,
    initialize = function(`billingEmail`=NULL, `preferredCurrency`=NULL, `customerName`=NULL, `customerPhone`=NULL, `addressLine1`=NULL, `addressLine2`=NULL, `addressCity`=NULL, `addressPostalCode`=NULL, `addressState`=NULL, `addressCountry`=NULL, `vatID`=NULL, ...){
      local.optional.var <- list(...)
      if (!is.null(`billingEmail`)) {
        stopifnot(is.character(`billingEmail`), length(`billingEmail`) == 1)
        self$`billingEmail` <- `billingEmail`
      }
      if (!is.null(`preferredCurrency`)) {
        stopifnot(is.character(`preferredCurrency`), length(`preferredCurrency`) == 1)
        self$`preferredCurrency` <- `preferredCurrency`
      }
      if (!is.null(`customerName`)) {
        stopifnot(is.character(`customerName`), length(`customerName`) == 1)
        self$`customerName` <- `customerName`
      }
      if (!is.null(`customerPhone`)) {
        stopifnot(is.character(`customerPhone`), length(`customerPhone`) == 1)
        self$`customerPhone` <- `customerPhone`
      }
      if (!is.null(`addressLine1`)) {
        stopifnot(is.character(`addressLine1`), length(`addressLine1`) == 1)
        self$`addressLine1` <- `addressLine1`
      }
      if (!is.null(`addressLine2`)) {
        stopifnot(is.character(`addressLine2`), length(`addressLine2`) == 1)
        self$`addressLine2` <- `addressLine2`
      }
      if (!is.null(`addressCity`)) {
        stopifnot(is.character(`addressCity`), length(`addressCity`) == 1)
        self$`addressCity` <- `addressCity`
      }
      if (!is.null(`addressPostalCode`)) {
        stopifnot(is.character(`addressPostalCode`), length(`addressPostalCode`) == 1)
        self$`addressPostalCode` <- `addressPostalCode`
      }
      if (!is.null(`addressState`)) {
        stopifnot(is.character(`addressState`), length(`addressState`) == 1)
        self$`addressState` <- `addressState`
      }
      if (!is.null(`addressCountry`)) {
        stopifnot(is.character(`addressCountry`), length(`addressCountry`) == 1)
        self$`addressCountry` <- `addressCountry`
      }
      if (!is.null(`vatID`)) {
        stopifnot(is.character(`vatID`), length(`vatID`) == 1)
        self$`vatID` <- `vatID`
      }
    },
    toJSON = function() {
      BillingInfoInOutObject <- list()
      if (!is.null(self$`billingEmail`)) {
        BillingInfoInOutObject[['billingEmail']] <-
          self$`billingEmail`
      }
      if (!is.null(self$`preferredCurrency`)) {
        BillingInfoInOutObject[['preferredCurrency']] <-
          self$`preferredCurrency`
      }
      if (!is.null(self$`customerName`)) {
        BillingInfoInOutObject[['customerName']] <-
          self$`customerName`
      }
      if (!is.null(self$`customerPhone`)) {
        BillingInfoInOutObject[['customerPhone']] <-
          self$`customerPhone`
      }
      if (!is.null(self$`addressLine1`)) {
        BillingInfoInOutObject[['addressLine1']] <-
          self$`addressLine1`
      }
      if (!is.null(self$`addressLine2`)) {
        BillingInfoInOutObject[['addressLine2']] <-
          self$`addressLine2`
      }
      if (!is.null(self$`addressCity`)) {
        BillingInfoInOutObject[['addressCity']] <-
          self$`addressCity`
      }
      if (!is.null(self$`addressPostalCode`)) {
        BillingInfoInOutObject[['addressPostalCode']] <-
          self$`addressPostalCode`
      }
      if (!is.null(self$`addressState`)) {
        BillingInfoInOutObject[['addressState']] <-
          self$`addressState`
      }
      if (!is.null(self$`addressCountry`)) {
        BillingInfoInOutObject[['addressCountry']] <-
          self$`addressCountry`
      }
      if (!is.null(self$`vatID`)) {
        BillingInfoInOutObject[['vatID']] <-
          self$`vatID`
      }

      BillingInfoInOutObject
    },
    fromJSON = function(BillingInfoInOutJson) {
      BillingInfoInOutObject <- jsonlite::fromJSON(BillingInfoInOutJson)
      if (!is.null(BillingInfoInOutObject$`billingEmail`)) {
        self$`billingEmail` <- BillingInfoInOutObject$`billingEmail`
      }
      if (!is.null(BillingInfoInOutObject$`preferredCurrency`)) {
        self$`preferredCurrency` <- BillingInfoInOutObject$`preferredCurrency`
      }
      if (!is.null(BillingInfoInOutObject$`customerName`)) {
        self$`customerName` <- BillingInfoInOutObject$`customerName`
      }
      if (!is.null(BillingInfoInOutObject$`customerPhone`)) {
        self$`customerPhone` <- BillingInfoInOutObject$`customerPhone`
      }
      if (!is.null(BillingInfoInOutObject$`addressLine1`)) {
        self$`addressLine1` <- BillingInfoInOutObject$`addressLine1`
      }
      if (!is.null(BillingInfoInOutObject$`addressLine2`)) {
        self$`addressLine2` <- BillingInfoInOutObject$`addressLine2`
      }
      if (!is.null(BillingInfoInOutObject$`addressCity`)) {
        self$`addressCity` <- BillingInfoInOutObject$`addressCity`
      }
      if (!is.null(BillingInfoInOutObject$`addressPostalCode`)) {
        self$`addressPostalCode` <- BillingInfoInOutObject$`addressPostalCode`
      }
      if (!is.null(BillingInfoInOutObject$`addressState`)) {
        self$`addressState` <- BillingInfoInOutObject$`addressState`
      }
      if (!is.null(BillingInfoInOutObject$`addressCountry`)) {
        self$`addressCountry` <- BillingInfoInOutObject$`addressCountry`
      }
      if (!is.null(BillingInfoInOutObject$`vatID`)) {
        self$`vatID` <- BillingInfoInOutObject$`vatID`
      }
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`billingEmail`)) {
        sprintf(
        '"billingEmail":
          "%s"
                ',
        self$`billingEmail`
        )},
        if (!is.null(self$`preferredCurrency`)) {
        sprintf(
        '"preferredCurrency":
          "%s"
                ',
        self$`preferredCurrency`
        )},
        if (!is.null(self$`customerName`)) {
        sprintf(
        '"customerName":
          "%s"
                ',
        self$`customerName`
        )},
        if (!is.null(self$`customerPhone`)) {
        sprintf(
        '"customerPhone":
          "%s"
                ',
        self$`customerPhone`
        )},
        if (!is.null(self$`addressLine1`)) {
        sprintf(
        '"addressLine1":
          "%s"
                ',
        self$`addressLine1`
        )},
        if (!is.null(self$`addressLine2`)) {
        sprintf(
        '"addressLine2":
          "%s"
                ',
        self$`addressLine2`
        )},
        if (!is.null(self$`addressCity`)) {
        sprintf(
        '"addressCity":
          "%s"
                ',
        self$`addressCity`
        )},
        if (!is.null(self$`addressPostalCode`)) {
        sprintf(
        '"addressPostalCode":
          "%s"
                ',
        self$`addressPostalCode`
        )},
        if (!is.null(self$`addressState`)) {
        sprintf(
        '"addressState":
          "%s"
                ',
        self$`addressState`
        )},
        if (!is.null(self$`addressCountry`)) {
        sprintf(
        '"addressCountry":
          "%s"
                ',
        self$`addressCountry`
        )},
        if (!is.null(self$`vatID`)) {
        sprintf(
        '"vatID":
          "%s"
                ',
        self$`vatID`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(BillingInfoInOutJson) {
      BillingInfoInOutObject <- jsonlite::fromJSON(BillingInfoInOutJson)
      self$`billingEmail` <- BillingInfoInOutObject$`billingEmail`
      self$`preferredCurrency` <- BillingInfoInOutObject$`preferredCurrency`
      self$`customerName` <- BillingInfoInOutObject$`customerName`
      self$`customerPhone` <- BillingInfoInOutObject$`customerPhone`
      self$`addressLine1` <- BillingInfoInOutObject$`addressLine1`
      self$`addressLine2` <- BillingInfoInOutObject$`addressLine2`
      self$`addressCity` <- BillingInfoInOutObject$`addressCity`
      self$`addressPostalCode` <- BillingInfoInOutObject$`addressPostalCode`
      self$`addressState` <- BillingInfoInOutObject$`addressState`
      self$`addressCountry` <- BillingInfoInOutObject$`addressCountry`
      self$`vatID` <- BillingInfoInOutObject$`vatID`
      self
    }
  )
)
namsor/namsor-r-sdk2 documentation built on March 15, 2021, 7:12 p.m.