software.amazon.awssdk.services.vpclattice.model.AccessLogSubscriptionSummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vpclattice Show documentation
Show all versions of vpclattice Show documentation
The AWS Java SDK for VPC Lattice module holds the client classes that are used for
communicating with VPC Lattice.
/*
* 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.vpclattice.model;
import java.io.Serializable;
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.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Summary information about an access log subscription.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AccessLogSubscriptionSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(AccessLogSubscriptionSummary::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("createdAt")
.getter(getter(AccessLogSubscriptionSummary::createdAt))
.setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField DESTINATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("destinationArn").getter(getter(AccessLogSubscriptionSummary::destinationArn))
.setter(setter(Builder::destinationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("destinationArn").build()).build();
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id")
.getter(getter(AccessLogSubscriptionSummary::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build();
private static final SdkField LAST_UPDATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("lastUpdatedAt")
.getter(getter(AccessLogSubscriptionSummary::lastUpdatedAt))
.setter(setter(Builder::lastUpdatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField RESOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("resourceArn").getter(getter(AccessLogSubscriptionSummary::resourceArn))
.setter(setter(Builder::resourceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceArn").build()).build();
private static final SdkField RESOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("resourceId").getter(getter(AccessLogSubscriptionSummary::resourceId))
.setter(setter(Builder::resourceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, CREATED_AT_FIELD,
DESTINATION_ARN_FIELD, ID_FIELD, LAST_UPDATED_AT_FIELD, RESOURCE_ARN_FIELD, RESOURCE_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final Instant createdAt;
private final String destinationArn;
private final String id;
private final Instant lastUpdatedAt;
private final String resourceArn;
private final String resourceId;
private AccessLogSubscriptionSummary(BuilderImpl builder) {
this.arn = builder.arn;
this.createdAt = builder.createdAt;
this.destinationArn = builder.destinationArn;
this.id = builder.id;
this.lastUpdatedAt = builder.lastUpdatedAt;
this.resourceArn = builder.resourceArn;
this.resourceId = builder.resourceId;
}
/**
*
* The Amazon Resource Name (ARN) of the access log subscription
*
*
* @return The Amazon Resource Name (ARN) of the access log subscription
*/
public final String arn() {
return arn;
}
/**
*
* The date and time that the access log subscription was created, specified in ISO-8601 format.
*
*
* @return The date and time that the access log subscription was created, specified in ISO-8601 format.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* The Amazon Resource Name (ARN) of the destination.
*
*
* @return The Amazon Resource Name (ARN) of the destination.
*/
public final String destinationArn() {
return destinationArn;
}
/**
*
* The ID of the access log subscription.
*
*
* @return The ID of the access log subscription.
*/
public final String id() {
return id;
}
/**
*
* The date and time that the access log subscription was last updated, specified in ISO-8601 format.
*
*
* @return The date and time that the access log subscription was last updated, specified in ISO-8601 format.
*/
public final Instant lastUpdatedAt() {
return lastUpdatedAt;
}
/**
*
* The Amazon Resource Name (ARN) of the service or service network.
*
*
* @return The Amazon Resource Name (ARN) of the service or service network.
*/
public final String resourceArn() {
return resourceArn;
}
/**
*
* The ID of the service or service network.
*
*
* @return The ID of the service or service network.
*/
public final String resourceId() {
return resourceId;
}
@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(arn());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(destinationArn());
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedAt());
hashCode = 31 * hashCode + Objects.hashCode(resourceArn());
hashCode = 31 * hashCode + Objects.hashCode(resourceId());
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 AccessLogSubscriptionSummary)) {
return false;
}
AccessLogSubscriptionSummary other = (AccessLogSubscriptionSummary) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(destinationArn(), other.destinationArn()) && Objects.equals(id(), other.id())
&& Objects.equals(lastUpdatedAt(), other.lastUpdatedAt()) && Objects.equals(resourceArn(), other.resourceArn())
&& Objects.equals(resourceId(), other.resourceId());
}
/**
* 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("AccessLogSubscriptionSummary").add("Arn", arn()).add("CreatedAt", createdAt())
.add("DestinationArn", destinationArn()).add("Id", id()).add("LastUpdatedAt", lastUpdatedAt())
.add("ResourceArn", resourceArn()).add("ResourceId", resourceId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "createdAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "destinationArn":
return Optional.ofNullable(clazz.cast(destinationArn()));
case "id":
return Optional.ofNullable(clazz.cast(id()));
case "lastUpdatedAt":
return Optional.ofNullable(clazz.cast(lastUpdatedAt()));
case "resourceArn":
return Optional.ofNullable(clazz.cast(resourceArn()));
case "resourceId":
return Optional.ofNullable(clazz.cast(resourceId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function