R/PermissionSet.r

# Looker API 4.0 (Beta) Reference
#
#  Welcome to the future! API 4.0 co-exists with APIs 3.1 and 3.0. (3.0 should no longer be used.) The \"beta\" tag means updates for API 4.0 may include breaking changes, but as always we will work to minimize them.  ### Authorization  The classic method of API authorization uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page.  API 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests.  For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization).   ### API Explorer  The API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs. It is a replacement for the 'api-docs' page currently provided on Looker instances.  For details, see the [API Explorer documentation](https://looker.com/docs/r/api/explorer).   ### Looker Language SDKs  The Looker API is a RESTful system that should be usable by any programming language capable of making HTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker has an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several language SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically authenticate API requests when needed.  For details on available Looker SDKs, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks).   ### API Versioning  Future releases of Looker expand the latest API version release-by-release to securely expose more and more of the core power of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without warning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking changes in future releases.  For details, see [Looker API Versioning](https://looker.com/docs/r/api/versioning).   ### In This Release  API 4.0 version was introduced so we can make adjustments to API functions, parameters, and response types to fix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can make to our stable API 3.1.  One benefit of these type adjustments in API 4.0 is dramatically better support for strongly typed languages like TypeScript, Kotlin, Swift, Go, C#, and more.  While API 3.1 is still the de-facto Looker API (\"current\", \"stable\", \"default\", etc), the bulk of our development activity has shifted to API 4.0, where all new features are added.  The API Explorer can be used to [interactively compare](https://looker.com/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0.   ### API and SDK Support Policies  Looker API versions and language SDKs have varying support levels. Please read the API and SDK [support policies](https://looker.com/docs/r/api/support-policy) for more information.   
#
# OpenAPI spec version: 4.0.21.18
# 
# Generated by: https://github.com/swagger-api/swagger-codegen.git


#' PermissionSet Class
#'
#' @field can 
#' @field all_access 
#' @field built_in 
#' @field id 
#' @field name 
#' @field permissions 
#' @field url 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite parse_json toJSON
#' @export
PermissionSet <- R6::R6Class(
  'PermissionSet',
  public = list(
    `can` = NULL,
    `all_access` = NULL,
    `built_in` = NULL,
    `id` = NULL,
    `name` = NULL,
    `permissions` = NULL,
    `url` = NULL,
    initialize = function(`can`, `all_access`, `built_in`, `id`, `name`, `permissions`, `url`){
      if (!missing(`can`)) {
        self$`can` <- `can`
      }
      if (!missing(`all_access`)) {
        self$`all_access` <- `all_access`
      }
      if (!missing(`built_in`)) {
        self$`built_in` <- `built_in`
      }
      if (!missing(`id`)) {
        stopifnot(is.numeric(`id`), length(`id`) == 1)
        self$`id` <- `id`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`permissions`)) {
        stopifnot(is.list(`permissions`), length(`permissions`) != 0)
        lapply(`permissions`, function(x) stopifnot(is.character(x)))
        self$`permissions` <- `permissions`
      }
      if (!missing(`url`)) {
        stopifnot(is.character(`url`), length(`url`) == 1)
        self$`url` <- `url`
      }
    },
    toJSON = function() {
      PermissionSetObject <- list()
      if (!is.null(self$`can`)) {
        PermissionSetObject[['can']] <- self$`can`
      }
      if (!is.null(self$`all_access`)) {
        PermissionSetObject[['all_access']] <- self$`all_access`
      }
      if (!is.null(self$`built_in`)) {
        PermissionSetObject[['built_in']] <- self$`built_in`
      }
      if (!is.null(self$`id`)) {
        PermissionSetObject[['id']] <- self$`id`
      }
      if (!is.null(self$`name`)) {
        PermissionSetObject[['name']] <- self$`name`
      }
      if (!is.null(self$`permissions`)) {
        PermissionSetObject[['permissions']] <- self$`permissions`
      }
      if (!is.null(self$`url`)) {
        PermissionSetObject[['url']] <- self$`url`
      }

      PermissionSetObject
    },
    fromJSONObject = function(PermissionSetJsonObject) {
      PermissionSetObject <- PermissionSetJsonObject #jsonlite::fromJSON(PermissionSetJson, simplifyVector = FALSE)
      if (!is.null(PermissionSetObject$`can`)) {
        self$`can` <- PermissionSetObject$`can`
      }
      if (!is.null(PermissionSetObject$`all_access`)) {
        self$`all_access` <- PermissionSetObject$`all_access`
      }
      if (!is.null(PermissionSetObject$`built_in`)) {
        self$`built_in` <- PermissionSetObject$`built_in`
      }
      if (!is.null(PermissionSetObject$`id`)) {
        self$`id` <- PermissionSetObject$`id`
      }
      if (!is.null(PermissionSetObject$`name`)) {
        self$`name` <- PermissionSetObject$`name`
      }
      if (!is.null(PermissionSetObject$`permissions`)) {
        self$`permissions` <- PermissionSetObject$`permissions`
      }
      if (!is.null(PermissionSetObject$`url`)) {
        self$`url` <- PermissionSetObject$`url`
      }
    },
    fromJSON = function(PermissionSetJson) {
      PermissionSetObject <- jsonlite::fromJSON(PermissionSetJson, simplifyVector = FALSE)
      self$fromJSONObject(PermissionSetObject)
    },
    toJSONString = function() {
       sprintf(
        '{
           "can": %s,
           "all_access": %s,
           "built_in": %s,
           "id": %d,
           "name": %s,
           "permissions": [%s],
           "url": %s
        }',
        self$`can`,
        self$`all_access`,
        self$`built_in`,
        self$`id`,
        self$`name`,
        lapply(self$`permissions`, function(x) paste(paste0('"', x, '"'), sep=",")),
        self$`url`
      )
    },
    fromJSONString = function(PermissionSetJson) {
      PermissionSetObject <- jsonlite::fromJSON(PermissionSetJson, simplifyVector = FALSE)
      self$`can` <- PermissionSetObject$`can`
      self$`all_access` <- PermissionSetObject$`all_access`
      self$`built_in` <- PermissionSetObject$`built_in`
      self$`id` <- PermissionSetObject$`id`
      self$`name` <- PermissionSetObject$`name`
      self$`permissions` <- PermissionSetObject$`permissions`
      self$`url` <- PermissionSetObject$`url`
    }
  )
)
looker/lookr documentation built on Jan. 15, 2024, 2:49 a.m.