R/Dashboard.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


#' Dashboard Class
#'
#' @field can 
#' @field content_favorite_id 
#' @field content_metadata_id 
#' @field description 
#' @field hidden 
#' @field id 
#' @field model 
#' @field query_timezone 
#' @field readonly 
#' @field refresh_interval 
#' @field refresh_interval_to_i 
#' @field folder 
#' @field title 
#' @field user_id 
#' @field slug 
#' @field preferred_viewer 
#' @field alert_sync_with_dashboard_filter_enabled 
#' @field background_color 
#' @field created_at 
#' @field crossfilter_enabled 
#' @field dashboard_elements 
#' @field dashboard_filters 
#' @field dashboard_layouts 
#' @field deleted 
#' @field deleted_at 
#' @field deleter_id 
#' @field edit_uri 
#' @field favorite_count 
#' @field filters_bar_collapsed 
#' @field last_accessed_at 
#' @field last_viewed_at 
#' @field updated_at 
#' @field last_updater_id 
#' @field last_updater_name 
#' @field user_name 
#' @field load_configuration 
#' @field lookml_link_id 
#' @field show_filters_bar 
#' @field show_title 
#' @field folder_id 
#' @field text_tile_text_color 
#' @field tile_background_color 
#' @field tile_text_color 
#' @field title_color 
#' @field view_count 
#' @field appearance 
#' @field url 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite parse_json toJSON
#' @export
Dashboard <- R6::R6Class(
  'Dashboard',
  public = list(
    `can` = NULL,
    `content_favorite_id` = NULL,
    `content_metadata_id` = NULL,
    `description` = NULL,
    `hidden` = NULL,
    `id` = NULL,
    `model` = NULL,
    `query_timezone` = NULL,
    `readonly` = NULL,
    `refresh_interval` = NULL,
    `refresh_interval_to_i` = NULL,
    `folder` = NULL,
    `title` = NULL,
    `user_id` = NULL,
    `slug` = NULL,
    `preferred_viewer` = NULL,
    `alert_sync_with_dashboard_filter_enabled` = NULL,
    `background_color` = NULL,
    `created_at` = NULL,
    `crossfilter_enabled` = NULL,
    `dashboard_elements` = NULL,
    `dashboard_filters` = NULL,
    `dashboard_layouts` = NULL,
    `deleted` = NULL,
    `deleted_at` = NULL,
    `deleter_id` = NULL,
    `edit_uri` = NULL,
    `favorite_count` = NULL,
    `filters_bar_collapsed` = NULL,
    `last_accessed_at` = NULL,
    `last_viewed_at` = NULL,
    `updated_at` = NULL,
    `last_updater_id` = NULL,
    `last_updater_name` = NULL,
    `user_name` = NULL,
    `load_configuration` = NULL,
    `lookml_link_id` = NULL,
    `show_filters_bar` = NULL,
    `show_title` = NULL,
    `folder_id` = NULL,
    `text_tile_text_color` = NULL,
    `tile_background_color` = NULL,
    `tile_text_color` = NULL,
    `title_color` = NULL,
    `view_count` = NULL,
    `appearance` = NULL,
    `url` = NULL,
    initialize = function(`can`, `content_favorite_id`, `content_metadata_id`, `description`, `hidden`, `id`, `model`, `query_timezone`, `readonly`, `refresh_interval`, `refresh_interval_to_i`, `folder`, `title`, `user_id`, `slug`, `preferred_viewer`, `alert_sync_with_dashboard_filter_enabled`, `background_color`, `created_at`, `crossfilter_enabled`, `dashboard_elements`, `dashboard_filters`, `dashboard_layouts`, `deleted`, `deleted_at`, `deleter_id`, `edit_uri`, `favorite_count`, `filters_bar_collapsed`, `last_accessed_at`, `last_viewed_at`, `updated_at`, `last_updater_id`, `last_updater_name`, `user_name`, `load_configuration`, `lookml_link_id`, `show_filters_bar`, `show_title`, `folder_id`, `text_tile_text_color`, `tile_background_color`, `tile_text_color`, `title_color`, `view_count`, `appearance`, `url`){
      if (!missing(`can`)) {
        self$`can` <- `can`
      }
      if (!missing(`content_favorite_id`)) {
        stopifnot(is.numeric(`content_favorite_id`), length(`content_favorite_id`) == 1)
        self$`content_favorite_id` <- `content_favorite_id`
      }
      if (!missing(`content_metadata_id`)) {
        stopifnot(is.numeric(`content_metadata_id`), length(`content_metadata_id`) == 1)
        self$`content_metadata_id` <- `content_metadata_id`
      }
      if (!missing(`description`)) {
        stopifnot(is.character(`description`), length(`description`) == 1)
        self$`description` <- `description`
      }
      if (!missing(`hidden`)) {
        self$`hidden` <- `hidden`
      }
      if (!missing(`id`)) {
        stopifnot(is.character(`id`), length(`id`) == 1)
        self$`id` <- `id`
      }
      if (!missing(`model`)) {
        stopifnot(R6::is.R6(`model`))
        self$`model` <- `model`
      }
      if (!missing(`query_timezone`)) {
        stopifnot(is.character(`query_timezone`), length(`query_timezone`) == 1)
        self$`query_timezone` <- `query_timezone`
      }
      if (!missing(`readonly`)) {
        self$`readonly` <- `readonly`
      }
      if (!missing(`refresh_interval`)) {
        stopifnot(is.character(`refresh_interval`), length(`refresh_interval`) == 1)
        self$`refresh_interval` <- `refresh_interval`
      }
      if (!missing(`refresh_interval_to_i`)) {
        stopifnot(is.numeric(`refresh_interval_to_i`), length(`refresh_interval_to_i`) == 1)
        self$`refresh_interval_to_i` <- `refresh_interval_to_i`
      }
      if (!missing(`folder`)) {
        stopifnot(R6::is.R6(`folder`))
        self$`folder` <- `folder`
      }
      if (!missing(`title`)) {
        stopifnot(is.character(`title`), length(`title`) == 1)
        self$`title` <- `title`
      }
      if (!missing(`user_id`)) {
        stopifnot(is.numeric(`user_id`), length(`user_id`) == 1)
        self$`user_id` <- `user_id`
      }
      if (!missing(`slug`)) {
        stopifnot(is.character(`slug`), length(`slug`) == 1)
        self$`slug` <- `slug`
      }
      if (!missing(`preferred_viewer`)) {
        stopifnot(is.character(`preferred_viewer`), length(`preferred_viewer`) == 1)
        self$`preferred_viewer` <- `preferred_viewer`
      }
      if (!missing(`alert_sync_with_dashboard_filter_enabled`)) {
        self$`alert_sync_with_dashboard_filter_enabled` <- `alert_sync_with_dashboard_filter_enabled`
      }
      if (!missing(`background_color`)) {
        stopifnot(is.character(`background_color`), length(`background_color`) == 1)
        self$`background_color` <- `background_color`
      }
      if (!missing(`created_at`)) {
        stopifnot(is.character(`created_at`), length(`created_at`) == 1)
        self$`created_at` <- `created_at`
      }
      if (!missing(`crossfilter_enabled`)) {
        self$`crossfilter_enabled` <- `crossfilter_enabled`
      }
      if (!missing(`dashboard_elements`)) {
        stopifnot(is.list(`dashboard_elements`), length(`dashboard_elements`) != 0)
        lapply(`dashboard_elements`, function(x) stopifnot(R6::is.R6(x)))
        self$`dashboard_elements` <- `dashboard_elements`
      }
      if (!missing(`dashboard_filters`)) {
        stopifnot(is.list(`dashboard_filters`), length(`dashboard_filters`) != 0)
        lapply(`dashboard_filters`, function(x) stopifnot(R6::is.R6(x)))
        self$`dashboard_filters` <- `dashboard_filters`
      }
      if (!missing(`dashboard_layouts`)) {
        stopifnot(is.list(`dashboard_layouts`), length(`dashboard_layouts`) != 0)
        lapply(`dashboard_layouts`, function(x) stopifnot(R6::is.R6(x)))
        self$`dashboard_layouts` <- `dashboard_layouts`
      }
      if (!missing(`deleted`)) {
        self$`deleted` <- `deleted`
      }
      if (!missing(`deleted_at`)) {
        stopifnot(is.character(`deleted_at`), length(`deleted_at`) == 1)
        self$`deleted_at` <- `deleted_at`
      }
      if (!missing(`deleter_id`)) {
        stopifnot(is.numeric(`deleter_id`), length(`deleter_id`) == 1)
        self$`deleter_id` <- `deleter_id`
      }
      if (!missing(`edit_uri`)) {
        stopifnot(is.character(`edit_uri`), length(`edit_uri`) == 1)
        self$`edit_uri` <- `edit_uri`
      }
      if (!missing(`favorite_count`)) {
        stopifnot(is.numeric(`favorite_count`), length(`favorite_count`) == 1)
        self$`favorite_count` <- `favorite_count`
      }
      if (!missing(`filters_bar_collapsed`)) {
        self$`filters_bar_collapsed` <- `filters_bar_collapsed`
      }
      if (!missing(`last_accessed_at`)) {
        stopifnot(is.character(`last_accessed_at`), length(`last_accessed_at`) == 1)
        self$`last_accessed_at` <- `last_accessed_at`
      }
      if (!missing(`last_viewed_at`)) {
        stopifnot(is.character(`last_viewed_at`), length(`last_viewed_at`) == 1)
        self$`last_viewed_at` <- `last_viewed_at`
      }
      if (!missing(`updated_at`)) {
        stopifnot(is.character(`updated_at`), length(`updated_at`) == 1)
        self$`updated_at` <- `updated_at`
      }
      if (!missing(`last_updater_id`)) {
        stopifnot(is.numeric(`last_updater_id`), length(`last_updater_id`) == 1)
        self$`last_updater_id` <- `last_updater_id`
      }
      if (!missing(`last_updater_name`)) {
        stopifnot(is.character(`last_updater_name`), length(`last_updater_name`) == 1)
        self$`last_updater_name` <- `last_updater_name`
      }
      if (!missing(`user_name`)) {
        stopifnot(is.character(`user_name`), length(`user_name`) == 1)
        self$`user_name` <- `user_name`
      }
      if (!missing(`load_configuration`)) {
        stopifnot(is.character(`load_configuration`), length(`load_configuration`) == 1)
        self$`load_configuration` <- `load_configuration`
      }
      if (!missing(`lookml_link_id`)) {
        stopifnot(is.character(`lookml_link_id`), length(`lookml_link_id`) == 1)
        self$`lookml_link_id` <- `lookml_link_id`
      }
      if (!missing(`show_filters_bar`)) {
        self$`show_filters_bar` <- `show_filters_bar`
      }
      if (!missing(`show_title`)) {
        self$`show_title` <- `show_title`
      }
      if (!missing(`folder_id`)) {
        stopifnot(is.character(`folder_id`), length(`folder_id`) == 1)
        self$`folder_id` <- `folder_id`
      }
      if (!missing(`text_tile_text_color`)) {
        stopifnot(is.character(`text_tile_text_color`), length(`text_tile_text_color`) == 1)
        self$`text_tile_text_color` <- `text_tile_text_color`
      }
      if (!missing(`tile_background_color`)) {
        stopifnot(is.character(`tile_background_color`), length(`tile_background_color`) == 1)
        self$`tile_background_color` <- `tile_background_color`
      }
      if (!missing(`tile_text_color`)) {
        stopifnot(is.character(`tile_text_color`), length(`tile_text_color`) == 1)
        self$`tile_text_color` <- `tile_text_color`
      }
      if (!missing(`title_color`)) {
        stopifnot(is.character(`title_color`), length(`title_color`) == 1)
        self$`title_color` <- `title_color`
      }
      if (!missing(`view_count`)) {
        stopifnot(is.numeric(`view_count`), length(`view_count`) == 1)
        self$`view_count` <- `view_count`
      }
      if (!missing(`appearance`)) {
        stopifnot(R6::is.R6(`appearance`))
        self$`appearance` <- `appearance`
      }
      if (!missing(`url`)) {
        stopifnot(is.character(`url`), length(`url`) == 1)
        self$`url` <- `url`
      }
    },
    toJSON = function() {
      DashboardObject <- list()
      if (!is.null(self$`can`)) {
        DashboardObject[['can']] <- self$`can`
      }
      if (!is.null(self$`content_favorite_id`)) {
        DashboardObject[['content_favorite_id']] <- self$`content_favorite_id`
      }
      if (!is.null(self$`content_metadata_id`)) {
        DashboardObject[['content_metadata_id']] <- self$`content_metadata_id`
      }
      if (!is.null(self$`description`)) {
        DashboardObject[['description']] <- self$`description`
      }
      if (!is.null(self$`hidden`)) {
        DashboardObject[['hidden']] <- self$`hidden`
      }
      if (!is.null(self$`id`)) {
        DashboardObject[['id']] <- self$`id`
      }
      if (!is.null(self$`model`)) {
        DashboardObject[['model']] <- self$`model`$toJSON()
      }
      if (!is.null(self$`query_timezone`)) {
        DashboardObject[['query_timezone']] <- self$`query_timezone`
      }
      if (!is.null(self$`readonly`)) {
        DashboardObject[['readonly']] <- self$`readonly`
      }
      if (!is.null(self$`refresh_interval`)) {
        DashboardObject[['refresh_interval']] <- self$`refresh_interval`
      }
      if (!is.null(self$`refresh_interval_to_i`)) {
        DashboardObject[['refresh_interval_to_i']] <- self$`refresh_interval_to_i`
      }
      if (!is.null(self$`folder`)) {
        DashboardObject[['folder']] <- self$`folder`$toJSON()
      }
      if (!is.null(self$`title`)) {
        DashboardObject[['title']] <- self$`title`
      }
      if (!is.null(self$`user_id`)) {
        DashboardObject[['user_id']] <- self$`user_id`
      }
      if (!is.null(self$`slug`)) {
        DashboardObject[['slug']] <- self$`slug`
      }
      if (!is.null(self$`preferred_viewer`)) {
        DashboardObject[['preferred_viewer']] <- self$`preferred_viewer`
      }
      if (!is.null(self$`alert_sync_with_dashboard_filter_enabled`)) {
        DashboardObject[['alert_sync_with_dashboard_filter_enabled']] <- self$`alert_sync_with_dashboard_filter_enabled`
      }
      if (!is.null(self$`background_color`)) {
        DashboardObject[['background_color']] <- self$`background_color`
      }
      if (!is.null(self$`created_at`)) {
        DashboardObject[['created_at']] <- self$`created_at`
      }
      if (!is.null(self$`crossfilter_enabled`)) {
        DashboardObject[['crossfilter_enabled']] <- self$`crossfilter_enabled`
      }
      if (!is.null(self$`dashboard_elements`)) {
        DashboardObject[['dashboard_elements']] <- lapply(self$`dashboard_elements`, function(x) x$toJSON())
      }
      if (!is.null(self$`dashboard_filters`)) {
        DashboardObject[['dashboard_filters']] <- lapply(self$`dashboard_filters`, function(x) x$toJSON())
      }
      if (!is.null(self$`dashboard_layouts`)) {
        DashboardObject[['dashboard_layouts']] <- lapply(self$`dashboard_layouts`, function(x) x$toJSON())
      }
      if (!is.null(self$`deleted`)) {
        DashboardObject[['deleted']] <- self$`deleted`
      }
      if (!is.null(self$`deleted_at`)) {
        DashboardObject[['deleted_at']] <- self$`deleted_at`
      }
      if (!is.null(self$`deleter_id`)) {
        DashboardObject[['deleter_id']] <- self$`deleter_id`
      }
      if (!is.null(self$`edit_uri`)) {
        DashboardObject[['edit_uri']] <- self$`edit_uri`
      }
      if (!is.null(self$`favorite_count`)) {
        DashboardObject[['favorite_count']] <- self$`favorite_count`
      }
      if (!is.null(self$`filters_bar_collapsed`)) {
        DashboardObject[['filters_bar_collapsed']] <- self$`filters_bar_collapsed`
      }
      if (!is.null(self$`last_accessed_at`)) {
        DashboardObject[['last_accessed_at']] <- self$`last_accessed_at`
      }
      if (!is.null(self$`last_viewed_at`)) {
        DashboardObject[['last_viewed_at']] <- self$`last_viewed_at`
      }
      if (!is.null(self$`updated_at`)) {
        DashboardObject[['updated_at']] <- self$`updated_at`
      }
      if (!is.null(self$`last_updater_id`)) {
        DashboardObject[['last_updater_id']] <- self$`last_updater_id`
      }
      if (!is.null(self$`last_updater_name`)) {
        DashboardObject[['last_updater_name']] <- self$`last_updater_name`
      }
      if (!is.null(self$`user_name`)) {
        DashboardObject[['user_name']] <- self$`user_name`
      }
      if (!is.null(self$`load_configuration`)) {
        DashboardObject[['load_configuration']] <- self$`load_configuration`
      }
      if (!is.null(self$`lookml_link_id`)) {
        DashboardObject[['lookml_link_id']] <- self$`lookml_link_id`
      }
      if (!is.null(self$`show_filters_bar`)) {
        DashboardObject[['show_filters_bar']] <- self$`show_filters_bar`
      }
      if (!is.null(self$`show_title`)) {
        DashboardObject[['show_title']] <- self$`show_title`
      }
      if (!is.null(self$`folder_id`)) {
        DashboardObject[['folder_id']] <- self$`folder_id`
      }
      if (!is.null(self$`text_tile_text_color`)) {
        DashboardObject[['text_tile_text_color']] <- self$`text_tile_text_color`
      }
      if (!is.null(self$`tile_background_color`)) {
        DashboardObject[['tile_background_color']] <- self$`tile_background_color`
      }
      if (!is.null(self$`tile_text_color`)) {
        DashboardObject[['tile_text_color']] <- self$`tile_text_color`
      }
      if (!is.null(self$`title_color`)) {
        DashboardObject[['title_color']] <- self$`title_color`
      }
      if (!is.null(self$`view_count`)) {
        DashboardObject[['view_count']] <- self$`view_count`
      }
      if (!is.null(self$`appearance`)) {
        DashboardObject[['appearance']] <- self$`appearance`$toJSON()
      }
      if (!is.null(self$`url`)) {
        DashboardObject[['url']] <- self$`url`
      }

      DashboardObject
    },
    fromJSONObject = function(DashboardJsonObject) {
      DashboardObject <- DashboardJsonObject #jsonlite::fromJSON(DashboardJson, simplifyVector = FALSE)
      if (!is.null(DashboardObject$`can`)) {
        self$`can` <- DashboardObject$`can`
      }
      if (!is.null(DashboardObject$`content_favorite_id`)) {
        self$`content_favorite_id` <- DashboardObject$`content_favorite_id`
      }
      if (!is.null(DashboardObject$`content_metadata_id`)) {
        self$`content_metadata_id` <- DashboardObject$`content_metadata_id`
      }
      if (!is.null(DashboardObject$`description`)) {
        self$`description` <- DashboardObject$`description`
      }
      if (!is.null(DashboardObject$`hidden`)) {
        self$`hidden` <- DashboardObject$`hidden`
      }
      if (!is.null(DashboardObject$`id`)) {
        self$`id` <- DashboardObject$`id`
      }
      if (!is.null(DashboardObject$`model`)) {
        modelObject <- LookModel$new()
        modelObject$fromJSON(jsonlite::toJSON(DashboardObject$model, auto_unbox = TRUE))
        self$`model` <- modelObject
      }
      if (!is.null(DashboardObject$`query_timezone`)) {
        self$`query_timezone` <- DashboardObject$`query_timezone`
      }
      if (!is.null(DashboardObject$`readonly`)) {
        self$`readonly` <- DashboardObject$`readonly`
      }
      if (!is.null(DashboardObject$`refresh_interval`)) {
        self$`refresh_interval` <- DashboardObject$`refresh_interval`
      }
      if (!is.null(DashboardObject$`refresh_interval_to_i`)) {
        self$`refresh_interval_to_i` <- DashboardObject$`refresh_interval_to_i`
      }
      if (!is.null(DashboardObject$`folder`)) {
        folderObject <- FolderBase$new()
        folderObject$fromJSON(jsonlite::toJSON(DashboardObject$folder, auto_unbox = TRUE))
        self$`folder` <- folderObject
      }
      if (!is.null(DashboardObject$`title`)) {
        self$`title` <- DashboardObject$`title`
      }
      if (!is.null(DashboardObject$`user_id`)) {
        self$`user_id` <- DashboardObject$`user_id`
      }
      if (!is.null(DashboardObject$`slug`)) {
        self$`slug` <- DashboardObject$`slug`
      }
      if (!is.null(DashboardObject$`preferred_viewer`)) {
        self$`preferred_viewer` <- DashboardObject$`preferred_viewer`
      }
      if (!is.null(DashboardObject$`alert_sync_with_dashboard_filter_enabled`)) {
        self$`alert_sync_with_dashboard_filter_enabled` <- DashboardObject$`alert_sync_with_dashboard_filter_enabled`
      }
      if (!is.null(DashboardObject$`background_color`)) {
        self$`background_color` <- DashboardObject$`background_color`
      }
      if (!is.null(DashboardObject$`created_at`)) {
        self$`created_at` <- DashboardObject$`created_at`
      }
      if (!is.null(DashboardObject$`crossfilter_enabled`)) {
        self$`crossfilter_enabled` <- DashboardObject$`crossfilter_enabled`
      }
      if (!is.null(DashboardObject$`dashboard_elements`)) {
        self$`dashboard_elements` <- lapply(DashboardObject$`dashboard_elements`, function(x) {
          dashboard_elementsObject <- DashboardElement$new()
          dashboard_elementsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
          dashboard_elementsObject
        })
      }
      if (!is.null(DashboardObject$`dashboard_filters`)) {
        self$`dashboard_filters` <- lapply(DashboardObject$`dashboard_filters`, function(x) {
          dashboard_filtersObject <- DashboardFilter$new()
          dashboard_filtersObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
          dashboard_filtersObject
        })
      }
      if (!is.null(DashboardObject$`dashboard_layouts`)) {
        self$`dashboard_layouts` <- lapply(DashboardObject$`dashboard_layouts`, function(x) {
          dashboard_layoutsObject <- DashboardLayout$new()
          dashboard_layoutsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
          dashboard_layoutsObject
        })
      }
      if (!is.null(DashboardObject$`deleted`)) {
        self$`deleted` <- DashboardObject$`deleted`
      }
      if (!is.null(DashboardObject$`deleted_at`)) {
        self$`deleted_at` <- DashboardObject$`deleted_at`
      }
      if (!is.null(DashboardObject$`deleter_id`)) {
        self$`deleter_id` <- DashboardObject$`deleter_id`
      }
      if (!is.null(DashboardObject$`edit_uri`)) {
        self$`edit_uri` <- DashboardObject$`edit_uri`
      }
      if (!is.null(DashboardObject$`favorite_count`)) {
        self$`favorite_count` <- DashboardObject$`favorite_count`
      }
      if (!is.null(DashboardObject$`filters_bar_collapsed`)) {
        self$`filters_bar_collapsed` <- DashboardObject$`filters_bar_collapsed`
      }
      if (!is.null(DashboardObject$`last_accessed_at`)) {
        self$`last_accessed_at` <- DashboardObject$`last_accessed_at`
      }
      if (!is.null(DashboardObject$`last_viewed_at`)) {
        self$`last_viewed_at` <- DashboardObject$`last_viewed_at`
      }
      if (!is.null(DashboardObject$`updated_at`)) {
        self$`updated_at` <- DashboardObject$`updated_at`
      }
      if (!is.null(DashboardObject$`last_updater_id`)) {
        self$`last_updater_id` <- DashboardObject$`last_updater_id`
      }
      if (!is.null(DashboardObject$`last_updater_name`)) {
        self$`last_updater_name` <- DashboardObject$`last_updater_name`
      }
      if (!is.null(DashboardObject$`user_name`)) {
        self$`user_name` <- DashboardObject$`user_name`
      }
      if (!is.null(DashboardObject$`load_configuration`)) {
        self$`load_configuration` <- DashboardObject$`load_configuration`
      }
      if (!is.null(DashboardObject$`lookml_link_id`)) {
        self$`lookml_link_id` <- DashboardObject$`lookml_link_id`
      }
      if (!is.null(DashboardObject$`show_filters_bar`)) {
        self$`show_filters_bar` <- DashboardObject$`show_filters_bar`
      }
      if (!is.null(DashboardObject$`show_title`)) {
        self$`show_title` <- DashboardObject$`show_title`
      }
      if (!is.null(DashboardObject$`folder_id`)) {
        self$`folder_id` <- DashboardObject$`folder_id`
      }
      if (!is.null(DashboardObject$`text_tile_text_color`)) {
        self$`text_tile_text_color` <- DashboardObject$`text_tile_text_color`
      }
      if (!is.null(DashboardObject$`tile_background_color`)) {
        self$`tile_background_color` <- DashboardObject$`tile_background_color`
      }
      if (!is.null(DashboardObject$`tile_text_color`)) {
        self$`tile_text_color` <- DashboardObject$`tile_text_color`
      }
      if (!is.null(DashboardObject$`title_color`)) {
        self$`title_color` <- DashboardObject$`title_color`
      }
      if (!is.null(DashboardObject$`view_count`)) {
        self$`view_count` <- DashboardObject$`view_count`
      }
      if (!is.null(DashboardObject$`appearance`)) {
        appearanceObject <- DashboardAppearance$new()
        appearanceObject$fromJSON(jsonlite::toJSON(DashboardObject$appearance, auto_unbox = TRUE))
        self$`appearance` <- appearanceObject
      }
      if (!is.null(DashboardObject$`url`)) {
        self$`url` <- DashboardObject$`url`
      }
    },
    fromJSON = function(DashboardJson) {
      DashboardObject <- jsonlite::fromJSON(DashboardJson, simplifyVector = FALSE)
      self$fromJSONObject(DashboardObject)
    },
    toJSONString = function() {
       sprintf(
        '{
           "can": %s,
           "content_favorite_id": %d,
           "content_metadata_id": %d,
           "description": %s,
           "hidden": %s,
           "id": %s,
           "model": %s,
           "query_timezone": %s,
           "readonly": %s,
           "refresh_interval": %s,
           "refresh_interval_to_i": %d,
           "folder": %s,
           "title": %s,
           "user_id": %d,
           "slug": %s,
           "preferred_viewer": %s,
           "alert_sync_with_dashboard_filter_enabled": %s,
           "background_color": %s,
           "created_at": %s,
           "crossfilter_enabled": %s,
           "dashboard_elements": [%s],
           "dashboard_filters": [%s],
           "dashboard_layouts": [%s],
           "deleted": %s,
           "deleted_at": %s,
           "deleter_id": %d,
           "edit_uri": %s,
           "favorite_count": %d,
           "filters_bar_collapsed": %s,
           "last_accessed_at": %s,
           "last_viewed_at": %s,
           "updated_at": %s,
           "last_updater_id": %d,
           "last_updater_name": %s,
           "user_name": %s,
           "load_configuration": %s,
           "lookml_link_id": %s,
           "show_filters_bar": %s,
           "show_title": %s,
           "folder_id": %s,
           "text_tile_text_color": %s,
           "tile_background_color": %s,
           "tile_text_color": %s,
           "title_color": %s,
           "view_count": %d,
           "appearance": %s,
           "url": %s
        }',
        self$`can`,
        self$`content_favorite_id`,
        self$`content_metadata_id`,
        self$`description`,
        self$`hidden`,
        self$`id`,
        self$`model`$toJSON(),
        self$`query_timezone`,
        self$`readonly`,
        self$`refresh_interval`,
        self$`refresh_interval_to_i`,
        self$`folder`$toJSON(),
        self$`title`,
        self$`user_id`,
        self$`slug`,
        self$`preferred_viewer`,
        self$`alert_sync_with_dashboard_filter_enabled`,
        self$`background_color`,
        self$`created_at`,
        self$`crossfilter_enabled`,
        lapply(self$`dashboard_elements`, function(x) paste(x$toJSON(), sep=",")),
        lapply(self$`dashboard_filters`, function(x) paste(x$toJSON(), sep=",")),
        lapply(self$`dashboard_layouts`, function(x) paste(x$toJSON(), sep=",")),
        self$`deleted`,
        self$`deleted_at`,
        self$`deleter_id`,
        self$`edit_uri`,
        self$`favorite_count`,
        self$`filters_bar_collapsed`,
        self$`last_accessed_at`,
        self$`last_viewed_at`,
        self$`updated_at`,
        self$`last_updater_id`,
        self$`last_updater_name`,
        self$`user_name`,
        self$`load_configuration`,
        self$`lookml_link_id`,
        self$`show_filters_bar`,
        self$`show_title`,
        self$`folder_id`,
        self$`text_tile_text_color`,
        self$`tile_background_color`,
        self$`tile_text_color`,
        self$`title_color`,
        self$`view_count`,
        self$`appearance`$toJSON(),
        self$`url`
      )
    },
    fromJSONString = function(DashboardJson) {
      DashboardObject <- jsonlite::fromJSON(DashboardJson, simplifyVector = FALSE)
      self$`can` <- DashboardObject$`can`
      self$`content_favorite_id` <- DashboardObject$`content_favorite_id`
      self$`content_metadata_id` <- DashboardObject$`content_metadata_id`
      self$`description` <- DashboardObject$`description`
      self$`hidden` <- DashboardObject$`hidden`
      self$`id` <- DashboardObject$`id`
      LookModelObject <- LookModel$new()
      self$`model` <- LookModelObject$fromJSON(jsonlite::toJSON(DashboardObject$model, auto_unbox = TRUE))
      self$`query_timezone` <- DashboardObject$`query_timezone`
      self$`readonly` <- DashboardObject$`readonly`
      self$`refresh_interval` <- DashboardObject$`refresh_interval`
      self$`refresh_interval_to_i` <- DashboardObject$`refresh_interval_to_i`
      FolderBaseObject <- FolderBase$new()
      self$`folder` <- FolderBaseObject$fromJSON(jsonlite::toJSON(DashboardObject$folder, auto_unbox = TRUE))
      self$`title` <- DashboardObject$`title`
      self$`user_id` <- DashboardObject$`user_id`
      self$`slug` <- DashboardObject$`slug`
      self$`preferred_viewer` <- DashboardObject$`preferred_viewer`
      self$`alert_sync_with_dashboard_filter_enabled` <- DashboardObject$`alert_sync_with_dashboard_filter_enabled`
      self$`background_color` <- DashboardObject$`background_color`
      self$`created_at` <- DashboardObject$`created_at`
      self$`crossfilter_enabled` <- DashboardObject$`crossfilter_enabled`
      self$`dashboard_elements` <- lapply(DashboardObject$`dashboard_elements`, function(x) DashboardElement$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`dashboard_filters` <- lapply(DashboardObject$`dashboard_filters`, function(x) DashboardFilter$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`dashboard_layouts` <- lapply(DashboardObject$`dashboard_layouts`, function(x) DashboardLayout$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`deleted` <- DashboardObject$`deleted`
      self$`deleted_at` <- DashboardObject$`deleted_at`
      self$`deleter_id` <- DashboardObject$`deleter_id`
      self$`edit_uri` <- DashboardObject$`edit_uri`
      self$`favorite_count` <- DashboardObject$`favorite_count`
      self$`filters_bar_collapsed` <- DashboardObject$`filters_bar_collapsed`
      self$`last_accessed_at` <- DashboardObject$`last_accessed_at`
      self$`last_viewed_at` <- DashboardObject$`last_viewed_at`
      self$`updated_at` <- DashboardObject$`updated_at`
      self$`last_updater_id` <- DashboardObject$`last_updater_id`
      self$`last_updater_name` <- DashboardObject$`last_updater_name`
      self$`user_name` <- DashboardObject$`user_name`
      self$`load_configuration` <- DashboardObject$`load_configuration`
      self$`lookml_link_id` <- DashboardObject$`lookml_link_id`
      self$`show_filters_bar` <- DashboardObject$`show_filters_bar`
      self$`show_title` <- DashboardObject$`show_title`
      self$`folder_id` <- DashboardObject$`folder_id`
      self$`text_tile_text_color` <- DashboardObject$`text_tile_text_color`
      self$`tile_background_color` <- DashboardObject$`tile_background_color`
      self$`tile_text_color` <- DashboardObject$`tile_text_color`
      self$`title_color` <- DashboardObject$`title_color`
      self$`view_count` <- DashboardObject$`view_count`
      DashboardAppearanceObject <- DashboardAppearance$new()
      self$`appearance` <- DashboardAppearanceObject$fromJSON(jsonlite::toJSON(DashboardObject$appearance, auto_unbox = TRUE))
      self$`url` <- DashboardObject$`url`
    }
  )
)
looker/lookr documentation built on Jan. 15, 2024, 2:49 a.m.