/* * 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.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Identifies the chunk on the Kinesis video stream where you want the GetMedia
API to start returning
* media data. You have the following options to identify the starting chunk:
*
* Choose the latest (or oldest) chunk. *
** Identify a specific chunk. You can identify a specific chunk either by providing a fragment number or timestamp * (server or producer). *
*
* Each chunk's metadata includes a continuation token as a Matroska (MKV) tag (
* AWS_KINESISVIDEO_CONTINUATION_TOKEN
). If your previous GetMedia
request terminated, you can
* use this tag value in your next GetMedia
request. The API then starts returning chunks starting where
* the last API ended.
*
* Identifies the fragment on the Kinesis video stream where you want to start getting the data from. *
** NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer
* or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't provide
* any additional information in the startSelector
.
*
* Specifies the fragment number from where you want the GetMedia
API to start returning the fragments.
*
* A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the
* startSelectorType
. The GetMedia
API then starts with the chunk containing the fragment
* that has the specified timestamp.
*
* Continuation token that Kinesis Video Streams returned in the previous GetMedia
response. The
* GetMedia
API then starts with the chunk identified by the continuation token.
*
* Identifies the fragment on the Kinesis video stream where you want to start getting the data from. *
** NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer
* or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't provide
* any additional information in the startSelector
.
*
* NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified
* producer or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't
* provide any additional information in the startSelector
.
*
* Identifies the fragment on the Kinesis video stream where you want to start getting the data from. *
** NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer
* or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't provide
* any additional information in the startSelector
.
*
* NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified
* producer or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't
* provide any additional information in the startSelector
.
*
* Identifies the fragment on the Kinesis video stream where you want to start getting the data from. *
** NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer
* or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't provide
* any additional information in the startSelector
.
*
* NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified
* producer or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't
* provide any additional information in the startSelector
.
*
* Identifies the fragment on the Kinesis video stream where you want to start getting the data from. *
** NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified producer
* or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't provide
* any additional information in the startSelector
.
*
* NOW - Start with the latest chunk on the stream. *
** EARLIEST - Start with earliest available chunk on the stream. *
*
* FRAGMENT_NUMBER - Start with the chunk after a specific fragment. You must also specify the
* AfterFragmentNumber
parameter.
*
* PRODUCER_TIMESTAMP or SERVER_TIMESTAMP - Start with the chunk containing a fragment with the specified
* producer or server timestamp. You specify the timestamp by adding StartTimestamp
.
*
* CONTINUATION_TOKEN - Read using the specified continuation token. *
*
* If you choose the NOW, EARLIEST, or CONTINUATION_TOKEN as the startSelectorType
, you don't
* provide any additional information in the startSelector
.
*
* Specifies the fragment number from where you want the GetMedia
API to start returning the fragments.
*
GetMedia
API to start returning the
* fragments.
*/
public void setAfterFragmentNumber(String afterFragmentNumber) {
this.afterFragmentNumber = afterFragmentNumber;
}
/**
*
* Specifies the fragment number from where you want the GetMedia
API to start returning the fragments.
*
GetMedia
API to start returning the
* fragments.
*/
public String getAfterFragmentNumber() {
return this.afterFragmentNumber;
}
/**
*
* Specifies the fragment number from where you want the GetMedia
API to start returning the fragments.
*
GetMedia
API to start returning the
* fragments.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSelector withAfterFragmentNumber(String afterFragmentNumber) {
setAfterFragmentNumber(afterFragmentNumber);
return this;
}
/**
*
* A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the
* startSelectorType
. The GetMedia
API then starts with the chunk containing the fragment
* that has the specified timestamp.
*
startSelectorType
. The GetMedia
API then starts with the chunk containing
* the fragment that has the specified timestamp.
*/
public void setStartTimestamp(java.util.Date startTimestamp) {
this.startTimestamp = startTimestamp;
}
/**
*
* A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the
* startSelectorType
. The GetMedia
API then starts with the chunk containing the fragment
* that has the specified timestamp.
*
startSelectorType
. The GetMedia
API then starts with the chunk containing
* the fragment that has the specified timestamp.
*/
public java.util.Date getStartTimestamp() {
return this.startTimestamp;
}
/**
*
* A timestamp value. This value is required if you choose the PRODUCER_TIMESTAMP or the SERVER_TIMESTAMP as the
* startSelectorType
. The GetMedia
API then starts with the chunk containing the fragment
* that has the specified timestamp.
*
startSelectorType
. The GetMedia
API then starts with the chunk containing
* the fragment that has the specified timestamp.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSelector withStartTimestamp(java.util.Date startTimestamp) {
setStartTimestamp(startTimestamp);
return this;
}
/**
*
* Continuation token that Kinesis Video Streams returned in the previous GetMedia
response. The
* GetMedia
API then starts with the chunk identified by the continuation token.
*
GetMedia
response. The
* GetMedia
API then starts with the chunk identified by the continuation token.
*/
public void setContinuationToken(String continuationToken) {
this.continuationToken = continuationToken;
}
/**
*
* Continuation token that Kinesis Video Streams returned in the previous GetMedia
response. The
* GetMedia
API then starts with the chunk identified by the continuation token.
*
GetMedia
response.
* The GetMedia
API then starts with the chunk identified by the continuation token.
*/
public String getContinuationToken() {
return this.continuationToken;
}
/**
*
* Continuation token that Kinesis Video Streams returned in the previous GetMedia
response. The
* GetMedia
API then starts with the chunk identified by the continuation token.
*
GetMedia
response. The
* GetMedia
API then starts with the chunk identified by the continuation token.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSelector withContinuationToken(String continuationToken) {
setContinuationToken(continuationToken);
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 (getStartSelectorType() != null)
sb.append("StartSelectorType: ").append(getStartSelectorType()).append(",");
if (getAfterFragmentNumber() != null)
sb.append("AfterFragmentNumber: ").append(getAfterFragmentNumber()).append(",");
if (getStartTimestamp() != null)
sb.append("StartTimestamp: ").append(getStartTimestamp()).append(",");
if (getContinuationToken() != null)
sb.append("ContinuationToken: ").append(getContinuationToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof StartSelector == false)
return false;
StartSelector other = (StartSelector) obj;
if (other.getStartSelectorType() == null ^ this.getStartSelectorType() == null)
return false;
if (other.getStartSelectorType() != null && other.getStartSelectorType().equals(this.getStartSelectorType()) == false)
return false;
if (other.getAfterFragmentNumber() == null ^ this.getAfterFragmentNumber() == null)
return false;
if (other.getAfterFragmentNumber() != null && other.getAfterFragmentNumber().equals(this.getAfterFragmentNumber()) == false)
return false;
if (other.getStartTimestamp() == null ^ this.getStartTimestamp() == null)
return false;
if (other.getStartTimestamp() != null && other.getStartTimestamp().equals(this.getStartTimestamp()) == false)
return false;
if (other.getContinuationToken() == null ^ this.getContinuationToken() == null)
return false;
if (other.getContinuationToken() != null && other.getContinuationToken().equals(this.getContinuationToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStartSelectorType() == null) ? 0 : getStartSelectorType().hashCode());
hashCode = prime * hashCode + ((getAfterFragmentNumber() == null) ? 0 : getAfterFragmentNumber().hashCode());
hashCode = prime * hashCode + ((getStartTimestamp() == null) ? 0 : getStartTimestamp().hashCode());
hashCode = prime * hashCode + ((getContinuationToken() == null) ? 0 : getContinuationToken().hashCode());
return hashCode;
}
@Override
public StartSelector clone() {
try {
return (StartSelector) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.kinesisvideo.model.transform.StartSelectorMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}