add toString method in models (#12706)

This commit is contained in:
William Cheng 2022-06-27 19:26:35 +08:00 committed by GitHub
parent 229b2dcfac
commit 9522f6d1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 172 additions and 18 deletions

View File

@ -349,8 +349,17 @@
stop(paste("The JSON input `", input, "` is invalid for {{classname}}: the required field `{{name}}` is missing."))
}
{{/requiredVars}}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of {{{classname}}}
#' @export
toString = function() {
self$toJSONString()
}
)
)
{{/isEnum}}

View File

@ -195,8 +195,17 @@ AllofTagApiResponse <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of AllofTagApiResponse
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -135,8 +135,17 @@ Animal <- R6::R6Class(
} else {
stop(paste("The JSON input `", input, "` is invalid for Animal: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Animal
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -141,8 +141,17 @@ BasquePig <- R6::R6Class(
} else {
stop(paste("The JSON input `", input, "` is invalid for BasquePig: the required field `color` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of BasquePig
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -158,8 +158,17 @@ Cat <- R6::R6Class(
} else {
stop(paste("The JSON input `", input, "` is invalid for Cat: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Cat
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -107,8 +107,17 @@ CatAllOf <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of CatAllOf
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -129,8 +129,17 @@ Category <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Category
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -141,8 +141,17 @@ DanishPig <- R6::R6Class(
} else {
stop(paste("The JSON input `", input, "` is invalid for DanishPig: the required field `size` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DanishPig
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -158,8 +158,17 @@ Dog <- R6::R6Class(
} else {
stop(paste("The JSON input `", input, "` is invalid for Dog: the required field `className` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Dog
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -107,8 +107,17 @@ DogAllOf <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of DogAllOf
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -151,8 +151,17 @@ ModelApiResponse <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of ModelApiResponse
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -217,8 +217,17 @@ Order <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Order
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -234,8 +234,17 @@ Pet <- R6::R6Class(
} else {
stop(paste("The JSON input `", input, "` is invalid for Pet: the required field `photoUrls` is missing."))
}
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Pet
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -151,8 +151,17 @@ Special <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Special
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -129,8 +129,17 @@ Tag <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of Tag
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -130,8 +130,17 @@ UpdatePetRequest <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of UpdatePetRequest
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -261,8 +261,17 @@ User <- R6::R6Class(
#' @export
validateJSON = function(input) {
input_json <- jsonlite::fromJSON(input)
},
#' To string (JSON format)
#'
#' @description
#' To string (JSON format)
#'
#' @return String representation of User
#' @export
toString = function() {
self$toJSONString()
}
)
)

View File

@ -47,7 +47,8 @@ pet <- Pet$new("name_test",
)
#jsonlite::minify(pet$toJSONString())
pet$toJSONString()
#cat(pet$toJSONString())
toString(pet$toString())
#json <-
#'[