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

software.amazon.awssdk.services.firehose.model.DeliveryStreamEncryptionConfiguration Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Kinesis Firehose module holds the client classes that are used for communicating with Amazon Kinesis Firehose Service

The 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.firehose.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.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;

/**
 * 

* Contains information about the server-side encryption (SSE) status for the delivery stream, the type customer master * key (CMK) in use, if any, and the ARN of the CMK. You can get DeliveryStreamEncryptionConfiguration by * invoking the DescribeDeliveryStream operation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DeliveryStreamEncryptionConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("KeyARN") .getter(getter(DeliveryStreamEncryptionConfiguration::keyARN)).setter(setter(Builder::keyARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyARN").build()).build(); private static final SdkField KEY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("KeyType").getter(getter(DeliveryStreamEncryptionConfiguration::keyTypeAsString)) .setter(setter(Builder::keyType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyType").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(DeliveryStreamEncryptionConfiguration::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField FAILURE_DESCRIPTION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("FailureDescription") .getter(getter(DeliveryStreamEncryptionConfiguration::failureDescription)) .setter(setter(Builder::failureDescription)).constructor(FailureDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureDescription").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(KEY_ARN_FIELD, KEY_TYPE_FIELD, STATUS_FIELD, FAILURE_DESCRIPTION_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String keyARN; private final String keyType; private final String status; private final FailureDescription failureDescription; private DeliveryStreamEncryptionConfiguration(BuilderImpl builder) { this.keyARN = builder.keyARN; this.keyType = builder.keyType; this.status = builder.status; this.failureDescription = builder.failureDescription; } /** *

* If KeyType is CUSTOMER_MANAGED_CMK, this field contains the ARN of the customer managed * CMK. If KeyType is Amazon Web Services_OWNED_CMK, * DeliveryStreamEncryptionConfiguration doesn't contain a value for KeyARN. *

* * @return If KeyType is CUSTOMER_MANAGED_CMK, this field contains the ARN of the customer * managed CMK. If KeyType is Amazon Web Services_OWNED_CMK, * DeliveryStreamEncryptionConfiguration doesn't contain a value for KeyARN. */ public final String keyARN() { return keyARN; } /** *

* Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master Keys * (CMKs). *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #keyType} will * return {@link KeyType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #keyTypeAsString}. *

* * @return Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master * Keys (CMKs). * @see KeyType */ public final KeyType keyType() { return KeyType.fromValue(keyType); } /** *

* Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master Keys * (CMKs). *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #keyType} will * return {@link KeyType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #keyTypeAsString}. *

* * @return Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master * Keys (CMKs). * @see KeyType */ public final String keyTypeAsString() { return keyType; } /** *

* This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the different * values of this status, see StartDeliveryStreamEncryption and StopDeliveryStreamEncryption. If this * status is ENABLING_FAILED or DISABLING_FAILED, it is the status of the most recent * attempt to enable or disable SSE, respectively. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link DeliveryStreamEncryptionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #statusAsString}. *

* * @return This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the * different values of this status, see StartDeliveryStreamEncryption and * StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or * DISABLING_FAILED, it is the status of the most recent attempt to enable or disable SSE, * respectively. * @see DeliveryStreamEncryptionStatus */ public final DeliveryStreamEncryptionStatus status() { return DeliveryStreamEncryptionStatus.fromValue(status); } /** *

* This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the different * values of this status, see StartDeliveryStreamEncryption and StopDeliveryStreamEncryption. If this * status is ENABLING_FAILED or DISABLING_FAILED, it is the status of the most recent * attempt to enable or disable SSE, respectively. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link DeliveryStreamEncryptionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #statusAsString}. *

* * @return This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the * different values of this status, see StartDeliveryStreamEncryption and * StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or * DISABLING_FAILED, it is the status of the most recent attempt to enable or disable SSE, * respectively. * @see DeliveryStreamEncryptionStatus */ public final String statusAsString() { return status; } /** *

* Provides details in case one of the following operations fails due to an error related to KMS: * CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, * StopDeliveryStreamEncryption. *

* * @return Provides details in case one of the following operations fails due to an error related to KMS: * CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, * StopDeliveryStreamEncryption. */ public final FailureDescription failureDescription() { return failureDescription; } @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(keyARN()); hashCode = 31 * hashCode + Objects.hashCode(keyTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(failureDescription()); 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 DeliveryStreamEncryptionConfiguration)) { return false; } DeliveryStreamEncryptionConfiguration other = (DeliveryStreamEncryptionConfiguration) obj; return Objects.equals(keyARN(), other.keyARN()) && Objects.equals(keyTypeAsString(), other.keyTypeAsString()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(failureDescription(), other.failureDescription()); } /** * 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("DeliveryStreamEncryptionConfiguration").add("KeyARN", keyARN()) .add("KeyType", keyTypeAsString()).add("Status", statusAsString()) .add("FailureDescription", failureDescription()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "KeyARN": return Optional.ofNullable(clazz.cast(keyARN())); case "KeyType": return Optional.ofNullable(clazz.cast(keyTypeAsString())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "FailureDescription": return Optional.ofNullable(clazz.cast(failureDescription())); 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("KeyARN", KEY_ARN_FIELD); map.put("KeyType", KEY_TYPE_FIELD); map.put("Status", STATUS_FIELD); map.put("FailureDescription", FAILURE_DESCRIPTION_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((DeliveryStreamEncryptionConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* If KeyType is CUSTOMER_MANAGED_CMK, this field contains the ARN of the customer * managed CMK. If KeyType is Amazon Web Services_OWNED_CMK, * DeliveryStreamEncryptionConfiguration doesn't contain a value for KeyARN. *

* * @param keyARN * If KeyType is CUSTOMER_MANAGED_CMK, this field contains the ARN of the * customer managed CMK. If KeyType is Amazon Web Services_OWNED_CMK, * DeliveryStreamEncryptionConfiguration doesn't contain a value for KeyARN. * @return Returns a reference to this object so that method calls can be chained together. */ Builder keyARN(String keyARN); /** *

* Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master Keys * (CMKs). *

* * @param keyType * Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master * Keys (CMKs). * @see KeyType * @return Returns a reference to this object so that method calls can be chained together. * @see KeyType */ Builder keyType(String keyType); /** *

* Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master Keys * (CMKs). *

* * @param keyType * Indicates the type of customer master key (CMK) that is used for encryption. The default setting is * Amazon Web Services_OWNED_CMK. For more information about CMKs, see Customer Master * Keys (CMKs). * @see KeyType * @return Returns a reference to this object so that method calls can be chained together. * @see KeyType */ Builder keyType(KeyType keyType); /** *

* This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the * different values of this status, see StartDeliveryStreamEncryption and * StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or * DISABLING_FAILED, it is the status of the most recent attempt to enable or disable SSE, * respectively. *

* * @param status * This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the * different values of this status, see StartDeliveryStreamEncryption and * StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or * DISABLING_FAILED, it is the status of the most recent attempt to enable or disable SSE, * respectively. * @see DeliveryStreamEncryptionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DeliveryStreamEncryptionStatus */ Builder status(String status); /** *

* This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the * different values of this status, see StartDeliveryStreamEncryption and * StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or * DISABLING_FAILED, it is the status of the most recent attempt to enable or disable SSE, * respectively. *

* * @param status * This is the server-side encryption (SSE) status for the Firehose stream. For a full description of the * different values of this status, see StartDeliveryStreamEncryption and * StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or * DISABLING_FAILED, it is the status of the most recent attempt to enable or disable SSE, * respectively. * @see DeliveryStreamEncryptionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see DeliveryStreamEncryptionStatus */ Builder status(DeliveryStreamEncryptionStatus status); /** *

* Provides details in case one of the following operations fails due to an error related to KMS: * CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, * StopDeliveryStreamEncryption. *

* * @param failureDescription * Provides details in case one of the following operations fails due to an error related to KMS: * CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, * StopDeliveryStreamEncryption. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureDescription(FailureDescription failureDescription); /** *

* Provides details in case one of the following operations fails due to an error related to KMS: * CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, * StopDeliveryStreamEncryption. *

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

* When the {@link Consumer} completes, {@link FailureDescription.Builder#build()} is called immediately and its * result is passed to {@link #failureDescription(FailureDescription)}. * * @param failureDescription * a consumer that will call methods on {@link FailureDescription.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #failureDescription(FailureDescription) */ default Builder failureDescription(Consumer failureDescription) { return failureDescription(FailureDescription.builder().applyMutation(failureDescription).build()); } } static final class BuilderImpl implements Builder { private String keyARN; private String keyType; private String status; private FailureDescription failureDescription; private BuilderImpl() { } private BuilderImpl(DeliveryStreamEncryptionConfiguration model) { keyARN(model.keyARN); keyType(model.keyType); status(model.status); failureDescription(model.failureDescription); } public final String getKeyARN() { return keyARN; } public final void setKeyARN(String keyARN) { this.keyARN = keyARN; } @Override public final Builder keyARN(String keyARN) { this.keyARN = keyARN; return this; } public final String getKeyType() { return keyType; } public final void setKeyType(String keyType) { this.keyType = keyType; } @Override public final Builder keyType(String keyType) { this.keyType = keyType; return this; } @Override public final Builder keyType(KeyType keyType) { this.keyType(keyType == null ? null : keyType.toString()); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(DeliveryStreamEncryptionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final FailureDescription.Builder getFailureDescription() { return failureDescription != null ? failureDescription.toBuilder() : null; } public final void setFailureDescription(FailureDescription.BuilderImpl failureDescription) { this.failureDescription = failureDescription != null ? failureDescription.build() : null; } @Override public final Builder failureDescription(FailureDescription failureDescription) { this.failureDescription = failureDescription; return this; } @Override public DeliveryStreamEncryptionConfiguration build() { return new DeliveryStreamEncryptionConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy