#[non_exhaustive]pub struct TargetBuilder { /* private fields */ }
Expand description
A builder for Target
.
Implementations§
Source§impl TargetBuilder
impl TargetBuilder
Sourcepub fn id(self, input: impl Into<String>) -> Self
pub fn id(self, input: impl Into<String>) -> Self
The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.
This field is required.Sourcepub fn set_id(self, input: Option<String>) -> Self
pub fn set_id(self, input: Option<String>) -> Self
The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.
Sourcepub fn get_id(&self) -> &Option<String>
pub fn get_id(&self) -> &Option<String>
The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.
Sourcepub fn arn(self, input: impl Into<String>) -> Self
pub fn arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the target.
This field is required.Sourcepub fn set_arn(self, input: Option<String>) -> Self
pub fn set_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the target.
Sourcepub fn role_arn(self, input: impl Into<String>) -> Self
pub fn role_arn(self, input: impl Into<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.
Sourcepub fn set_role_arn(self, input: Option<String>) -> Self
pub fn set_role_arn(self, input: Option<String>) -> Self
The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.
Sourcepub fn get_role_arn(&self) -> &Option<String>
pub fn get_role_arn(&self) -> &Option<String>
The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.
Sourcepub fn input(self, input: impl Into<String>) -> Self
pub fn input(self, input: impl Into<String>) -> Self
Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see The JavaScript Object Notation (JSON) Data Interchange Format.
Sourcepub fn set_input(self, input: Option<String>) -> Self
pub fn set_input(self, input: Option<String>) -> Self
Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see The JavaScript Object Notation (JSON) Data Interchange Format.
Sourcepub fn get_input(&self) -> &Option<String>
pub fn get_input(&self) -> &Option<String>
Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see The JavaScript Object Notation (JSON) Data Interchange Format.
Sourcepub fn input_path(self, input: impl Into<String>) -> Self
pub fn input_path(self, input: impl Into<String>) -> Self
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You may use JSON dot notation or bracket notation. For more information about JSON paths, see JSONPath.
Sourcepub fn set_input_path(self, input: Option<String>) -> Self
pub fn set_input_path(self, input: Option<String>) -> Self
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You may use JSON dot notation or bracket notation. For more information about JSON paths, see JSONPath.
Sourcepub fn get_input_path(&self) -> &Option<String>
pub fn get_input_path(&self) -> &Option<String>
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You may use JSON dot notation or bracket notation. For more information about JSON paths, see JSONPath.
Sourcepub fn input_transformer(self, input: InputTransformer) -> Self
pub fn input_transformer(self, input: InputTransformer) -> Self
Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
Sourcepub fn set_input_transformer(self, input: Option<InputTransformer>) -> Self
pub fn set_input_transformer(self, input: Option<InputTransformer>) -> Self
Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
Sourcepub fn get_input_transformer(&self) -> &Option<InputTransformer>
pub fn get_input_transformer(&self) -> &Option<InputTransformer>
Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.
Sourcepub fn kinesis_parameters(self, input: KinesisParameters) -> Self
pub fn kinesis_parameters(self, input: KinesisParameters) -> Self
The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the eventId
as the partition key.
Sourcepub fn set_kinesis_parameters(self, input: Option<KinesisParameters>) -> Self
pub fn set_kinesis_parameters(self, input: Option<KinesisParameters>) -> Self
The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the eventId
as the partition key.
Sourcepub fn get_kinesis_parameters(&self) -> &Option<KinesisParameters>
pub fn get_kinesis_parameters(&self) -> &Option<KinesisParameters>
The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the eventId
as the partition key.
Sourcepub fn run_command_parameters(self, input: RunCommandParameters) -> Self
pub fn run_command_parameters(self, input: RunCommandParameters) -> Self
Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
Sourcepub fn set_run_command_parameters(
self,
input: Option<RunCommandParameters>,
) -> Self
pub fn set_run_command_parameters( self, input: Option<RunCommandParameters>, ) -> Self
Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
Sourcepub fn get_run_command_parameters(&self) -> &Option<RunCommandParameters>
pub fn get_run_command_parameters(&self) -> &Option<RunCommandParameters>
Parameters used when you are using the rule to invoke Amazon EC2 Run Command.
Sourcepub fn ecs_parameters(self, input: EcsParameters) -> Self
pub fn ecs_parameters(self, input: EcsParameters) -> Self
Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see Task Definitions in the Amazon EC2 Container Service Developer Guide.
Sourcepub fn set_ecs_parameters(self, input: Option<EcsParameters>) -> Self
pub fn set_ecs_parameters(self, input: Option<EcsParameters>) -> Self
Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see Task Definitions in the Amazon EC2 Container Service Developer Guide.
Sourcepub fn get_ecs_parameters(&self) -> &Option<EcsParameters>
pub fn get_ecs_parameters(&self) -> &Option<EcsParameters>
Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see Task Definitions in the Amazon EC2 Container Service Developer Guide.
Sourcepub fn batch_parameters(self, input: BatchParameters) -> Self
pub fn batch_parameters(self, input: BatchParameters) -> Self
If the event target is an Batch job, this contains the job definition, job name, and other parameters. For more information, see Jobs in the Batch User Guide.
Sourcepub fn set_batch_parameters(self, input: Option<BatchParameters>) -> Self
pub fn set_batch_parameters(self, input: Option<BatchParameters>) -> Self
If the event target is an Batch job, this contains the job definition, job name, and other parameters. For more information, see Jobs in the Batch User Guide.
Sourcepub fn get_batch_parameters(&self) -> &Option<BatchParameters>
pub fn get_batch_parameters(&self) -> &Option<BatchParameters>
If the event target is an Batch job, this contains the job definition, job name, and other parameters. For more information, see Jobs in the Batch User Guide.
Sourcepub fn sqs_parameters(self, input: SqsParameters) -> Self
pub fn sqs_parameters(self, input: SqsParameters) -> Self
Contains the message group ID to use when the target is a FIFO queue.
If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
Sourcepub fn set_sqs_parameters(self, input: Option<SqsParameters>) -> Self
pub fn set_sqs_parameters(self, input: Option<SqsParameters>) -> Self
Contains the message group ID to use when the target is a FIFO queue.
If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
Sourcepub fn get_sqs_parameters(&self) -> &Option<SqsParameters>
pub fn get_sqs_parameters(&self) -> &Option<SqsParameters>
Contains the message group ID to use when the target is a FIFO queue.
If you specify an SQS FIFO queue as a target, the queue must have content-based deduplication enabled.
Sourcepub fn http_parameters(self, input: HttpParameters) -> Self
pub fn http_parameters(self, input: HttpParameters) -> Self
Contains the HTTP parameters to use when the target is a API Gateway endpoint or EventBridge ApiDestination.
If you specify an API Gateway API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.
Sourcepub fn set_http_parameters(self, input: Option<HttpParameters>) -> Self
pub fn set_http_parameters(self, input: Option<HttpParameters>) -> Self
Contains the HTTP parameters to use when the target is a API Gateway endpoint or EventBridge ApiDestination.
If you specify an API Gateway API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.
Sourcepub fn get_http_parameters(&self) -> &Option<HttpParameters>
pub fn get_http_parameters(&self) -> &Option<HttpParameters>
Contains the HTTP parameters to use when the target is a API Gateway endpoint or EventBridge ApiDestination.
If you specify an API Gateway API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.
Sourcepub fn redshift_data_parameters(self, input: RedshiftDataParameters) -> Self
pub fn redshift_data_parameters(self, input: RedshiftDataParameters) -> Self
Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.
If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.
Sourcepub fn set_redshift_data_parameters(
self,
input: Option<RedshiftDataParameters>,
) -> Self
pub fn set_redshift_data_parameters( self, input: Option<RedshiftDataParameters>, ) -> Self
Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.
If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.
Sourcepub fn get_redshift_data_parameters(&self) -> &Option<RedshiftDataParameters>
pub fn get_redshift_data_parameters(&self) -> &Option<RedshiftDataParameters>
Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.
If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.
Sourcepub fn sage_maker_pipeline_parameters(
self,
input: SageMakerPipelineParameters,
) -> Self
pub fn sage_maker_pipeline_parameters( self, input: SageMakerPipelineParameters, ) -> Self
Contains the SageMaker AI Model Building Pipeline parameters to start execution of a SageMaker AI Model Building Pipeline.
If you specify a SageMaker AI Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.
Sourcepub fn set_sage_maker_pipeline_parameters(
self,
input: Option<SageMakerPipelineParameters>,
) -> Self
pub fn set_sage_maker_pipeline_parameters( self, input: Option<SageMakerPipelineParameters>, ) -> Self
Contains the SageMaker AI Model Building Pipeline parameters to start execution of a SageMaker AI Model Building Pipeline.
If you specify a SageMaker AI Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.
Sourcepub fn get_sage_maker_pipeline_parameters(
&self,
) -> &Option<SageMakerPipelineParameters>
pub fn get_sage_maker_pipeline_parameters( &self, ) -> &Option<SageMakerPipelineParameters>
Contains the SageMaker AI Model Building Pipeline parameters to start execution of a SageMaker AI Model Building Pipeline.
If you specify a SageMaker AI Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.
Sourcepub fn dead_letter_config(self, input: DeadLetterConfig) -> Self
pub fn dead_letter_config(self, input: DeadLetterConfig) -> Self
The DeadLetterConfig
that defines the target queue to send dead-letter queue events to.
Sourcepub fn set_dead_letter_config(self, input: Option<DeadLetterConfig>) -> Self
pub fn set_dead_letter_config(self, input: Option<DeadLetterConfig>) -> Self
The DeadLetterConfig
that defines the target queue to send dead-letter queue events to.
Sourcepub fn get_dead_letter_config(&self) -> &Option<DeadLetterConfig>
pub fn get_dead_letter_config(&self) -> &Option<DeadLetterConfig>
The DeadLetterConfig
that defines the target queue to send dead-letter queue events to.
Sourcepub fn retry_policy(self, input: RetryPolicy) -> Self
pub fn retry_policy(self, input: RetryPolicy) -> Self
The retry policy configuration to use for the dead-letter queue.
Sourcepub fn set_retry_policy(self, input: Option<RetryPolicy>) -> Self
pub fn set_retry_policy(self, input: Option<RetryPolicy>) -> Self
The retry policy configuration to use for the dead-letter queue.
Sourcepub fn get_retry_policy(&self) -> &Option<RetryPolicy>
pub fn get_retry_policy(&self) -> &Option<RetryPolicy>
The retry policy configuration to use for the dead-letter queue.
Sourcepub fn app_sync_parameters(self, input: AppSyncParameters) -> Self
pub fn app_sync_parameters(self, input: AppSyncParameters) -> Self
Contains the GraphQL operation to be parsed and executed, if the event target is an AppSync API.
Sourcepub fn set_app_sync_parameters(self, input: Option<AppSyncParameters>) -> Self
pub fn set_app_sync_parameters(self, input: Option<AppSyncParameters>) -> Self
Contains the GraphQL operation to be parsed and executed, if the event target is an AppSync API.
Sourcepub fn get_app_sync_parameters(&self) -> &Option<AppSyncParameters>
pub fn get_app_sync_parameters(&self) -> &Option<AppSyncParameters>
Contains the GraphQL operation to be parsed and executed, if the event target is an AppSync API.
Trait Implementations§
Source§impl Clone for TargetBuilder
impl Clone for TargetBuilder
Source§fn clone(&self) -> TargetBuilder
fn clone(&self) -> TargetBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TargetBuilder
impl Debug for TargetBuilder
Source§impl Default for TargetBuilder
impl Default for TargetBuilder
Source§fn default() -> TargetBuilder
fn default() -> TargetBuilder
Source§impl PartialEq for TargetBuilder
impl PartialEq for TargetBuilder
impl StructuralPartialEq for TargetBuilder
Auto Trait Implementations§
impl Freeze for TargetBuilder
impl RefUnwindSafe for TargetBuilder
impl Send for TargetBuilder
impl Sync for TargetBuilder
impl Unpin for TargetBuilder
impl UnwindSafe for TargetBuilder
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);