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


#' LookmlModelExploreField Class
#'
#' @field align 
#' @field can_filter 
#' @field category 
#' @field default_filter_value 
#' @field description 
#' @field dimension_group 
#' @field enumerations 
#' @field error 
#' @field field_group_label 
#' @field field_group_variant 
#' @field fill_style 
#' @field fiscal_month_offset 
#' @field has_allowed_values 
#' @field hidden 
#' @field is_filter 
#' @field is_fiscal 
#' @field is_numeric 
#' @field is_timeframe 
#' @field can_time_filter 
#' @field time_interval 
#' @field label 
#' @field label_from_parameter 
#' @field label_short 
#' @field lookml_link 
#' @field map_layer 
#' @field measure 
#' @field name 
#' @field strict_value_format 
#' @field parameter 
#' @field permanent 
#' @field primary_key 
#' @field project_name 
#' @field requires_refresh_on_sort 
#' @field scope 
#' @field sortable 
#' @field source_file 
#' @field source_file_path 
#' @field sql 
#' @field sql_case 
#' @field filters 
#' @field suggest_dimension 
#' @field suggest_explore 
#' @field suggestable 
#' @field suggestions 
#' @field tags 
#' @field type 
#' @field user_attribute_filter_types 
#' @field value_format 
#' @field view 
#' @field view_label 
#' @field dynamic 
#' @field week_start_day 
#' @field times_used 
#' @field original_view 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite parse_json toJSON
#' @export
LookmlModelExploreField <- R6::R6Class(
  'LookmlModelExploreField',
  public = list(
    `align` = NULL,
    `can_filter` = NULL,
    `category` = NULL,
    `default_filter_value` = NULL,
    `description` = NULL,
    `dimension_group` = NULL,
    `enumerations` = NULL,
    `error` = NULL,
    `field_group_label` = NULL,
    `field_group_variant` = NULL,
    `fill_style` = NULL,
    `fiscal_month_offset` = NULL,
    `has_allowed_values` = NULL,
    `hidden` = NULL,
    `is_filter` = NULL,
    `is_fiscal` = NULL,
    `is_numeric` = NULL,
    `is_timeframe` = NULL,
    `can_time_filter` = NULL,
    `time_interval` = NULL,
    `label` = NULL,
    `label_from_parameter` = NULL,
    `label_short` = NULL,
    `lookml_link` = NULL,
    `map_layer` = NULL,
    `measure` = NULL,
    `name` = NULL,
    `strict_value_format` = NULL,
    `parameter` = NULL,
    `permanent` = NULL,
    `primary_key` = NULL,
    `project_name` = NULL,
    `requires_refresh_on_sort` = NULL,
    `scope` = NULL,
    `sortable` = NULL,
    `source_file` = NULL,
    `source_file_path` = NULL,
    `sql` = NULL,
    `sql_case` = NULL,
    `filters` = NULL,
    `suggest_dimension` = NULL,
    `suggest_explore` = NULL,
    `suggestable` = NULL,
    `suggestions` = NULL,
    `tags` = NULL,
    `type` = NULL,
    `user_attribute_filter_types` = NULL,
    `value_format` = NULL,
    `view` = NULL,
    `view_label` = NULL,
    `dynamic` = NULL,
    `week_start_day` = NULL,
    `times_used` = NULL,
    `original_view` = NULL,
    initialize = function(`align`, `can_filter`, `category`, `default_filter_value`, `description`, `dimension_group`, `enumerations`, `error`, `field_group_label`, `field_group_variant`, `fill_style`, `fiscal_month_offset`, `has_allowed_values`, `hidden`, `is_filter`, `is_fiscal`, `is_numeric`, `is_timeframe`, `can_time_filter`, `time_interval`, `label`, `label_from_parameter`, `label_short`, `lookml_link`, `map_layer`, `measure`, `name`, `strict_value_format`, `parameter`, `permanent`, `primary_key`, `project_name`, `requires_refresh_on_sort`, `scope`, `sortable`, `source_file`, `source_file_path`, `sql`, `sql_case`, `filters`, `suggest_dimension`, `suggest_explore`, `suggestable`, `suggestions`, `tags`, `type`, `user_attribute_filter_types`, `value_format`, `view`, `view_label`, `dynamic`, `week_start_day`, `times_used`, `original_view`){
      if (!missing(`align`)) {
        stopifnot(is.character(`align`), length(`align`) == 1)
        self$`align` <- `align`
      }
      if (!missing(`can_filter`)) {
        self$`can_filter` <- `can_filter`
      }
      if (!missing(`category`)) {
        stopifnot(is.character(`category`), length(`category`) == 1)
        self$`category` <- `category`
      }
      if (!missing(`default_filter_value`)) {
        stopifnot(is.character(`default_filter_value`), length(`default_filter_value`) == 1)
        self$`default_filter_value` <- `default_filter_value`
      }
      if (!missing(`description`)) {
        stopifnot(is.character(`description`), length(`description`) == 1)
        self$`description` <- `description`
      }
      if (!missing(`dimension_group`)) {
        stopifnot(is.character(`dimension_group`), length(`dimension_group`) == 1)
        self$`dimension_group` <- `dimension_group`
      }
      if (!missing(`enumerations`)) {
        stopifnot(is.list(`enumerations`), length(`enumerations`) != 0)
        lapply(`enumerations`, function(x) stopifnot(R6::is.R6(x)))
        self$`enumerations` <- `enumerations`
      }
      if (!missing(`error`)) {
        stopifnot(is.character(`error`), length(`error`) == 1)
        self$`error` <- `error`
      }
      if (!missing(`field_group_label`)) {
        stopifnot(is.character(`field_group_label`), length(`field_group_label`) == 1)
        self$`field_group_label` <- `field_group_label`
      }
      if (!missing(`field_group_variant`)) {
        stopifnot(is.character(`field_group_variant`), length(`field_group_variant`) == 1)
        self$`field_group_variant` <- `field_group_variant`
      }
      if (!missing(`fill_style`)) {
        stopifnot(is.character(`fill_style`), length(`fill_style`) == 1)
        self$`fill_style` <- `fill_style`
      }
      if (!missing(`fiscal_month_offset`)) {
        stopifnot(is.numeric(`fiscal_month_offset`), length(`fiscal_month_offset`) == 1)
        self$`fiscal_month_offset` <- `fiscal_month_offset`
      }
      if (!missing(`has_allowed_values`)) {
        self$`has_allowed_values` <- `has_allowed_values`
      }
      if (!missing(`hidden`)) {
        self$`hidden` <- `hidden`
      }
      if (!missing(`is_filter`)) {
        self$`is_filter` <- `is_filter`
      }
      if (!missing(`is_fiscal`)) {
        self$`is_fiscal` <- `is_fiscal`
      }
      if (!missing(`is_numeric`)) {
        self$`is_numeric` <- `is_numeric`
      }
      if (!missing(`is_timeframe`)) {
        self$`is_timeframe` <- `is_timeframe`
      }
      if (!missing(`can_time_filter`)) {
        self$`can_time_filter` <- `can_time_filter`
      }
      if (!missing(`time_interval`)) {
        stopifnot(R6::is.R6(`time_interval`))
        self$`time_interval` <- `time_interval`
      }
      if (!missing(`label`)) {
        stopifnot(is.character(`label`), length(`label`) == 1)
        self$`label` <- `label`
      }
      if (!missing(`label_from_parameter`)) {
        stopifnot(is.character(`label_from_parameter`), length(`label_from_parameter`) == 1)
        self$`label_from_parameter` <- `label_from_parameter`
      }
      if (!missing(`label_short`)) {
        stopifnot(is.character(`label_short`), length(`label_short`) == 1)
        self$`label_short` <- `label_short`
      }
      if (!missing(`lookml_link`)) {
        stopifnot(is.character(`lookml_link`), length(`lookml_link`) == 1)
        self$`lookml_link` <- `lookml_link`
      }
      if (!missing(`map_layer`)) {
        stopifnot(R6::is.R6(`map_layer`))
        self$`map_layer` <- `map_layer`
      }
      if (!missing(`measure`)) {
        self$`measure` <- `measure`
      }
      if (!missing(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!missing(`strict_value_format`)) {
        self$`strict_value_format` <- `strict_value_format`
      }
      if (!missing(`parameter`)) {
        self$`parameter` <- `parameter`
      }
      if (!missing(`permanent`)) {
        self$`permanent` <- `permanent`
      }
      if (!missing(`primary_key`)) {
        self$`primary_key` <- `primary_key`
      }
      if (!missing(`project_name`)) {
        stopifnot(is.character(`project_name`), length(`project_name`) == 1)
        self$`project_name` <- `project_name`
      }
      if (!missing(`requires_refresh_on_sort`)) {
        self$`requires_refresh_on_sort` <- `requires_refresh_on_sort`
      }
      if (!missing(`scope`)) {
        stopifnot(is.character(`scope`), length(`scope`) == 1)
        self$`scope` <- `scope`
      }
      if (!missing(`sortable`)) {
        self$`sortable` <- `sortable`
      }
      if (!missing(`source_file`)) {
        stopifnot(is.character(`source_file`), length(`source_file`) == 1)
        self$`source_file` <- `source_file`
      }
      if (!missing(`source_file_path`)) {
        stopifnot(is.character(`source_file_path`), length(`source_file_path`) == 1)
        self$`source_file_path` <- `source_file_path`
      }
      if (!missing(`sql`)) {
        stopifnot(is.character(`sql`), length(`sql`) == 1)
        self$`sql` <- `sql`
      }
      if (!missing(`sql_case`)) {
        stopifnot(is.list(`sql_case`), length(`sql_case`) != 0)
        lapply(`sql_case`, function(x) stopifnot(R6::is.R6(x)))
        self$`sql_case` <- `sql_case`
      }
      if (!missing(`filters`)) {
        stopifnot(is.list(`filters`), length(`filters`) != 0)
        lapply(`filters`, function(x) stopifnot(R6::is.R6(x)))
        self$`filters` <- `filters`
      }
      if (!missing(`suggest_dimension`)) {
        stopifnot(is.character(`suggest_dimension`), length(`suggest_dimension`) == 1)
        self$`suggest_dimension` <- `suggest_dimension`
      }
      if (!missing(`suggest_explore`)) {
        stopifnot(is.character(`suggest_explore`), length(`suggest_explore`) == 1)
        self$`suggest_explore` <- `suggest_explore`
      }
      if (!missing(`suggestable`)) {
        self$`suggestable` <- `suggestable`
      }
      if (!missing(`suggestions`)) {
        stopifnot(is.list(`suggestions`), length(`suggestions`) != 0)
        lapply(`suggestions`, function(x) stopifnot(is.character(x)))
        self$`suggestions` <- `suggestions`
      }
      if (!missing(`tags`)) {
        stopifnot(is.list(`tags`), length(`tags`) != 0)
        lapply(`tags`, function(x) stopifnot(is.character(x)))
        self$`tags` <- `tags`
      }
      if (!missing(`type`)) {
        stopifnot(is.character(`type`), length(`type`) == 1)
        self$`type` <- `type`
      }
      if (!missing(`user_attribute_filter_types`)) {
        stopifnot(is.list(`user_attribute_filter_types`), length(`user_attribute_filter_types`) != 0)
        lapply(`user_attribute_filter_types`, function(x) stopifnot(is.character(x)))
        self$`user_attribute_filter_types` <- `user_attribute_filter_types`
      }
      if (!missing(`value_format`)) {
        stopifnot(is.character(`value_format`), length(`value_format`) == 1)
        self$`value_format` <- `value_format`
      }
      if (!missing(`view`)) {
        stopifnot(is.character(`view`), length(`view`) == 1)
        self$`view` <- `view`
      }
      if (!missing(`view_label`)) {
        stopifnot(is.character(`view_label`), length(`view_label`) == 1)
        self$`view_label` <- `view_label`
      }
      if (!missing(`dynamic`)) {
        self$`dynamic` <- `dynamic`
      }
      if (!missing(`week_start_day`)) {
        stopifnot(is.character(`week_start_day`), length(`week_start_day`) == 1)
        self$`week_start_day` <- `week_start_day`
      }
      if (!missing(`times_used`)) {
        stopifnot(is.numeric(`times_used`), length(`times_used`) == 1)
        self$`times_used` <- `times_used`
      }
      if (!missing(`original_view`)) {
        stopifnot(is.character(`original_view`), length(`original_view`) == 1)
        self$`original_view` <- `original_view`
      }
    },
    toJSON = function() {
      LookmlModelExploreFieldObject <- list()
      if (!is.null(self$`align`)) {
        LookmlModelExploreFieldObject[['align']] <- self$`align`
      }
      if (!is.null(self$`can_filter`)) {
        LookmlModelExploreFieldObject[['can_filter']] <- self$`can_filter`
      }
      if (!is.null(self$`category`)) {
        LookmlModelExploreFieldObject[['category']] <- self$`category`
      }
      if (!is.null(self$`default_filter_value`)) {
        LookmlModelExploreFieldObject[['default_filter_value']] <- self$`default_filter_value`
      }
      if (!is.null(self$`description`)) {
        LookmlModelExploreFieldObject[['description']] <- self$`description`
      }
      if (!is.null(self$`dimension_group`)) {
        LookmlModelExploreFieldObject[['dimension_group']] <- self$`dimension_group`
      }
      if (!is.null(self$`enumerations`)) {
        LookmlModelExploreFieldObject[['enumerations']] <- lapply(self$`enumerations`, function(x) x$toJSON())
      }
      if (!is.null(self$`error`)) {
        LookmlModelExploreFieldObject[['error']] <- self$`error`
      }
      if (!is.null(self$`field_group_label`)) {
        LookmlModelExploreFieldObject[['field_group_label']] <- self$`field_group_label`
      }
      if (!is.null(self$`field_group_variant`)) {
        LookmlModelExploreFieldObject[['field_group_variant']] <- self$`field_group_variant`
      }
      if (!is.null(self$`fill_style`)) {
        LookmlModelExploreFieldObject[['fill_style']] <- self$`fill_style`
      }
      if (!is.null(self$`fiscal_month_offset`)) {
        LookmlModelExploreFieldObject[['fiscal_month_offset']] <- self$`fiscal_month_offset`
      }
      if (!is.null(self$`has_allowed_values`)) {
        LookmlModelExploreFieldObject[['has_allowed_values']] <- self$`has_allowed_values`
      }
      if (!is.null(self$`hidden`)) {
        LookmlModelExploreFieldObject[['hidden']] <- self$`hidden`
      }
      if (!is.null(self$`is_filter`)) {
        LookmlModelExploreFieldObject[['is_filter']] <- self$`is_filter`
      }
      if (!is.null(self$`is_fiscal`)) {
        LookmlModelExploreFieldObject[['is_fiscal']] <- self$`is_fiscal`
      }
      if (!is.null(self$`is_numeric`)) {
        LookmlModelExploreFieldObject[['is_numeric']] <- self$`is_numeric`
      }
      if (!is.null(self$`is_timeframe`)) {
        LookmlModelExploreFieldObject[['is_timeframe']] <- self$`is_timeframe`
      }
      if (!is.null(self$`can_time_filter`)) {
        LookmlModelExploreFieldObject[['can_time_filter']] <- self$`can_time_filter`
      }
      if (!is.null(self$`time_interval`)) {
        LookmlModelExploreFieldObject[['time_interval']] <- self$`time_interval`$toJSON()
      }
      if (!is.null(self$`label`)) {
        LookmlModelExploreFieldObject[['label']] <- self$`label`
      }
      if (!is.null(self$`label_from_parameter`)) {
        LookmlModelExploreFieldObject[['label_from_parameter']] <- self$`label_from_parameter`
      }
      if (!is.null(self$`label_short`)) {
        LookmlModelExploreFieldObject[['label_short']] <- self$`label_short`
      }
      if (!is.null(self$`lookml_link`)) {
        LookmlModelExploreFieldObject[['lookml_link']] <- self$`lookml_link`
      }
      if (!is.null(self$`map_layer`)) {
        LookmlModelExploreFieldObject[['map_layer']] <- self$`map_layer`$toJSON()
      }
      if (!is.null(self$`measure`)) {
        LookmlModelExploreFieldObject[['measure']] <- self$`measure`
      }
      if (!is.null(self$`name`)) {
        LookmlModelExploreFieldObject[['name']] <- self$`name`
      }
      if (!is.null(self$`strict_value_format`)) {
        LookmlModelExploreFieldObject[['strict_value_format']] <- self$`strict_value_format`
      }
      if (!is.null(self$`parameter`)) {
        LookmlModelExploreFieldObject[['parameter']] <- self$`parameter`
      }
      if (!is.null(self$`permanent`)) {
        LookmlModelExploreFieldObject[['permanent']] <- self$`permanent`
      }
      if (!is.null(self$`primary_key`)) {
        LookmlModelExploreFieldObject[['primary_key']] <- self$`primary_key`
      }
      if (!is.null(self$`project_name`)) {
        LookmlModelExploreFieldObject[['project_name']] <- self$`project_name`
      }
      if (!is.null(self$`requires_refresh_on_sort`)) {
        LookmlModelExploreFieldObject[['requires_refresh_on_sort']] <- self$`requires_refresh_on_sort`
      }
      if (!is.null(self$`scope`)) {
        LookmlModelExploreFieldObject[['scope']] <- self$`scope`
      }
      if (!is.null(self$`sortable`)) {
        LookmlModelExploreFieldObject[['sortable']] <- self$`sortable`
      }
      if (!is.null(self$`source_file`)) {
        LookmlModelExploreFieldObject[['source_file']] <- self$`source_file`
      }
      if (!is.null(self$`source_file_path`)) {
        LookmlModelExploreFieldObject[['source_file_path']] <- self$`source_file_path`
      }
      if (!is.null(self$`sql`)) {
        LookmlModelExploreFieldObject[['sql']] <- self$`sql`
      }
      if (!is.null(self$`sql_case`)) {
        LookmlModelExploreFieldObject[['sql_case']] <- lapply(self$`sql_case`, function(x) x$toJSON())
      }
      if (!is.null(self$`filters`)) {
        LookmlModelExploreFieldObject[['filters']] <- lapply(self$`filters`, function(x) x$toJSON())
      }
      if (!is.null(self$`suggest_dimension`)) {
        LookmlModelExploreFieldObject[['suggest_dimension']] <- self$`suggest_dimension`
      }
      if (!is.null(self$`suggest_explore`)) {
        LookmlModelExploreFieldObject[['suggest_explore']] <- self$`suggest_explore`
      }
      if (!is.null(self$`suggestable`)) {
        LookmlModelExploreFieldObject[['suggestable']] <- self$`suggestable`
      }
      if (!is.null(self$`suggestions`)) {
        LookmlModelExploreFieldObject[['suggestions']] <- self$`suggestions`
      }
      if (!is.null(self$`tags`)) {
        LookmlModelExploreFieldObject[['tags']] <- self$`tags`
      }
      if (!is.null(self$`type`)) {
        LookmlModelExploreFieldObject[['type']] <- self$`type`
      }
      if (!is.null(self$`user_attribute_filter_types`)) {
        LookmlModelExploreFieldObject[['user_attribute_filter_types']] <- self$`user_attribute_filter_types`
      }
      if (!is.null(self$`value_format`)) {
        LookmlModelExploreFieldObject[['value_format']] <- self$`value_format`
      }
      if (!is.null(self$`view`)) {
        LookmlModelExploreFieldObject[['view']] <- self$`view`
      }
      if (!is.null(self$`view_label`)) {
        LookmlModelExploreFieldObject[['view_label']] <- self$`view_label`
      }
      if (!is.null(self$`dynamic`)) {
        LookmlModelExploreFieldObject[['dynamic']] <- self$`dynamic`
      }
      if (!is.null(self$`week_start_day`)) {
        LookmlModelExploreFieldObject[['week_start_day']] <- self$`week_start_day`
      }
      if (!is.null(self$`times_used`)) {
        LookmlModelExploreFieldObject[['times_used']] <- self$`times_used`
      }
      if (!is.null(self$`original_view`)) {
        LookmlModelExploreFieldObject[['original_view']] <- self$`original_view`
      }

      LookmlModelExploreFieldObject
    },
    fromJSONObject = function(LookmlModelExploreFieldJsonObject) {
      LookmlModelExploreFieldObject <- LookmlModelExploreFieldJsonObject #jsonlite::fromJSON(LookmlModelExploreFieldJson, simplifyVector = FALSE)
      if (!is.null(LookmlModelExploreFieldObject$`align`)) {
        self$`align` <- LookmlModelExploreFieldObject$`align`
      }
      if (!is.null(LookmlModelExploreFieldObject$`can_filter`)) {
        self$`can_filter` <- LookmlModelExploreFieldObject$`can_filter`
      }
      if (!is.null(LookmlModelExploreFieldObject$`category`)) {
        self$`category` <- LookmlModelExploreFieldObject$`category`
      }
      if (!is.null(LookmlModelExploreFieldObject$`default_filter_value`)) {
        self$`default_filter_value` <- LookmlModelExploreFieldObject$`default_filter_value`
      }
      if (!is.null(LookmlModelExploreFieldObject$`description`)) {
        self$`description` <- LookmlModelExploreFieldObject$`description`
      }
      if (!is.null(LookmlModelExploreFieldObject$`dimension_group`)) {
        self$`dimension_group` <- LookmlModelExploreFieldObject$`dimension_group`
      }
      if (!is.null(LookmlModelExploreFieldObject$`enumerations`)) {
        self$`enumerations` <- lapply(LookmlModelExploreFieldObject$`enumerations`, function(x) {
          enumerationsObject <- LookmlModelExploreFieldEnumeration$new()
          enumerationsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
          enumerationsObject
        })
      }
      if (!is.null(LookmlModelExploreFieldObject$`error`)) {
        self$`error` <- LookmlModelExploreFieldObject$`error`
      }
      if (!is.null(LookmlModelExploreFieldObject$`field_group_label`)) {
        self$`field_group_label` <- LookmlModelExploreFieldObject$`field_group_label`
      }
      if (!is.null(LookmlModelExploreFieldObject$`field_group_variant`)) {
        self$`field_group_variant` <- LookmlModelExploreFieldObject$`field_group_variant`
      }
      if (!is.null(LookmlModelExploreFieldObject$`fill_style`)) {
        self$`fill_style` <- LookmlModelExploreFieldObject$`fill_style`
      }
      if (!is.null(LookmlModelExploreFieldObject$`fiscal_month_offset`)) {
        self$`fiscal_month_offset` <- LookmlModelExploreFieldObject$`fiscal_month_offset`
      }
      if (!is.null(LookmlModelExploreFieldObject$`has_allowed_values`)) {
        self$`has_allowed_values` <- LookmlModelExploreFieldObject$`has_allowed_values`
      }
      if (!is.null(LookmlModelExploreFieldObject$`hidden`)) {
        self$`hidden` <- LookmlModelExploreFieldObject$`hidden`
      }
      if (!is.null(LookmlModelExploreFieldObject$`is_filter`)) {
        self$`is_filter` <- LookmlModelExploreFieldObject$`is_filter`
      }
      if (!is.null(LookmlModelExploreFieldObject$`is_fiscal`)) {
        self$`is_fiscal` <- LookmlModelExploreFieldObject$`is_fiscal`
      }
      if (!is.null(LookmlModelExploreFieldObject$`is_numeric`)) {
        self$`is_numeric` <- LookmlModelExploreFieldObject$`is_numeric`
      }
      if (!is.null(LookmlModelExploreFieldObject$`is_timeframe`)) {
        self$`is_timeframe` <- LookmlModelExploreFieldObject$`is_timeframe`
      }
      if (!is.null(LookmlModelExploreFieldObject$`can_time_filter`)) {
        self$`can_time_filter` <- LookmlModelExploreFieldObject$`can_time_filter`
      }
      if (!is.null(LookmlModelExploreFieldObject$`time_interval`)) {
        time_intervalObject <- LookmlModelExploreFieldTimeInterval$new()
        time_intervalObject$fromJSON(jsonlite::toJSON(LookmlModelExploreFieldObject$time_interval, auto_unbox = TRUE))
        self$`time_interval` <- time_intervalObject
      }
      if (!is.null(LookmlModelExploreFieldObject$`label`)) {
        self$`label` <- LookmlModelExploreFieldObject$`label`
      }
      if (!is.null(LookmlModelExploreFieldObject$`label_from_parameter`)) {
        self$`label_from_parameter` <- LookmlModelExploreFieldObject$`label_from_parameter`
      }
      if (!is.null(LookmlModelExploreFieldObject$`label_short`)) {
        self$`label_short` <- LookmlModelExploreFieldObject$`label_short`
      }
      if (!is.null(LookmlModelExploreFieldObject$`lookml_link`)) {
        self$`lookml_link` <- LookmlModelExploreFieldObject$`lookml_link`
      }
      if (!is.null(LookmlModelExploreFieldObject$`map_layer`)) {
        map_layerObject <- LookmlModelExploreFieldMapLayer$new()
        map_layerObject$fromJSON(jsonlite::toJSON(LookmlModelExploreFieldObject$map_layer, auto_unbox = TRUE))
        self$`map_layer` <- map_layerObject
      }
      if (!is.null(LookmlModelExploreFieldObject$`measure`)) {
        self$`measure` <- LookmlModelExploreFieldObject$`measure`
      }
      if (!is.null(LookmlModelExploreFieldObject$`name`)) {
        self$`name` <- LookmlModelExploreFieldObject$`name`
      }
      if (!is.null(LookmlModelExploreFieldObject$`strict_value_format`)) {
        self$`strict_value_format` <- LookmlModelExploreFieldObject$`strict_value_format`
      }
      if (!is.null(LookmlModelExploreFieldObject$`parameter`)) {
        self$`parameter` <- LookmlModelExploreFieldObject$`parameter`
      }
      if (!is.null(LookmlModelExploreFieldObject$`permanent`)) {
        self$`permanent` <- LookmlModelExploreFieldObject$`permanent`
      }
      if (!is.null(LookmlModelExploreFieldObject$`primary_key`)) {
        self$`primary_key` <- LookmlModelExploreFieldObject$`primary_key`
      }
      if (!is.null(LookmlModelExploreFieldObject$`project_name`)) {
        self$`project_name` <- LookmlModelExploreFieldObject$`project_name`
      }
      if (!is.null(LookmlModelExploreFieldObject$`requires_refresh_on_sort`)) {
        self$`requires_refresh_on_sort` <- LookmlModelExploreFieldObject$`requires_refresh_on_sort`
      }
      if (!is.null(LookmlModelExploreFieldObject$`scope`)) {
        self$`scope` <- LookmlModelExploreFieldObject$`scope`
      }
      if (!is.null(LookmlModelExploreFieldObject$`sortable`)) {
        self$`sortable` <- LookmlModelExploreFieldObject$`sortable`
      }
      if (!is.null(LookmlModelExploreFieldObject$`source_file`)) {
        self$`source_file` <- LookmlModelExploreFieldObject$`source_file`
      }
      if (!is.null(LookmlModelExploreFieldObject$`source_file_path`)) {
        self$`source_file_path` <- LookmlModelExploreFieldObject$`source_file_path`
      }
      if (!is.null(LookmlModelExploreFieldObject$`sql`)) {
        self$`sql` <- LookmlModelExploreFieldObject$`sql`
      }
      if (!is.null(LookmlModelExploreFieldObject$`sql_case`)) {
        self$`sql_case` <- lapply(LookmlModelExploreFieldObject$`sql_case`, function(x) {
          sql_caseObject <- LookmlModelExploreFieldSqlCase$new()
          sql_caseObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
          sql_caseObject
        })
      }
      if (!is.null(LookmlModelExploreFieldObject$`filters`)) {
        self$`filters` <- lapply(LookmlModelExploreFieldObject$`filters`, function(x) {
          filtersObject <- LookmlModelExploreFieldMeasureFilters$new()
          filtersObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))
          filtersObject
        })
      }
      if (!is.null(LookmlModelExploreFieldObject$`suggest_dimension`)) {
        self$`suggest_dimension` <- LookmlModelExploreFieldObject$`suggest_dimension`
      }
      if (!is.null(LookmlModelExploreFieldObject$`suggest_explore`)) {
        self$`suggest_explore` <- LookmlModelExploreFieldObject$`suggest_explore`
      }
      if (!is.null(LookmlModelExploreFieldObject$`suggestable`)) {
        self$`suggestable` <- LookmlModelExploreFieldObject$`suggestable`
      }
      if (!is.null(LookmlModelExploreFieldObject$`suggestions`)) {
        self$`suggestions` <- LookmlModelExploreFieldObject$`suggestions`
      }
      if (!is.null(LookmlModelExploreFieldObject$`tags`)) {
        self$`tags` <- LookmlModelExploreFieldObject$`tags`
      }
      if (!is.null(LookmlModelExploreFieldObject$`type`)) {
        self$`type` <- LookmlModelExploreFieldObject$`type`
      }
      if (!is.null(LookmlModelExploreFieldObject$`user_attribute_filter_types`)) {
        self$`user_attribute_filter_types` <- LookmlModelExploreFieldObject$`user_attribute_filter_types`
      }
      if (!is.null(LookmlModelExploreFieldObject$`value_format`)) {
        self$`value_format` <- LookmlModelExploreFieldObject$`value_format`
      }
      if (!is.null(LookmlModelExploreFieldObject$`view`)) {
        self$`view` <- LookmlModelExploreFieldObject$`view`
      }
      if (!is.null(LookmlModelExploreFieldObject$`view_label`)) {
        self$`view_label` <- LookmlModelExploreFieldObject$`view_label`
      }
      if (!is.null(LookmlModelExploreFieldObject$`dynamic`)) {
        self$`dynamic` <- LookmlModelExploreFieldObject$`dynamic`
      }
      if (!is.null(LookmlModelExploreFieldObject$`week_start_day`)) {
        self$`week_start_day` <- LookmlModelExploreFieldObject$`week_start_day`
      }
      if (!is.null(LookmlModelExploreFieldObject$`times_used`)) {
        self$`times_used` <- LookmlModelExploreFieldObject$`times_used`
      }
      if (!is.null(LookmlModelExploreFieldObject$`original_view`)) {
        self$`original_view` <- LookmlModelExploreFieldObject$`original_view`
      }
    },
    fromJSON = function(LookmlModelExploreFieldJson) {
      LookmlModelExploreFieldObject <- jsonlite::fromJSON(LookmlModelExploreFieldJson, simplifyVector = FALSE)
      self$fromJSONObject(LookmlModelExploreFieldObject)
    },
    toJSONString = function() {
       sprintf(
        '{
           "align": %s,
           "can_filter": %s,
           "category": %s,
           "default_filter_value": %s,
           "description": %s,
           "dimension_group": %s,
           "enumerations": [%s],
           "error": %s,
           "field_group_label": %s,
           "field_group_variant": %s,
           "fill_style": %s,
           "fiscal_month_offset": %d,
           "has_allowed_values": %s,
           "hidden": %s,
           "is_filter": %s,
           "is_fiscal": %s,
           "is_numeric": %s,
           "is_timeframe": %s,
           "can_time_filter": %s,
           "time_interval": %s,
           "label": %s,
           "label_from_parameter": %s,
           "label_short": %s,
           "lookml_link": %s,
           "map_layer": %s,
           "measure": %s,
           "name": %s,
           "strict_value_format": %s,
           "parameter": %s,
           "permanent": %s,
           "primary_key": %s,
           "project_name": %s,
           "requires_refresh_on_sort": %s,
           "scope": %s,
           "sortable": %s,
           "source_file": %s,
           "source_file_path": %s,
           "sql": %s,
           "sql_case": [%s],
           "filters": [%s],
           "suggest_dimension": %s,
           "suggest_explore": %s,
           "suggestable": %s,
           "suggestions": [%s],
           "tags": [%s],
           "type": %s,
           "user_attribute_filter_types": [%s],
           "value_format": %s,
           "view": %s,
           "view_label": %s,
           "dynamic": %s,
           "week_start_day": %s,
           "times_used": %d,
           "original_view": %s
        }',
        self$`align`,
        self$`can_filter`,
        self$`category`,
        self$`default_filter_value`,
        self$`description`,
        self$`dimension_group`,
        lapply(self$`enumerations`, function(x) paste(x$toJSON(), sep=",")),
        self$`error`,
        self$`field_group_label`,
        self$`field_group_variant`,
        self$`fill_style`,
        self$`fiscal_month_offset`,
        self$`has_allowed_values`,
        self$`hidden`,
        self$`is_filter`,
        self$`is_fiscal`,
        self$`is_numeric`,
        self$`is_timeframe`,
        self$`can_time_filter`,
        self$`time_interval`$toJSON(),
        self$`label`,
        self$`label_from_parameter`,
        self$`label_short`,
        self$`lookml_link`,
        self$`map_layer`$toJSON(),
        self$`measure`,
        self$`name`,
        self$`strict_value_format`,
        self$`parameter`,
        self$`permanent`,
        self$`primary_key`,
        self$`project_name`,
        self$`requires_refresh_on_sort`,
        self$`scope`,
        self$`sortable`,
        self$`source_file`,
        self$`source_file_path`,
        self$`sql`,
        lapply(self$`sql_case`, function(x) paste(x$toJSON(), sep=",")),
        lapply(self$`filters`, function(x) paste(x$toJSON(), sep=",")),
        self$`suggest_dimension`,
        self$`suggest_explore`,
        self$`suggestable`,
        lapply(self$`suggestions`, function(x) paste(paste0('"', x, '"'), sep=",")),
        lapply(self$`tags`, function(x) paste(paste0('"', x, '"'), sep=",")),
        self$`type`,
        lapply(self$`user_attribute_filter_types`, function(x) paste(paste0('"', x, '"'), sep=",")),
        self$`value_format`,
        self$`view`,
        self$`view_label`,
        self$`dynamic`,
        self$`week_start_day`,
        self$`times_used`,
        self$`original_view`
      )
    },
    fromJSONString = function(LookmlModelExploreFieldJson) {
      LookmlModelExploreFieldObject <- jsonlite::fromJSON(LookmlModelExploreFieldJson, simplifyVector = FALSE)
      self$`align` <- LookmlModelExploreFieldObject$`align`
      self$`can_filter` <- LookmlModelExploreFieldObject$`can_filter`
      self$`category` <- LookmlModelExploreFieldObject$`category`
      self$`default_filter_value` <- LookmlModelExploreFieldObject$`default_filter_value`
      self$`description` <- LookmlModelExploreFieldObject$`description`
      self$`dimension_group` <- LookmlModelExploreFieldObject$`dimension_group`
      self$`enumerations` <- lapply(LookmlModelExploreFieldObject$`enumerations`, function(x) LookmlModelExploreFieldEnumeration$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`error` <- LookmlModelExploreFieldObject$`error`
      self$`field_group_label` <- LookmlModelExploreFieldObject$`field_group_label`
      self$`field_group_variant` <- LookmlModelExploreFieldObject$`field_group_variant`
      self$`fill_style` <- LookmlModelExploreFieldObject$`fill_style`
      self$`fiscal_month_offset` <- LookmlModelExploreFieldObject$`fiscal_month_offset`
      self$`has_allowed_values` <- LookmlModelExploreFieldObject$`has_allowed_values`
      self$`hidden` <- LookmlModelExploreFieldObject$`hidden`
      self$`is_filter` <- LookmlModelExploreFieldObject$`is_filter`
      self$`is_fiscal` <- LookmlModelExploreFieldObject$`is_fiscal`
      self$`is_numeric` <- LookmlModelExploreFieldObject$`is_numeric`
      self$`is_timeframe` <- LookmlModelExploreFieldObject$`is_timeframe`
      self$`can_time_filter` <- LookmlModelExploreFieldObject$`can_time_filter`
      LookmlModelExploreFieldTimeIntervalObject <- LookmlModelExploreFieldTimeInterval$new()
      self$`time_interval` <- LookmlModelExploreFieldTimeIntervalObject$fromJSON(jsonlite::toJSON(LookmlModelExploreFieldObject$time_interval, auto_unbox = TRUE))
      self$`label` <- LookmlModelExploreFieldObject$`label`
      self$`label_from_parameter` <- LookmlModelExploreFieldObject$`label_from_parameter`
      self$`label_short` <- LookmlModelExploreFieldObject$`label_short`
      self$`lookml_link` <- LookmlModelExploreFieldObject$`lookml_link`
      LookmlModelExploreFieldMapLayerObject <- LookmlModelExploreFieldMapLayer$new()
      self$`map_layer` <- LookmlModelExploreFieldMapLayerObject$fromJSON(jsonlite::toJSON(LookmlModelExploreFieldObject$map_layer, auto_unbox = TRUE))
      self$`measure` <- LookmlModelExploreFieldObject$`measure`
      self$`name` <- LookmlModelExploreFieldObject$`name`
      self$`strict_value_format` <- LookmlModelExploreFieldObject$`strict_value_format`
      self$`parameter` <- LookmlModelExploreFieldObject$`parameter`
      self$`permanent` <- LookmlModelExploreFieldObject$`permanent`
      self$`primary_key` <- LookmlModelExploreFieldObject$`primary_key`
      self$`project_name` <- LookmlModelExploreFieldObject$`project_name`
      self$`requires_refresh_on_sort` <- LookmlModelExploreFieldObject$`requires_refresh_on_sort`
      self$`scope` <- LookmlModelExploreFieldObject$`scope`
      self$`sortable` <- LookmlModelExploreFieldObject$`sortable`
      self$`source_file` <- LookmlModelExploreFieldObject$`source_file`
      self$`source_file_path` <- LookmlModelExploreFieldObject$`source_file_path`
      self$`sql` <- LookmlModelExploreFieldObject$`sql`
      self$`sql_case` <- lapply(LookmlModelExploreFieldObject$`sql_case`, function(x) LookmlModelExploreFieldSqlCase$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`filters` <- lapply(LookmlModelExploreFieldObject$`filters`, function(x) LookmlModelExploreFieldMeasureFilters$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)))
      self$`suggest_dimension` <- LookmlModelExploreFieldObject$`suggest_dimension`
      self$`suggest_explore` <- LookmlModelExploreFieldObject$`suggest_explore`
      self$`suggestable` <- LookmlModelExploreFieldObject$`suggestable`
      self$`suggestions` <- LookmlModelExploreFieldObject$`suggestions`
      self$`tags` <- LookmlModelExploreFieldObject$`tags`
      self$`type` <- LookmlModelExploreFieldObject$`type`
      self$`user_attribute_filter_types` <- LookmlModelExploreFieldObject$`user_attribute_filter_types`
      self$`value_format` <- LookmlModelExploreFieldObject$`value_format`
      self$`view` <- LookmlModelExploreFieldObject$`view`
      self$`view_label` <- LookmlModelExploreFieldObject$`view_label`
      self$`dynamic` <- LookmlModelExploreFieldObject$`dynamic`
      self$`week_start_day` <- LookmlModelExploreFieldObject$`week_start_day`
      self$`times_used` <- LookmlModelExploreFieldObject$`times_used`
      self$`original_view` <- LookmlModelExploreFieldObject$`original_view`
    }
  )
)
looker/lookr documentation built on Jan. 15, 2024, 2:49 a.m.