R/LookmlModelExploreField.r

# Looker API 3.0 Reference
# 
# ### Authorization  The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **/login** endpoint to obtain a temporary access_token. Include that access_token in the Authorization header of Looker API requests. For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization)  ### Client SDKs  The Looker API is a RESTful system that should be usable by any programming language capable of making HTTPS requests. Client SDKs for a variety of programming languages can be generated from the Looker API's Swagger JSON metadata to streamline use of the Looker API in your applications. A client SDK for Ruby is available as an example. For more information, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks)  ### Try It Out!  The 'api-docs' page served by the Looker instance includes 'Try It Out!' buttons for each API method. After logging in with API3 credentials, you can use the \"Try It Out!\" buttons to call the API directly from the documentation page to interactively explore API features and responses.  ### Versioning  Future releases of Looker will expand this API release-by-release to securely expose more and more of the core power of Looker to API client applications. API endpoints marked as \"beta\" may receive breaking changes without warning. Stable (non-beta) API endpoints should not receive breaking changes in future releases. For more information, see [Looker API Versioning](https://looker.com/docs/r/api/versioning) 
# 
# OpenAPI spec version: 3.0.0
# 
# 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 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_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 parameter 
#' @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 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 
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
LookmlModelExploreField <- R6::R6Class(
  'LookmlModelExploreField',
  public = list(
    `align` = NULL,
    `can_filter` = NULL,
    `category` = NULL,
    `default_filter_value` = NULL,
    `description` = 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_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,
    `parameter` = 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,
    `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,
    initialize = function(`align`, `can_filter`, `category`, `default_filter_value`, `description`, `enumerations`, `error`, `field_group_label`, `field_group_variant`, `fill_style`, `fiscal_month_offset`, `has_allowed_values`, `hidden`, `is_filter`, `is_numeric`, `is_timeframe`, `can_time_filter`, `time_interval`, `label`, `label_from_parameter`, `label_short`, `lookml_link`, `map_layer`, `measure`, `name`, `parameter`, `primary_key`, `project_name`, `requires_refresh_on_sort`, `scope`, `sortable`, `source_file`, `source_file_path`, `sql`, `sql_case`, `suggest_dimension`, `suggest_explore`, `suggestable`, `suggestions`, `tags`, `type`, `user_attribute_filter_types`, `value_format`, `view`, `view_label`, `dynamic`){
      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(`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_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(`parameter`)) {
        self$`parameter` <- `parameter`
      }
      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(`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`
      }
    },
    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$`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_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$`parameter`)) {
        LookmlModelExploreFieldObject[['parameter']] <- self$`parameter`
      }
      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$`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`
      }

      LookmlModelExploreFieldObject
    },
    fromJSON = function(LookmlModelExploreFieldJson) {
      LookmlModelExploreFieldObject <- jsonlite::fromJSON(LookmlModelExploreFieldJson)
      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$`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_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$`parameter`)) {
        self$`parameter` <- LookmlModelExploreFieldObject$`parameter`
      }
      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$`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`
      }
    },
    toJSONString = function() {
       sprintf(
        '{
           "align": %s,
           "can_filter": %s,
           "category": %s,
           "default_filter_value": %s,
           "description": %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_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,
           "parameter": %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],
           "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
        }',
        self$`align`,
        self$`can_filter`,
        self$`category`,
        self$`default_filter_value`,
        self$`description`,
        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_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$`parameter`,
        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=",")),
        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`
      )
    },
    fromJSONString = function(LookmlModelExploreFieldJson) {
      LookmlModelExploreFieldObject <- jsonlite::fromJSON(LookmlModelExploreFieldJson)
      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$`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_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$`parameter` <- LookmlModelExploreFieldObject$`parameter`
      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$`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`
    }
  )
)
haarthi/R_sdk documentation built on May 18, 2019, 11:28 p.m.