/* * 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; /** *
* The structure that contains the information required for the KVS images delivery. If null, the configuration will be * deleted from the stream. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ImageGenerationConfiguration implements Serializable, Cloneable, StructuredPojo { /** *
     * Indicates whether the ContinuousImageGenerationConfigurations API is enabled or disabled.
     * 
* The origin of the Server or Producer timestamps to use to generate the images. *
*/ private String imageSelectorType; /** ** The structure that contains the information required to deliver images to a customer. *
*/ private ImageGenerationDestinationConfig destinationConfig; /** *
     * The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum
     * value that can be provided is 33 ms, because a camera that generates content at 30 FPS would create a frame every
     * 33.3 ms. If the timestamp range is less than the sampling interval, the Image from the
     * StartTimestamp will be returned if available.
     * 
* The accepted image format. *
*/ private String format; /** *
     * The list of a key-value pair structure that contains extra parameters that can be applied when the image is
     * generated. The FormatConfig key is the JPEGQuality, which indicates the JPEG quality
     * key to be used to generate the image. The FormatConfig value accepts ints from 1 to 100. If the
     * value is 1, the image will be generated with less quality and the best compression. If the value is 100, the
     * image will be generated with the best quality and less compression. If no value is provided, the default value of
     * the JPEGQuality key will be set to 80.
     * 
     * The width of the output image that is used in conjunction with the HeightPixels parameter. When both
     * WidthPixels and HeightPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the WidthPixels parameter is provided, its original aspect
     * ratio will be used to calculate the HeightPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
     * The height of the output image that is used in conjunction with the WidthPixels parameter. When both
     * HeightPixels and WidthPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the HeightPixels parameter is provided, its original aspect
     * ratio will be used to calculate the WidthPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
     * Indicates whether the ContinuousImageGenerationConfigurations API is enabled or disabled.
     * 
ContinuousImageGenerationConfigurations API is enabled or disabled.
     * @see ConfigurationStatus
     */
    public void setStatus(String status) {
        this.status = status;
    }
    /**
     * 
     * Indicates whether the ContinuousImageGenerationConfigurations API is enabled or disabled.
     * 
ContinuousImageGenerationConfigurations API is enabled or disabled.
     * @see ConfigurationStatus
     */
    public String getStatus() {
        return this.status;
    }
    /**
     * 
     * Indicates whether the ContinuousImageGenerationConfigurations API is enabled or disabled.
     * 
ContinuousImageGenerationConfigurations API is enabled or disabled.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ConfigurationStatus
     */
    public ImageGenerationConfiguration withStatus(String status) {
        setStatus(status);
        return this;
    }
    /**
     * 
     * Indicates whether the ContinuousImageGenerationConfigurations API is enabled or disabled.
     * 
ContinuousImageGenerationConfigurations API is enabled or disabled.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ConfigurationStatus
     */
    public ImageGenerationConfiguration withStatus(ConfigurationStatus status) {
        this.status = status.toString();
        return this;
    }
    /**
     * * The origin of the Server or Producer timestamps to use to generate the images. *
* * @param imageSelectorType * The origin of the Server or Producer timestamps to use to generate the images. * @see ImageSelectorType */ public void setImageSelectorType(String imageSelectorType) { this.imageSelectorType = imageSelectorType; } /** ** The origin of the Server or Producer timestamps to use to generate the images. *
* * @return The origin of the Server or Producer timestamps to use to generate the images. * @see ImageSelectorType */ public String getImageSelectorType() { return this.imageSelectorType; } /** ** The origin of the Server or Producer timestamps to use to generate the images. *
* * @param imageSelectorType * The origin of the Server or Producer timestamps to use to generate the images. * @return Returns a reference to this object so that method calls can be chained together. * @see ImageSelectorType */ public ImageGenerationConfiguration withImageSelectorType(String imageSelectorType) { setImageSelectorType(imageSelectorType); return this; } /** ** The origin of the Server or Producer timestamps to use to generate the images. *
* * @param imageSelectorType * The origin of the Server or Producer timestamps to use to generate the images. * @return Returns a reference to this object so that method calls can be chained together. * @see ImageSelectorType */ public ImageGenerationConfiguration withImageSelectorType(ImageSelectorType imageSelectorType) { this.imageSelectorType = imageSelectorType.toString(); return this; } /** ** The structure that contains the information required to deliver images to a customer. *
* * @param destinationConfig * The structure that contains the information required to deliver images to a customer. */ public void setDestinationConfig(ImageGenerationDestinationConfig destinationConfig) { this.destinationConfig = destinationConfig; } /** ** The structure that contains the information required to deliver images to a customer. *
* * @return The structure that contains the information required to deliver images to a customer. */ public ImageGenerationDestinationConfig getDestinationConfig() { return this.destinationConfig; } /** ** The structure that contains the information required to deliver images to a customer. *
* * @param destinationConfig * The structure that contains the information required to deliver images to a customer. * @return Returns a reference to this object so that method calls can be chained together. */ public ImageGenerationConfiguration withDestinationConfig(ImageGenerationDestinationConfig destinationConfig) { setDestinationConfig(destinationConfig); return this; } /** *
     * The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum
     * value that can be provided is 33 ms, because a camera that generates content at 30 FPS would create a frame every
     * 33.3 ms. If the timestamp range is less than the sampling interval, the Image from the
     * StartTimestamp will be returned if available.
     * 
StartTimestamp will be returned if available.
     */
    public void setSamplingInterval(Integer samplingInterval) {
        this.samplingInterval = samplingInterval;
    }
    /**
     * 
     * The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum
     * value that can be provided is 33 ms, because a camera that generates content at 30 FPS would create a frame every
     * 33.3 ms. If the timestamp range is less than the sampling interval, the Image from the
     * StartTimestamp will be returned if available.
     * 
StartTimestamp will be returned if available.
     */
    public Integer getSamplingInterval() {
        return this.samplingInterval;
    }
    /**
     * 
     * The time interval in milliseconds (ms) at which the images need to be generated from the stream. The minimum
     * value that can be provided is 33 ms, because a camera that generates content at 30 FPS would create a frame every
     * 33.3 ms. If the timestamp range is less than the sampling interval, the Image from the
     * StartTimestamp will be returned if available.
     * 
StartTimestamp will be returned if available.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public ImageGenerationConfiguration withSamplingInterval(Integer samplingInterval) {
        setSamplingInterval(samplingInterval);
        return this;
    }
    /**
     * * The accepted image format. *
* * @param format * The accepted image format. * @see Format */ public void setFormat(String format) { this.format = format; } /** ** The accepted image format. *
* * @return The accepted image format. * @see Format */ public String getFormat() { return this.format; } /** ** The accepted image format. *
* * @param format * The accepted image format. * @return Returns a reference to this object so that method calls can be chained together. * @see Format */ public ImageGenerationConfiguration withFormat(String format) { setFormat(format); return this; } /** ** The accepted image format. *
* * @param format * The accepted image format. * @return Returns a reference to this object so that method calls can be chained together. * @see Format */ public ImageGenerationConfiguration withFormat(Format format) { this.format = format.toString(); return this; } /** *
     * The list of a key-value pair structure that contains extra parameters that can be applied when the image is
     * generated. The FormatConfig key is the JPEGQuality, which indicates the JPEG quality
     * key to be used to generate the image. The FormatConfig value accepts ints from 1 to 100. If the
     * value is 1, the image will be generated with less quality and the best compression. If the value is 100, the
     * image will be generated with the best quality and less compression. If no value is provided, the default value of
     * the JPEGQuality key will be set to 80.
     * 
FormatConfig key is the JPEGQuality, which indicates the JPEG
     *         quality key to be used to generate the image. The FormatConfig value accepts ints from 1 to
     *         100. If the value is 1, the image will be generated with less quality and the best compression. If the
     *         value is 100, the image will be generated with the best quality and less compression. If no value is
     *         provided, the default value of the JPEGQuality key will be set to 80.
     */
    public java.util.Map
     * The list of a key-value pair structure that contains extra parameters that can be applied when the image is
     * generated. The FormatConfig key is the JPEGQuality, which indicates the JPEG quality
     * key to be used to generate the image. The FormatConfig value accepts ints from 1 to 100. If the
     * value is 1, the image will be generated with less quality and the best compression. If the value is 100, the
     * image will be generated with the best quality and less compression. If no value is provided, the default value of
     * the JPEGQuality key will be set to 80.
     * 
FormatConfig key is the JPEGQuality, which indicates the JPEG
     *        quality key to be used to generate the image. The FormatConfig value accepts ints from 1 to
     *        100. If the value is 1, the image will be generated with less quality and the best compression. If the
     *        value is 100, the image will be generated with the best quality and less compression. If no value is
     *        provided, the default value of the JPEGQuality key will be set to 80.
     */
    public void setFormatConfig(java.util.Map
     * The list of a key-value pair structure that contains extra parameters that can be applied when the image is
     * generated. The FormatConfig key is the JPEGQuality, which indicates the JPEG quality
     * key to be used to generate the image. The FormatConfig value accepts ints from 1 to 100. If the
     * value is 1, the image will be generated with less quality and the best compression. If the value is 100, the
     * image will be generated with the best quality and less compression. If no value is provided, the default value of
     * the JPEGQuality key will be set to 80.
     * 
FormatConfig key is the JPEGQuality, which indicates the JPEG
     *        quality key to be used to generate the image. The FormatConfig value accepts ints from 1 to
     *        100. If the value is 1, the image will be generated with less quality and the best compression. If the
     *        value is 100, the image will be generated with the best quality and less compression. If no value is
     *        provided, the default value of the JPEGQuality key will be set to 80.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public ImageGenerationConfiguration withFormatConfig(java.util.Map
     * The width of the output image that is used in conjunction with the HeightPixels parameter. When both
     * WidthPixels and HeightPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the WidthPixels parameter is provided, its original aspect
     * ratio will be used to calculate the HeightPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
HeightPixels parameter.
     *        When both WidthPixels and HeightPixels parameters are provided, the image will
     *        be stretched to fit the specified aspect ratio. If only the WidthPixels parameter is
     *        provided, its original aspect ratio will be used to calculate the HeightPixels ratio. If
     *        neither parameter is provided, the original image size will be returned.
     */
    public void setWidthPixels(Integer widthPixels) {
        this.widthPixels = widthPixels;
    }
    /**
     * 
     * The width of the output image that is used in conjunction with the HeightPixels parameter. When both
     * WidthPixels and HeightPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the WidthPixels parameter is provided, its original aspect
     * ratio will be used to calculate the HeightPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
HeightPixels parameter.
     *         When both WidthPixels and HeightPixels parameters are provided, the image will
     *         be stretched to fit the specified aspect ratio. If only the WidthPixels parameter is
     *         provided, its original aspect ratio will be used to calculate the HeightPixels ratio. If
     *         neither parameter is provided, the original image size will be returned.
     */
    public Integer getWidthPixels() {
        return this.widthPixels;
    }
    /**
     * 
     * The width of the output image that is used in conjunction with the HeightPixels parameter. When both
     * WidthPixels and HeightPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the WidthPixels parameter is provided, its original aspect
     * ratio will be used to calculate the HeightPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
HeightPixels parameter.
     *        When both WidthPixels and HeightPixels parameters are provided, the image will
     *        be stretched to fit the specified aspect ratio. If only the WidthPixels parameter is
     *        provided, its original aspect ratio will be used to calculate the HeightPixels ratio. If
     *        neither parameter is provided, the original image size will be returned.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public ImageGenerationConfiguration withWidthPixels(Integer widthPixels) {
        setWidthPixels(widthPixels);
        return this;
    }
    /**
     * 
     * The height of the output image that is used in conjunction with the WidthPixels parameter. When both
     * HeightPixels and WidthPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the HeightPixels parameter is provided, its original aspect
     * ratio will be used to calculate the WidthPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
WidthPixels parameter.
     *        When both HeightPixels and WidthPixels parameters are provided, the image will
     *        be stretched to fit the specified aspect ratio. If only the HeightPixels parameter is
     *        provided, its original aspect ratio will be used to calculate the WidthPixels ratio. If
     *        neither parameter is provided, the original image size will be returned.
     */
    public void setHeightPixels(Integer heightPixels) {
        this.heightPixels = heightPixels;
    }
    /**
     * 
     * The height of the output image that is used in conjunction with the WidthPixels parameter. When both
     * HeightPixels and WidthPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the HeightPixels parameter is provided, its original aspect
     * ratio will be used to calculate the WidthPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
WidthPixels parameter.
     *         When both HeightPixels and WidthPixels parameters are provided, the image will
     *         be stretched to fit the specified aspect ratio. If only the HeightPixels parameter is
     *         provided, its original aspect ratio will be used to calculate the WidthPixels ratio. If
     *         neither parameter is provided, the original image size will be returned.
     */
    public Integer getHeightPixels() {
        return this.heightPixels;
    }
    /**
     * 
     * The height of the output image that is used in conjunction with the WidthPixels parameter. When both
     * HeightPixels and WidthPixels parameters are provided, the image will be stretched to
     * fit the specified aspect ratio. If only the HeightPixels parameter is provided, its original aspect
     * ratio will be used to calculate the WidthPixels ratio. If neither parameter is provided, the
     * original image size will be returned.
     * 
WidthPixels parameter.
     *        When both HeightPixels and WidthPixels parameters are provided, the image will
     *        be stretched to fit the specified aspect ratio. If only the HeightPixels parameter is
     *        provided, its original aspect ratio will be used to calculate the WidthPixels ratio. If
     *        neither parameter is provided, the original image size will be returned.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public ImageGenerationConfiguration withHeightPixels(Integer heightPixels) {
        setHeightPixels(heightPixels);
        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 (getStatus() != null)
            sb.append("Status: ").append(getStatus()).append(",");
        if (getImageSelectorType() != null)
            sb.append("ImageSelectorType: ").append(getImageSelectorType()).append(",");
        if (getDestinationConfig() != null)
            sb.append("DestinationConfig: ").append(getDestinationConfig()).append(",");
        if (getSamplingInterval() != null)
            sb.append("SamplingInterval: ").append(getSamplingInterval()).append(",");
        if (getFormat() != null)
            sb.append("Format: ").append(getFormat()).append(",");
        if (getFormatConfig() != null)
            sb.append("FormatConfig: ").append(getFormatConfig()).append(",");
        if (getWidthPixels() != null)
            sb.append("WidthPixels: ").append(getWidthPixels()).append(",");
        if (getHeightPixels() != null)
            sb.append("HeightPixels: ").append(getHeightPixels());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof ImageGenerationConfiguration == false)
            return false;
        ImageGenerationConfiguration other = (ImageGenerationConfiguration) obj;
        if (other.getStatus() == null ^ this.getStatus() == null)
            return false;
        if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
            return false;
        if (other.getImageSelectorType() == null ^ this.getImageSelectorType() == null)
            return false;
        if (other.getImageSelectorType() != null && other.getImageSelectorType().equals(this.getImageSelectorType()) == false)
            return false;
        if (other.getDestinationConfig() == null ^ this.getDestinationConfig() == null)
            return false;
        if (other.getDestinationConfig() != null && other.getDestinationConfig().equals(this.getDestinationConfig()) == false)
            return false;
        if (other.getSamplingInterval() == null ^ this.getSamplingInterval() == null)
            return false;
        if (other.getSamplingInterval() != null && other.getSamplingInterval().equals(this.getSamplingInterval()) == false)
            return false;
        if (other.getFormat() == null ^ this.getFormat() == null)
            return false;
        if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false)
            return false;
        if (other.getFormatConfig() == null ^ this.getFormatConfig() == null)
            return false;
        if (other.getFormatConfig() != null && other.getFormatConfig().equals(this.getFormatConfig()) == false)
            return false;
        if (other.getWidthPixels() == null ^ this.getWidthPixels() == null)
            return false;
        if (other.getWidthPixels() != null && other.getWidthPixels().equals(this.getWidthPixels()) == false)
            return false;
        if (other.getHeightPixels() == null ^ this.getHeightPixels() == null)
            return false;
        if (other.getHeightPixels() != null && other.getHeightPixels().equals(this.getHeightPixels()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
        hashCode = prime * hashCode + ((getImageSelectorType() == null) ? 0 : getImageSelectorType().hashCode());
        hashCode = prime * hashCode + ((getDestinationConfig() == null) ? 0 : getDestinationConfig().hashCode());
        hashCode = prime * hashCode + ((getSamplingInterval() == null) ? 0 : getSamplingInterval().hashCode());
        hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode());
        hashCode = prime * hashCode + ((getFormatConfig() == null) ? 0 : getFormatConfig().hashCode());
        hashCode = prime * hashCode + ((getWidthPixels() == null) ? 0 : getWidthPixels().hashCode());
        hashCode = prime * hashCode + ((getHeightPixels() == null) ? 0 : getHeightPixels().hashCode());
        return hashCode;
    }
    @Override
    public ImageGenerationConfiguration clone() {
        try {
            return (ImageGenerationConfiguration) 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.ImageGenerationConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}