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 1000 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! 
#
# OpenAPI spec version: 2.0.2-beta
# Contact: contact@namsor.com
# Generated by: https://openapi-generator.tech


#' BillingInfoInOut Class
#'
#' @field billingEmail 
#' @field preferredCurrency 
#' @field customerName 
#' @field customerPhone 
#' @field addressLine1 
#' @field addressLine2 
#' @field addressCity 
#' @field addressPostalCode 
#' @field addressState 
#' @field addressCountry 
#' @field vatID 
#'
#' @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`, `preferredCurrency`, `customerName`, `customerPhone`, `addressLine1`, `addressLine2`, `addressCity`, `addressPostalCode`, `addressState`, `addressCountry`, `vatID`){
      if (!missing(`billingEmail`)) {
        stopifnot(is.character(`billingEmail`), length(`billingEmail`) == 1)
        self$`billingEmail` <- `billingEmail`
      }
      if (!missing(`preferredCurrency`)) {
        stopifnot(is.character(`preferredCurrency`), length(`preferredCurrency`) == 1)
        self$`preferredCurrency` <- `preferredCurrency`
      }
      if (!missing(`customerName`)) {
        stopifnot(is.character(`customerName`), length(`customerName`) == 1)
        self$`customerName` <- `customerName`
      }
      if (!missing(`customerPhone`)) {
        stopifnot(is.character(`customerPhone`), length(`customerPhone`) == 1)
        self$`customerPhone` <- `customerPhone`
      }
      if (!missing(`addressLine1`)) {
        stopifnot(is.character(`addressLine1`), length(`addressLine1`) == 1)
        self$`addressLine1` <- `addressLine1`
      }
      if (!missing(`addressLine2`)) {
        stopifnot(is.character(`addressLine2`), length(`addressLine2`) == 1)
        self$`addressLine2` <- `addressLine2`
      }
      if (!missing(`addressCity`)) {
        stopifnot(is.character(`addressCity`), length(`addressCity`) == 1)
        self$`addressCity` <- `addressCity`
      }
      if (!missing(`addressPostalCode`)) {
        stopifnot(is.character(`addressPostalCode`), length(`addressPostalCode`) == 1)
        self$`addressPostalCode` <- `addressPostalCode`
      }
      if (!missing(`addressState`)) {
        stopifnot(is.character(`addressState`), length(`addressState`) == 1)
        self$`addressState` <- `addressState`
      }
      if (!missing(`addressCountry`)) {
        stopifnot(is.character(`addressCountry`), length(`addressCountry`) == 1)
        self$`addressCountry` <- `addressCountry`
      }
      if (!missing(`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() {
      sprintf(
        '{
           "billingEmail":
             "%s",
           "preferredCurrency":
             "%s",
           "customerName":
             "%s",
           "customerPhone":
             "%s",
           "addressLine1":
             "%s",
           "addressLine2":
             "%s",
           "addressCity":
             "%s",
           "addressPostalCode":
             "%s",
           "addressState":
             "%s",
           "addressCountry":
             "%s",
           "vatID":
             "%s"
        }',
        self$`billingEmail`,
        self$`preferredCurrency`,
        self$`customerName`,
        self$`customerPhone`,
        self$`addressLine1`,
        self$`addressLine2`,
        self$`addressCity`,
        self$`addressPostalCode`,
        self$`addressState`,
        self$`addressCountry`,
        self$`vatID`
      )
    },
    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
    }
  )
)
wing328/namsor-r-client documentation built on May 26, 2019, 7:01 p.m.