/* * 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.ivs.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Object that describes which renditions should be recorded for a stream. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RenditionConfiguration implements Serializable, Cloneable, StructuredPojo { /** *

* Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. *

*/ private String renditionSelection; /** *

* Indicates which renditions are recorded for a stream, if renditionSelection is CUSTOM; * otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the * stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the * resolution dimensions of each rendition, see Auto-Record to Amazon S3. *

*/ private java.util.List renditions; /** *

* Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. *

* * @param renditionSelection * Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. * @see RenditionConfigurationRenditionSelection */ public void setRenditionSelection(String renditionSelection) { this.renditionSelection = renditionSelection; } /** *

* Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. *

* * @return Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. * @see RenditionConfigurationRenditionSelection */ public String getRenditionSelection() { return this.renditionSelection; } /** *

* Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. *

* * @param renditionSelection * Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. * @return Returns a reference to this object so that method calls can be chained together. * @see RenditionConfigurationRenditionSelection */ public RenditionConfiguration withRenditionSelection(String renditionSelection) { setRenditionSelection(renditionSelection); return this; } /** *

* Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. *

* * @param renditionSelection * Indicates which set of renditions are recorded for a stream. For BASIC channels, the * CUSTOM value has no effect. If CUSTOM is specified, a set of renditions must be * specified in the renditions field. Default: ALL. * @return Returns a reference to this object so that method calls can be chained together. * @see RenditionConfigurationRenditionSelection */ public RenditionConfiguration withRenditionSelection(RenditionConfigurationRenditionSelection renditionSelection) { this.renditionSelection = renditionSelection.toString(); return this; } /** *

* Indicates which renditions are recorded for a stream, if renditionSelection is CUSTOM; * otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the * stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the * resolution dimensions of each rendition, see Auto-Record to Amazon S3. *

* * @return Indicates which renditions are recorded for a stream, if renditionSelection is * CUSTOM; otherwise, this field is irrelevant. The selected renditions are recorded if they * are available during the stream. If a selected rendition is unavailable, the best available rendition is * recorded. For details on the resolution dimensions of each rendition, see Auto-Record to Amazon S3. * @see RenditionConfigurationRendition */ public java.util.List getRenditions() { return renditions; } /** *

* Indicates which renditions are recorded for a stream, if renditionSelection is CUSTOM; * otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the * stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the * resolution dimensions of each rendition, see Auto-Record to Amazon S3. *

* * @param renditions * Indicates which renditions are recorded for a stream, if renditionSelection is * CUSTOM; otherwise, this field is irrelevant. The selected renditions are recorded if they are * available during the stream. If a selected rendition is unavailable, the best available rendition is * recorded. For details on the resolution dimensions of each rendition, see Auto-Record to Amazon S3. * @see RenditionConfigurationRendition */ public void setRenditions(java.util.Collection renditions) { if (renditions == null) { this.renditions = null; return; } this.renditions = new java.util.ArrayList(renditions); } /** *

* Indicates which renditions are recorded for a stream, if renditionSelection is CUSTOM; * otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the * stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the * resolution dimensions of each rendition, see Auto-Record to Amazon S3. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setRenditions(java.util.Collection)} or {@link #withRenditions(java.util.Collection)} if you want to * override the existing values. *

* * @param renditions * Indicates which renditions are recorded for a stream, if renditionSelection is * CUSTOM; otherwise, this field is irrelevant. The selected renditions are recorded if they are * available during the stream. If a selected rendition is unavailable, the best available rendition is * recorded. For details on the resolution dimensions of each rendition, see Auto-Record to Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. * @see RenditionConfigurationRendition */ public RenditionConfiguration withRenditions(String... renditions) { if (this.renditions == null) { setRenditions(new java.util.ArrayList(renditions.length)); } for (String ele : renditions) { this.renditions.add(ele); } return this; } /** *

* Indicates which renditions are recorded for a stream, if renditionSelection is CUSTOM; * otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the * stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the * resolution dimensions of each rendition, see Auto-Record to Amazon S3. *

* * @param renditions * Indicates which renditions are recorded for a stream, if renditionSelection is * CUSTOM; otherwise, this field is irrelevant. The selected renditions are recorded if they are * available during the stream. If a selected rendition is unavailable, the best available rendition is * recorded. For details on the resolution dimensions of each rendition, see Auto-Record to Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. * @see RenditionConfigurationRendition */ public RenditionConfiguration withRenditions(java.util.Collection renditions) { setRenditions(renditions); return this; } /** *

* Indicates which renditions are recorded for a stream, if renditionSelection is CUSTOM; * otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the * stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the * resolution dimensions of each rendition, see Auto-Record to Amazon S3. *

* * @param renditions * Indicates which renditions are recorded for a stream, if renditionSelection is * CUSTOM; otherwise, this field is irrelevant. The selected renditions are recorded if they are * available during the stream. If a selected rendition is unavailable, the best available rendition is * recorded. For details on the resolution dimensions of each rendition, see Auto-Record to Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. * @see RenditionConfigurationRendition */ public RenditionConfiguration withRenditions(RenditionConfigurationRendition... renditions) { java.util.ArrayList renditionsCopy = new java.util.ArrayList(renditions.length); for (RenditionConfigurationRendition value : renditions) { renditionsCopy.add(value.toString()); } if (getRenditions() == null) { setRenditions(renditionsCopy); } else { getRenditions().addAll(renditionsCopy); } 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 (getRenditionSelection() != null) sb.append("RenditionSelection: ").append(getRenditionSelection()).append(","); if (getRenditions() != null) sb.append("Renditions: ").append(getRenditions()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RenditionConfiguration == false) return false; RenditionConfiguration other = (RenditionConfiguration) obj; if (other.getRenditionSelection() == null ^ this.getRenditionSelection() == null) return false; if (other.getRenditionSelection() != null && other.getRenditionSelection().equals(this.getRenditionSelection()) == false) return false; if (other.getRenditions() == null ^ this.getRenditions() == null) return false; if (other.getRenditions() != null && other.getRenditions().equals(this.getRenditions()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRenditionSelection() == null) ? 0 : getRenditionSelection().hashCode()); hashCode = prime * hashCode + ((getRenditions() == null) ? 0 : getRenditions().hashCode()); return hashCode; } @Override public RenditionConfiguration clone() { try { return (RenditionConfiguration) 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.ivs.model.transform.RenditionConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }