/* * 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; /** *

* Updates stream metadata, such as the device name and media type. *

*

* You must provide the stream name or the Amazon Resource Name (ARN) of the * stream. *

*

* To make sure that you have the latest version of the stream before updating * it, you can specify the stream version. Kinesis Video Streams assigns a * version to each stream. When you update a stream, Kinesis Video Streams * assigns a new version number. To get the latest stream version, use the * DescribeStream API. *

*

* UpdateStream is an asynchronous operation, and takes time to * complete. *

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

* The name of the stream whose metadata you want to update. *

*

* 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 ARN of the stream whose metadata you want to update. *

*

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:[a-z\d-]+:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA- * Z0-9_.-]+/[0-9]+
*/ private String streamARN; /** *

* The version of the stream whose metadata you want to update. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9]+
*/ private String currentVersion; /** *

* 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; /** *

* The stream's media type. Use MediaType to specify the type * of content that the stream contains to the consumers of the stream. For * more information about media types, see Media Types. If you choose to specify the MediaType, * see Naming * Requirements. *

*

* To play video on the console, you must specify the correct video type. * For example, if the video in the stream is H.264, specify * video/h264 as the MediaType. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
*/ private String mediaType; /** *

* The name of the stream whose metadata you want to update. *

*

* 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

* The name of the stream whose metadata you want to update. *

*

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

*/ public String getStreamName() { return streamName; } /** *

* The name of the stream whose metadata you want to update. *

*

* 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

* The name of the stream whose metadata you want to update. *

*

* 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; } /** *

* The name of the stream whose metadata you want to update. *

*

* 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

* The name of the stream whose metadata you want to update. *

*

* 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 UpdateStreamRequest withStreamName(String streamName) { this.streamName = streamName; return this; } /** *

* The ARN of the stream whose metadata you want to update. *

*

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:[a-z\d-]+:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA- * Z0-9_.-]+/[0-9]+
* * @return

* The ARN of the stream whose metadata you want to update. *

*/ public String getStreamARN() { return streamARN; } /** *

* The ARN of the stream whose metadata you want to update. *

*

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:[a-z\d-]+:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA- * Z0-9_.-]+/[0-9]+
* * @param streamARN

* The ARN of the stream whose metadata you want to update. *

*/ public void setStreamARN(String streamARN) { this.streamARN = streamARN; } /** *

* The ARN of the stream whose metadata you want to update. *

*

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

* Constraints:
* Length: 1 - 1024
* Pattern: * arn:[a-z\d-]+:kinesisvideo:[a-z0-9-]+:[0-9]+:[a-z]+/[a-zA- * Z0-9_.-]+/[0-9]+
* * @param streamARN

* The ARN of the stream whose metadata you want to update. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateStreamRequest withStreamARN(String streamARN) { this.streamARN = streamARN; return this; } /** *

* The version of the stream whose metadata you want to update. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9]+
* * @return

* The version of the stream whose metadata you want to update. *

*/ public String getCurrentVersion() { return currentVersion; } /** *

* The version of the stream whose metadata you want to update. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9]+
* * @param currentVersion

* The version of the stream whose metadata you want to update. *

*/ public void setCurrentVersion(String currentVersion) { this.currentVersion = currentVersion; } /** *

* The version of the stream whose metadata you want to update. *

*

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

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9]+
* * @param currentVersion

* The version of the stream whose metadata you want to update. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateStreamRequest withCurrentVersion(String currentVersion) { this.currentVersion = currentVersion; return this; } /** *

* 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 UpdateStreamRequest withDeviceName(String deviceName) { this.deviceName = deviceName; return this; } /** *

* The stream's media type. Use MediaType to specify the type * of content that the stream contains to the consumers of the stream. For * more information about media types, see Media Types. If you choose to specify the MediaType, * see Naming * Requirements. *

*

* To play video on the console, you must specify the correct video type. * For example, if the video in the stream is H.264, specify * video/h264 as the MediaType. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
* * @return

* The stream's media type. Use MediaType to specify * the type of content that the stream contains to the consumers of * the stream. For more information about media types, see Media Types. If you choose to specify the * MediaType, see Naming * Requirements. *

*

* To play video on the console, you must specify the correct video * type. For example, if the video in the stream is H.264, specify * video/h264 as the MediaType. *

*/ public String getMediaType() { return mediaType; } /** *

* The stream's media type. Use MediaType to specify the type * of content that the stream contains to the consumers of the stream. For * more information about media types, see Media Types. If you choose to specify the MediaType, * see Naming * Requirements. *

*

* To play video on the console, you must specify the correct video type. * For example, if the video in the stream is H.264, specify * video/h264 as the MediaType. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [\w\-\.\+]+/[\w\-\.\+]+(,[\w\-\.\+]+/[\w\-\.\+]+)*
* * @param mediaType

* The stream's media type. Use MediaType to specify * the type of content that the stream contains to the consumers * of the stream. For more information about media types, see Media Types. If you choose to specify the * MediaType, see Naming * Requirements. *

*

* To play video on the console, you must specify the correct * video type. For example, if the video in the stream is H.264, * specify video/h264 as the MediaType. *

*/ public void setMediaType(String mediaType) { this.mediaType = mediaType; } /** *

* The stream's media type. Use MediaType to specify the type * of content that the stream contains to the consumers of the stream. For * more information about media types, see Media Types. If you choose to specify the MediaType, * see Naming * Requirements. *

*

* To play video on the console, you must specify the correct video type. * For example, if the video in the stream is H.264, specify * video/h264 as the MediaType. *

*

* 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 stream's media type. Use MediaType to specify * the type of content that the stream contains to the consumers * of the stream. For more information about media types, see Media Types. If you choose to specify the * MediaType, see Naming * Requirements. *

*

* To play video on the console, you must specify the correct * video type. For example, if the video in the stream is H.264, * specify video/h264 as the MediaType. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateStreamRequest withMediaType(String mediaType) { this.mediaType = mediaType; 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 (getStreamName() != null) sb.append("StreamName: " + getStreamName() + ","); if (getStreamARN() != null) sb.append("StreamARN: " + getStreamARN() + ","); if (getCurrentVersion() != null) sb.append("CurrentVersion: " + getCurrentVersion() + ","); if (getDeviceName() != null) sb.append("DeviceName: " + getDeviceName() + ","); if (getMediaType() != null) sb.append("MediaType: " + getMediaType()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamName() == null) ? 0 : getStreamName().hashCode()); hashCode = prime * hashCode + ((getStreamARN() == null) ? 0 : getStreamARN().hashCode()); hashCode = prime * hashCode + ((getCurrentVersion() == null) ? 0 : getCurrentVersion().hashCode()); hashCode = prime * hashCode + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); hashCode = prime * hashCode + ((getMediaType() == null) ? 0 : getMediaType().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateStreamRequest == false) return false; UpdateStreamRequest other = (UpdateStreamRequest) obj; if (other.getStreamName() == null ^ this.getStreamName() == null) return false; if (other.getStreamName() != null && other.getStreamName().equals(this.getStreamName()) == false) return false; if (other.getStreamARN() == null ^ this.getStreamARN() == null) return false; if (other.getStreamARN() != null && other.getStreamARN().equals(this.getStreamARN()) == false) return false; if (other.getCurrentVersion() == null ^ this.getCurrentVersion() == null) return false; if (other.getCurrentVersion() != null && other.getCurrentVersion().equals(this.getCurrentVersion()) == false) return false; if (other.getDeviceName() == null ^ this.getDeviceName() == null) return false; if (other.getDeviceName() != null && other.getDeviceName().equals(this.getDeviceName()) == false) return false; if (other.getMediaType() == null ^ this.getMediaType() == null) return false; if (other.getMediaType() != null && other.getMediaType().equals(this.getMediaType()) == false) return false; return true; } }