Skip to content

Commit

Permalink
Merge pull request #33 from Lattice-Works/develop
Browse files Browse the repository at this point in the history
v0.1.2
  • Loading branch information
jokedurnez authored Jul 31, 2020
2 parents e9e9dbe + 9f3ce7e commit dac0cab
Show file tree
Hide file tree
Showing 142 changed files with 1,269 additions and 777 deletions.
2 changes: 1 addition & 1 deletion R/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: openlattice
Title: R Package Client for OpenLattice API
Version: 0.1.1
Version: 0.1.2
Authors@R: person("OpenAPI Generator community", email = "[email protected]", role = c("aut", "cre"))
Description: OpenLattice API
URL: https://github.com/GIT_USER_ID/GIT_REPO_ID
Expand Down
10 changes: 8 additions & 2 deletions R/R/access_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

#' @docType class
#' @title AccessCheck
#'
#' @description AccessCheck Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field aclKey list( character ) [optional]
#'
#' @field permissions list( character ) [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Expand All @@ -23,7 +25,9 @@ AccessCheck <- R6::R6Class(
public = list(
`aclKey` = NULL,
`permissions` = NULL,
initialize = function(`aclKey`=NULL, `permissions`=NULL, ...){
initialize = function(
`aclKey`=NULL, `permissions`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`aclKey`)) {
stopifnot(is.vector(`aclKey`))
Expand Down Expand Up @@ -57,6 +61,7 @@ AccessCheck <- R6::R6Class(
if (!is.null(AccessCheckObject$`permissions`)) {
self$`permissions` <- ApiClient$new()$deserializeObj(AccessCheckObject$`permissions`, "array[character]", loadNamespace("openlattice"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
Expand Down Expand Up @@ -86,3 +91,4 @@ AccessCheck <- R6::R6Class(
}
)
)

16 changes: 11 additions & 5 deletions R/R/ace.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

#' @docType class
#' @title Ace
#'
#' @description Ace Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field principal \link{Principal} [optional]
#'
#' @field permissions list( character ) [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Expand All @@ -23,7 +25,9 @@ Ace <- R6::R6Class(
public = list(
`principal` = NULL,
`permissions` = NULL,
initialize = function(`principal`=NULL, `permissions`=NULL, ...){
initialize = function(
`principal`=NULL, `permissions`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`principal`)) {
stopifnot(R6::is.R6(`principal`))
Expand Down Expand Up @@ -52,12 +56,13 @@ Ace <- R6::R6Class(
AceObject <- jsonlite::fromJSON(AceJson)
if (!is.null(AceObject$`principal`)) {
principalObject <- Principal$new()
principalObject$fromJSON(jsonlite::toJSON(AceObject$principal, auto_unbox = TRUE, digits = NA))
principalObject$fromJSON(jsonlite::toJSON(AceObject$principal, auto_unbox = FALSE, digits = NA))
self$`principal` <- principalObject
}
if (!is.null(AceObject$`permissions`)) {
self$`permissions` <- ApiClient$new()$deserializeObj(AceObject$`permissions`, "array[character]", loadNamespace("openlattice"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
Expand All @@ -66,7 +71,7 @@ Ace <- R6::R6Class(
'"principal":
%s
',
jsonlite::toJSON(self$`principal`$toJSON(), auto_unbox=TRUE, digits = NA)
jsonlite::toJSON(self$`principal`$toJSON(), auto_unbox=FALSE, digits = NA)
)},
if (!is.null(self$`permissions`)) {
sprintf(
Expand All @@ -81,9 +86,10 @@ Ace <- R6::R6Class(
},
fromJSONString = function(AceJson) {
AceObject <- jsonlite::fromJSON(AceJson)
self$`principal` <- Principal$new()$fromJSON(jsonlite::toJSON(AceObject$principal, auto_unbox = TRUE, digits = NA))
self$`principal` <- Principal$new()$fromJSON(jsonlite::toJSON(AceObject$principal, auto_unbox = FALSE, digits = NA))
self$`permissions` <- ApiClient$new()$deserializeObj(AceObject$`permissions`, "array[character]", loadNamespace("openlattice"))
self
}
)
)

12 changes: 9 additions & 3 deletions R/R/acl.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

#' @docType class
#' @title Acl
#'
#' @description Acl Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field aclKey list( character ) [optional]
#'
#' @field aces list( \link{Ace} ) [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Expand All @@ -23,7 +25,9 @@ Acl <- R6::R6Class(
public = list(
`aclKey` = NULL,
`aces` = NULL,
initialize = function(`aclKey`=NULL, `aces`=NULL, ...){
initialize = function(
`aclKey`=NULL, `aces`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`aclKey`)) {
stopifnot(is.vector(`aclKey`))
Expand Down Expand Up @@ -57,6 +61,7 @@ Acl <- R6::R6Class(
if (!is.null(AclObject$`aces`)) {
self$`aces` <- ApiClient$new()$deserializeObj(AclObject$`aces`, "array[Ace]", loadNamespace("openlattice"))
}
self
},
toJSONString = function() {
jsoncontent <- c(
Expand All @@ -72,7 +77,7 @@ Acl <- R6::R6Class(
'"aces":
[%s]
',
paste(sapply(self$`aces`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
paste(sapply(self$`aces`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=FALSE, digits = NA)), collapse=",")
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
Expand All @@ -86,3 +91,4 @@ Acl <- R6::R6Class(
}
)
)

16 changes: 11 additions & 5 deletions R/R/acl_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

#' @docType class
#' @title AclData
#'
#' @description AclData Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field action character [optional]
#'
#' @field acl \link{Acl} [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Expand All @@ -23,7 +25,9 @@ AclData <- R6::R6Class(
public = list(
`action` = NULL,
`acl` = NULL,
initialize = function(`action`=NULL, `acl`=NULL, ...){
initialize = function(
`action`=NULL, `acl`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`action`)) {
stopifnot(is.character(`action`), length(`action`) == 1)
Expand Down Expand Up @@ -54,9 +58,10 @@ AclData <- R6::R6Class(
}
if (!is.null(AclDataObject$`acl`)) {
aclObject <- Acl$new()
aclObject$fromJSON(jsonlite::toJSON(AclDataObject$acl, auto_unbox = TRUE, digits = NA))
aclObject$fromJSON(jsonlite::toJSON(AclDataObject$acl, auto_unbox = FALSE, digits = NA))
self$`acl` <- aclObject
}
self
},
toJSONString = function() {
jsoncontent <- c(
Expand All @@ -72,7 +77,7 @@ AclData <- R6::R6Class(
'"acl":
%s
',
jsonlite::toJSON(self$`acl`$toJSON(), auto_unbox=TRUE, digits = NA)
jsonlite::toJSON(self$`acl`$toJSON(), auto_unbox=FALSE, digits = NA)
)}
)
jsoncontent <- paste(jsoncontent, collapse = ",")
Expand All @@ -81,8 +86,9 @@ AclData <- R6::R6Class(
fromJSONString = function(AclDataJson) {
AclDataObject <- jsonlite::fromJSON(AclDataJson)
self$`action` <- AclDataObject$`action`
self$`acl` <- Acl$new()$fromJSON(jsonlite::toJSON(AclDataObject$acl, auto_unbox = TRUE, digits = NA))
self$`acl` <- Acl$new()$fromJSON(jsonlite::toJSON(AclDataObject$acl, auto_unbox = FALSE, digits = NA))
self
}
)
)

4 changes: 2 additions & 2 deletions R/R/admin_api.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
#' #################### reindex ####################
#'
#' library(openlattice)
#' var.request_body <- {'key' => array$new()} # list(array[character]) | A map of entity set ids to entity key ids that determines what will be reindexed. If no entity key ids are provided then all entities in an entity set are reindexed. If no entity set ids are provided then all entity sets are scheduled for reindexing.
#' var.request_body <- NULL # list(array[character]) | A map of entity set ids to entity key ids that determines what will be reindexed. If no entity key ids are provided then all entities in an entity set are reindexed. If no entity set ids are provided then all entity sets are scheduled for reindexing.
#'
#' #Merge job descriptions for performing a partial or full reindex of provided entity sets.
#' api.instance <- AdminApi$new()
Expand All @@ -145,7 +145,7 @@
#' #################### update_reindex ####################
#'
#' library(openlattice)
#' var.request_body <- {'key' => array$new()} # list(array[character]) | A map of entity set ids to entity key ids that determines what will be reindexed. If no entity key ids are provided then all entities in an entity set are reindexed. If no entity set ids are provided then all entity sets are scheduled for reindexing.
#' var.request_body <- NULL # list(array[character]) | A map of entity set ids to entity key ids that determines what will be reindexed. If no entity key ids are provided then all entities in an entity set are reindexed. If no entity set ids are provided then all entity sets are scheduled for reindexing.
#'
#' #Replaces job descriptions for performing a partial or full reindex of provided entity sets.
#' api.instance <- AdminApi$new()
Expand Down
12 changes: 9 additions & 3 deletions R/R/advanced_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@

#' @docType class
#' @title AdvancedSearch
#'
#' @description AdvancedSearch Class
#'
#' @format An \code{R6Class} generator object
#'
#' @field searchFields list( \link{SearchDetails} ) [optional]
#'
#' @field start integer [optional]
#'
#' @field maxHits integer [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
Expand All @@ -26,7 +28,9 @@ AdvancedSearch <- R6::R6Class(
`searchFields` = NULL,
`start` = NULL,
`maxHits` = NULL,
initialize = function(`searchFields`=NULL, `start`=NULL, `maxHits`=NULL, ...){
initialize = function(
`searchFields`=NULL, `start`=NULL, `maxHits`=NULL, ...
) {
local.optional.var <- list(...)
if (!is.null(`searchFields`)) {
stopifnot(is.vector(`searchFields`))
Expand Down Expand Up @@ -70,6 +74,7 @@ AdvancedSearch <- R6::R6Class(
if (!is.null(AdvancedSearchObject$`maxHits`)) {
self$`maxHits` <- AdvancedSearchObject$`maxHits`
}
self
},
toJSONString = function() {
jsoncontent <- c(
Expand All @@ -78,7 +83,7 @@ AdvancedSearch <- R6::R6Class(
'"searchFields":
[%s]
',
paste(sapply(self$`searchFields`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=TRUE, digits = NA)), collapse=",")
paste(sapply(self$`searchFields`, function(x) jsonlite::toJSON(x$toJSON(), auto_unbox=FALSE, digits = NA)), collapse=",")
)},
if (!is.null(self$`start`)) {
sprintf(
Expand Down Expand Up @@ -107,3 +112,4 @@ AdvancedSearch <- R6::R6Class(
}
)
)

6 changes: 4 additions & 2 deletions R/R/api_client.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ApiClient <- R6::R6Class(
# base path of all requests
basePath = "https://api.openlattice.com",
# user agent in the HTTP request
userAgent = "OpenAPI-Generator/0.1.1/r",
userAgent = "OpenAPI-Generator/0.1.2/r",
# default headers in the HTTP request
defaultHeaders = NULL,
# username (HTTP basic authentication)
Expand Down Expand Up @@ -164,7 +164,9 @@ ApiClient <- R6::R6Class(
else if (exists(returnType, pkgEnv) && !(c(returnType) %in% primitiveTypes)) {
returnType <- get(returnType, envir = as.environment(pkgEnv))
returnObj <- returnType$new()
returnObj$fromJSON(jsonlite::toJSON(obj, digits = NA))
returnObj$fromJSON(
jsonlite::toJSON(obj, digits = NA, auto_unbox = FALSE)
)
}

# To handle primitive type
Expand Down
Loading

0 comments on commit dac0cab

Please sign in to comment.