/* * 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 PutMediaRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* You pass this value as the x-amzn-stream-name HTTP header. *

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. *

*/ private String streamName; /** *

* You pass this value as the x-amzn-stream-arn HTTP header. *

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you don't * specify the streamARN, you must specify the streamName. *

*/ private String streamARN; /** *

* You pass this value as the x-amzn-fragment-timecode-type HTTP header. *

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API overview. *

*/ private String fragmentTimecodeType; /** *

* You pass this value as the x-amzn-producer-start-timestamp HTTP header. *

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of the * specific fragments in the request). *

*/ private java.util.Date producerStartTimestamp; /** *

* The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video Streams * supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain one or more * clusters. *

* *

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the * fragment duration. *

*
*/ private java.io.InputStream payload; /** *

* You pass this value as the x-amzn-stream-name HTTP header. *

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. *

* * @param streamName * You pass this value as the x-amzn-stream-name HTTP header.

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. */ public void setStreamName(String streamName) { this.streamName = streamName; } /** *

* You pass this value as the x-amzn-stream-name HTTP header. *

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. *

* * @return You pass this value as the x-amzn-stream-name HTTP header.

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. */ public String getStreamName() { return this.streamName; } /** *

* You pass this value as the x-amzn-stream-name HTTP header. *

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. *

* * @param streamName * You pass this value as the x-amzn-stream-name HTTP header.

*

* Name of the Kinesis video stream where you want to write the media content. If you don't specify the * streamName, you must specify the streamARN. * @return Returns a reference to this object so that method calls can be chained together. */ public PutMediaRequest withStreamName(String streamName) { setStreamName(streamName); return this; } /** *

* You pass this value as the x-amzn-stream-arn HTTP header. *

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you don't * specify the streamARN, you must specify the streamName. *

* * @param streamARN * You pass this value as the x-amzn-stream-arn HTTP header.

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you * don't specify the streamARN, you must specify the streamName. */ public void setStreamARN(String streamARN) { this.streamARN = streamARN; } /** *

* You pass this value as the x-amzn-stream-arn HTTP header. *

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you don't * specify the streamARN, you must specify the streamName. *

* * @return You pass this value as the x-amzn-stream-arn HTTP header.

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you * don't specify the streamARN, you must specify the streamName. */ public String getStreamARN() { return this.streamARN; } /** *

* You pass this value as the x-amzn-stream-arn HTTP header. *

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you don't * specify the streamARN, you must specify the streamName. *

* * @param streamARN * You pass this value as the x-amzn-stream-arn HTTP header.

*

* Amazon Resource Name (ARN) of the Kinesis video stream where you want to write the media content. If you * don't specify the streamARN, you must specify the streamName. * @return Returns a reference to this object so that method calls can be chained together. */ public PutMediaRequest withStreamARN(String streamARN) { setStreamARN(streamARN); return this; } /** *

* You pass this value as the x-amzn-fragment-timecode-type HTTP header. *

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API overview. *

* * @param fragmentTimecodeType * You pass this value as the x-amzn-fragment-timecode-type HTTP header.

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API * overview. * @see FragmentTimecodeType */ public void setFragmentTimecodeType(String fragmentTimecodeType) { this.fragmentTimecodeType = fragmentTimecodeType; } /** *

* You pass this value as the x-amzn-fragment-timecode-type HTTP header. *

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API overview. *

* * @return You pass this value as the x-amzn-fragment-timecode-type HTTP header.

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API * overview. * @see FragmentTimecodeType */ public String getFragmentTimecodeType() { return this.fragmentTimecodeType; } /** *

* You pass this value as the x-amzn-fragment-timecode-type HTTP header. *

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API overview. *

* * @param fragmentTimecodeType * You pass this value as the x-amzn-fragment-timecode-type HTTP header.

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API * overview. * @return Returns a reference to this object so that method calls can be chained together. * @see FragmentTimecodeType */ public PutMediaRequest withFragmentTimecodeType(String fragmentTimecodeType) { setFragmentTimecodeType(fragmentTimecodeType); return this; } /** *

* You pass this value as the x-amzn-fragment-timecode-type HTTP header. *

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API overview. *

* * @param fragmentTimecodeType * You pass this value as the x-amzn-fragment-timecode-type HTTP header.

*

* Indicates whether timecodes in the fragments (payload, HTTP request body) are absolute or relative to * producerStartTimestamp. Kinesis Video Streams uses this information to compute the * producer_timestamp for the fragment received in the request, as described in the API * overview. * @return Returns a reference to this object so that method calls can be chained together. * @see FragmentTimecodeType */ public PutMediaRequest withFragmentTimecodeType(FragmentTimecodeType fragmentTimecodeType) { this.fragmentTimecodeType = fragmentTimecodeType.toString(); return this; } /** *

* You pass this value as the x-amzn-producer-start-timestamp HTTP header. *

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of the * specific fragments in the request). *

* * @param producerStartTimestamp * You pass this value as the x-amzn-producer-start-timestamp HTTP header.

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of * the specific fragments in the request). */ public void setProducerStartTimestamp(java.util.Date producerStartTimestamp) { this.producerStartTimestamp = producerStartTimestamp; } /** *

* You pass this value as the x-amzn-producer-start-timestamp HTTP header. *

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of the * specific fragments in the request). *

* * @return You pass this value as the x-amzn-producer-start-timestamp HTTP header.

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of * the specific fragments in the request). */ public java.util.Date getProducerStartTimestamp() { return this.producerStartTimestamp; } /** *

* You pass this value as the x-amzn-producer-start-timestamp HTTP header. *

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of the * specific fragments in the request). *

* * @param producerStartTimestamp * You pass this value as the x-amzn-producer-start-timestamp HTTP header.

*

* This is the producer time stamp at which the producer started recording the media (not the time stamp of * the specific fragments in the request). * @return Returns a reference to this object so that method calls can be chained together. */ public PutMediaRequest withProducerStartTimestamp(java.util.Date producerStartTimestamp) { setProducerStartTimestamp(producerStartTimestamp); return this; } /** *

* The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video Streams * supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain one or more * clusters. *

* *

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the * fragment duration. *

*
* * @param payload * The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video * Streams supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain * one or more clusters.

*

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the * fragment duration. *

*/ public void setPayload(java.io.InputStream payload) { this.payload = payload; } /** *

* The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video Streams * supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain one or more * clusters. *

* *

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the * fragment duration. *

*
* * @return The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video * Streams supports only the Matroska (MKV) container format with a single MKV segment. A segment can * contain one or more clusters.

*

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes * the fragment duration. *

*/ public java.io.InputStream getPayload() { return this.payload; } /** *

* The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video Streams * supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain one or more * clusters. *

* *

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the * fragment duration. *

*
* * @param payload * The media content to write to the Kinesis video stream. In the current implementation, Kinesis Video * Streams supports only the Matroska (MKV) container format with a single MKV segment. A segment can contain * one or more clusters.

*

* Each MKV cluster maps to a Kinesis video stream fragment. Whatever cluster duration you choose becomes the * fragment duration. *

* @return Returns a reference to this object so that method calls can be chained together. */ public PutMediaRequest withPayload(java.io.InputStream payload) { setPayload(payload); 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 (getStreamName() != null) sb.append("StreamName: ").append(getStreamName()).append(","); if (getStreamARN() != null) sb.append("StreamARN: ").append(getStreamARN()).append(","); if (getFragmentTimecodeType() != null) sb.append("FragmentTimecodeType: ").append(getFragmentTimecodeType()).append(","); if (getProducerStartTimestamp() != null) sb.append("ProducerStartTimestamp: ").append(getProducerStartTimestamp()).append(","); if (getPayload() != null) sb.append("Payload: ").append(getPayload()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PutMediaRequest == false) return false; PutMediaRequest other = (PutMediaRequest) 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.getFragmentTimecodeType() == null ^ this.getFragmentTimecodeType() == null) return false; if (other.getFragmentTimecodeType() != null && other.getFragmentTimecodeType().equals(this.getFragmentTimecodeType()) == false) return false; if (other.getProducerStartTimestamp() == null ^ this.getProducerStartTimestamp() == null) return false; if (other.getProducerStartTimestamp() != null && other.getProducerStartTimestamp().equals(this.getProducerStartTimestamp()) == false) return false; if (other.getPayload() == null ^ this.getPayload() == null) return false; if (other.getPayload() != null && other.getPayload().equals(this.getPayload()) == false) return false; return true; } @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 + ((getFragmentTimecodeType() == null) ? 0 : getFragmentTimecodeType().hashCode()); hashCode = prime * hashCode + ((getProducerStartTimestamp() == null) ? 0 : getProducerStartTimestamp().hashCode()); hashCode = prime * hashCode + ((getPayload() == null) ? 0 : getPayload().hashCode()); return hashCode; } @Override public PutMediaRequest clone() { return (PutMediaRequest) super.clone(); } }