software.amazon.awssdk.services.apprunner.model.VpcIngressConnection Maven / Gradle / Ivy
Show all versions of apprunner 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.apprunner.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.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;
/**
*
* The App Runner resource that specifies an App Runner endpoint for incoming traffic. It establishes a connection
* between a VPC interface endpoint and a App Runner service, to make your App Runner service accessible from only
* within an Amazon VPC.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class VpcIngressConnection implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VPC_INGRESS_CONNECTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VpcIngressConnectionArn").getter(getter(VpcIngressConnection::vpcIngressConnectionArn))
.setter(setter(Builder::vpcIngressConnectionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcIngressConnectionArn").build())
.build();
private static final SdkField VPC_INGRESS_CONNECTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VpcIngressConnectionName").getter(getter(VpcIngressConnection::vpcIngressConnectionName))
.setter(setter(Builder::vpcIngressConnectionName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcIngressConnectionName").build())
.build();
private static final SdkField SERVICE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceArn").getter(getter(VpcIngressConnection::serviceArn)).setter(setter(Builder::serviceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceArn").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(VpcIngressConnection::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AccountId").getter(getter(VpcIngressConnection::accountId)).setter(setter(Builder::accountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountId").build()).build();
private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DomainName").getter(getter(VpcIngressConnection::domainName)).setter(setter(Builder::domainName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build();
private static final SdkField INGRESS_VPC_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("IngressVpcConfiguration")
.getter(getter(VpcIngressConnection::ingressVpcConfiguration)).setter(setter(Builder::ingressVpcConfiguration))
.constructor(IngressVpcConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IngressVpcConfiguration").build())
.build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedAt").getter(getter(VpcIngressConnection::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField DELETED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("DeletedAt").getter(getter(VpcIngressConnection::deletedAt)).setter(setter(Builder::deletedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletedAt").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
VPC_INGRESS_CONNECTION_ARN_FIELD, VPC_INGRESS_CONNECTION_NAME_FIELD, SERVICE_ARN_FIELD, STATUS_FIELD,
ACCOUNT_ID_FIELD, DOMAIN_NAME_FIELD, INGRESS_VPC_CONFIGURATION_FIELD, CREATED_AT_FIELD, DELETED_AT_FIELD));
private static final long serialVersionUID = 1L;
private final String vpcIngressConnectionArn;
private final String vpcIngressConnectionName;
private final String serviceArn;
private final String status;
private final String accountId;
private final String domainName;
private final IngressVpcConfiguration ingressVpcConfiguration;
private final Instant createdAt;
private final Instant deletedAt;
private VpcIngressConnection(BuilderImpl builder) {
this.vpcIngressConnectionArn = builder.vpcIngressConnectionArn;
this.vpcIngressConnectionName = builder.vpcIngressConnectionName;
this.serviceArn = builder.serviceArn;
this.status = builder.status;
this.accountId = builder.accountId;
this.domainName = builder.domainName;
this.ingressVpcConfiguration = builder.ingressVpcConfiguration;
this.createdAt = builder.createdAt;
this.deletedAt = builder.deletedAt;
}
/**
*
* The Amazon Resource Name (ARN) of the VPC Ingress Connection.
*
*
* @return The Amazon Resource Name (ARN) of the VPC Ingress Connection.
*/
public final String vpcIngressConnectionArn() {
return vpcIngressConnectionArn;
}
/**
*
* The customer-provided VPC Ingress Connection name.
*
*
* @return The customer-provided VPC Ingress Connection name.
*/
public final String vpcIngressConnectionName() {
return vpcIngressConnectionName;
}
/**
*
* The Amazon Resource Name (ARN) of the service associated with the VPC Ingress Connection.
*
*
* @return The Amazon Resource Name (ARN) of the service associated with the VPC Ingress Connection.
*/
public final String serviceArn() {
return serviceArn;
}
/**
*
* The current status of the VPC Ingress Connection. The VPC Ingress Connection displays one of the following
* statuses: AVAILABLE
, PENDING_CREATION
, PENDING_UPDATE
,
* PENDING_DELETION
,FAILED_CREATION
, FAILED_UPDATE
,
* FAILED_DELETION
, and DELETED
..
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link VpcIngressConnectionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The current status of the VPC Ingress Connection. The VPC Ingress Connection displays one of the
* following statuses: AVAILABLE
, PENDING_CREATION
, PENDING_UPDATE
,
* PENDING_DELETION
,FAILED_CREATION
, FAILED_UPDATE
,
* FAILED_DELETION
, and DELETED
..
* @see VpcIngressConnectionStatus
*/
public final VpcIngressConnectionStatus status() {
return VpcIngressConnectionStatus.fromValue(status);
}
/**
*
* The current status of the VPC Ingress Connection. The VPC Ingress Connection displays one of the following
* statuses: AVAILABLE
, PENDING_CREATION
, PENDING_UPDATE
,
* PENDING_DELETION
,FAILED_CREATION
, FAILED_UPDATE
,
* FAILED_DELETION
, and DELETED
..
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link VpcIngressConnectionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The current status of the VPC Ingress Connection. The VPC Ingress Connection displays one of the
* following statuses: AVAILABLE
, PENDING_CREATION
, PENDING_UPDATE
,
* PENDING_DELETION
,FAILED_CREATION
, FAILED_UPDATE
,
* FAILED_DELETION
, and DELETED
..
* @see VpcIngressConnectionStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The Account Id you use to create the VPC Ingress Connection resource.
*
*
* @return The Account Id you use to create the VPC Ingress Connection resource.
*/
public final String accountId() {
return accountId;
}
/**
*
* The domain name associated with the VPC Ingress Connection resource.
*
*
* @return The domain name associated with the VPC Ingress Connection resource.
*/
public final String domainName() {
return domainName;
}
/**
*
* Specifications for the customer’s VPC and related PrivateLink VPC endpoint that are used to associate with the
* VPC Ingress Connection resource.
*
*
* @return Specifications for the customer’s VPC and related PrivateLink VPC endpoint that are used to associate
* with the VPC Ingress Connection resource.
*/
public final IngressVpcConfiguration ingressVpcConfiguration() {
return ingressVpcConfiguration;
}
/**
*
* The time when the VPC Ingress Connection was created. It's in the Unix time stamp format.
*
*
* -
*
* Type: Timestamp
*
*
* -
*
* Required: Yes
*
*
*
*
* @return The time when the VPC Ingress Connection was created. It's in the Unix time stamp format.
*
* -
*
* Type: Timestamp
*
*
* -
*
* Required: Yes
*
*
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* The time when the App Runner service was deleted. It's in the Unix time stamp format.
*
*
* -
*
* Type: Timestamp
*
*
* -
*
* Required: No
*
*
*
*
* @return The time when the App Runner service was deleted. It's in the Unix time stamp format.
*
* -
*
* Type: Timestamp
*
*
* -
*
* Required: No
*
*
*/
public final Instant deletedAt() {
return deletedAt;
}
@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(vpcIngressConnectionArn());
hashCode = 31 * hashCode + Objects.hashCode(vpcIngressConnectionName());
hashCode = 31 * hashCode + Objects.hashCode(serviceArn());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(accountId());
hashCode = 31 * hashCode + Objects.hashCode(domainName());
hashCode = 31 * hashCode + Objects.hashCode(ingressVpcConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(deletedAt());
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 VpcIngressConnection)) {
return false;
}
VpcIngressConnection other = (VpcIngressConnection) obj;
return Objects.equals(vpcIngressConnectionArn(), other.vpcIngressConnectionArn())
&& Objects.equals(vpcIngressConnectionName(), other.vpcIngressConnectionName())
&& Objects.equals(serviceArn(), other.serviceArn()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(accountId(), other.accountId()) && Objects.equals(domainName(), other.domainName())
&& Objects.equals(ingressVpcConfiguration(), other.ingressVpcConfiguration())
&& Objects.equals(createdAt(), other.createdAt()) && Objects.equals(deletedAt(), other.deletedAt());
}
/**
* 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("VpcIngressConnection").add("VpcIngressConnectionArn", vpcIngressConnectionArn())
.add("VpcIngressConnectionName", vpcIngressConnectionName()).add("ServiceArn", serviceArn())
.add("Status", statusAsString()).add("AccountId", accountId()).add("DomainName", domainName())
.add("IngressVpcConfiguration", ingressVpcConfiguration()).add("CreatedAt", createdAt())
.add("DeletedAt", deletedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "VpcIngressConnectionArn":
return Optional.ofNullable(clazz.cast(vpcIngressConnectionArn()));
case "VpcIngressConnectionName":
return Optional.ofNullable(clazz.cast(vpcIngressConnectionName()));
case "ServiceArn":
return Optional.ofNullable(clazz.cast(serviceArn()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "AccountId":
return Optional.ofNullable(clazz.cast(accountId()));
case "DomainName":
return Optional.ofNullable(clazz.cast(domainName()));
case "IngressVpcConfiguration":
return Optional.ofNullable(clazz.cast(ingressVpcConfiguration()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "DeletedAt":
return Optional.ofNullable(clazz.cast(deletedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function