R/component_benchmark.R

# Engines API
#
# Allow clients to fetch Engines Analytics through APIs.
#
# The version of the OpenAPI document: 2
# Contact: analytics.api.support@factset.com
# Generated by: https://openapi-generator.tech

#' @docType class
#' @title ComponentBenchmark
#' @description ComponentBenchmark Class
#' @format An \code{R6Class} generator object
#' @field id  character [optional]
#'
#' @field name  character [optional]
#'
#' @field holdingsmode  character [optional]
#'
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite fromJSON toJSON
#' @export
ComponentBenchmark <- R6::R6Class(
  'ComponentBenchmark',
  public = list(
    `id` = NULL,
    `name` = NULL,
    `holdingsmode` = NULL,
    initialize = function(`id`=NULL, `name`=NULL, `holdingsmode`=NULL, ...){
      local.optional.var <- list(...)
      if (!is.null(`id`)) {
        stopifnot(is.character(`id`), length(`id`) == 1)
        self$`id` <- `id`
      }
      if (!is.null(`name`)) {
        stopifnot(is.character(`name`), length(`name`) == 1)
        self$`name` <- `name`
      }
      if (!is.null(`holdingsmode`)) {
        stopifnot(is.character(`holdingsmode`), length(`holdingsmode`) == 1)
        self$`holdingsmode` <- `holdingsmode`
      }
    },
    toJSON = function() {
      ComponentBenchmarkObject <- list()
      if (!is.null(self$`id`)) {
        ComponentBenchmarkObject[['id']] <-
          self$`id`
      }
      if (!is.null(self$`name`)) {
        ComponentBenchmarkObject[['name']] <-
          self$`name`
      }
      if (!is.null(self$`holdingsmode`)) {
        ComponentBenchmarkObject[['holdingsmode']] <-
          self$`holdingsmode`
      }

      ComponentBenchmarkObject
    },
    fromJSON = function(ComponentBenchmarkJson) {
      ComponentBenchmarkObject <- jsonlite::fromJSON(ComponentBenchmarkJson)
      if (!is.null(ComponentBenchmarkObject$`id`)) {
        self$`id` <- ComponentBenchmarkObject$`id`
      }
      if (!is.null(ComponentBenchmarkObject$`name`)) {
        self$`name` <- ComponentBenchmarkObject$`name`
      }
      if (!is.null(ComponentBenchmarkObject$`holdingsmode`)) {
        self$`holdingsmode` <- ComponentBenchmarkObject$`holdingsmode`
      }
    },
    toJSONString = function() {
      jsoncontent <- c(
        if (!is.null(self$`id`)) {
        sprintf(
        '"id":
          "%s"
                ',
        self$`id`
        )},
        if (!is.null(self$`name`)) {
        sprintf(
        '"name":
          "%s"
                ',
        self$`name`
        )},
        if (!is.null(self$`holdingsmode`)) {
        sprintf(
        '"holdingsmode":
          "%s"
                ',
        self$`holdingsmode`
        )}
      )
      jsoncontent <- paste(jsoncontent, collapse = ",")
      paste('{', jsoncontent, '}', sep = "")
    },
    fromJSONString = function(ComponentBenchmarkJson) {
      ComponentBenchmarkObject <- jsonlite::fromJSON(ComponentBenchmarkJson)
      self$`id` <- ComponentBenchmarkObject$`id`
      self$`name` <- ComponentBenchmarkObject$`name`
      self$`holdingsmode` <- ComponentBenchmarkObject$`holdingsmode`
      self
    }
  )
)

Try the factset.analyticsapi.engines package in your browser

Any scripts or data that you put into this service are public.

factset.analyticsapi.engines documentation built on Feb. 2, 2020, 5:06 p.m.