![JAR search and dependency download from the Maven repository](/logo.png)
software.amazon.awssdk.services.mediaconvert.model.JobTemplate Maven / Gradle / Ivy
Show all versions of mediaconvert 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.mediaconvert.model;
import java.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* A job template is a pre-made set of encoding instructions that you can use to quickly create a job.
*/
@Generated("software.amazon.awssdk:codegen")
public final class JobTemplate implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ACCELERATION_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("AccelerationSettings")
.getter(getter(JobTemplate::accelerationSettings)).setter(setter(Builder::accelerationSettings))
.constructor(AccelerationSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("accelerationSettings").build())
.build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
.getter(getter(JobTemplate::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField CATEGORY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Category").getter(getter(JobTemplate::category)).setter(setter(Builder::category))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("category").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("CreatedAt")
.getter(getter(JobTemplate::createdAt))
.setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.UNIX_TIMESTAMP)).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(JobTemplate::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField> HOP_DESTINATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("HopDestinations")
.getter(getter(JobTemplate::hopDestinations))
.setter(setter(Builder::hopDestinations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("hopDestinations").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(HopDestination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField LAST_UPDATED_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("LastUpdated")
.getter(getter(JobTemplate::lastUpdated))
.setter(setter(Builder::lastUpdated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdated").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.UNIX_TIMESTAMP)).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(JobTemplate::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField PRIORITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Priority").getter(getter(JobTemplate::priority)).setter(setter(Builder::priority))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("priority").build()).build();
private static final SdkField QUEUE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Queue")
.getter(getter(JobTemplate::queue)).setter(setter(Builder::queue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("queue").build()).build();
private static final SdkField SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Settings").getter(getter(JobTemplate::settings))
.setter(setter(Builder::settings)).constructor(JobTemplateSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("settings").build()).build();
private static final SdkField STATUS_UPDATE_INTERVAL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatusUpdateInterval").getter(getter(JobTemplate::statusUpdateIntervalAsString))
.setter(setter(Builder::statusUpdateInterval))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusUpdateInterval").build())
.build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(JobTemplate::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCELERATION_SETTINGS_FIELD,
ARN_FIELD, CATEGORY_FIELD, CREATED_AT_FIELD, DESCRIPTION_FIELD, HOP_DESTINATIONS_FIELD, LAST_UPDATED_FIELD,
NAME_FIELD, PRIORITY_FIELD, QUEUE_FIELD, SETTINGS_FIELD, STATUS_UPDATE_INTERVAL_FIELD, TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final AccelerationSettings accelerationSettings;
private final String arn;
private final String category;
private final Instant createdAt;
private final String description;
private final List hopDestinations;
private final Instant lastUpdated;
private final String name;
private final Integer priority;
private final String queue;
private final JobTemplateSettings settings;
private final String statusUpdateInterval;
private final String type;
private JobTemplate(BuilderImpl builder) {
this.accelerationSettings = builder.accelerationSettings;
this.arn = builder.arn;
this.category = builder.category;
this.createdAt = builder.createdAt;
this.description = builder.description;
this.hopDestinations = builder.hopDestinations;
this.lastUpdated = builder.lastUpdated;
this.name = builder.name;
this.priority = builder.priority;
this.queue = builder.queue;
this.settings = builder.settings;
this.statusUpdateInterval = builder.statusUpdateInterval;
this.type = builder.type;
}
/**
* Accelerated transcoding can significantly speed up jobs with long, visually complex content.
*
* @return Accelerated transcoding can significantly speed up jobs with long, visually complex content.
*/
public final AccelerationSettings accelerationSettings() {
return accelerationSettings;
}
/**
* An identifier for this resource that is unique within all of AWS.
*
* @return An identifier for this resource that is unique within all of AWS.
*/
public final String arn() {
return arn;
}
/**
* An optional category you create to organize your job templates.
*
* @return An optional category you create to organize your job templates.
*/
public final String category() {
return category;
}
/**
* The timestamp in epoch seconds for Job template creation.
*
* @return The timestamp in epoch seconds for Job template creation.
*/
public final Instant createdAt() {
return createdAt;
}
/**
* An optional description you create for each job template.
*
* @return An optional description you create for each job template.
*/
public final String description() {
return description;
}
/**
* For responses, this returns true if the service returned a value for the HopDestinations property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasHopDestinations() {
return hopDestinations != null && !(hopDestinations instanceof SdkAutoConstructList);
}
/**
* Optional list of hop destinations.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasHopDestinations} method.
*
*
* @return Optional list of hop destinations.
*/
public final List hopDestinations() {
return hopDestinations;
}
/**
* The timestamp in epoch seconds when the Job template was last updated.
*
* @return The timestamp in epoch seconds when the Job template was last updated.
*/
public final Instant lastUpdated() {
return lastUpdated;
}
/**
* A name you create for each job template. Each name must be unique within your account.
*
* @return A name you create for each job template. Each name must be unique within your account.
*/
public final String name() {
return name;
}
/**
* Relative priority on the job.
*
* @return Relative priority on the job.
*/
public final Integer priority() {
return priority;
}
/**
* Optional. The queue that jobs created from this template are assigned to. If you don't specify this, jobs will go
* to the default queue.
*
* @return Optional. The queue that jobs created from this template are assigned to. If you don't specify this, jobs
* will go to the default queue.
*/
public final String queue() {
return queue;
}
/**
* JobTemplateSettings contains all the transcode settings saved in the template that will be applied to jobs
* created from it.
*
* @return JobTemplateSettings contains all the transcode settings saved in the template that will be applied to
* jobs created from it.
*/
public final JobTemplateSettings settings() {
return settings;
}
/**
* Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events. Set the interval, in
* seconds, between status updates. MediaConvert sends an update at this interval from the time the service begins
* processing your job to the time it completes the transcode or encounters an error.
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #statusUpdateInterval} will return {@link StatusUpdateInterval#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #statusUpdateIntervalAsString}.
*
*
* @return Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events. Set the interval,
* in seconds, between status updates. MediaConvert sends an update at this interval from the time the
* service begins processing your job to the time it completes the transcode or encounters an error.
* @see StatusUpdateInterval
*/
public final StatusUpdateInterval statusUpdateInterval() {
return StatusUpdateInterval.fromValue(statusUpdateInterval);
}
/**
* Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events. Set the interval, in
* seconds, between status updates. MediaConvert sends an update at this interval from the time the service begins
* processing your job to the time it completes the transcode or encounters an error.
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #statusUpdateInterval} will return {@link StatusUpdateInterval#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #statusUpdateIntervalAsString}.
*
*
* @return Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch Events. Set the interval,
* in seconds, between status updates. MediaConvert sends an update at this interval from the time the
* service begins processing your job to the time it completes the transcode or encounters an error.
* @see StatusUpdateInterval
*/
public final String statusUpdateIntervalAsString() {
return statusUpdateInterval;
}
/**
* A job template can be of two types: system or custom. System or built-in job templates can't be modified or
* deleted by the user.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link Type#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return A job template can be of two types: system or custom. System or built-in job templates can't be modified
* or deleted by the user.
* @see Type
*/
public final Type type() {
return Type.fromValue(type);
}
/**
* A job template can be of two types: system or custom. System or built-in job templates can't be modified or
* deleted by the user.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link Type#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return A job template can be of two types: system or custom. System or built-in job templates can't be modified
* or deleted by the user.
* @see Type
*/
public final String typeAsString() {
return type;
}
@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(accelerationSettings());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(category());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(hasHopDestinations() ? hopDestinations() : null);
hashCode = 31 * hashCode + Objects.hashCode(lastUpdated());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(priority());
hashCode = 31 * hashCode + Objects.hashCode(queue());
hashCode = 31 * hashCode + Objects.hashCode(settings());
hashCode = 31 * hashCode + Objects.hashCode(statusUpdateIntervalAsString());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
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 JobTemplate)) {
return false;
}
JobTemplate other = (JobTemplate) obj;
return Objects.equals(accelerationSettings(), other.accelerationSettings()) && Objects.equals(arn(), other.arn())
&& Objects.equals(category(), other.category()) && Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(description(), other.description()) && hasHopDestinations() == other.hasHopDestinations()
&& Objects.equals(hopDestinations(), other.hopDestinations())
&& Objects.equals(lastUpdated(), other.lastUpdated()) && Objects.equals(name(), other.name())
&& Objects.equals(priority(), other.priority()) && Objects.equals(queue(), other.queue())
&& Objects.equals(settings(), other.settings())
&& Objects.equals(statusUpdateIntervalAsString(), other.statusUpdateIntervalAsString())
&& Objects.equals(typeAsString(), other.typeAsString());
}
/**
* 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("JobTemplate").add("AccelerationSettings", accelerationSettings()).add("Arn", arn())
.add("Category", category()).add("CreatedAt", createdAt()).add("Description", description())
.add("HopDestinations", hasHopDestinations() ? hopDestinations() : null).add("LastUpdated", lastUpdated())
.add("Name", name()).add("Priority", priority()).add("Queue", queue()).add("Settings", settings())
.add("StatusUpdateInterval", statusUpdateIntervalAsString()).add("Type", typeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AccelerationSettings":
return Optional.ofNullable(clazz.cast(accelerationSettings()));
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "Category":
return Optional.ofNullable(clazz.cast(category()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "HopDestinations":
return Optional.ofNullable(clazz.cast(hopDestinations()));
case "LastUpdated":
return Optional.ofNullable(clazz.cast(lastUpdated()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Priority":
return Optional.ofNullable(clazz.cast(priority()));
case "Queue":
return Optional.ofNullable(clazz.cast(queue()));
case "Settings":
return Optional.ofNullable(clazz.cast(settings()));
case "StatusUpdateInterval":
return Optional.ofNullable(clazz.cast(statusUpdateIntervalAsString()));
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function