software.amazon.awssdk.services.kinesisvideo.model.DescribeEdgeConfigurationResponse Maven / Gradle / Ivy
Show all versions of kinesisvideo 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.kinesisvideo.model;
import java.time.Instant;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeEdgeConfigurationResponse extends KinesisVideoResponse implements
ToCopyableBuilder {
private static final SdkField STREAM_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StreamName").getter(getter(DescribeEdgeConfigurationResponse::streamName))
.setter(setter(Builder::streamName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamName").build()).build();
private static final SdkField STREAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StreamARN").getter(getter(DescribeEdgeConfigurationResponse::streamARN))
.setter(setter(Builder::streamARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamARN").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeEdgeConfigurationResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_UPDATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastUpdatedTime").getter(getter(DescribeEdgeConfigurationResponse::lastUpdatedTime))
.setter(setter(Builder::lastUpdatedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedTime").build()).build();
private static final SdkField SYNC_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SyncStatus").getter(getter(DescribeEdgeConfigurationResponse::syncStatusAsString))
.setter(setter(Builder::syncStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SyncStatus").build()).build();
private static final SdkField FAILED_STATUS_DETAILS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailedStatusDetails").getter(getter(DescribeEdgeConfigurationResponse::failedStatusDetails))
.setter(setter(Builder::failedStatusDetails))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailedStatusDetails").build())
.build();
private static final SdkField EDGE_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("EdgeConfig").getter(getter(DescribeEdgeConfigurationResponse::edgeConfig))
.setter(setter(Builder::edgeConfig)).constructor(EdgeConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeConfig").build()).build();
private static final SdkField EDGE_AGENT_STATUS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EdgeAgentStatus")
.getter(getter(DescribeEdgeConfigurationResponse::edgeAgentStatus)).setter(setter(Builder::edgeAgentStatus))
.constructor(EdgeAgentStatus::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EdgeAgentStatus").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STREAM_NAME_FIELD,
STREAM_ARN_FIELD, CREATION_TIME_FIELD, LAST_UPDATED_TIME_FIELD, SYNC_STATUS_FIELD, FAILED_STATUS_DETAILS_FIELD,
EDGE_CONFIG_FIELD, EDGE_AGENT_STATUS_FIELD));
private final String streamName;
private final String streamARN;
private final Instant creationTime;
private final Instant lastUpdatedTime;
private final String syncStatus;
private final String failedStatusDetails;
private final EdgeConfig edgeConfig;
private final EdgeAgentStatus edgeAgentStatus;
private DescribeEdgeConfigurationResponse(BuilderImpl builder) {
super(builder);
this.streamName = builder.streamName;
this.streamARN = builder.streamARN;
this.creationTime = builder.creationTime;
this.lastUpdatedTime = builder.lastUpdatedTime;
this.syncStatus = builder.syncStatus;
this.failedStatusDetails = builder.failedStatusDetails;
this.edgeConfig = builder.edgeConfig;
this.edgeAgentStatus = builder.edgeAgentStatus;
}
/**
*
* The name of the stream from which the edge configuration was updated.
*
*
* @return The name of the stream from which the edge configuration was updated.
*/
public final String streamName() {
return streamName;
}
/**
*
* The Amazon Resource Name (ARN) of the stream.
*
*
* @return The Amazon Resource Name (ARN) of the stream.
*/
public final String streamARN() {
return streamARN;
}
/**
*
* The timestamp at which a stream’s edge configuration was first created.
*
*
* @return The timestamp at which a stream’s edge configuration was first created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The timestamp at which a stream’s edge configuration was last updated.
*
*
* @return The timestamp at which a stream’s edge configuration was last updated.
*/
public final Instant lastUpdatedTime() {
return lastUpdatedTime;
}
/**
*
* The latest status of the edge configuration update.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #syncStatus} will
* return {@link SyncStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #syncStatusAsString}.
*
*
* @return The latest status of the edge configuration update.
* @see SyncStatus
*/
public final SyncStatus syncStatus() {
return SyncStatus.fromValue(syncStatus);
}
/**
*
* The latest status of the edge configuration update.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #syncStatus} will
* return {@link SyncStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #syncStatusAsString}.
*
*
* @return The latest status of the edge configuration update.
* @see SyncStatus
*/
public final String syncStatusAsString() {
return syncStatus;
}
/**
*
* A description of the generated failure status.
*
*
* @return A description of the generated failure status.
*/
public final String failedStatusDetails() {
return failedStatusDetails;
}
/**
*
* 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.
*
*
* @return 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.
*/
public final EdgeConfig edgeConfig() {
return edgeConfig;
}
/**
*
* An object that contains the latest status details for an edge agent's recorder and uploader jobs. Use this
* information to determine the current health of an edge agent.
*
*
* @return An object that contains the latest status details for an edge agent's recorder and uploader jobs. Use
* this information to determine the current health of an edge agent.
*/
public final EdgeAgentStatus edgeAgentStatus() {
return edgeAgentStatus;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(streamName());
hashCode = 31 * hashCode + Objects.hashCode(streamARN());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTime());
hashCode = 31 * hashCode + Objects.hashCode(syncStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(failedStatusDetails());
hashCode = 31 * hashCode + Objects.hashCode(edgeConfig());
hashCode = 31 * hashCode + Objects.hashCode(edgeAgentStatus());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DescribeEdgeConfigurationResponse)) {
return false;
}
DescribeEdgeConfigurationResponse other = (DescribeEdgeConfigurationResponse) obj;
return Objects.equals(streamName(), other.streamName()) && Objects.equals(streamARN(), other.streamARN())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastUpdatedTime(), other.lastUpdatedTime())
&& Objects.equals(syncStatusAsString(), other.syncStatusAsString())
&& Objects.equals(failedStatusDetails(), other.failedStatusDetails())
&& Objects.equals(edgeConfig(), other.edgeConfig()) && Objects.equals(edgeAgentStatus(), other.edgeAgentStatus());
}
/**
* 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("DescribeEdgeConfigurationResponse").add("StreamName", streamName())
.add("StreamARN", streamARN()).add("CreationTime", creationTime()).add("LastUpdatedTime", lastUpdatedTime())
.add("SyncStatus", syncStatusAsString()).add("FailedStatusDetails", failedStatusDetails())
.add("EdgeConfig", edgeConfig()).add("EdgeAgentStatus", edgeAgentStatus()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StreamName":
return Optional.ofNullable(clazz.cast(streamName()));
case "StreamARN":
return Optional.ofNullable(clazz.cast(streamARN()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastUpdatedTime":
return Optional.ofNullable(clazz.cast(lastUpdatedTime()));
case "SyncStatus":
return Optional.ofNullable(clazz.cast(syncStatusAsString()));
case "FailedStatusDetails":
return Optional.ofNullable(clazz.cast(failedStatusDetails()));
case "EdgeConfig":
return Optional.ofNullable(clazz.cast(edgeConfig()));
case "EdgeAgentStatus":
return Optional.ofNullable(clazz.cast(edgeAgentStatus()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function