R/message_push_response.R

# DaDaPush Public API
#
# DaDaPush: Real-time Notifications App Send real-time notifications through our API without coding and maintaining your own app for iOS or Android devices.
#
# The version of the OpenAPI document: v1
# Contact: contacts@dadapush.com
# Generated by: https://openapi-generator.tech


#' MessagePushResponse Class
#'
#' @field messageId 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
MessagePushResponse <- R6::R6Class(
  'MessagePushResponse',
  public = list(
    `messageId` = NULL,
    initialize = function(`messageId`, ...){
      local.optional.var <- list(...)
      if (!missing(`messageId`)) {
        stopifnot(is.numeric(`messageId`), length(`messageId`) == 1)
        self$`messageId` <- `messageId`
      }
    },
    toJSON = function() {
      MessagePushResponseObject <- list()
      if (!is.null(self$`messageId`)) {
        MessagePushResponseObject[['messageId']] <-
          self$`messageId`
      }

      MessagePushResponseObject
    },
    fromJSON = function(MessagePushResponseJson) {
      MessagePushResponseObject <- jsonlite::fromJSON(MessagePushResponseJson)
      if (!is.null(MessagePushResponseObject$`messageId`)) {
        self$`messageId` <- MessagePushResponseObject$`messageId`
      }
    },
    toJSONString = function() {
      sprintf(
        '{
           "messageId":
             %d
        }',
        self$`messageId`
      )
    },
    fromJSONString = function(MessagePushResponseJson) {
      MessagePushResponseObject <- jsonlite::fromJSON(MessagePushResponseJson)
      self$`messageId` <- MessagePushResponseObject$`messageId`
      self
    }
  )
)
dadapush/dadapush-r-client documentation built on Nov. 4, 2019, 9:36 a.m.