software.amazon.awssdk.services.iot.model.KinesisAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iot Show documentation
Show all versions of iot Show documentation
The AWS Java SDK for AWS Iot Service module holds the client classes that are used for communicating
with AWS IoT Service
/*
* 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.iot.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
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;
/**
*
* Describes an action to write data to an Amazon Kinesis stream.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class KinesisAction implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("roleArn").getter(getter(KinesisAction::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();
private static final SdkField STREAM_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("streamName").getter(getter(KinesisAction::streamName)).setter(setter(Builder::streamName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("streamName").build()).build();
private static final SdkField PARTITION_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("partitionKey").getter(getter(KinesisAction::partitionKey)).setter(setter(Builder::partitionKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("partitionKey").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ROLE_ARN_FIELD,
STREAM_NAME_FIELD, PARTITION_KEY_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String roleArn;
private final String streamName;
private final String partitionKey;
private KinesisAction(BuilderImpl builder) {
this.roleArn = builder.roleArn;
this.streamName = builder.streamName;
this.partitionKey = builder.partitionKey;
}
/**
*
* The ARN of the IAM role that grants access to the Amazon Kinesis stream.
*
*
* @return The ARN of the IAM role that grants access to the Amazon Kinesis stream.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The name of the Amazon Kinesis stream.
*
*
* @return The name of the Amazon Kinesis stream.
*/
public final String streamName() {
return streamName;
}
/**
*
* The partition key.
*
*
* @return The partition key.
*/
public final String partitionKey() {
return partitionKey;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(streamName());
hashCode = 31 * hashCode + Objects.hashCode(partitionKey());
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 KinesisAction)) {
return false;
}
KinesisAction other = (KinesisAction) obj;
return Objects.equals(roleArn(), other.roleArn()) && Objects.equals(streamName(), other.streamName())
&& Objects.equals(partitionKey(), other.partitionKey());
}
/**
* 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("KinesisAction").add("RoleArn", roleArn()).add("StreamName", streamName())
.add("PartitionKey", partitionKey()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "roleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "streamName":
return Optional.ofNullable(clazz.cast(streamName()));
case "partitionKey":
return Optional.ofNullable(clazz.cast(partitionKey()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("roleArn", ROLE_ARN_FIELD);
map.put("streamName", STREAM_NAME_FIELD);
map.put("partitionKey", PARTITION_KEY_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy