RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
rstudio::launcher_plugins::api::JobConfig Struct Reference

Struct which represents a custom configuration setting for jobs launched with a given Plugin. More...

#include <Job.hpp>

Public Types

enum  Type { Type::ENUM, Type::FLOAT, Type::INT, Type::STRING }
 

Public Member Functions

 JobConfig ()=default
 Default constructor.
 
 JobConfig (std::string in_name, Type in_type)
 Constructor. More...
 
json::Object toJson () const
 Converts this JobConfig to a JSON object which represents it. More...
 

Static Public Member Functions

static Error fromJson (const json::Object &in_json, JobConfig &out_jobConfig)
 Constructs a JobConfig from a JSON object which represents the job config. More...
 

Public Attributes

std::string Name
 
Optional< TypeValueType
 
std::string Value
 

Detailed Description

Struct which represents a custom configuration setting for jobs launched with a given Plugin.

JobConfig values should be used only when there is a necessary per-job configuration that cannot be covered by another aspect of the Job structure, such as a ResourceLimit or PlacementConstraint.

Member Enumeration Documentation

◆ Type

Enumerator
ENUM 

Enumeration type.

FLOAT 

Floating point value type.

INT 

Integer type.

STRING 

String type.

Constructor & Destructor Documentation

◆ JobConfig()

rstudio::launcher_plugins::api::JobConfig::JobConfig ( std::string  in_name,
Type  in_type 
)

Constructor.

Parameters
in_nameThe name of the custom job configuration value.
in_typeThe type of the custom job configuration value.

Member Function Documentation

◆ fromJson()

static Error rstudio::launcher_plugins::api::JobConfig::fromJson ( const json::Object in_json,
JobConfig out_jobConfig 
)
static

Constructs a JobConfig from a JSON object which represents the job config.

Parameters
in_jsonThe JSON object which represents the job config.
out_jobConfigThe populated job config value. Not valid if an error is returned.
Returns
Success if in_json could be parsed as a JobConfig; Error otherwise.

◆ toJson()

json::Object rstudio::launcher_plugins::api::JobConfig::toJson ( ) const

Converts this JobConfig to a JSON object which represents it.

Returns
The JSON object which represents this JobConfig.

Member Data Documentation

◆ Name

std::string rstudio::launcher_plugins::api::JobConfig::Name

The name of the custom job configuration value.

◆ Value

std::string rstudio::launcher_plugins::api::JobConfig::Value

The value of the custom job configuration value.

◆ ValueType

Optional<Type> rstudio::launcher_plugins::api::JobConfig::ValueType

The type of the custom job configuration value.


The documentation for this struct was generated from the following file: