software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkServiceAssociationResponse Maven / Gradle / Ivy
Show all versions of vpclattice 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.vpclattice.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.core.traits.TimestampFormatTrait;
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 GetServiceNetworkServiceAssociationResponse extends VpcLatticeResponse implements
ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(GetServiceNetworkServiceAssociationResponse::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(GetServiceNetworkServiceAssociationResponse::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 CREATED_BY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("createdBy").getter(getter(GetServiceNetworkServiceAssociationResponse::createdBy))
.setter(setter(Builder::createdBy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdBy").build()).build();
private static final SdkField CUSTOM_DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("customDomainName").getter(getter(GetServiceNetworkServiceAssociationResponse::customDomainName))
.setter(setter(Builder::customDomainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("customDomainName").build()).build();
private static final SdkField DNS_ENTRY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("dnsEntry").getter(getter(GetServiceNetworkServiceAssociationResponse::dnsEntry))
.setter(setter(Builder::dnsEntry)).constructor(DnsEntry::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dnsEntry").build()).build();
private static final SdkField FAILURE_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("failureCode").getter(getter(GetServiceNetworkServiceAssociationResponse::failureCode))
.setter(setter(Builder::failureCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failureCode").build()).build();
private static final SdkField FAILURE_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("failureMessage").getter(getter(GetServiceNetworkServiceAssociationResponse::failureMessage))
.setter(setter(Builder::failureMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failureMessage").build()).build();
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id")
.getter(getter(GetServiceNetworkServiceAssociationResponse::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build();
private static final SdkField SERVICE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceArn").getter(getter(GetServiceNetworkServiceAssociationResponse::serviceArn))
.setter(setter(Builder::serviceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceArn").build()).build();
private static final SdkField SERVICE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceId").getter(getter(GetServiceNetworkServiceAssociationResponse::serviceId))
.setter(setter(Builder::serviceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceId").build()).build();
private static final SdkField SERVICE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceName").getter(getter(GetServiceNetworkServiceAssociationResponse::serviceName))
.setter(setter(Builder::serviceName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceName").build()).build();
private static final SdkField SERVICE_NETWORK_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceNetworkArn").getter(getter(GetServiceNetworkServiceAssociationResponse::serviceNetworkArn))
.setter(setter(Builder::serviceNetworkArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceNetworkArn").build()).build();
private static final SdkField SERVICE_NETWORK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceNetworkId").getter(getter(GetServiceNetworkServiceAssociationResponse::serviceNetworkId))
.setter(setter(Builder::serviceNetworkId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceNetworkId").build()).build();
private static final SdkField SERVICE_NETWORK_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("serviceNetworkName").getter(getter(GetServiceNetworkServiceAssociationResponse::serviceNetworkName))
.setter(setter(Builder::serviceNetworkName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceNetworkName").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(GetServiceNetworkServiceAssociationResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, CREATED_AT_FIELD,
CREATED_BY_FIELD, CUSTOM_DOMAIN_NAME_FIELD, DNS_ENTRY_FIELD, FAILURE_CODE_FIELD, FAILURE_MESSAGE_FIELD, ID_FIELD,
SERVICE_ARN_FIELD, SERVICE_ID_FIELD, SERVICE_NAME_FIELD, SERVICE_NETWORK_ARN_FIELD, SERVICE_NETWORK_ID_FIELD,
SERVICE_NETWORK_NAME_FIELD, STATUS_FIELD));
private final String arn;
private final Instant createdAt;
private final String createdBy;
private final String customDomainName;
private final DnsEntry dnsEntry;
private final String failureCode;
private final String failureMessage;
private final String id;
private final String serviceArn;
private final String serviceId;
private final String serviceName;
private final String serviceNetworkArn;
private final String serviceNetworkId;
private final String serviceNetworkName;
private final String status;
private GetServiceNetworkServiceAssociationResponse(BuilderImpl builder) {
super(builder);
this.arn = builder.arn;
this.createdAt = builder.createdAt;
this.createdBy = builder.createdBy;
this.customDomainName = builder.customDomainName;
this.dnsEntry = builder.dnsEntry;
this.failureCode = builder.failureCode;
this.failureMessage = builder.failureMessage;
this.id = builder.id;
this.serviceArn = builder.serviceArn;
this.serviceId = builder.serviceId;
this.serviceName = builder.serviceName;
this.serviceNetworkArn = builder.serviceNetworkArn;
this.serviceNetworkId = builder.serviceNetworkId;
this.serviceNetworkName = builder.serviceNetworkName;
this.status = builder.status;
}
/**
*
* The Amazon Resource Name (ARN) of the association.
*
*
* @return The Amazon Resource Name (ARN) of the association.
*/
public final String arn() {
return arn;
}
/**
*
* The date and time that the association was created, specified in ISO-8601 format.
*
*
* @return The date and time that the association was created, specified in ISO-8601 format.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* The account that created the association.
*
*
* @return The account that created the association.
*/
public final String createdBy() {
return createdBy;
}
/**
*
* The custom domain name of the service.
*
*
* @return The custom domain name of the service.
*/
public final String customDomainName() {
return customDomainName;
}
/**
*
* The DNS name of the service.
*
*
* @return The DNS name of the service.
*/
public final DnsEntry dnsEntry() {
return dnsEntry;
}
/**
*
* The failure code.
*
*
* @return The failure code.
*/
public final String failureCode() {
return failureCode;
}
/**
*
* The failure message.
*
*
* @return The failure message.
*/
public final String failureMessage() {
return failureMessage;
}
/**
*
* The ID of the service network and service association.
*
*
* @return The ID of the service network and service association.
*/
public final String id() {
return id;
}
/**
*
* The Amazon Resource Name (ARN) of the service.
*
*
* @return The Amazon Resource Name (ARN) of the service.
*/
public final String serviceArn() {
return serviceArn;
}
/**
*
* The ID of the service.
*
*
* @return The ID of the service.
*/
public final String serviceId() {
return serviceId;
}
/**
*
* The name of the service.
*
*
* @return The name of the service.
*/
public final String serviceName() {
return serviceName;
}
/**
*
* The Amazon Resource Name (ARN) of the service network.
*
*
* @return The Amazon Resource Name (ARN) of the service network.
*/
public final String serviceNetworkArn() {
return serviceNetworkArn;
}
/**
*
* The ID of the service network.
*
*
* @return The ID of the service network.
*/
public final String serviceNetworkId() {
return serviceNetworkId;
}
/**
*
* The name of the service network.
*
*
* @return The name of the service network.
*/
public final String serviceNetworkName() {
return serviceNetworkName;
}
/**
*
* The status of the association.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ServiceNetworkServiceAssociationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the
* service is available from {@link #statusAsString}.
*
*
* @return The status of the association.
* @see ServiceNetworkServiceAssociationStatus
*/
public final ServiceNetworkServiceAssociationStatus status() {
return ServiceNetworkServiceAssociationStatus.fromValue(status);
}
/**
*
* The status of the association.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ServiceNetworkServiceAssociationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the
* service is available from {@link #statusAsString}.
*
*
* @return The status of the association.
* @see ServiceNetworkServiceAssociationStatus
*/
public final String statusAsString() {
return status;
}
@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(arn());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(createdBy());
hashCode = 31 * hashCode + Objects.hashCode(customDomainName());
hashCode = 31 * hashCode + Objects.hashCode(dnsEntry());
hashCode = 31 * hashCode + Objects.hashCode(failureCode());
hashCode = 31 * hashCode + Objects.hashCode(failureMessage());
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(serviceArn());
hashCode = 31 * hashCode + Objects.hashCode(serviceId());
hashCode = 31 * hashCode + Objects.hashCode(serviceName());
hashCode = 31 * hashCode + Objects.hashCode(serviceNetworkArn());
hashCode = 31 * hashCode + Objects.hashCode(serviceNetworkId());
hashCode = 31 * hashCode + Objects.hashCode(serviceNetworkName());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
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 GetServiceNetworkServiceAssociationResponse)) {
return false;
}
GetServiceNetworkServiceAssociationResponse other = (GetServiceNetworkServiceAssociationResponse) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(createdBy(), other.createdBy()) && Objects.equals(customDomainName(), other.customDomainName())
&& Objects.equals(dnsEntry(), other.dnsEntry()) && Objects.equals(failureCode(), other.failureCode())
&& Objects.equals(failureMessage(), other.failureMessage()) && Objects.equals(id(), other.id())
&& Objects.equals(serviceArn(), other.serviceArn()) && Objects.equals(serviceId(), other.serviceId())
&& Objects.equals(serviceName(), other.serviceName())
&& Objects.equals(serviceNetworkArn(), other.serviceNetworkArn())
&& Objects.equals(serviceNetworkId(), other.serviceNetworkId())
&& Objects.equals(serviceNetworkName(), other.serviceNetworkName())
&& Objects.equals(statusAsString(), other.statusAsString());
}
/**
* 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("GetServiceNetworkServiceAssociationResponse").add("Arn", arn()).add("CreatedAt", createdAt())
.add("CreatedBy", createdBy()).add("CustomDomainName", customDomainName()).add("DnsEntry", dnsEntry())
.add("FailureCode", failureCode()).add("FailureMessage", failureMessage()).add("Id", id())
.add("ServiceArn", serviceArn()).add("ServiceId", serviceId()).add("ServiceName", serviceName())
.add("ServiceNetworkArn", serviceNetworkArn()).add("ServiceNetworkId", serviceNetworkId())
.add("ServiceNetworkName", serviceNetworkName()).add("Status", statusAsString()).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 "createdBy":
return Optional.ofNullable(clazz.cast(createdBy()));
case "customDomainName":
return Optional.ofNullable(clazz.cast(customDomainName()));
case "dnsEntry":
return Optional.ofNullable(clazz.cast(dnsEntry()));
case "failureCode":
return Optional.ofNullable(clazz.cast(failureCode()));
case "failureMessage":
return Optional.ofNullable(clazz.cast(failureMessage()));
case "id":
return Optional.ofNullable(clazz.cast(id()));
case "serviceArn":
return Optional.ofNullable(clazz.cast(serviceArn()));
case "serviceId":
return Optional.ofNullable(clazz.cast(serviceId()));
case "serviceName":
return Optional.ofNullable(clazz.cast(serviceName()));
case "serviceNetworkArn":
return Optional.ofNullable(clazz.cast(serviceNetworkArn()));
case "serviceNetworkId":
return Optional.ofNullable(clazz.cast(serviceNetworkId()));
case "serviceNetworkName":
return Optional.ofNullable(clazz.cast(serviceNetworkName()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function