software.amazon.awssdk.services.elastictranscoder.model.JobWatermark Maven / Gradle / Ivy
Show all versions of elastictranscoder Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.elastictranscoder.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Watermarks can be in .png or .jpg format. If you want to display a watermark that is not rectangular, use the .png
* format, which supports transparency.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class JobWatermark implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField PRESET_WATERMARK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PresetWatermarkId").getter(getter(JobWatermark::presetWatermarkId))
.setter(setter(Builder::presetWatermarkId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PresetWatermarkId").build()).build();
private static final SdkField INPUT_KEY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("InputKey").getter(getter(JobWatermark::inputKey)).setter(setter(Builder::inputKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputKey").build()).build();
private static final SdkField ENCRYPTION_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Encryption").getter(getter(JobWatermark::encryption)).setter(setter(Builder::encryption))
.constructor(Encryption::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encryption").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PRESET_WATERMARK_ID_FIELD,
INPUT_KEY_FIELD, ENCRYPTION_FIELD));
private static final long serialVersionUID = 1L;
private final String presetWatermarkId;
private final String inputKey;
private final Encryption encryption;
private JobWatermark(BuilderImpl builder) {
this.presetWatermarkId = builder.presetWatermarkId;
this.inputKey = builder.inputKey;
this.encryption = builder.encryption;
}
/**
*
* The ID of the watermark settings that Elastic Transcoder uses to add watermarks to the video during transcoding.
* The settings are in the preset specified by Preset for the current output. In that preset, the value of
* Watermarks Id tells Elastic Transcoder which settings to use.
*
*
* @return The ID of the watermark settings that Elastic Transcoder uses to add watermarks to the video during
* transcoding. The settings are in the preset specified by Preset for the current output. In that preset,
* the value of Watermarks Id tells Elastic Transcoder which settings to use.
*/
public final String presetWatermarkId() {
return presetWatermarkId;
}
/**
*
* The name of the .png or .jpg file that you want to use for the watermark. To determine which Amazon S3 bucket
* contains the specified file, Elastic Transcoder checks the pipeline specified by Pipeline
; the
* Input Bucket
object in that pipeline identifies the bucket.
*
*
* If the file name includes a prefix, for example, logos/128x64.png, include the prefix in the key. If the
* file isn't in the specified bucket, Elastic Transcoder returns an error.
*
*
* @return The name of the .png or .jpg file that you want to use for the watermark. To determine which Amazon S3
* bucket contains the specified file, Elastic Transcoder checks the pipeline specified by
* Pipeline
; the Input Bucket
object in that pipeline identifies the bucket.
*
* If the file name includes a prefix, for example, logos/128x64.png, include the prefix in the key.
* If the file isn't in the specified bucket, Elastic Transcoder returns an error.
*/
public final String inputKey() {
return inputKey;
}
/**
*
* The encryption settings, if any, that you want Elastic Transcoder to apply to your watermarks.
*
*
* @return The encryption settings, if any, that you want Elastic Transcoder to apply to your watermarks.
*/
public final Encryption encryption() {
return encryption;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(presetWatermarkId());
hashCode = 31 * hashCode + Objects.hashCode(inputKey());
hashCode = 31 * hashCode + Objects.hashCode(encryption());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof JobWatermark)) {
return false;
}
JobWatermark other = (JobWatermark) obj;
return Objects.equals(presetWatermarkId(), other.presetWatermarkId()) && Objects.equals(inputKey(), other.inputKey())
&& Objects.equals(encryption(), other.encryption());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("JobWatermark").add("PresetWatermarkId", presetWatermarkId()).add("InputKey", inputKey())
.add("Encryption", encryption()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "PresetWatermarkId":
return Optional.ofNullable(clazz.cast(presetWatermarkId()));
case "InputKey":
return Optional.ofNullable(clazz.cast(inputKey()));
case "Encryption":
return Optional.ofNullable(clazz.cast(encryption()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function