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

software.amazon.awssdk.services.eventbridge.model.DescribeArchiveResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for EventBridge module holds the client classes that are used for communicating with EventBridge.

There is a newer version: 2.29.39
Show newest version
/*
 * 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.eventbridge.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.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 DescribeArchiveResponse extends EventBridgeResponse implements
        ToCopyableBuilder {
    private static final SdkField ARCHIVE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ArchiveArn").getter(getter(DescribeArchiveResponse::archiveArn)).setter(setter(Builder::archiveArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ArchiveArn").build()).build();

    private static final SdkField ARCHIVE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ArchiveName").getter(getter(DescribeArchiveResponse::archiveName)).setter(setter(Builder::archiveName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ArchiveName").build()).build();

    private static final SdkField EVENT_SOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EventSourceArn").getter(getter(DescribeArchiveResponse::eventSourceArn))
            .setter(setter(Builder::eventSourceArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventSourceArn").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(DescribeArchiveResponse::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField EVENT_PATTERN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EventPattern").getter(getter(DescribeArchiveResponse::eventPattern))
            .setter(setter(Builder::eventPattern))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventPattern").build()).build();

    private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State")
            .getter(getter(DescribeArchiveResponse::stateAsString)).setter(setter(Builder::state))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build();

    private static final SdkField STATE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("StateReason").getter(getter(DescribeArchiveResponse::stateReason)).setter(setter(Builder::stateReason))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StateReason").build()).build();

    private static final SdkField RETENTION_DAYS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("RetentionDays").getter(getter(DescribeArchiveResponse::retentionDays))
            .setter(setter(Builder::retentionDays))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetentionDays").build()).build();

    private static final SdkField SIZE_BYTES_FIELD = SdkField. builder(MarshallingType.LONG).memberName("SizeBytes")
            .getter(getter(DescribeArchiveResponse::sizeBytes)).setter(setter(Builder::sizeBytes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SizeBytes").build()).build();

    private static final SdkField EVENT_COUNT_FIELD = SdkField. builder(MarshallingType.LONG)
            .memberName("EventCount").getter(getter(DescribeArchiveResponse::eventCount)).setter(setter(Builder::eventCount))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventCount").build()).build();

    private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("CreationTime").getter(getter(DescribeArchiveResponse::creationTime))
            .setter(setter(Builder::creationTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARCHIVE_ARN_FIELD,
            ARCHIVE_NAME_FIELD, EVENT_SOURCE_ARN_FIELD, DESCRIPTION_FIELD, EVENT_PATTERN_FIELD, STATE_FIELD, STATE_REASON_FIELD,
            RETENTION_DAYS_FIELD, SIZE_BYTES_FIELD, EVENT_COUNT_FIELD, CREATION_TIME_FIELD));

    private final String archiveArn;

    private final String archiveName;

    private final String eventSourceArn;

    private final String description;

    private final String eventPattern;

    private final String state;

    private final String stateReason;

    private final Integer retentionDays;

    private final Long sizeBytes;

    private final Long eventCount;

    private final Instant creationTime;

    private DescribeArchiveResponse(BuilderImpl builder) {
        super(builder);
        this.archiveArn = builder.archiveArn;
        this.archiveName = builder.archiveName;
        this.eventSourceArn = builder.eventSourceArn;
        this.description = builder.description;
        this.eventPattern = builder.eventPattern;
        this.state = builder.state;
        this.stateReason = builder.stateReason;
        this.retentionDays = builder.retentionDays;
        this.sizeBytes = builder.sizeBytes;
        this.eventCount = builder.eventCount;
        this.creationTime = builder.creationTime;
    }

    /**
     * 

* The ARN of the archive. *

* * @return The ARN of the archive. */ public final String archiveArn() { return archiveArn; } /** *

* The name of the archive. *

* * @return The name of the archive. */ public final String archiveName() { return archiveName; } /** *

* The ARN of the event source associated with the archive. *

* * @return The ARN of the event source associated with the archive. */ public final String eventSourceArn() { return eventSourceArn; } /** *

* The description of the archive. *

* * @return The description of the archive. */ public final String description() { return description; } /** *

* The event pattern used to filter events sent to the archive. *

* * @return The event pattern used to filter events sent to the archive. */ public final String eventPattern() { return eventPattern; } /** *

* The state of the archive. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link ArchiveState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

* * @return The state of the archive. * @see ArchiveState */ public final ArchiveState state() { return ArchiveState.fromValue(state); } /** *

* The state of the archive. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link ArchiveState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

* * @return The state of the archive. * @see ArchiveState */ public final String stateAsString() { return state; } /** *

* The reason that the archive is in the state. *

* * @return The reason that the archive is in the state. */ public final String stateReason() { return stateReason; } /** *

* The number of days to retain events for in the archive. *

* * @return The number of days to retain events for in the archive. */ public final Integer retentionDays() { return retentionDays; } /** *

* The size of the archive in bytes. *

* * @return The size of the archive in bytes. */ public final Long sizeBytes() { return sizeBytes; } /** *

* The number of events in the archive. *

* * @return The number of events in the archive. */ public final Long eventCount() { return eventCount; } /** *

* The time at which the archive was created. *

* * @return The time at which the archive was created. */ public final Instant creationTime() { return creationTime; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(archiveArn()); hashCode = 31 * hashCode + Objects.hashCode(archiveName()); hashCode = 31 * hashCode + Objects.hashCode(eventSourceArn()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(eventPattern()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(stateReason()); hashCode = 31 * hashCode + Objects.hashCode(retentionDays()); hashCode = 31 * hashCode + Objects.hashCode(sizeBytes()); hashCode = 31 * hashCode + Objects.hashCode(eventCount()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); 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 DescribeArchiveResponse)) { return false; } DescribeArchiveResponse other = (DescribeArchiveResponse) obj; return Objects.equals(archiveArn(), other.archiveArn()) && Objects.equals(archiveName(), other.archiveName()) && Objects.equals(eventSourceArn(), other.eventSourceArn()) && Objects.equals(description(), other.description()) && Objects.equals(eventPattern(), other.eventPattern()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(stateReason(), other.stateReason()) && Objects.equals(retentionDays(), other.retentionDays()) && Objects.equals(sizeBytes(), other.sizeBytes()) && Objects.equals(eventCount(), other.eventCount()) && Objects.equals(creationTime(), other.creationTime()); } /** * 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("DescribeArchiveResponse").add("ArchiveArn", archiveArn()).add("ArchiveName", archiveName()) .add("EventSourceArn", eventSourceArn()).add("Description", description()).add("EventPattern", eventPattern()) .add("State", stateAsString()).add("StateReason", stateReason()).add("RetentionDays", retentionDays()) .add("SizeBytes", sizeBytes()).add("EventCount", eventCount()).add("CreationTime", creationTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ArchiveArn": return Optional.ofNullable(clazz.cast(archiveArn())); case "ArchiveName": return Optional.ofNullable(clazz.cast(archiveName())); case "EventSourceArn": return Optional.ofNullable(clazz.cast(eventSourceArn())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "EventPattern": return Optional.ofNullable(clazz.cast(eventPattern())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "StateReason": return Optional.ofNullable(clazz.cast(stateReason())); case "RetentionDays": return Optional.ofNullable(clazz.cast(retentionDays())); case "SizeBytes": return Optional.ofNullable(clazz.cast(sizeBytes())); case "EventCount": return Optional.ofNullable(clazz.cast(eventCount())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeArchiveResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends EventBridgeResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The ARN of the archive. *

* * @param archiveArn * The ARN of the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder archiveArn(String archiveArn); /** *

* The name of the archive. *

* * @param archiveName * The name of the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder archiveName(String archiveName); /** *

* The ARN of the event source associated with the archive. *

* * @param eventSourceArn * The ARN of the event source associated with the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventSourceArn(String eventSourceArn); /** *

* The description of the archive. *

* * @param description * The description of the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The event pattern used to filter events sent to the archive. *

* * @param eventPattern * The event pattern used to filter events sent to the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventPattern(String eventPattern); /** *

* The state of the archive. *

* * @param state * The state of the archive. * @see ArchiveState * @return Returns a reference to this object so that method calls can be chained together. * @see ArchiveState */ Builder state(String state); /** *

* The state of the archive. *

* * @param state * The state of the archive. * @see ArchiveState * @return Returns a reference to this object so that method calls can be chained together. * @see ArchiveState */ Builder state(ArchiveState state); /** *

* The reason that the archive is in the state. *

* * @param stateReason * The reason that the archive is in the state. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stateReason(String stateReason); /** *

* The number of days to retain events for in the archive. *

* * @param retentionDays * The number of days to retain events for in the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retentionDays(Integer retentionDays); /** *

* The size of the archive in bytes. *

* * @param sizeBytes * The size of the archive in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sizeBytes(Long sizeBytes); /** *

* The number of events in the archive. *

* * @param eventCount * The number of events in the archive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventCount(Long eventCount); /** *

* The time at which the archive was created. *

* * @param creationTime * The time at which the archive was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); } static final class BuilderImpl extends EventBridgeResponse.BuilderImpl implements Builder { private String archiveArn; private String archiveName; private String eventSourceArn; private String description; private String eventPattern; private String state; private String stateReason; private Integer retentionDays; private Long sizeBytes; private Long eventCount; private Instant creationTime; private BuilderImpl() { } private BuilderImpl(DescribeArchiveResponse model) { super(model); archiveArn(model.archiveArn); archiveName(model.archiveName); eventSourceArn(model.eventSourceArn); description(model.description); eventPattern(model.eventPattern); state(model.state); stateReason(model.stateReason); retentionDays(model.retentionDays); sizeBytes(model.sizeBytes); eventCount(model.eventCount); creationTime(model.creationTime); } public final String getArchiveArn() { return archiveArn; } public final void setArchiveArn(String archiveArn) { this.archiveArn = archiveArn; } @Override public final Builder archiveArn(String archiveArn) { this.archiveArn = archiveArn; return this; } public final String getArchiveName() { return archiveName; } public final void setArchiveName(String archiveName) { this.archiveName = archiveName; } @Override public final Builder archiveName(String archiveName) { this.archiveName = archiveName; return this; } public final String getEventSourceArn() { return eventSourceArn; } public final void setEventSourceArn(String eventSourceArn) { this.eventSourceArn = eventSourceArn; } @Override public final Builder eventSourceArn(String eventSourceArn) { this.eventSourceArn = eventSourceArn; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getEventPattern() { return eventPattern; } public final void setEventPattern(String eventPattern) { this.eventPattern = eventPattern; } @Override public final Builder eventPattern(String eventPattern) { this.eventPattern = eventPattern; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(ArchiveState state) { this.state(state == null ? null : state.toString()); return this; } public final String getStateReason() { return stateReason; } public final void setStateReason(String stateReason) { this.stateReason = stateReason; } @Override public final Builder stateReason(String stateReason) { this.stateReason = stateReason; return this; } public final Integer getRetentionDays() { return retentionDays; } public final void setRetentionDays(Integer retentionDays) { this.retentionDays = retentionDays; } @Override public final Builder retentionDays(Integer retentionDays) { this.retentionDays = retentionDays; return this; } public final Long getSizeBytes() { return sizeBytes; } public final void setSizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; } @Override public final Builder sizeBytes(Long sizeBytes) { this.sizeBytes = sizeBytes; return this; } public final Long getEventCount() { return eventCount; } public final void setEventCount(Long eventCount) { this.eventCount = eventCount; } @Override public final Builder eventCount(Long eventCount) { this.eventCount = eventCount; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } @Override public DescribeArchiveResponse build() { return new DescribeArchiveResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy