All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.eventbridge.model.Target Maven / Gradle / Ivy

Go to download

The AWS Java SDK for EventBridge module holds the client classes that are used for communicating with EventBridge.

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.eventbridge.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Targets are the resources to be invoked when a rule is triggered. For a complete list of services and resources that * can be set as a target, see PutTargets. *

*

* If you are setting the event bus of another account as the target, and that account granted permission to your * account through an organization instead of directly by the account ID, then you must specify a RoleArn * with proper permissions in the Target structure. For more information, see Sending * and Receiving Events Between Amazon Web Services Accounts in the Amazon EventBridge User Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Target implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(Target::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(Target::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build(); private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RoleArn").getter(getter(Target::roleArn)).setter(setter(Builder::roleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build(); private static final SdkField INPUT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Input") .getter(getter(Target::input)).setter(setter(Builder::input)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Input").build()).build(); private static final SdkField INPUT_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InputPath").getter(getter(Target::inputPath)).setter(setter(Builder::inputPath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputPath").build()).build(); private static final SdkField INPUT_TRANSFORMER_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("InputTransformer") .getter(getter(Target::inputTransformer)).setter(setter(Builder::inputTransformer)) .constructor(InputTransformer::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputTransformer").build()).build(); private static final SdkField KINESIS_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("KinesisParameters") .getter(getter(Target::kinesisParameters)).setter(setter(Builder::kinesisParameters)) .constructor(KinesisParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KinesisParameters").build()).build(); private static final SdkField RUN_COMMAND_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("RunCommandParameters") .getter(getter(Target::runCommandParameters)).setter(setter(Builder::runCommandParameters)) .constructor(RunCommandParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RunCommandParameters").build()) .build(); private static final SdkField ECS_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("EcsParameters").getter(getter(Target::ecsParameters)) .setter(setter(Builder::ecsParameters)).constructor(EcsParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EcsParameters").build()).build(); private static final SdkField BATCH_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("BatchParameters") .getter(getter(Target::batchParameters)).setter(setter(Builder::batchParameters)) .constructor(BatchParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BatchParameters").build()).build(); private static final SdkField SQS_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SqsParameters").getter(getter(Target::sqsParameters)) .setter(setter(Builder::sqsParameters)).constructor(SqsParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SqsParameters").build()).build(); private static final SdkField HTTP_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("HttpParameters") .getter(getter(Target::httpParameters)).setter(setter(Builder::httpParameters)).constructor(HttpParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HttpParameters").build()).build(); private static final SdkField REDSHIFT_DATA_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("RedshiftDataParameters") .getter(getter(Target::redshiftDataParameters)).setter(setter(Builder::redshiftDataParameters)) .constructor(RedshiftDataParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RedshiftDataParameters").build()) .build(); private static final SdkField SAGE_MAKER_PIPELINE_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("SageMakerPipelineParameters") .getter(getter(Target::sageMakerPipelineParameters)) .setter(setter(Builder::sageMakerPipelineParameters)) .constructor(SageMakerPipelineParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SageMakerPipelineParameters") .build()).build(); private static final SdkField DEAD_LETTER_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DeadLetterConfig") .getter(getter(Target::deadLetterConfig)).setter(setter(Builder::deadLetterConfig)) .constructor(DeadLetterConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeadLetterConfig").build()).build(); private static final SdkField RETRY_POLICY_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("RetryPolicy").getter(getter(Target::retryPolicy)).setter(setter(Builder::retryPolicy)) .constructor(RetryPolicy::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetryPolicy").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, ARN_FIELD, ROLE_ARN_FIELD, INPUT_FIELD, INPUT_PATH_FIELD, INPUT_TRANSFORMER_FIELD, KINESIS_PARAMETERS_FIELD, RUN_COMMAND_PARAMETERS_FIELD, ECS_PARAMETERS_FIELD, BATCH_PARAMETERS_FIELD, SQS_PARAMETERS_FIELD, HTTP_PARAMETERS_FIELD, REDSHIFT_DATA_PARAMETERS_FIELD, SAGE_MAKER_PIPELINE_PARAMETERS_FIELD, DEAD_LETTER_CONFIG_FIELD, RETRY_POLICY_FIELD)); private static final long serialVersionUID = 1L; private final String id; private final String arn; private final String roleArn; private final String input; private final String inputPath; private final InputTransformer inputTransformer; private final KinesisParameters kinesisParameters; private final RunCommandParameters runCommandParameters; private final EcsParameters ecsParameters; private final BatchParameters batchParameters; private final SqsParameters sqsParameters; private final HttpParameters httpParameters; private final RedshiftDataParameters redshiftDataParameters; private final SageMakerPipelineParameters sageMakerPipelineParameters; private final DeadLetterConfig deadLetterConfig; private final RetryPolicy retryPolicy; private Target(BuilderImpl builder) { this.id = builder.id; this.arn = builder.arn; this.roleArn = builder.roleArn; this.input = builder.input; this.inputPath = builder.inputPath; this.inputTransformer = builder.inputTransformer; this.kinesisParameters = builder.kinesisParameters; this.runCommandParameters = builder.runCommandParameters; this.ecsParameters = builder.ecsParameters; this.batchParameters = builder.batchParameters; this.sqsParameters = builder.sqsParameters; this.httpParameters = builder.httpParameters; this.redshiftDataParameters = builder.redshiftDataParameters; this.sageMakerPipelineParameters = builder.sageMakerPipelineParameters; this.deadLetterConfig = builder.deadLetterConfig; this.retryPolicy = builder.retryPolicy; } /** *

* 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. *

* * @return 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. */ public final String id() { return id; } /** *

* The Amazon Resource Name (ARN) of the target. *

* * @return The Amazon Resource Name (ARN) of the target. */ public final String arn() { return arn; } /** *

* 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. *

* * @return 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. */ public final String roleArn() { return roleArn; } /** *

* 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. *

* * @return 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. */ public final String input() { return input; } /** *

* 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. *

* * @return 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. */ public final String inputPath() { return inputPath; } /** *

* 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. *

* * @return 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. */ public final InputTransformer inputTransformer() { return inputTransformer; } /** *

* 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. *

* * @return 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. */ public final KinesisParameters kinesisParameters() { return kinesisParameters; } /** *

* Parameters used when you are using the rule to invoke Amazon EC2 Run Command. *

* * @return Parameters used when you are using the rule to invoke Amazon EC2 Run Command. */ public final RunCommandParameters runCommandParameters() { return runCommandParameters; } /** *

* 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. *

* * @return 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. */ public final EcsParameters ecsParameters() { return ecsParameters; } /** *

* 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. *

* * @return 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. */ public final BatchParameters batchParameters() { return batchParameters; } /** *

* 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. *

* * @return 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. */ public final SqsParameters sqsParameters() { return sqsParameters; } /** *

* 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. *

* * @return 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. */ public final HttpParameters httpParameters() { return httpParameters; } /** *

* 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. *

* * @return 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. */ public final RedshiftDataParameters redshiftDataParameters() { return redshiftDataParameters; } /** *

* Contains the SageMaker Model Building Pipeline parameters to start execution of a SageMaker Model Building * Pipeline. *

*

* If you specify a SageMaker Model Building Pipeline as a target, you can use this to specify parameters to start a * pipeline execution based on EventBridge events. *

* * @return Contains the SageMaker Model Building Pipeline parameters to start execution of a SageMaker Model * Building Pipeline.

*

* If you specify a SageMaker Model Building Pipeline as a target, you can use this to specify parameters to * start a pipeline execution based on EventBridge events. */ public final SageMakerPipelineParameters sageMakerPipelineParameters() { return sageMakerPipelineParameters; } /** *

* The DeadLetterConfig that defines the target queue to send dead-letter queue events to. *

* * @return The DeadLetterConfig that defines the target queue to send dead-letter queue events to. */ public final DeadLetterConfig deadLetterConfig() { return deadLetterConfig; } /** *

* The RetryPolicy object that contains the retry policy configuration to use for the dead-letter * queue. *

* * @return The RetryPolicy object that contains the retry policy configuration to use for the * dead-letter queue. */ public final RetryPolicy retryPolicy() { return retryPolicy; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(input()); hashCode = 31 * hashCode + Objects.hashCode(inputPath()); hashCode = 31 * hashCode + Objects.hashCode(inputTransformer()); hashCode = 31 * hashCode + Objects.hashCode(kinesisParameters()); hashCode = 31 * hashCode + Objects.hashCode(runCommandParameters()); hashCode = 31 * hashCode + Objects.hashCode(ecsParameters()); hashCode = 31 * hashCode + Objects.hashCode(batchParameters()); hashCode = 31 * hashCode + Objects.hashCode(sqsParameters()); hashCode = 31 * hashCode + Objects.hashCode(httpParameters()); hashCode = 31 * hashCode + Objects.hashCode(redshiftDataParameters()); hashCode = 31 * hashCode + Objects.hashCode(sageMakerPipelineParameters()); hashCode = 31 * hashCode + Objects.hashCode(deadLetterConfig()); hashCode = 31 * hashCode + Objects.hashCode(retryPolicy()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Target)) { return false; } Target other = (Target) obj; return Objects.equals(id(), other.id()) && Objects.equals(arn(), other.arn()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(input(), other.input()) && Objects.equals(inputPath(), other.inputPath()) && Objects.equals(inputTransformer(), other.inputTransformer()) && Objects.equals(kinesisParameters(), other.kinesisParameters()) && Objects.equals(runCommandParameters(), other.runCommandParameters()) && Objects.equals(ecsParameters(), other.ecsParameters()) && Objects.equals(batchParameters(), other.batchParameters()) && Objects.equals(sqsParameters(), other.sqsParameters()) && Objects.equals(httpParameters(), other.httpParameters()) && Objects.equals(redshiftDataParameters(), other.redshiftDataParameters()) && Objects.equals(sageMakerPipelineParameters(), other.sageMakerPipelineParameters()) && Objects.equals(deadLetterConfig(), other.deadLetterConfig()) && Objects.equals(retryPolicy(), other.retryPolicy()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("Target").add("Id", id()).add("Arn", arn()).add("RoleArn", roleArn()).add("Input", input()) .add("InputPath", inputPath()).add("InputTransformer", inputTransformer()) .add("KinesisParameters", kinesisParameters()).add("RunCommandParameters", runCommandParameters()) .add("EcsParameters", ecsParameters()).add("BatchParameters", batchParameters()) .add("SqsParameters", sqsParameters()).add("HttpParameters", httpParameters()) .add("RedshiftDataParameters", redshiftDataParameters()) .add("SageMakerPipelineParameters", sageMakerPipelineParameters()).add("DeadLetterConfig", deadLetterConfig()) .add("RetryPolicy", retryPolicy()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Id": return Optional.ofNullable(clazz.cast(id())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "RoleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "Input": return Optional.ofNullable(clazz.cast(input())); case "InputPath": return Optional.ofNullable(clazz.cast(inputPath())); case "InputTransformer": return Optional.ofNullable(clazz.cast(inputTransformer())); case "KinesisParameters": return Optional.ofNullable(clazz.cast(kinesisParameters())); case "RunCommandParameters": return Optional.ofNullable(clazz.cast(runCommandParameters())); case "EcsParameters": return Optional.ofNullable(clazz.cast(ecsParameters())); case "BatchParameters": return Optional.ofNullable(clazz.cast(batchParameters())); case "SqsParameters": return Optional.ofNullable(clazz.cast(sqsParameters())); case "HttpParameters": return Optional.ofNullable(clazz.cast(httpParameters())); case "RedshiftDataParameters": return Optional.ofNullable(clazz.cast(redshiftDataParameters())); case "SageMakerPipelineParameters": return Optional.ofNullable(clazz.cast(sageMakerPipelineParameters())); case "DeadLetterConfig": return Optional.ofNullable(clazz.cast(deadLetterConfig())); case "RetryPolicy": return Optional.ofNullable(clazz.cast(retryPolicy())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Target) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* 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. *

* * @param id * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* The Amazon Resource Name (ARN) of the target. *

* * @param arn * The Amazon Resource Name (ARN) of the target. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* 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. *

* * @param roleArn * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* 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. *

* * @param input * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder input(String input); /** *

* 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. *

* * @param inputPath * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputPath(String inputPath); /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputTransformer(InputTransformer 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. *

* This is a convenience method that creates an instance of the {@link InputTransformer.Builder} avoiding the * need to create one manually via {@link InputTransformer#builder()}. * *

* When the {@link Consumer} completes, {@link InputTransformer.Builder#build()} is called immediately and its * result is passed to {@link #inputTransformer(InputTransformer)}. * * @param inputTransformer * a consumer that will call methods on {@link InputTransformer.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #inputTransformer(InputTransformer) */ default Builder inputTransformer(Consumer inputTransformer) { return inputTransformer(InputTransformer.builder().applyMutation(inputTransformer).build()); } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kinesisParameters(KinesisParameters 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. *

* This is a convenience method that creates an instance of the {@link KinesisParameters.Builder} avoiding the * need to create one manually via {@link KinesisParameters#builder()}. * *

* When the {@link Consumer} completes, {@link KinesisParameters.Builder#build()} is called immediately and its * result is passed to {@link #kinesisParameters(KinesisParameters)}. * * @param kinesisParameters * a consumer that will call methods on {@link KinesisParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #kinesisParameters(KinesisParameters) */ default Builder kinesisParameters(Consumer kinesisParameters) { return kinesisParameters(KinesisParameters.builder().applyMutation(kinesisParameters).build()); } /** *

* Parameters used when you are using the rule to invoke Amazon EC2 Run Command. *

* * @param runCommandParameters * Parameters used when you are using the rule to invoke Amazon EC2 Run Command. * @return Returns a reference to this object so that method calls can be chained together. */ Builder runCommandParameters(RunCommandParameters runCommandParameters); /** *

* Parameters used when you are using the rule to invoke Amazon EC2 Run Command. *

* This is a convenience method that creates an instance of the {@link RunCommandParameters.Builder} avoiding * the need to create one manually via {@link RunCommandParameters#builder()}. * *

* When the {@link Consumer} completes, {@link RunCommandParameters.Builder#build()} is called immediately and * its result is passed to {@link #runCommandParameters(RunCommandParameters)}. * * @param runCommandParameters * a consumer that will call methods on {@link RunCommandParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #runCommandParameters(RunCommandParameters) */ default Builder runCommandParameters(Consumer runCommandParameters) { return runCommandParameters(RunCommandParameters.builder().applyMutation(runCommandParameters).build()); } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ecsParameters(EcsParameters 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. *

* This is a convenience method that creates an instance of the {@link EcsParameters.Builder} avoiding the need * to create one manually via {@link EcsParameters#builder()}. * *

* When the {@link Consumer} completes, {@link EcsParameters.Builder#build()} is called immediately and its * result is passed to {@link #ecsParameters(EcsParameters)}. * * @param ecsParameters * a consumer that will call methods on {@link EcsParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #ecsParameters(EcsParameters) */ default Builder ecsParameters(Consumer ecsParameters) { return ecsParameters(EcsParameters.builder().applyMutation(ecsParameters).build()); } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder batchParameters(BatchParameters 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. *

* This is a convenience method that creates an instance of the {@link BatchParameters.Builder} avoiding the * need to create one manually via {@link BatchParameters#builder()}. * *

* When the {@link Consumer} completes, {@link BatchParameters.Builder#build()} is called immediately and its * result is passed to {@link #batchParameters(BatchParameters)}. * * @param batchParameters * a consumer that will call methods on {@link BatchParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #batchParameters(BatchParameters) */ default Builder batchParameters(Consumer batchParameters) { return batchParameters(BatchParameters.builder().applyMutation(batchParameters).build()); } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sqsParameters(SqsParameters 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. *

* This is a convenience method that creates an instance of the {@link SqsParameters.Builder} avoiding the need * to create one manually via {@link SqsParameters#builder()}. * *

* When the {@link Consumer} completes, {@link SqsParameters.Builder#build()} is called immediately and its * result is passed to {@link #sqsParameters(SqsParameters)}. * * @param sqsParameters * a consumer that will call methods on {@link SqsParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sqsParameters(SqsParameters) */ default Builder sqsParameters(Consumer sqsParameters) { return sqsParameters(SqsParameters.builder().applyMutation(sqsParameters).build()); } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder httpParameters(HttpParameters 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. *

* This is a convenience method that creates an instance of the {@link HttpParameters.Builder} avoiding the need * to create one manually via {@link HttpParameters#builder()}. * *

* When the {@link Consumer} completes, {@link HttpParameters.Builder#build()} is called immediately and its * result is passed to {@link #httpParameters(HttpParameters)}. * * @param httpParameters * a consumer that will call methods on {@link HttpParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #httpParameters(HttpParameters) */ default Builder httpParameters(Consumer httpParameters) { return httpParameters(HttpParameters.builder().applyMutation(httpParameters).build()); } /** *

* 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. *

* * @param 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder redshiftDataParameters(RedshiftDataParameters 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. *

* This is a convenience method that creates an instance of the {@link RedshiftDataParameters.Builder} avoiding * the need to create one manually via {@link RedshiftDataParameters#builder()}. * *

* When the {@link Consumer} completes, {@link RedshiftDataParameters.Builder#build()} is called immediately and * its result is passed to {@link #redshiftDataParameters(RedshiftDataParameters)}. * * @param redshiftDataParameters * a consumer that will call methods on {@link RedshiftDataParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #redshiftDataParameters(RedshiftDataParameters) */ default Builder redshiftDataParameters(Consumer redshiftDataParameters) { return redshiftDataParameters(RedshiftDataParameters.builder().applyMutation(redshiftDataParameters).build()); } /** *

* Contains the SageMaker Model Building Pipeline parameters to start execution of a SageMaker Model Building * Pipeline. *

*

* If you specify a SageMaker Model Building Pipeline as a target, you can use this to specify parameters to * start a pipeline execution based on EventBridge events. *

* * @param sageMakerPipelineParameters * Contains the SageMaker Model Building Pipeline parameters to start execution of a SageMaker Model * Building Pipeline.

*

* If you specify a SageMaker Model Building Pipeline as a target, you can use this to specify parameters * to start a pipeline execution based on EventBridge events. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sageMakerPipelineParameters(SageMakerPipelineParameters sageMakerPipelineParameters); /** *

* Contains the SageMaker Model Building Pipeline parameters to start execution of a SageMaker Model Building * Pipeline. *

*

* If you specify a SageMaker Model Building Pipeline as a target, you can use this to specify parameters to * start a pipeline execution based on EventBridge events. *

* This is a convenience method that creates an instance of the {@link SageMakerPipelineParameters.Builder} * avoiding the need to create one manually via {@link SageMakerPipelineParameters#builder()}. * *

* When the {@link Consumer} completes, {@link SageMakerPipelineParameters.Builder#build()} is called * immediately and its result is passed to {@link #sageMakerPipelineParameters(SageMakerPipelineParameters)}. * * @param sageMakerPipelineParameters * a consumer that will call methods on {@link SageMakerPipelineParameters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sageMakerPipelineParameters(SageMakerPipelineParameters) */ default Builder sageMakerPipelineParameters(Consumer sageMakerPipelineParameters) { return sageMakerPipelineParameters(SageMakerPipelineParameters.builder().applyMutation(sageMakerPipelineParameters) .build()); } /** *

* The DeadLetterConfig that defines the target queue to send dead-letter queue events to. *

* * @param deadLetterConfig * The DeadLetterConfig that defines the target queue to send dead-letter queue events to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deadLetterConfig(DeadLetterConfig deadLetterConfig); /** *

* The DeadLetterConfig that defines the target queue to send dead-letter queue events to. *

* This is a convenience method that creates an instance of the {@link DeadLetterConfig.Builder} avoiding the * need to create one manually via {@link DeadLetterConfig#builder()}. * *

* When the {@link Consumer} completes, {@link DeadLetterConfig.Builder#build()} is called immediately and its * result is passed to {@link #deadLetterConfig(DeadLetterConfig)}. * * @param deadLetterConfig * a consumer that will call methods on {@link DeadLetterConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #deadLetterConfig(DeadLetterConfig) */ default Builder deadLetterConfig(Consumer deadLetterConfig) { return deadLetterConfig(DeadLetterConfig.builder().applyMutation(deadLetterConfig).build()); } /** *

* The RetryPolicy object that contains the retry policy configuration to use for the dead-letter * queue. *

* * @param retryPolicy * The RetryPolicy object that contains the retry policy configuration to use for the * dead-letter queue. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retryPolicy(RetryPolicy retryPolicy); /** *

* The RetryPolicy object that contains the retry policy configuration to use for the dead-letter * queue. *

* This is a convenience method that creates an instance of the {@link RetryPolicy.Builder} avoiding the need to * create one manually via {@link RetryPolicy#builder()}. * *

* When the {@link Consumer} completes, {@link RetryPolicy.Builder#build()} is called immediately and its result * is passed to {@link #retryPolicy(RetryPolicy)}. * * @param retryPolicy * a consumer that will call methods on {@link RetryPolicy.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #retryPolicy(RetryPolicy) */ default Builder retryPolicy(Consumer retryPolicy) { return retryPolicy(RetryPolicy.builder().applyMutation(retryPolicy).build()); } } static final class BuilderImpl implements Builder { private String id; private String arn; private String roleArn; private String input; private String inputPath; private InputTransformer inputTransformer; private KinesisParameters kinesisParameters; private RunCommandParameters runCommandParameters; private EcsParameters ecsParameters; private BatchParameters batchParameters; private SqsParameters sqsParameters; private HttpParameters httpParameters; private RedshiftDataParameters redshiftDataParameters; private SageMakerPipelineParameters sageMakerPipelineParameters; private DeadLetterConfig deadLetterConfig; private RetryPolicy retryPolicy; private BuilderImpl() { } private BuilderImpl(Target model) { id(model.id); arn(model.arn); roleArn(model.roleArn); input(model.input); inputPath(model.inputPath); inputTransformer(model.inputTransformer); kinesisParameters(model.kinesisParameters); runCommandParameters(model.runCommandParameters); ecsParameters(model.ecsParameters); batchParameters(model.batchParameters); sqsParameters(model.sqsParameters); httpParameters(model.httpParameters); redshiftDataParameters(model.redshiftDataParameters); sageMakerPipelineParameters(model.sageMakerPipelineParameters); deadLetterConfig(model.deadLetterConfig); retryPolicy(model.retryPolicy); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final String getInput() { return input; } public final void setInput(String input) { this.input = input; } @Override public final Builder input(String input) { this.input = input; return this; } public final String getInputPath() { return inputPath; } public final void setInputPath(String inputPath) { this.inputPath = inputPath; } @Override public final Builder inputPath(String inputPath) { this.inputPath = inputPath; return this; } public final InputTransformer.Builder getInputTransformer() { return inputTransformer != null ? inputTransformer.toBuilder() : null; } public final void setInputTransformer(InputTransformer.BuilderImpl inputTransformer) { this.inputTransformer = inputTransformer != null ? inputTransformer.build() : null; } @Override public final Builder inputTransformer(InputTransformer inputTransformer) { this.inputTransformer = inputTransformer; return this; } public final KinesisParameters.Builder getKinesisParameters() { return kinesisParameters != null ? kinesisParameters.toBuilder() : null; } public final void setKinesisParameters(KinesisParameters.BuilderImpl kinesisParameters) { this.kinesisParameters = kinesisParameters != null ? kinesisParameters.build() : null; } @Override public final Builder kinesisParameters(KinesisParameters kinesisParameters) { this.kinesisParameters = kinesisParameters; return this; } public final RunCommandParameters.Builder getRunCommandParameters() { return runCommandParameters != null ? runCommandParameters.toBuilder() : null; } public final void setRunCommandParameters(RunCommandParameters.BuilderImpl runCommandParameters) { this.runCommandParameters = runCommandParameters != null ? runCommandParameters.build() : null; } @Override public final Builder runCommandParameters(RunCommandParameters runCommandParameters) { this.runCommandParameters = runCommandParameters; return this; } public final EcsParameters.Builder getEcsParameters() { return ecsParameters != null ? ecsParameters.toBuilder() : null; } public final void setEcsParameters(EcsParameters.BuilderImpl ecsParameters) { this.ecsParameters = ecsParameters != null ? ecsParameters.build() : null; } @Override public final Builder ecsParameters(EcsParameters ecsParameters) { this.ecsParameters = ecsParameters; return this; } public final BatchParameters.Builder getBatchParameters() { return batchParameters != null ? batchParameters.toBuilder() : null; } public final void setBatchParameters(BatchParameters.BuilderImpl batchParameters) { this.batchParameters = batchParameters != null ? batchParameters.build() : null; } @Override public final Builder batchParameters(BatchParameters batchParameters) { this.batchParameters = batchParameters; return this; } public final SqsParameters.Builder getSqsParameters() { return sqsParameters != null ? sqsParameters.toBuilder() : null; } public final void setSqsParameters(SqsParameters.BuilderImpl sqsParameters) { this.sqsParameters = sqsParameters != null ? sqsParameters.build() : null; } @Override public final Builder sqsParameters(SqsParameters sqsParameters) { this.sqsParameters = sqsParameters; return this; } public final HttpParameters.Builder getHttpParameters() { return httpParameters != null ? httpParameters.toBuilder() : null; } public final void setHttpParameters(HttpParameters.BuilderImpl httpParameters) { this.httpParameters = httpParameters != null ? httpParameters.build() : null; } @Override public final Builder httpParameters(HttpParameters httpParameters) { this.httpParameters = httpParameters; return this; } public final RedshiftDataParameters.Builder getRedshiftDataParameters() { return redshiftDataParameters != null ? redshiftDataParameters.toBuilder() : null; } public final void setRedshiftDataParameters(RedshiftDataParameters.BuilderImpl redshiftDataParameters) { this.redshiftDataParameters = redshiftDataParameters != null ? redshiftDataParameters.build() : null; } @Override public final Builder redshiftDataParameters(RedshiftDataParameters redshiftDataParameters) { this.redshiftDataParameters = redshiftDataParameters; return this; } public final SageMakerPipelineParameters.Builder getSageMakerPipelineParameters() { return sageMakerPipelineParameters != null ? sageMakerPipelineParameters.toBuilder() : null; } public final void setSageMakerPipelineParameters(SageMakerPipelineParameters.BuilderImpl sageMakerPipelineParameters) { this.sageMakerPipelineParameters = sageMakerPipelineParameters != null ? sageMakerPipelineParameters.build() : null; } @Override public final Builder sageMakerPipelineParameters(SageMakerPipelineParameters sageMakerPipelineParameters) { this.sageMakerPipelineParameters = sageMakerPipelineParameters; return this; } public final DeadLetterConfig.Builder getDeadLetterConfig() { return deadLetterConfig != null ? deadLetterConfig.toBuilder() : null; } public final void setDeadLetterConfig(DeadLetterConfig.BuilderImpl deadLetterConfig) { this.deadLetterConfig = deadLetterConfig != null ? deadLetterConfig.build() : null; } @Override public final Builder deadLetterConfig(DeadLetterConfig deadLetterConfig) { this.deadLetterConfig = deadLetterConfig; return this; } public final RetryPolicy.Builder getRetryPolicy() { return retryPolicy != null ? retryPolicy.toBuilder() : null; } public final void setRetryPolicy(RetryPolicy.BuilderImpl retryPolicy) { this.retryPolicy = retryPolicy != null ? retryPolicy.build() : null; } @Override public final Builder retryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; return this; } @Override public Target build() { return new Target(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy