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

software.amazon.awssdk.services.kinesisvideo.model.UpdateDataRetentionRequest Maven / Gradle / Ivy

/*
 * 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.kinesisvideo.model;

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.awscore.AwsRequestOverrideConfiguration;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateDataRetentionRequest extends KinesisVideoRequest implements
        ToCopyableBuilder {
    private static final SdkField STREAM_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("StreamName").getter(getter(UpdateDataRetentionRequest::streamName)).setter(setter(Builder::streamName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamName").build()).build();

    private static final SdkField STREAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("StreamARN").getter(getter(UpdateDataRetentionRequest::streamARN)).setter(setter(Builder::streamARN))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamARN").build()).build();

    private static final SdkField CURRENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("CurrentVersion").getter(getter(UpdateDataRetentionRequest::currentVersion))
            .setter(setter(Builder::currentVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentVersion").build()).build();

    private static final SdkField OPERATION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Operation").getter(getter(UpdateDataRetentionRequest::operationAsString))
            .setter(setter(Builder::operation))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Operation").build()).build();

    private static final SdkField DATA_RETENTION_CHANGE_IN_HOURS_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("DataRetentionChangeInHours")
            .getter(getter(UpdateDataRetentionRequest::dataRetentionChangeInHours))
            .setter(setter(Builder::dataRetentionChangeInHours))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataRetentionChangeInHours").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STREAM_NAME_FIELD,
            STREAM_ARN_FIELD, CURRENT_VERSION_FIELD, OPERATION_FIELD, DATA_RETENTION_CHANGE_IN_HOURS_FIELD));

    private final String streamName;

    private final String streamARN;

    private final String currentVersion;

    private final String operation;

    private final Integer dataRetentionChangeInHours;

    private UpdateDataRetentionRequest(BuilderImpl builder) {
        super(builder);
        this.streamName = builder.streamName;
        this.streamARN = builder.streamARN;
        this.currentVersion = builder.currentVersion;
        this.operation = builder.operation;
        this.dataRetentionChangeInHours = builder.dataRetentionChangeInHours;
    }

    /**
     * 

* The name of the stream whose retention period you want to change. *

* * @return The name of the stream whose retention period you want to change. */ public final String streamName() { return streamName; } /** *

* The Amazon Resource Name (ARN) of the stream whose retention period you want to change. *

* * @return The Amazon Resource Name (ARN) of the stream whose retention period you want to change. */ public final String streamARN() { return streamARN; } /** *

* The version of the stream whose retention period you want to change. To get the version, call either the * DescribeStream or the ListStreams API. *

* * @return The version of the stream whose retention period you want to change. To get the version, call either the * DescribeStream or the ListStreams API. */ public final String currentVersion() { return currentVersion; } /** *

* Indicates whether you want to increase or decrease the retention period. *

*

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

* * @return Indicates whether you want to increase or decrease the retention period. * @see UpdateDataRetentionOperation */ public final UpdateDataRetentionOperation operation() { return UpdateDataRetentionOperation.fromValue(operation); } /** *

* Indicates whether you want to increase or decrease the retention period. *

*

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

* * @return Indicates whether you want to increase or decrease the retention period. * @see UpdateDataRetentionOperation */ public final String operationAsString() { return operation; } /** *

* The retention period, in hours. The value you specify replaces the current value. The maximum value for this * parameter is 87600 (ten years). *

* * @return The retention period, in hours. The value you specify replaces the current value. The maximum value for * this parameter is 87600 (ten years). */ public final Integer dataRetentionChangeInHours() { return dataRetentionChangeInHours; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(streamName()); hashCode = 31 * hashCode + Objects.hashCode(streamARN()); hashCode = 31 * hashCode + Objects.hashCode(currentVersion()); hashCode = 31 * hashCode + Objects.hashCode(operationAsString()); hashCode = 31 * hashCode + Objects.hashCode(dataRetentionChangeInHours()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateDataRetentionRequest)) { return false; } UpdateDataRetentionRequest other = (UpdateDataRetentionRequest) obj; return Objects.equals(streamName(), other.streamName()) && Objects.equals(streamARN(), other.streamARN()) && Objects.equals(currentVersion(), other.currentVersion()) && Objects.equals(operationAsString(), other.operationAsString()) && Objects.equals(dataRetentionChangeInHours(), other.dataRetentionChangeInHours()); } /** * 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("UpdateDataRetentionRequest").add("StreamName", streamName()).add("StreamARN", streamARN()) .add("CurrentVersion", currentVersion()).add("Operation", operationAsString()) .add("DataRetentionChangeInHours", dataRetentionChangeInHours()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "StreamName": return Optional.ofNullable(clazz.cast(streamName())); case "StreamARN": return Optional.ofNullable(clazz.cast(streamARN())); case "CurrentVersion": return Optional.ofNullable(clazz.cast(currentVersion())); case "Operation": return Optional.ofNullable(clazz.cast(operationAsString())); case "DataRetentionChangeInHours": return Optional.ofNullable(clazz.cast(dataRetentionChangeInHours())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateDataRetentionRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends KinesisVideoRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the stream whose retention period you want to change. *

* * @param streamName * The name of the stream whose retention period you want to change. * @return Returns a reference to this object so that method calls can be chained together. */ Builder streamName(String streamName); /** *

* The Amazon Resource Name (ARN) of the stream whose retention period you want to change. *

* * @param streamARN * The Amazon Resource Name (ARN) of the stream whose retention period you want to change. * @return Returns a reference to this object so that method calls can be chained together. */ Builder streamARN(String streamARN); /** *

* The version of the stream whose retention period you want to change. To get the version, call either the * DescribeStream or the ListStreams API. *

* * @param currentVersion * The version of the stream whose retention period you want to change. To get the version, call either * the DescribeStream or the ListStreams API. * @return Returns a reference to this object so that method calls can be chained together. */ Builder currentVersion(String currentVersion); /** *

* Indicates whether you want to increase or decrease the retention period. *

* * @param operation * Indicates whether you want to increase or decrease the retention period. * @see UpdateDataRetentionOperation * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateDataRetentionOperation */ Builder operation(String operation); /** *

* Indicates whether you want to increase or decrease the retention period. *

* * @param operation * Indicates whether you want to increase or decrease the retention period. * @see UpdateDataRetentionOperation * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateDataRetentionOperation */ Builder operation(UpdateDataRetentionOperation operation); /** *

* The retention period, in hours. The value you specify replaces the current value. The maximum value for this * parameter is 87600 (ten years). *

* * @param dataRetentionChangeInHours * The retention period, in hours. The value you specify replaces the current value. The maximum value * for this parameter is 87600 (ten years). * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataRetentionChangeInHours(Integer dataRetentionChangeInHours); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends KinesisVideoRequest.BuilderImpl implements Builder { private String streamName; private String streamARN; private String currentVersion; private String operation; private Integer dataRetentionChangeInHours; private BuilderImpl() { } private BuilderImpl(UpdateDataRetentionRequest model) { super(model); streamName(model.streamName); streamARN(model.streamARN); currentVersion(model.currentVersion); operation(model.operation); dataRetentionChangeInHours(model.dataRetentionChangeInHours); } public final String getStreamName() { return streamName; } @Override public final Builder streamName(String streamName) { this.streamName = streamName; return this; } public final void setStreamName(String streamName) { this.streamName = streamName; } public final String getStreamARN() { return streamARN; } @Override public final Builder streamARN(String streamARN) { this.streamARN = streamARN; return this; } public final void setStreamARN(String streamARN) { this.streamARN = streamARN; } public final String getCurrentVersion() { return currentVersion; } @Override public final Builder currentVersion(String currentVersion) { this.currentVersion = currentVersion; return this; } public final void setCurrentVersion(String currentVersion) { this.currentVersion = currentVersion; } public final String getOperation() { return operation; } @Override public final Builder operation(String operation) { this.operation = operation; return this; } @Override public final Builder operation(UpdateDataRetentionOperation operation) { this.operation(operation == null ? null : operation.toString()); return this; } public final void setOperation(String operation) { this.operation = operation; } public final Integer getDataRetentionChangeInHours() { return dataRetentionChangeInHours; } @Override public final Builder dataRetentionChangeInHours(Integer dataRetentionChangeInHours) { this.dataRetentionChangeInHours = dataRetentionChangeInHours; return this; } public final void setDataRetentionChangeInHours(Integer dataRetentionChangeInHours) { this.dataRetentionChangeInHours = dataRetentionChangeInHours; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateDataRetentionRequest build() { return new UpdateDataRetentionRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy