Fawkes API  Fawkes Development Version
DomainOperatorParameter Class Reference

DomainOperatorParameter representation for JSON transfer. More...

#include <DomainOperatorParameter.h>

Public Member Functions

 DomainOperatorParameter ()
 Constructor. More...
 
 DomainOperatorParameter (const std::string &json)
 Constructor from JSON. More...
 
 DomainOperatorParameter (const rapidjson::Value &v)
 Constructor from JSON. More...
 
virtual ~DomainOperatorParameter ()
 Destructor. More...
 
virtual std::string to_json (bool pretty=false) const
 Render object to JSON. More...
 
virtual void to_json_value (rapidjson::Document &d, rapidjson::Value &v) const
 Render object to JSON. More...
 
virtual void from_json (const std::string &json)
 Retrieve data from JSON string. More...
 
virtual void from_json_value (const rapidjson::Value &v)
 Retrieve data from JSON string. More...
 
virtual void validate (bool subcall=false) const
 Validate if all required fields have been set. More...
 
std::optional< std::string > name () const
 Get name value. More...
 
void set_name (const std::string &name)
 Set name value. More...
 
std::optional< std::string > type () const
 Get type value. More...
 
void set_type (const std::string &type)
 Set type value. More...
 

Static Public Member Functions

static std::string api_version ()
 Get version of implemented API. More...
 

Detailed Description

DomainOperatorParameter representation for JSON transfer.

Definition at line 27 of file DomainOperatorParameter.h.

Constructor & Destructor Documentation

◆ DomainOperatorParameter() [1/3]

DomainOperatorParameter::DomainOperatorParameter ( )

Constructor.

Definition at line 24 of file DomainOperatorParameter.cpp.

◆ DomainOperatorParameter() [2/3]

DomainOperatorParameter::DomainOperatorParameter ( const std::string &  json)

Constructor from JSON.

Parameters
jsonJSON string to initialize from

Definition at line 28 of file DomainOperatorParameter.cpp.

References from_json().

◆ DomainOperatorParameter() [3/3]

DomainOperatorParameter::DomainOperatorParameter ( const rapidjson::Value &  v)

Constructor from JSON.

Parameters
vRapidJSON value object to initialize from.

Definition at line 33 of file DomainOperatorParameter.cpp.

References from_json_value().

◆ ~DomainOperatorParameter()

DomainOperatorParameter::~DomainOperatorParameter ( )
virtual

Destructor.

Definition at line 38 of file DomainOperatorParameter.cpp.

Member Function Documentation

◆ api_version()

static std::string DomainOperatorParameter::api_version ( )
inlinestatic

Get version of implemented API.

Returns
string representation of version

Definition at line 48 of file DomainOperatorParameter.h.

◆ from_json()

void DomainOperatorParameter::from_json ( const std::string &  json)
virtual

Retrieve data from JSON string.

Parameters
jsonJSON representation suitable for this object. Will allow partial assignment and not validate automaticaly.
See also
validate()

Definition at line 82 of file DomainOperatorParameter.cpp.

References from_json_value().

Referenced by DomainOperatorParameter().

◆ from_json_value()

void DomainOperatorParameter::from_json_value ( const rapidjson::Value &  v)
virtual

Retrieve data from JSON string.

Parameters
vRapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly.
See also
validate()

Definition at line 91 of file DomainOperatorParameter.cpp.

Referenced by DomainOperatorParameter(), from_json(), and DomainOperator::from_json_value().

◆ name()

std::optional<std::string> DomainOperatorParameter::name ( ) const
inline

Get name value.

Returns
name value

Definition at line 92 of file DomainOperatorParameter.h.

Referenced by set_name().

◆ set_name()

void DomainOperatorParameter::set_name ( const std::string &  name)
inline

Set name value.

Parameters
namenew value

Definition at line 101 of file DomainOperatorParameter.h.

References name().

◆ set_type()

void DomainOperatorParameter::set_type ( const std::string &  type)
inline

Set type value.

Parameters
typenew value

Definition at line 118 of file DomainOperatorParameter.h.

References type().

◆ to_json()

std::string DomainOperatorParameter::to_json ( bool  pretty = false) const
virtual

Render object to JSON.

Parameters
prettytrue to enable pretty printing (readable spacing)
Returns
JSON string

Definition at line 43 of file DomainOperatorParameter.cpp.

References to_json_value().

◆ to_json_value()

void DomainOperatorParameter::to_json_value ( rapidjson::Document &  d,
rapidjson::Value &  v 
) const
virtual

Render object to JSON.

Parameters
dRapidJSON document to retrieve allocator from
vRapidJSON value to add data to

Definition at line 62 of file DomainOperatorParameter.cpp.

Referenced by to_json().

◆ type()

std::optional<std::string> DomainOperatorParameter::type ( ) const
inline

Get type value.

Returns
type value

Definition at line 109 of file DomainOperatorParameter.h.

Referenced by set_type().

◆ validate()

void DomainOperatorParameter::validate ( bool  subcall = false) const
virtual

Validate if all required fields have been set.

Parameters
subcalltrue if this is called from another class, e.g., a sub-class or array holder. Will modify the kind of exception thrown.
Exceptions
std::vector<std::string>thrown if required information is missing and subcall is set to true. Contains a list of missing fields.
std::runtime_errorinformative message describing the missing fields

Definition at line 102 of file DomainOperatorParameter.cpp.


The documentation for this class was generated from the following files: