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

software.amazon.awssdk.services.notifications.model.NotificationEventOverview 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.notifications.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes a short summary of a NotificationEvent. This is only used when listing notification events. *

*/ @Generated("software.amazon.awssdk:codegen") public final class NotificationEventOverview implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(NotificationEventOverview::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField NOTIFICATION_CONFIGURATION_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("notificationConfigurationArn") .getter(getter(NotificationEventOverview::notificationConfigurationArn)) .setter(setter(Builder::notificationConfigurationArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("notificationConfigurationArn") .build()).build(); private static final SdkField RELATED_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("relatedAccount").getter(getter(NotificationEventOverview::relatedAccount)) .setter(setter(Builder::relatedAccount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("relatedAccount").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("creationTime") .getter(getter(NotificationEventOverview::creationTime)) .setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationTime").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField NOTIFICATION_EVENT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("notificationEvent") .getter(getter(NotificationEventOverview::notificationEvent)).setter(setter(Builder::notificationEvent)) .constructor(NotificationEventSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("notificationEvent").build()).build(); private static final SdkField AGGREGATION_EVENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("aggregationEventType").getter(getter(NotificationEventOverview::aggregationEventTypeAsString)) .setter(setter(Builder::aggregationEventType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("aggregationEventType").build()) .build(); private static final SdkField AGGREGATE_NOTIFICATION_EVENT_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("aggregateNotificationEventArn") .getter(getter(NotificationEventOverview::aggregateNotificationEventArn)) .setter(setter(Builder::aggregateNotificationEventArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("aggregateNotificationEventArn") .build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NOTIFICATION_CONFIGURATION_ARN_FIELD, RELATED_ACCOUNT_FIELD, CREATION_TIME_FIELD, NOTIFICATION_EVENT_FIELD, AGGREGATION_EVENT_TYPE_FIELD, AGGREGATE_NOTIFICATION_EVENT_ARN_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("arn", ARN_FIELD); put("notificationConfigurationArn", NOTIFICATION_CONFIGURATION_ARN_FIELD); put("relatedAccount", RELATED_ACCOUNT_FIELD); put("creationTime", CREATION_TIME_FIELD); put("notificationEvent", NOTIFICATION_EVENT_FIELD); put("aggregationEventType", AGGREGATION_EVENT_TYPE_FIELD); put("aggregateNotificationEventArn", AGGREGATE_NOTIFICATION_EVENT_ARN_FIELD); } }); private static final long serialVersionUID = 1L; private final String arn; private final String notificationConfigurationArn; private final String relatedAccount; private final Instant creationTime; private final NotificationEventSummary notificationEvent; private final String aggregationEventType; private final String aggregateNotificationEventArn; private NotificationEventOverview(BuilderImpl builder) { this.arn = builder.arn; this.notificationConfigurationArn = builder.notificationConfigurationArn; this.relatedAccount = builder.relatedAccount; this.creationTime = builder.creationTime; this.notificationEvent = builder.notificationEvent; this.aggregationEventType = builder.aggregationEventType; this.aggregateNotificationEventArn = builder.aggregateNotificationEventArn; } /** *

* The Amazon Resource Name (ARN) of the resource. *

* * @return The Amazon Resource Name (ARN) of the resource. */ public final String arn() { return arn; } /** *

* The ARN of the NotificationConfiguration. *

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

* The account name containing the NotificationHub. *

* * @return The account name containing the NotificationHub. */ public final String relatedAccount() { return relatedAccount; } /** *

* The creation time of the NotificationEvent. *

* * @return The creation time of the NotificationEvent. */ public final Instant creationTime() { return creationTime; } /** *

* Refers to a NotificationEventSummary object. *

*

* Similar in structure to content in the GetNotificationEvent response. *

* * @return Refers to a NotificationEventSummary object.

*

* Similar in structure to content in the GetNotificationEvent response. */ public final NotificationEventSummary notificationEvent() { return notificationEvent; } /** *

* The NotificationConfiguration's aggregation type. *

*
    *
  • *

    * Values: *

    *
      *
    • *

      * AGGREGATE *

      *
        *
      • *

        * The notification event is an aggregate notification. Aggregate notifications summarize grouped events over a * specified time period. *

        *
      • *
      *
    • *
    • *

      * CHILD *

      *
        *
      • *

        * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

        *
      • *
      *
    • *
    • *

      * NONE *

      *
        *
      • *

        * The notification isn't aggregated. *

        *
      • *
      *
    • *
    *
  • *
*

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

* * @return The NotificationConfiguration's aggregation type.

*
    *
  • *

    * Values: *

    *
      *
    • *

      * AGGREGATE *

      *
        *
      • *

        * The notification event is an aggregate notification. Aggregate notifications summarize grouped events * over a specified time period. *

        *
      • *
      *
    • *
    • *

      * CHILD *

      *
        *
      • *

        * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

        *
      • *
      *
    • *
    • *

      * NONE *

      *
        *
      • *

        * The notification isn't aggregated. *

        *
      • *
      *
    • *
    *
  • * @see AggregationEventType */ public final AggregationEventType aggregationEventType() { return AggregationEventType.fromValue(aggregationEventType); } /** *

    * The NotificationConfiguration's aggregation type. *

    *
      *
    • *

      * Values: *

      *
        *
      • *

        * AGGREGATE *

        *
          *
        • *

          * The notification event is an aggregate notification. Aggregate notifications summarize grouped events over a * specified time period. *

          *
        • *
        *
      • *
      • *

        * CHILD *

        *
          *
        • *

          * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

          *
        • *
        *
      • *
      • *

        * NONE *

        *
          *
        • *

          * The notification isn't aggregated. *

          *
        • *
        *
      • *
      *
    • *
    *

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

    * * @return The NotificationConfiguration's aggregation type.

    *
      *
    • *

      * Values: *

      *
        *
      • *

        * AGGREGATE *

        *
          *
        • *

          * The notification event is an aggregate notification. Aggregate notifications summarize grouped events * over a specified time period. *

          *
        • *
        *
      • *
      • *

        * CHILD *

        *
          *
        • *

          * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

          *
        • *
        *
      • *
      • *

        * NONE *

        *
          *
        • *

          * The notification isn't aggregated. *

          *
        • *
        *
      • *
      *
    • * @see AggregationEventType */ public final String aggregationEventTypeAsString() { return aggregationEventType; } /** *

      * The ARN of the aggregatedNotificationEventArn to match. *

      * * @return The ARN of the aggregatedNotificationEventArn to match. */ public final String aggregateNotificationEventArn() { return aggregateNotificationEventArn; } @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(arn()); hashCode = 31 * hashCode + Objects.hashCode(notificationConfigurationArn()); hashCode = 31 * hashCode + Objects.hashCode(relatedAccount()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(notificationEvent()); hashCode = 31 * hashCode + Objects.hashCode(aggregationEventTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(aggregateNotificationEventArn()); 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 NotificationEventOverview)) { return false; } NotificationEventOverview other = (NotificationEventOverview) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(notificationConfigurationArn(), other.notificationConfigurationArn()) && Objects.equals(relatedAccount(), other.relatedAccount()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(notificationEvent(), other.notificationEvent()) && Objects.equals(aggregationEventTypeAsString(), other.aggregationEventTypeAsString()) && Objects.equals(aggregateNotificationEventArn(), other.aggregateNotificationEventArn()); } /** * 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("NotificationEventOverview").add("Arn", arn()) .add("NotificationConfigurationArn", notificationConfigurationArn()).add("RelatedAccount", relatedAccount()) .add("CreationTime", creationTime()).add("NotificationEvent", notificationEvent()) .add("AggregationEventType", aggregationEventTypeAsString()) .add("AggregateNotificationEventArn", aggregateNotificationEventArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "notificationConfigurationArn": return Optional.ofNullable(clazz.cast(notificationConfigurationArn())); case "relatedAccount": return Optional.ofNullable(clazz.cast(relatedAccount())); case "creationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "notificationEvent": return Optional.ofNullable(clazz.cast(notificationEvent())); case "aggregationEventType": return Optional.ofNullable(clazz.cast(aggregationEventTypeAsString())); case "aggregateNotificationEventArn": return Optional.ofNullable(clazz.cast(aggregateNotificationEventArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((NotificationEventOverview) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The Amazon Resource Name (ARN) of the resource. *

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

      * The ARN of the NotificationConfiguration. *

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

      * The account name containing the NotificationHub. *

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

      * The creation time of the NotificationEvent. *

      * * @param creationTime * The creation time of the NotificationEvent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

      * Refers to a NotificationEventSummary object. *

      *

      * Similar in structure to content in the GetNotificationEvent response. *

      * * @param notificationEvent * Refers to a NotificationEventSummary object.

      *

      * Similar in structure to content in the GetNotificationEvent response. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notificationEvent(NotificationEventSummary notificationEvent); /** *

      * Refers to a NotificationEventSummary object. *

      *

      * Similar in structure to content in the GetNotificationEvent response. *

      * This is a convenience method that creates an instance of the {@link NotificationEventSummary.Builder} * avoiding the need to create one manually via {@link NotificationEventSummary#builder()}. * *

      * When the {@link Consumer} completes, {@link NotificationEventSummary.Builder#build()} is called immediately * and its result is passed to {@link #notificationEvent(NotificationEventSummary)}. * * @param notificationEvent * a consumer that will call methods on {@link NotificationEventSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #notificationEvent(NotificationEventSummary) */ default Builder notificationEvent(Consumer notificationEvent) { return notificationEvent(NotificationEventSummary.builder().applyMutation(notificationEvent).build()); } /** *

      * The NotificationConfiguration's aggregation type. *

      *
        *
      • *

        * Values: *

        *
          *
        • *

          * AGGREGATE *

          *
            *
          • *

            * The notification event is an aggregate notification. Aggregate notifications summarize grouped events over a * specified time period. *

            *
          • *
          *
        • *
        • *

          * CHILD *

          *
            *
          • *

            * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

            *
          • *
          *
        • *
        • *

          * NONE *

          *
            *
          • *

            * The notification isn't aggregated. *

            *
          • *
          *
        • *
        *
      • *
      * * @param aggregationEventType * The NotificationConfiguration's aggregation type.

      *
        *
      • *

        * Values: *

        *
          *
        • *

          * AGGREGATE *

          *
            *
          • *

            * The notification event is an aggregate notification. Aggregate notifications summarize grouped events * over a specified time period. *

            *
          • *
          *
        • *
        • *

          * CHILD *

          *
            *
          • *

            * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

            *
          • *
          *
        • *
        • *

          * NONE *

          *
            *
          • *

            * The notification isn't aggregated. *

            *
          • *
          *
        • *
        *
      • * @see AggregationEventType * @return Returns a reference to this object so that method calls can be chained together. * @see AggregationEventType */ Builder aggregationEventType(String aggregationEventType); /** *

        * The NotificationConfiguration's aggregation type. *

        *
          *
        • *

          * Values: *

          *
            *
          • *

            * AGGREGATE *

            *
              *
            • *

              * The notification event is an aggregate notification. Aggregate notifications summarize grouped events over a * specified time period. *

              *
            • *
            *
          • *
          • *

            * CHILD *

            *
              *
            • *

              * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

              *
            • *
            *
          • *
          • *

            * NONE *

            *
              *
            • *

              * The notification isn't aggregated. *

              *
            • *
            *
          • *
          *
        • *
        * * @param aggregationEventType * The NotificationConfiguration's aggregation type.

        *
          *
        • *

          * Values: *

          *
            *
          • *

            * AGGREGATE *

            *
              *
            • *

              * The notification event is an aggregate notification. Aggregate notifications summarize grouped events * over a specified time period. *

              *
            • *
            *
          • *
          • *

            * CHILD *

            *
              *
            • *

              * Some EventRules are ACTIVE and some are INACTIVE. Any call can be run. *

              *
            • *
            *
          • *
          • *

            * NONE *

            *
              *
            • *

              * The notification isn't aggregated. *

              *
            • *
            *
          • *
          *
        • * @see AggregationEventType * @return Returns a reference to this object so that method calls can be chained together. * @see AggregationEventType */ Builder aggregationEventType(AggregationEventType aggregationEventType); /** *

          * The ARN of the aggregatedNotificationEventArn to match. *

          * * @param aggregateNotificationEventArn * The ARN of the aggregatedNotificationEventArn to match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder aggregateNotificationEventArn(String aggregateNotificationEventArn); } static final class BuilderImpl implements Builder { private String arn; private String notificationConfigurationArn; private String relatedAccount; private Instant creationTime; private NotificationEventSummary notificationEvent; private String aggregationEventType; private String aggregateNotificationEventArn; private BuilderImpl() { } private BuilderImpl(NotificationEventOverview model) { arn(model.arn); notificationConfigurationArn(model.notificationConfigurationArn); relatedAccount(model.relatedAccount); creationTime(model.creationTime); notificationEvent(model.notificationEvent); aggregationEventType(model.aggregationEventType); aggregateNotificationEventArn(model.aggregateNotificationEventArn); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getNotificationConfigurationArn() { return notificationConfigurationArn; } public final void setNotificationConfigurationArn(String notificationConfigurationArn) { this.notificationConfigurationArn = notificationConfigurationArn; } @Override public final Builder notificationConfigurationArn(String notificationConfigurationArn) { this.notificationConfigurationArn = notificationConfigurationArn; return this; } public final String getRelatedAccount() { return relatedAccount; } public final void setRelatedAccount(String relatedAccount) { this.relatedAccount = relatedAccount; } @Override public final Builder relatedAccount(String relatedAccount) { this.relatedAccount = relatedAccount; 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; } public final NotificationEventSummary.Builder getNotificationEvent() { return notificationEvent != null ? notificationEvent.toBuilder() : null; } public final void setNotificationEvent(NotificationEventSummary.BuilderImpl notificationEvent) { this.notificationEvent = notificationEvent != null ? notificationEvent.build() : null; } @Override public final Builder notificationEvent(NotificationEventSummary notificationEvent) { this.notificationEvent = notificationEvent; return this; } public final String getAggregationEventType() { return aggregationEventType; } public final void setAggregationEventType(String aggregationEventType) { this.aggregationEventType = aggregationEventType; } @Override public final Builder aggregationEventType(String aggregationEventType) { this.aggregationEventType = aggregationEventType; return this; } @Override public final Builder aggregationEventType(AggregationEventType aggregationEventType) { this.aggregationEventType(aggregationEventType == null ? null : aggregationEventType.toString()); return this; } public final String getAggregateNotificationEventArn() { return aggregateNotificationEventArn; } public final void setAggregateNotificationEventArn(String aggregateNotificationEventArn) { this.aggregateNotificationEventArn = aggregateNotificationEventArn; } @Override public final Builder aggregateNotificationEventArn(String aggregateNotificationEventArn) { this.aggregateNotificationEventArn = aggregateNotificationEventArn; return this; } @Override public NotificationEventOverview build() { return new NotificationEventOverview(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy