All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.elastictranscoder.model.PlayReadyDrm Maven / Gradle / Ivy

/*
 * 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.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;

/**
 * 

* The PlayReady DRM settings, if any, that you want Elastic Transcoder to apply to the output files associated with * this playlist. *

*

* PlayReady DRM encrypts your media files using aes-ctr encryption. *

*

* If you use DRM for an HLSv3 playlist, your outputs must have a master playlist. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PlayReadyDrm implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FORMAT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Format") .getter(getter(PlayReadyDrm::format)).setter(setter(Builder::format)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Format").build()).build(); private static final SdkField KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Key") .getter(getter(PlayReadyDrm::key)).setter(setter(Builder::key)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Key").build()).build(); private static final SdkField KEY_MD5_FIELD = SdkField. builder(MarshallingType.STRING).memberName("KeyMd5") .getter(getter(PlayReadyDrm::keyMd5)).setter(setter(Builder::keyMd5)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyMd5").build()).build(); private static final SdkField KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("KeyId") .getter(getter(PlayReadyDrm::keyId)).setter(setter(Builder::keyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyId").build()).build(); private static final SdkField INITIALIZATION_VECTOR_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InitializationVector").getter(getter(PlayReadyDrm::initializationVector)) .setter(setter(Builder::initializationVector)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InitializationVector").build()) .build(); private static final SdkField LICENSE_ACQUISITION_URL_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LicenseAcquisitionUrl").getter(getter(PlayReadyDrm::licenseAcquisitionUrl)) .setter(setter(Builder::licenseAcquisitionUrl)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LicenseAcquisitionUrl").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FORMAT_FIELD, KEY_FIELD, KEY_MD5_FIELD, KEY_ID_FIELD, INITIALIZATION_VECTOR_FIELD, LICENSE_ACQUISITION_URL_FIELD)); private static final long serialVersionUID = 1L; private final String format; private final String key; private final String keyMd5; private final String keyId; private final String initializationVector; private final String licenseAcquisitionUrl; private PlayReadyDrm(BuilderImpl builder) { this.format = builder.format; this.key = builder.key; this.keyMd5 = builder.keyMd5; this.keyId = builder.keyId; this.initializationVector = builder.initializationVector; this.licenseAcquisitionUrl = builder.licenseAcquisitionUrl; } /** *

* The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this * playlist. *

* * @return The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with * this playlist. */ public final String format() { return format; } /** *

* The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must be * one of the following bit lengths before being base64-encoded: *

*

* 128, 192, or 256. *

*

* The key must also be encrypted by using AWS KMS. *

* * @return The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it * must be one of the following bit lengths before being base64-encoded:

*

* 128, 192, or 256. *

*

* The key must also be encrypted by using AWS KMS. */ public final String key() { return key; } /** *

* The MD5 digest of the key used for DRM on your file, and that you want Elastic Transcoder to use as a checksum to * make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must be exactly 16 * bytes before being base64-encoded. *

* * @return The MD5 digest of the key used for DRM on your file, and that you want Elastic Transcoder to use as a * checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it * must be exactly 16 bytes before being base64-encoded. */ public final String keyMd5() { return keyMd5; } /** *

* The ID for your DRM key, so that your DRM license provider knows which key to provide. *

*

* The key ID must be provided in big endian, and Elastic Transcoder converts it to little endian before inserting * it into the PlayReady DRM headers. If you are unsure whether your license server provides your key ID in big or * little endian, check with your DRM provider. *

* * @return The ID for your DRM key, so that your DRM license provider knows which key to provide.

*

* The key ID must be provided in big endian, and Elastic Transcoder converts it to little endian before * inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your * key ID in big or little endian, check with your DRM provider. */ public final String keyId() { return keyId; } /** *

* The series of random bits created by a random bit generator, unique for every encryption operation, that you want * Elastic Transcoder to use to encrypt your files. The initialization vector must be base64-encoded, and it must be * exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic Transcoder * generates one for you. *

* * @return The series of random bits created by a random bit generator, unique for every encryption operation, that * you want Elastic Transcoder to use to encrypt your files. The initialization vector must be * base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization * vector is provided, Elastic Transcoder generates one for you. */ public final String initializationVector() { return initializationVector; } /** *

* The location of the license key required to play DRM content. The URL must be an absolute path, and is referenced * by the PlayReady header. The PlayReady header is referenced in the protection header of the client manifest for * Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS playlist outputs. An * example URL looks like this: https://www.example.com/exampleKey/ *

* * @return The location of the license key required to play DRM content. The URL must be an absolute path, and is * referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the * client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for * HLS playlist outputs. An example URL looks like this: https://www.example.com/exampleKey/ */ public final String licenseAcquisitionUrl() { return licenseAcquisitionUrl; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(format()); hashCode = 31 * hashCode + Objects.hashCode(key()); hashCode = 31 * hashCode + Objects.hashCode(keyMd5()); hashCode = 31 * hashCode + Objects.hashCode(keyId()); hashCode = 31 * hashCode + Objects.hashCode(initializationVector()); hashCode = 31 * hashCode + Objects.hashCode(licenseAcquisitionUrl()); 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 PlayReadyDrm)) { return false; } PlayReadyDrm other = (PlayReadyDrm) obj; return Objects.equals(format(), other.format()) && Objects.equals(key(), other.key()) && Objects.equals(keyMd5(), other.keyMd5()) && Objects.equals(keyId(), other.keyId()) && Objects.equals(initializationVector(), other.initializationVector()) && Objects.equals(licenseAcquisitionUrl(), other.licenseAcquisitionUrl()); } /** * 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("PlayReadyDrm").add("Format", format()).add("Key", key()).add("KeyMd5", keyMd5()) .add("KeyId", keyId()).add("InitializationVector", initializationVector()) .add("LicenseAcquisitionUrl", licenseAcquisitionUrl()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Format": return Optional.ofNullable(clazz.cast(format())); case "Key": return Optional.ofNullable(clazz.cast(key())); case "KeyMd5": return Optional.ofNullable(clazz.cast(keyMd5())); case "KeyId": return Optional.ofNullable(clazz.cast(keyId())); case "InitializationVector": return Optional.ofNullable(clazz.cast(initializationVector())); case "LicenseAcquisitionUrl": return Optional.ofNullable(clazz.cast(licenseAcquisitionUrl())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((PlayReadyDrm) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with this * playlist. *

* * @param format * The type of DRM, if any, that you want Elastic Transcoder to apply to the output files associated with * this playlist. * @return Returns a reference to this object so that method calls can be chained together. */ Builder format(String format); /** *

* The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and it must * be one of the following bit lengths before being base64-encoded: *

*

* 128, 192, or 256. *

*

* The key must also be encrypted by using AWS KMS. *

* * @param key * The DRM key for your file, provided by your DRM license provider. The key must be base64-encoded, and * it must be one of the following bit lengths before being base64-encoded:

*

* 128, 192, or 256. *

*

* The key must also be encrypted by using AWS KMS. * @return Returns a reference to this object so that method calls can be chained together. */ Builder key(String key); /** *

* The MD5 digest of the key used for DRM on your file, and that you want Elastic Transcoder to use as a * checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and it must * be exactly 16 bytes before being base64-encoded. *

* * @param keyMd5 * The MD5 digest of the key used for DRM on your file, and that you want Elastic Transcoder to use as a * checksum to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, and * it must be exactly 16 bytes before being base64-encoded. * @return Returns a reference to this object so that method calls can be chained together. */ Builder keyMd5(String keyMd5); /** *

* The ID for your DRM key, so that your DRM license provider knows which key to provide. *

*

* The key ID must be provided in big endian, and Elastic Transcoder converts it to little endian before * inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides your key * ID in big or little endian, check with your DRM provider. *

* * @param keyId * The ID for your DRM key, so that your DRM license provider knows which key to provide.

*

* The key ID must be provided in big endian, and Elastic Transcoder converts it to little endian before * inserting it into the PlayReady DRM headers. If you are unsure whether your license server provides * your key ID in big or little endian, check with your DRM provider. * @return Returns a reference to this object so that method calls can be chained together. */ Builder keyId(String keyId); /** *

* The series of random bits created by a random bit generator, unique for every encryption operation, that you * want Elastic Transcoder to use to encrypt your files. The initialization vector must be base64-encoded, and * it must be exactly 8 bytes long before being base64-encoded. If no initialization vector is provided, Elastic * Transcoder generates one for you. *

* * @param initializationVector * The series of random bits created by a random bit generator, unique for every encryption operation, * that you want Elastic Transcoder to use to encrypt your files. The initialization vector must be * base64-encoded, and it must be exactly 8 bytes long before being base64-encoded. If no initialization * vector is provided, Elastic Transcoder generates one for you. * @return Returns a reference to this object so that method calls can be chained together. */ Builder initializationVector(String initializationVector); /** *

* The location of the license key required to play DRM content. The URL must be an absolute path, and is * referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the client * manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags for HLS * playlist outputs. An example URL looks like this: https://www.example.com/exampleKey/ *

* * @param licenseAcquisitionUrl * The location of the license key required to play DRM content. The URL must be an absolute path, and is * referenced by the PlayReady header. The PlayReady header is referenced in the protection header of the * client manifest for Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata tags * for HLS playlist outputs. An example URL looks like this: * https://www.example.com/exampleKey/ * @return Returns a reference to this object so that method calls can be chained together. */ Builder licenseAcquisitionUrl(String licenseAcquisitionUrl); } static final class BuilderImpl implements Builder { private String format; private String key; private String keyMd5; private String keyId; private String initializationVector; private String licenseAcquisitionUrl; private BuilderImpl() { } private BuilderImpl(PlayReadyDrm model) { format(model.format); key(model.key); keyMd5(model.keyMd5); keyId(model.keyId); initializationVector(model.initializationVector); licenseAcquisitionUrl(model.licenseAcquisitionUrl); } public final String getFormat() { return format; } public final void setFormat(String format) { this.format = format; } @Override public final Builder format(String format) { this.format = format; return this; } public final String getKey() { return key; } public final void setKey(String key) { this.key = key; } @Override public final Builder key(String key) { this.key = key; return this; } public final String getKeyMd5() { return keyMd5; } public final void setKeyMd5(String keyMd5) { this.keyMd5 = keyMd5; } @Override public final Builder keyMd5(String keyMd5) { this.keyMd5 = keyMd5; return this; } public final String getKeyId() { return keyId; } public final void setKeyId(String keyId) { this.keyId = keyId; } @Override public final Builder keyId(String keyId) { this.keyId = keyId; return this; } public final String getInitializationVector() { return initializationVector; } public final void setInitializationVector(String initializationVector) { this.initializationVector = initializationVector; } @Override public final Builder initializationVector(String initializationVector) { this.initializationVector = initializationVector; return this; } public final String getLicenseAcquisitionUrl() { return licenseAcquisitionUrl; } public final void setLicenseAcquisitionUrl(String licenseAcquisitionUrl) { this.licenseAcquisitionUrl = licenseAcquisitionUrl; } @Override public final Builder licenseAcquisitionUrl(String licenseAcquisitionUrl) { this.licenseAcquisitionUrl = licenseAcquisitionUrl; return this; } @Override public PlayReadyDrm build() { return new PlayReadyDrm(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy