
software.amazon.awssdk.services.kinesisvideo.model.EdgeConfig 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.kinesisvideo.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;
/**
*
* A description of the stream's edge configuration that will be used to sync with the Edge Agent IoT Greengrass
* component. The Edge Agent component will run on an IoT Hub Device setup at your premise.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class EdgeConfig implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField HUB_DEVICE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HubDeviceArn").getter(getter(EdgeConfig::hubDeviceArn)).setter(setter(Builder::hubDeviceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HubDeviceArn").build()).build();
private static final SdkField RECORDER_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RecorderConfig")
.getter(getter(EdgeConfig::recorderConfig)).setter(setter(Builder::recorderConfig))
.constructor(RecorderConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecorderConfig").build()).build();
private static final SdkField UPLOADER_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("UploaderConfig")
.getter(getter(EdgeConfig::uploaderConfig)).setter(setter(Builder::uploaderConfig))
.constructor(UploaderConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UploaderConfig").build()).build();
private static final SdkField DELETION_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DeletionConfig")
.getter(getter(EdgeConfig::deletionConfig)).setter(setter(Builder::deletionConfig))
.constructor(DeletionConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletionConfig").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(HUB_DEVICE_ARN_FIELD,
RECORDER_CONFIG_FIELD, UPLOADER_CONFIG_FIELD, DELETION_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String hubDeviceArn;
private final RecorderConfig recorderConfig;
private final UploaderConfig uploaderConfig;
private final DeletionConfig deletionConfig;
private EdgeConfig(BuilderImpl builder) {
this.hubDeviceArn = builder.hubDeviceArn;
this.recorderConfig = builder.recorderConfig;
this.uploaderConfig = builder.uploaderConfig;
this.deletionConfig = builder.deletionConfig;
}
/**
*
* The "Internet of Things (IoT) Thing" Arn of the stream.
*
*
* @return The "Internet of Things (IoT) Thing" Arn of the stream.
*/
public final String hubDeviceArn() {
return hubDeviceArn;
}
/**
*
* The recorder configuration consists of the local MediaSourceConfig
details, that are used as
* credentials to access the local media files streamed on the camera.
*
*
* @return The recorder configuration consists of the local MediaSourceConfig
details, that are used as
* credentials to access the local media files streamed on the camera.
*/
public final RecorderConfig recorderConfig() {
return recorderConfig;
}
/**
*
* The uploader configuration contains the ScheduleExpression
details that are used to schedule upload
* jobs for the recorded media files from the Edge Agent to a Kinesis Video Stream.
*
*
* @return The uploader configuration contains the ScheduleExpression
details that are used to schedule
* upload jobs for the recorded media files from the Edge Agent to a Kinesis Video Stream.
*/
public final UploaderConfig uploaderConfig() {
return uploaderConfig;
}
/**
*
* The deletion configuration is made up of the retention time (EdgeRetentionInHours
) and local size
* configuration (LocalSizeConfig
) details that are used to make the deletion.
*
*
* @return The deletion configuration is made up of the retention time (EdgeRetentionInHours
) and local
* size configuration (LocalSizeConfig
) details that are used to make the deletion.
*/
public final DeletionConfig deletionConfig() {
return deletionConfig;
}
@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(hubDeviceArn());
hashCode = 31 * hashCode + Objects.hashCode(recorderConfig());
hashCode = 31 * hashCode + Objects.hashCode(uploaderConfig());
hashCode = 31 * hashCode + Objects.hashCode(deletionConfig());
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 EdgeConfig)) {
return false;
}
EdgeConfig other = (EdgeConfig) obj;
return Objects.equals(hubDeviceArn(), other.hubDeviceArn()) && Objects.equals(recorderConfig(), other.recorderConfig())
&& Objects.equals(uploaderConfig(), other.uploaderConfig())
&& Objects.equals(deletionConfig(), other.deletionConfig());
}
/**
* 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("EdgeConfig").add("HubDeviceArn", hubDeviceArn()).add("RecorderConfig", recorderConfig())
.add("UploaderConfig", uploaderConfig()).add("DeletionConfig", deletionConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "HubDeviceArn":
return Optional.ofNullable(clazz.cast(hubDeviceArn()));
case "RecorderConfig":
return Optional.ofNullable(clazz.cast(recorderConfig()));
case "UploaderConfig":
return Optional.ofNullable(clazz.cast(uploaderConfig()));
case "DeletionConfig":
return Optional.ofNullable(clazz.cast(deletionConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function