Struct jenkins_api::job::builder::JobBuilder
source · pub struct JobBuilder<'a, 'b, 'c, 'd> { /* private fields */ }
Expand description
Helper to build a job
Implementations§
source§impl<'a, 'b, 'c, 'd> JobBuilder<'a, 'b, 'c, 'd>
impl<'a, 'b, 'c, 'd> JobBuilder<'a, 'b, 'c, 'd>
sourcepub fn send(self) -> Result<ShortQueueItem, Error>
pub fn send(self) -> Result<ShortQueueItem, Error>
Trigger the build
sourcepub fn with_delay(self, delay_sec: u32) -> Self
pub fn with_delay(self, delay_sec: u32) -> Self
Add a delay before the job will be built
sourcepub fn remotely_with_token_and_cause(
self,
token: &'d str,
cause: Option<&'c str>
) -> Result<Self, Error>
pub fn remotely_with_token_and_cause(
self,
token: &'d str,
cause: Option<&'c str>
) -> Result<Self, Error>
Trigger the build remotely with a token and a cause
Errors
This methods will return an error if building remotely a build with parameters
sourcepub fn with_parameters<T: Serialize>(self, parameters: &T) -> Result<Self, Error>
pub fn with_parameters<T: Serialize>(self, parameters: &T) -> Result<Self, Error>
Build with parameters
Supported parameters type: Boolean, Choice, Multi-line string, Password, Run, String
Unsupported parameters type: File, Credentials
Errors
If used on a Job
without parameters, sending this build will return an
Error::IllegalState
If used with invalid parameters type / value, sending this build will return an
Error::IllegalArgument
This methods will return an error if serializing parameters
fails, or if passing
parameters to a remote build.