#[non_exhaustive]pub struct StepExecutionBuilder { /* private fields */ }
Expand description
A builder for StepExecution
.
Implementations§
Source§impl StepExecutionBuilder
impl StepExecutionBuilder
Sourcepub fn set_step_name(self, input: Option<String>) -> Self
pub fn set_step_name(self, input: Option<String>) -> Self
The name of this execution step.
Sourcepub fn get_step_name(&self) -> &Option<String>
pub fn get_step_name(&self) -> &Option<String>
The name of this execution step.
Sourcepub fn action(self, input: impl Into<String>) -> Self
pub fn action(self, input: impl Into<String>) -> Self
The action this step performs. The action determines the behavior of the step.
Sourcepub fn set_action(self, input: Option<String>) -> Self
pub fn set_action(self, input: Option<String>) -> Self
The action this step performs. The action determines the behavior of the step.
Sourcepub fn get_action(&self) -> &Option<String>
pub fn get_action(&self) -> &Option<String>
The action this step performs. The action determines the behavior of the step.
Sourcepub fn timeout_seconds(self, input: i64) -> Self
pub fn timeout_seconds(self, input: i64) -> Self
The timeout seconds of the step.
Sourcepub fn set_timeout_seconds(self, input: Option<i64>) -> Self
pub fn set_timeout_seconds(self, input: Option<i64>) -> Self
The timeout seconds of the step.
Sourcepub fn get_timeout_seconds(&self) -> &Option<i64>
pub fn get_timeout_seconds(&self) -> &Option<i64>
The timeout seconds of the step.
Sourcepub fn on_failure(self, input: impl Into<String>) -> Self
pub fn on_failure(self, input: impl Into<String>) -> Self
The action to take if the step fails. The default value is Abort
.
Sourcepub fn set_on_failure(self, input: Option<String>) -> Self
pub fn set_on_failure(self, input: Option<String>) -> Self
The action to take if the step fails. The default value is Abort
.
Sourcepub fn get_on_failure(&self) -> &Option<String>
pub fn get_on_failure(&self) -> &Option<String>
The action to take if the step fails. The default value is Abort
.
Sourcepub fn max_attempts(self, input: i32) -> Self
pub fn max_attempts(self, input: i32) -> Self
The maximum number of tries to run the action of the step. The default value is 1
.
Sourcepub fn set_max_attempts(self, input: Option<i32>) -> Self
pub fn set_max_attempts(self, input: Option<i32>) -> Self
The maximum number of tries to run the action of the step. The default value is 1
.
Sourcepub fn get_max_attempts(&self) -> &Option<i32>
pub fn get_max_attempts(&self) -> &Option<i32>
The maximum number of tries to run the action of the step. The default value is 1
.
Sourcepub fn execution_start_time(self, input: DateTime) -> Self
pub fn execution_start_time(self, input: DateTime) -> Self
If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field isn't populated.
Sourcepub fn set_execution_start_time(self, input: Option<DateTime>) -> Self
pub fn set_execution_start_time(self, input: Option<DateTime>) -> Self
If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field isn't populated.
Sourcepub fn get_execution_start_time(&self) -> &Option<DateTime>
pub fn get_execution_start_time(&self) -> &Option<DateTime>
If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field isn't populated.
Sourcepub fn execution_end_time(self, input: DateTime) -> Self
pub fn execution_end_time(self, input: DateTime) -> Self
If a step has finished execution, this contains the time the execution ended. If the step hasn't yet concluded, this field isn't populated.
Sourcepub fn set_execution_end_time(self, input: Option<DateTime>) -> Self
pub fn set_execution_end_time(self, input: Option<DateTime>) -> Self
If a step has finished execution, this contains the time the execution ended. If the step hasn't yet concluded, this field isn't populated.
Sourcepub fn get_execution_end_time(&self) -> &Option<DateTime>
pub fn get_execution_end_time(&self) -> &Option<DateTime>
If a step has finished execution, this contains the time the execution ended. If the step hasn't yet concluded, this field isn't populated.
Sourcepub fn step_status(self, input: AutomationExecutionStatus) -> Self
pub fn step_status(self, input: AutomationExecutionStatus) -> Self
The execution status for this step.
Sourcepub fn set_step_status(self, input: Option<AutomationExecutionStatus>) -> Self
pub fn set_step_status(self, input: Option<AutomationExecutionStatus>) -> Self
The execution status for this step.
Sourcepub fn get_step_status(&self) -> &Option<AutomationExecutionStatus>
pub fn get_step_status(&self) -> &Option<AutomationExecutionStatus>
The execution status for this step.
Sourcepub fn response_code(self, input: impl Into<String>) -> Self
pub fn response_code(self, input: impl Into<String>) -> Self
The response code returned by the execution of the step.
Sourcepub fn set_response_code(self, input: Option<String>) -> Self
pub fn set_response_code(self, input: Option<String>) -> Self
The response code returned by the execution of the step.
Sourcepub fn get_response_code(&self) -> &Option<String>
pub fn get_response_code(&self) -> &Option<String>
The response code returned by the execution of the step.
Sourcepub fn inputs(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn inputs(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to inputs
.
To override the contents of this collection use set_inputs
.
Fully-resolved values passed into the step before execution.
Sourcepub fn set_inputs(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_inputs(self, input: Option<HashMap<String, String>>) -> Self
Fully-resolved values passed into the step before execution.
Sourcepub fn get_inputs(&self) -> &Option<HashMap<String, String>>
pub fn get_inputs(&self) -> &Option<HashMap<String, String>>
Fully-resolved values passed into the step before execution.
Sourcepub fn outputs(self, k: impl Into<String>, v: Vec<String>) -> Self
pub fn outputs(self, k: impl Into<String>, v: Vec<String>) -> Self
Adds a key-value pair to outputs
.
To override the contents of this collection use set_outputs
.
Returned values from the execution of the step.
Sourcepub fn set_outputs(self, input: Option<HashMap<String, Vec<String>>>) -> Self
pub fn set_outputs(self, input: Option<HashMap<String, Vec<String>>>) -> Self
Returned values from the execution of the step.
Sourcepub fn get_outputs(&self) -> &Option<HashMap<String, Vec<String>>>
pub fn get_outputs(&self) -> &Option<HashMap<String, Vec<String>>>
Returned values from the execution of the step.
Sourcepub fn response(self, input: impl Into<String>) -> Self
pub fn response(self, input: impl Into<String>) -> Self
A message associated with the response code for an execution.
Sourcepub fn set_response(self, input: Option<String>) -> Self
pub fn set_response(self, input: Option<String>) -> Self
A message associated with the response code for an execution.
Sourcepub fn get_response(&self) -> &Option<String>
pub fn get_response(&self) -> &Option<String>
A message associated with the response code for an execution.
Sourcepub fn failure_message(self, input: impl Into<String>) -> Self
pub fn failure_message(self, input: impl Into<String>) -> Self
If a step failed, this message explains why the execution failed.
Sourcepub fn set_failure_message(self, input: Option<String>) -> Self
pub fn set_failure_message(self, input: Option<String>) -> Self
If a step failed, this message explains why the execution failed.
Sourcepub fn get_failure_message(&self) -> &Option<String>
pub fn get_failure_message(&self) -> &Option<String>
If a step failed, this message explains why the execution failed.
Sourcepub fn failure_details(self, input: FailureDetails) -> Self
pub fn failure_details(self, input: FailureDetails) -> Self
Information about the Automation failure.
Sourcepub fn set_failure_details(self, input: Option<FailureDetails>) -> Self
pub fn set_failure_details(self, input: Option<FailureDetails>) -> Self
Information about the Automation failure.
Sourcepub fn get_failure_details(&self) -> &Option<FailureDetails>
pub fn get_failure_details(&self) -> &Option<FailureDetails>
Information about the Automation failure.
Sourcepub fn step_execution_id(self, input: impl Into<String>) -> Self
pub fn step_execution_id(self, input: impl Into<String>) -> Self
The unique ID of a step execution.
Sourcepub fn set_step_execution_id(self, input: Option<String>) -> Self
pub fn set_step_execution_id(self, input: Option<String>) -> Self
The unique ID of a step execution.
Sourcepub fn get_step_execution_id(&self) -> &Option<String>
pub fn get_step_execution_id(&self) -> &Option<String>
The unique ID of a step execution.
Sourcepub fn overridden_parameters(self, k: impl Into<String>, v: Vec<String>) -> Self
pub fn overridden_parameters(self, k: impl Into<String>, v: Vec<String>) -> Self
Adds a key-value pair to overridden_parameters
.
To override the contents of this collection use set_overridden_parameters
.
A user-specified list of parameters to override when running a step.
Sourcepub fn set_overridden_parameters(
self,
input: Option<HashMap<String, Vec<String>>>,
) -> Self
pub fn set_overridden_parameters( self, input: Option<HashMap<String, Vec<String>>>, ) -> Self
A user-specified list of parameters to override when running a step.
Sourcepub fn get_overridden_parameters(&self) -> &Option<HashMap<String, Vec<String>>>
pub fn get_overridden_parameters(&self) -> &Option<HashMap<String, Vec<String>>>
A user-specified list of parameters to override when running a step.
Sourcepub fn is_end(self, input: bool) -> Self
pub fn is_end(self, input: bool) -> Self
The flag which can be used to end automation no matter whether the step succeeds or fails.
Sourcepub fn set_is_end(self, input: Option<bool>) -> Self
pub fn set_is_end(self, input: Option<bool>) -> Self
The flag which can be used to end automation no matter whether the step succeeds or fails.
Sourcepub fn get_is_end(&self) -> &Option<bool>
pub fn get_is_end(&self) -> &Option<bool>
The flag which can be used to end automation no matter whether the step succeeds or fails.
Sourcepub fn next_step(self, input: impl Into<String>) -> Self
pub fn next_step(self, input: impl Into<String>) -> Self
The next step after the step succeeds.
Sourcepub fn set_next_step(self, input: Option<String>) -> Self
pub fn set_next_step(self, input: Option<String>) -> Self
The next step after the step succeeds.
Sourcepub fn get_next_step(&self) -> &Option<String>
pub fn get_next_step(&self) -> &Option<String>
The next step after the step succeeds.
Sourcepub fn is_critical(self, input: bool) -> Self
pub fn is_critical(self, input: bool) -> Self
The flag which can be used to help decide whether the failure of current step leads to the Automation failure.
Sourcepub fn set_is_critical(self, input: Option<bool>) -> Self
pub fn set_is_critical(self, input: Option<bool>) -> Self
The flag which can be used to help decide whether the failure of current step leads to the Automation failure.
Sourcepub fn get_is_critical(&self) -> &Option<bool>
pub fn get_is_critical(&self) -> &Option<bool>
The flag which can be used to help decide whether the failure of current step leads to the Automation failure.
Sourcepub fn valid_next_steps(self, input: impl Into<String>) -> Self
pub fn valid_next_steps(self, input: impl Into<String>) -> Self
Appends an item to valid_next_steps
.
To override the contents of this collection use set_valid_next_steps
.
Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.
Sourcepub fn set_valid_next_steps(self, input: Option<Vec<String>>) -> Self
pub fn set_valid_next_steps(self, input: Option<Vec<String>>) -> Self
Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.
Sourcepub fn get_valid_next_steps(&self) -> &Option<Vec<String>>
pub fn get_valid_next_steps(&self) -> &Option<Vec<String>>
Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.
Sourcepub fn targets(self, input: Target) -> Self
pub fn targets(self, input: Target) -> Self
Appends an item to targets
.
To override the contents of this collection use set_targets
.
The targets for the step execution.
Sourcepub fn set_targets(self, input: Option<Vec<Target>>) -> Self
pub fn set_targets(self, input: Option<Vec<Target>>) -> Self
The targets for the step execution.
Sourcepub fn get_targets(&self) -> &Option<Vec<Target>>
pub fn get_targets(&self) -> &Option<Vec<Target>>
The targets for the step execution.
Sourcepub fn target_location(self, input: TargetLocation) -> Self
pub fn target_location(self, input: TargetLocation) -> Self
The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.
Sourcepub fn set_target_location(self, input: Option<TargetLocation>) -> Self
pub fn set_target_location(self, input: Option<TargetLocation>) -> Self
The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.
Sourcepub fn get_target_location(&self) -> &Option<TargetLocation>
pub fn get_target_location(&self) -> &Option<TargetLocation>
The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.
Sourcepub fn triggered_alarms(self, input: AlarmStateInformation) -> Self
pub fn triggered_alarms(self, input: AlarmStateInformation) -> Self
Appends an item to triggered_alarms
.
To override the contents of this collection use set_triggered_alarms
.
The CloudWatch alarms that were invoked by the automation.
Sourcepub fn set_triggered_alarms(
self,
input: Option<Vec<AlarmStateInformation>>,
) -> Self
pub fn set_triggered_alarms( self, input: Option<Vec<AlarmStateInformation>>, ) -> Self
The CloudWatch alarms that were invoked by the automation.
Sourcepub fn get_triggered_alarms(&self) -> &Option<Vec<AlarmStateInformation>>
pub fn get_triggered_alarms(&self) -> &Option<Vec<AlarmStateInformation>>
The CloudWatch alarms that were invoked by the automation.
Sourcepub fn parent_step_details(self, input: ParentStepDetails) -> Self
pub fn parent_step_details(self, input: ParentStepDetails) -> Self
Information about the parent step.
Sourcepub fn set_parent_step_details(self, input: Option<ParentStepDetails>) -> Self
pub fn set_parent_step_details(self, input: Option<ParentStepDetails>) -> Self
Information about the parent step.
Sourcepub fn get_parent_step_details(&self) -> &Option<ParentStepDetails>
pub fn get_parent_step_details(&self) -> &Option<ParentStepDetails>
Information about the parent step.
Sourcepub fn build(self) -> StepExecution
pub fn build(self) -> StepExecution
Consumes the builder and constructs a StepExecution
.
Trait Implementations§
Source§impl Clone for StepExecutionBuilder
impl Clone for StepExecutionBuilder
Source§fn clone(&self) -> StepExecutionBuilder
fn clone(&self) -> StepExecutionBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StepExecutionBuilder
impl Debug for StepExecutionBuilder
Source§impl Default for StepExecutionBuilder
impl Default for StepExecutionBuilder
Source§fn default() -> StepExecutionBuilder
fn default() -> StepExecutionBuilder
Source§impl PartialEq for StepExecutionBuilder
impl PartialEq for StepExecutionBuilder
impl StructuralPartialEq for StepExecutionBuilder
Auto Trait Implementations§
impl Freeze for StepExecutionBuilder
impl RefUnwindSafe for StepExecutionBuilder
impl Send for StepExecutionBuilder
impl Sync for StepExecutionBuilder
impl Unpin for StepExecutionBuilder
impl UnwindSafe for StepExecutionBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);