/* * Copyright 2018-2023 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 com.amazonaws.services.kinesisvideo.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateStreamRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the device that is writing to the stream. *

* *

* In the current implementation, Kinesis Video Streams does not use this name. *

*
*/ private String deviceName; /** *

* A name for the stream that you are creating. *

*

* The stream name is an identifier for the stream, and must be unique for each account and region. *

*/ private String streamName; /** *

* The media type of the stream. Consumers of the stream can use this information when processing the stream. For * more information about media types, see Media Types. If you choose to specify * the MediaType, see Naming Requirements * for guidelines. *

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). *

*/ private String mediaType; /** *

* The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt stream data. *

*

* If no key ID is specified, the default, Kinesis Video-managed key (Amazon Web Services/kinesisvideo) * is used. *

*

* For more information, see DescribeKey. *

*/ private String kmsKeyId; /** *

* The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data in a * data store that is associated with the stream. *

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that remain in * the service host buffer, which has a retention time limit of 5 minutes and a retention memory limit of 200 MB. * Fragments are removed from the buffer when either limit is reached. *

*/ private Integer dataRetentionInHours; /** *

* A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional). *

*/ private java.util.Map tags; /** *

* The name of the device that is writing to the stream. *

* *

* In the current implementation, Kinesis Video Streams does not use this name. *

*
* * @param deviceName * The name of the device that is writing to the stream.

*

* In the current implementation, Kinesis Video Streams does not use this name. *

*/ public void setDeviceName(String deviceName) { this.deviceName = deviceName; } /** *

* The name of the device that is writing to the stream. *

* *

* In the current implementation, Kinesis Video Streams does not use this name. *

*
* * @return The name of the device that is writing to the stream.

*

* In the current implementation, Kinesis Video Streams does not use this name. *

*/ public String getDeviceName() { return this.deviceName; } /** *

* The name of the device that is writing to the stream. *

* *

* In the current implementation, Kinesis Video Streams does not use this name. *

*
* * @param deviceName * The name of the device that is writing to the stream.

*

* In the current implementation, Kinesis Video Streams does not use this name. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest withDeviceName(String deviceName) { setDeviceName(deviceName); return this; } /** *

* A name for the stream that you are creating. *

*

* The stream name is an identifier for the stream, and must be unique for each account and region. *

* * @param streamName * A name for the stream that you are creating.

*

* The stream name is an identifier for the stream, and must be unique for each account and region. */ public void setStreamName(String streamName) { this.streamName = streamName; } /** *

* A name for the stream that you are creating. *

*

* The stream name is an identifier for the stream, and must be unique for each account and region. *

* * @return A name for the stream that you are creating.

*

* The stream name is an identifier for the stream, and must be unique for each account and region. */ public String getStreamName() { return this.streamName; } /** *

* A name for the stream that you are creating. *

*

* The stream name is an identifier for the stream, and must be unique for each account and region. *

* * @param streamName * A name for the stream that you are creating.

*

* The stream name is an identifier for the stream, and must be unique for each account and region. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest withStreamName(String streamName) { setStreamName(streamName); return this; } /** *

* The media type of the stream. Consumers of the stream can use this information when processing the stream. For * more information about media types, see Media Types. If you choose to specify * the MediaType, see Naming Requirements * for guidelines. *

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). *

* * @param mediaType * The media type of the stream. Consumers of the stream can use this information when processing the stream. * For more information about media types, see Media Types. If you choose to * specify the MediaType, see Naming * Requirements for guidelines.

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). */ public void setMediaType(String mediaType) { this.mediaType = mediaType; } /** *

* The media type of the stream. Consumers of the stream can use this information when processing the stream. For * more information about media types, see Media Types. If you choose to specify * the MediaType, see Naming Requirements * for guidelines. *

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). *

* * @return The media type of the stream. Consumers of the stream can use this information when processing the * stream. For more information about media types, see Media Types. If you choose to * specify the MediaType, see Naming * Requirements for guidelines.

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). */ public String getMediaType() { return this.mediaType; } /** *

* The media type of the stream. Consumers of the stream can use this information when processing the stream. For * more information about media types, see Media Types. If you choose to specify * the MediaType, see Naming Requirements * for guidelines. *

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). *

* * @param mediaType * The media type of the stream. Consumers of the stream can use this information when processing the stream. * For more information about media types, see Media Types. If you choose to * specify the MediaType, see Naming * Requirements for guidelines.

*

* Example valid values include "video/h264" and "video/h264,audio/aac". *

*

* This parameter is optional; the default value is null (or empty in JSON). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest withMediaType(String mediaType) { setMediaType(mediaType); return this; } /** *

* The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt stream data. *

*

* If no key ID is specified, the default, Kinesis Video-managed key (Amazon Web Services/kinesisvideo) * is used. *

*

* For more information, see DescribeKey. *

* * @param kmsKeyId * The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt * stream data.

*

* If no key ID is specified, the default, Kinesis Video-managed key ( * Amazon Web Services/kinesisvideo) is used. *

*

* For more information, see DescribeKey. */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** *

* The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt stream data. *

*

* If no key ID is specified, the default, Kinesis Video-managed key (Amazon Web Services/kinesisvideo) * is used. *

*

* For more information, see DescribeKey. *

* * @return The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt * stream data.

*

* If no key ID is specified, the default, Kinesis Video-managed key ( * Amazon Web Services/kinesisvideo) is used. *

*

* For more information, see DescribeKey. */ public String getKmsKeyId() { return this.kmsKeyId; } /** *

* The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt stream data. *

*

* If no key ID is specified, the default, Kinesis Video-managed key (Amazon Web Services/kinesisvideo) * is used. *

*

* For more information, see DescribeKey. *

* * @param kmsKeyId * The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt * stream data.

*

* If no key ID is specified, the default, Kinesis Video-managed key ( * Amazon Web Services/kinesisvideo) is used. *

*

* For more information, see DescribeKey. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** *

* The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data in a * data store that is associated with the stream. *

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that remain in * the service host buffer, which has a retention time limit of 5 minutes and a retention memory limit of 200 MB. * Fragments are removed from the buffer when either limit is reached. *

* * @param dataRetentionInHours * The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data * in a data store that is associated with the stream.

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that * remain in the service host buffer, which has a retention time limit of 5 minutes and a retention memory * limit of 200 MB. Fragments are removed from the buffer when either limit is reached. */ public void setDataRetentionInHours(Integer dataRetentionInHours) { this.dataRetentionInHours = dataRetentionInHours; } /** *

* The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data in a * data store that is associated with the stream. *

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that remain in * the service host buffer, which has a retention time limit of 5 minutes and a retention memory limit of 200 MB. * Fragments are removed from the buffer when either limit is reached. *

* * @return The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the * data in a data store that is associated with the stream.

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that * remain in the service host buffer, which has a retention time limit of 5 minutes and a retention memory * limit of 200 MB. Fragments are removed from the buffer when either limit is reached. */ public Integer getDataRetentionInHours() { return this.dataRetentionInHours; } /** *

* The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data in a * data store that is associated with the stream. *

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that remain in * the service host buffer, which has a retention time limit of 5 minutes and a retention memory limit of 200 MB. * Fragments are removed from the buffer when either limit is reached. *

* * @param dataRetentionInHours * The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data * in a data store that is associated with the stream.

*

* The default value is 0, indicating that the stream does not persist data. *

*

* When the DataRetentionInHours value is 0, consumers can still consume the fragments that * remain in the service host buffer, which has a retention time limit of 5 minutes and a retention memory * limit of 200 MB. Fragments are removed from the buffer when either limit is reached. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest withDataRetentionInHours(Integer dataRetentionInHours) { setDataRetentionInHours(dataRetentionInHours); return this; } /** *

* A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional). *

* * @return A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is * optional). */ public java.util.Map getTags() { return tags; } /** *

* A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional). *

* * @param tags * A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is * optional). */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional). *

* * @param tags * A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is * optional). * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see CreateStreamRequest#withTags * @returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStreamRequest clearTagsEntries() { this.tags = null; return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDeviceName() != null) sb.append("DeviceName: ").append(getDeviceName()).append(","); if (getStreamName() != null) sb.append("StreamName: ").append(getStreamName()).append(","); if (getMediaType() != null) sb.append("MediaType: ").append(getMediaType()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()).append(","); if (getDataRetentionInHours() != null) sb.append("DataRetentionInHours: ").append(getDataRetentionInHours()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateStreamRequest == false) return false; CreateStreamRequest other = (CreateStreamRequest) obj; if (other.getDeviceName() == null ^ this.getDeviceName() == null) return false; if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == false) return false; if (other.getStreamName() == null ^ this.getStreamName() == null) return false; if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == false) return false; if (other.getMediaType() == null ^ this.getMediaType() == null) return false; if (other.getMediaType() != null && other.getMediaType().equals(this.getMediaType()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; if (other.getDataRetentionInHours() == null ^ this.getDataRetentionInHours() == null) return false; if (other.getDataRetentionInHours() != null && other.getDataRetentionInHours().equals(this.getDataRetentionInHours()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); hashCode = prime * hashCode + ((getStreamName() == null) ? 0 : getStreamName().hashCode()); hashCode = prime * hashCode + ((getMediaType() == null) ? 0 : getMediaType().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getDataRetentionInHours() == null) ? 0 : getDataRetentionInHours().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public CreateStreamRequest clone() { return (CreateStreamRequest) super.clone(); } }