/* * Copyright 2010-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 com.amazonaws.AmazonWebServiceRequest; /** *

* Creates a new Kinesis video stream. *

*

* When you create a new stream, Kinesis Video Streams assigns it a version * number. When you change the stream's metadata, Kinesis Video Streams updates * the version. *

*

* CreateStream is an asynchronous operation. *

*

* For information about how the service works, see How it Works. *

*

* You must have permissions for the KinesisVideo:CreateStream * action. *

*/ public class CreateStreamRequest extends AmazonWebServiceRequest implements Serializable { /** *

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

* *

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

*
*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.-]+
*/ 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. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
*/ 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). *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
*/ 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. *

*

* Constraints:
* Length: 1 - 2048
* Pattern: .+
*/ 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. *

*

* Constraints:
* Range: 0 -
*/ 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 = new java.util.HashMap(); /** *

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

* *

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

*
*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.-]+
* * @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 deviceName; } /** *

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

* *

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

*
*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.-]+
* * @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. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_.-]+
* * @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 A reference to this updated object so that method calls can be * chained together. */ public CreateStreamRequest withDeviceName(String deviceName) { this.deviceName = 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. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @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 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. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @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. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 256
* Pattern: [a-zA-Z0-9_.-]+
* * @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 A reference to this updated object so that method calls can be * chained together. */ public CreateStreamRequest withStreamName(String streamName) { this.streamName = 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). *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
* * @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 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). *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
* * @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). *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
* * @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 A reference to this updated object so that method calls can be * chained together. */ public CreateStreamRequest withMediaType(String mediaType) { this.mediaType = 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. *

*

* Constraints:
* Length: 1 - 2048
* Pattern: .+
* * @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 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. *

*

* Constraints:
* Length: 1 - 2048
* Pattern: .+
* * @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. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 2048
* Pattern: .+
* * @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 A reference to this updated object so that method calls can be * chained together. */ public CreateStreamRequest withKmsKeyId(String kmsKeyId) { this.kmsKeyId = 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. *

*

* Constraints:
* Range: 0 -
* * @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 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. *

*

* Constraints:
* Range: 0 -
* * @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. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0 -
* * @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 A reference to this updated object so that method calls can be * chained together. */ public CreateStreamRequest withDataRetentionInHours(Integer dataRetentionInHours) { this.dataRetentionInHours = 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). *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param tags

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

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateStreamRequest withTags(java.util.Map tags) { this.tags = tags; return this; } /** *

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

*

* The method adds a new key-value pair into Tags parameter, and returns a * reference to this object so that method calls can be chained together. * * @param key The key of the entry to be added into Tags. * @param value The corresponding value of the entry to be added into Tags. * @return A reference to this updated 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. *

* 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; useful for testing and * debugging. * * @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: " + getDeviceName() + ","); if (getStreamName() != null) sb.append("StreamName: " + getStreamName() + ","); if (getMediaType() != null) sb.append("MediaType: " + getMediaType() + ","); if (getKmsKeyId() != null) sb.append("KmsKeyId: " + getKmsKeyId() + ","); if (getDataRetentionInHours() != null) sb.append("DataRetentionInHours: " + getDataRetentionInHours() + ","); if (getTags() != null) sb.append("Tags: " + getTags()); sb.append("}"); return sb.toString(); } @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 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; } }