R/billing_project_membership.R

# FireCloud
#
# FireCloud API 
#
# The version of the OpenAPI document: 0.1
# 
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title BillingProjectMembership
#'
#' @description BillingProjectMembership Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field projectName  character 
#'
#' @field role  character 
#'
#' @field status  character 
#'
#' @field message  character [optional]
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
BillingProjectMembership <- R6::R6Class(
  'BillingProjectMembership',
  public = list(
    `projectName` = NULL,
    `role` = NULL,
    `status` = NULL,
    `message` = NULL,
    initialize = function(
        `projectName`, `role`, `status`, `message`=NULL, ...
    ) {
      local.optional.var <- list(...)
      if (!missing(`projectName`)) {
        stopifnot(is.character(`projectName`), length(`projectName`) == 1)
        self$`projectName` <- `projectName`
      }
      if (!missing(`role`)) {
        stopifnot(is.character(`role`), length(`role`) == 1)
        self$`role` <- `role`
      }
      if (!missing(`status`)) {
        stopifnot(is.character(`status`), length(`status`) == 1)
        self$`status` <- `status`
      }
      if (!is.null(`message`)) {
        stopifnot(is.character(`message`), length(`message`) == 1)
        self$`message` <- `message`
      }
    },
    toJSON = function() {
      BillingProjectMembershipObject <- list()
      if (!is.null(self$`projectName`)) {
        BillingProjectMembershipObject[['projectName']] <-
          self$`projectName`
      }
      if (!is.null(self$`role`)) {
        BillingProjectMembershipObject[['role']] <-
          self$`role`
      }
      if (!is.null(self$`status`)) {
        BillingProjectMembershipObject[['status']] <-
          self$`status`
      }
      if (!is.null(self$`message`)) {
        BillingProjectMembershipObject[['message']] <-
          self$`message`
      }

      BillingProjectMembershipObject
    },
    fromJSON = function(BillingProjectMembershipJson) {
      BillingProjectMembershipObject <- jsonlite::fromJSON(BillingProjectMembershipJson)
      if (!is.null(BillingProjectMembershipObject$`projectName`)) {
        self$`projectName` <- BillingProjectMembershipObject$`projectName`
      }
      if (!is.null(BillingProjectMembershipObject$`role`)) {
        self$`role` <- BillingProjectMembershipObject$`role`
      }
      if (!is.null(BillingProjectMembershipObject$`status`)) {
        self$`status` <- BillingProjectMembershipObject$`status`
      }
      if (!is.null(BillingProjectMembershipObject$`message`)) {
        self$`message` <- BillingProjectMembershipObject$`message`
      }
      self
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`projectName`)) {
        sprintf(
        '"projectName":
          "%s"
                ',
        self$`projectName`
        )},
        if (!is.null(self$`role`)) {
        sprintf(
        '"role":
          "%s"
                ',
        self$`role`
        )},
        if (!is.null(self$`status`)) {
        sprintf(
        '"status":
          "%s"
                ',
        self$`status`
        )},
        if (!is.null(self$`message`)) {
        sprintf(
        '"message":
          "%s"
                ',
        self$`message`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(BillingProjectMembershipJson) {
      BillingProjectMembershipObject <- jsonlite::fromJSON(BillingProjectMembershipJson)
      self$`projectName` <- BillingProjectMembershipObject$`projectName`
      self$`role` <- BillingProjectMembershipObject$`role`
      self$`status` <- BillingProjectMembershipObject$`status`
      self$`message` <- BillingProjectMembershipObject$`message`
      self
    }
  )
)
vjcitn/terraClientR documentation built on Dec. 23, 2021, 4:07 p.m.