software.amazon.awssdk.services.mediaconvert.model.StaticKeyProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mediaconvert Show documentation
Show all versions of mediaconvert Show documentation
The AWS Java SDK for AWS Elemental MediaConvert module holds the client classes that are used for
communicating
with AWS Elemental MediaConvert Service
/*
* 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.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;
/**
* Use these settings to set up encryption with a static key provider.
*/
@Generated("software.amazon.awssdk:codegen")
public final class StaticKeyProvider implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField KEY_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KeyFormat").getter(getter(StaticKeyProvider::keyFormat)).setter(setter(Builder::keyFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("keyFormat").build()).build();
private static final SdkField KEY_FORMAT_VERSIONS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KeyFormatVersions").getter(getter(StaticKeyProvider::keyFormatVersions))
.setter(setter(Builder::keyFormatVersions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("keyFormatVersions").build()).build();
private static final SdkField STATIC_KEY_VALUE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StaticKeyValue").getter(getter(StaticKeyProvider::staticKeyValue))
.setter(setter(Builder::staticKeyValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("staticKeyValue").build()).build();
private static final SdkField URL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Url")
.getter(getter(StaticKeyProvider::url)).setter(setter(Builder::url))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("url").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(KEY_FORMAT_FIELD,
KEY_FORMAT_VERSIONS_FIELD, STATIC_KEY_VALUE_FIELD, URL_FIELD));
private static final long serialVersionUID = 1L;
private final String keyFormat;
private final String keyFormatVersions;
private final String staticKeyValue;
private final String url;
private StaticKeyProvider(BuilderImpl builder) {
this.keyFormat = builder.keyFormat;
this.keyFormatVersions = builder.keyFormatVersions;
this.staticKeyValue = builder.staticKeyValue;
this.url = builder.url;
}
/**
* Relates to DRM implementation. Sets the value of the KEYFORMAT attribute. Must be 'identity' or a reverse DNS
* string. May be omitted to indicate an implicit value of 'identity'.
*
* @return Relates to DRM implementation. Sets the value of the KEYFORMAT attribute. Must be 'identity' or a reverse
* DNS string. May be omitted to indicate an implicit value of 'identity'.
*/
public final String keyFormat() {
return keyFormat;
}
/**
* Relates to DRM implementation. Either a single positive integer version value or a slash delimited list of
* version values (1/2/3).
*
* @return Relates to DRM implementation. Either a single positive integer version value or a slash delimited list
* of version values (1/2/3).
*/
public final String keyFormatVersions() {
return keyFormatVersions;
}
/**
* Relates to DRM implementation. Use a 32-character hexidecimal string to specify Key Value.
*
* @return Relates to DRM implementation. Use a 32-character hexidecimal string to specify Key Value.
*/
public final String staticKeyValue() {
return staticKeyValue;
}
/**
* Relates to DRM implementation. The location of the license server used for protecting content.
*
* @return Relates to DRM implementation. The location of the license server used for protecting content.
*/
public final String url() {
return url;
}
@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(keyFormat());
hashCode = 31 * hashCode + Objects.hashCode(keyFormatVersions());
hashCode = 31 * hashCode + Objects.hashCode(staticKeyValue());
hashCode = 31 * hashCode + Objects.hashCode(url());
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 StaticKeyProvider)) {
return false;
}
StaticKeyProvider other = (StaticKeyProvider) obj;
return Objects.equals(keyFormat(), other.keyFormat()) && Objects.equals(keyFormatVersions(), other.keyFormatVersions())
&& Objects.equals(staticKeyValue(), other.staticKeyValue()) && Objects.equals(url(), other.url());
}
/**
* 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("StaticKeyProvider").add("KeyFormat", keyFormat()).add("KeyFormatVersions", keyFormatVersions())
.add("StaticKeyValue", staticKeyValue()).add("Url", url()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "KeyFormat":
return Optional.ofNullable(clazz.cast(keyFormat()));
case "KeyFormatVersions":
return Optional.ofNullable(clazz.cast(keyFormatVersions()));
case "StaticKeyValue":
return Optional.ofNullable(clazz.cast(staticKeyValue()));
case "Url":
return Optional.ofNullable(clazz.cast(url()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function