RStudio Launcher Plugin SDK  1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
Public Member Functions | Protected Member Functions | Friends | List of all members
rstudio::launcher_plugins::api::UserRequest Class Reference

Base class which should be used by the class of requests which require a username. More...

#include <Request.hpp>

Inheritance diagram for rstudio::launcher_plugins::api::UserRequest:
rstudio::launcher_plugins::api::Request rstudio::launcher_plugins::Noncopyable rstudio::launcher_plugins::api::JobIdRequest rstudio::launcher_plugins::api::SubmitJobRequest rstudio::launcher_plugins::api::ControlJobRequest rstudio::launcher_plugins::api::JobStateRequest rstudio::launcher_plugins::api::JobStatusRequest rstudio::launcher_plugins::api::NetworkRequest rstudio::launcher_plugins::api::OutputStreamRequest rstudio::launcher_plugins::api::ResourceUtilStreamRequest

Public Member Functions

const system::UsergetUser () const
 Gets the user who initiated this request. More...
 
const std::string & getRequestUsername () const
 Gets the actual username that was used when the request was submitted. More...
 
- Public Member Functions inherited from rstudio::launcher_plugins::api::Request
virtual ~Request ()=default
 Virtual destructor for inheritance.
 
uint64_t getId () const
 Gets the ID of this request. More...
 
Type getType () const
 Gets the request type. More...
 
- Public Member Functions inherited from rstudio::launcher_plugins::Noncopyable
 Noncopyable ()=default
 Default constructor.
 
 Noncopyable (const Noncopyable &)=delete
 Deleted copy constructor.
 
Noncopyableoperator= (const Noncopyable &)=delete
 Deleted assignment operator.
 

Protected Member Functions

 UserRequest (Request::Type in_type, const json::Object &in_requestJson)
 Constructor. More...
 
- Protected Member Functions inherited from rstudio::launcher_plugins::api::Request
 Request (Type in_requestType, const json::Object &in_requestJson)
 Constructor. More...
 
 PRIVATE_IMPL (m_baseImpl)
 

Friends

class Request
 

Additional Inherited Members

- Public Types inherited from rstudio::launcher_plugins::api::Request
enum  Type {
  Type::HEARTBEAT = 0, Type::BOOTSTRAP = 1, Type::SUBMIT_JOB = 2, Type::GET_JOB = 3,
  Type::GET_JOB_STATUS = 4, Type::CONTROL_JOB = 5, Type::GET_JOB_OUTPUT = 6, Type::GET_JOB_RESOURCE_UTIL = 7,
  Type::GET_JOB_NETWORK = 8, Type::GET_CLUSTER_INFO = 9, Type::INVALID
}
 
- Static Public Member Functions inherited from rstudio::launcher_plugins::api::Request
static Error fromJson (const json::Object &in_requestJson, std::shared_ptr< Request > &out_request)
 Converts a Json::Object into the appropriate Request object. More...
 

Detailed Description

Base class which should be used by the class of requests which require a username.

Constructor & Destructor Documentation

◆ UserRequest()

rstudio::launcher_plugins::api::UserRequest::UserRequest ( Request::Type  in_type,
const json::Object in_requestJson 
)
explicitprotected

Constructor.

Parameters
in_typeThe type of the user request.
in_requestJsonThe JSON Object which represents the user request.

Member Function Documentation

◆ getRequestUsername()

const std::string& rstudio::launcher_plugins::api::UserRequest::getRequestUsername ( ) const

Gets the actual username that was used when the request was submitted.

This value is only useful for auditing purposes and should not be required by most plugins.

Returns
The actual username that was used when the request was submitted.

◆ getUser()

const system::User& rstudio::launcher_plugins::api::UserRequest::getUser ( ) const

Gets the user who initiated this request.

If an admin user made this request, this object may represent all users (check by calling User::isAllUsers()). In that case, information for all users should be returned.

Returns
The user who initiated this request.

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