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

software.amazon.awssdk.services.s3outposts.model.Endpoint Maven / Gradle / Ivy

Go to download

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

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.s3outposts.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* S3 on Outposts access points simplify managing data access at scale for shared datasets in Amazon S3 on Outposts. S3 * on Outposts uses endpoints to connect to Outposts buckets so that you can perform actions within your virtual private * cloud (VPC). *

*/ @Generated("software.amazon.awssdk:codegen") public final class Endpoint implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ENDPOINT_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EndpointArn").getter(getter(Endpoint::endpointArn)).setter(setter(Builder::endpointArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointArn").build()).build(); private static final SdkField OUTPOSTS_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("OutpostsId").getter(getter(Endpoint::outpostsId)).setter(setter(Builder::outpostsId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutpostsId").build()).build(); private static final SdkField CIDR_BLOCK_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CidrBlock").getter(getter(Endpoint::cidrBlock)).setter(setter(Builder::cidrBlock)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CidrBlock").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(Endpoint::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTime").getter(getter(Endpoint::creationTime)).setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build(); private static final SdkField> NETWORK_INTERFACES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NetworkInterfaces") .getter(getter(Endpoint::networkInterfaces)) .setter(setter(Builder::networkInterfaces)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkInterfaces").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(NetworkInterface::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENDPOINT_ARN_FIELD, OUTPOSTS_ID_FIELD, CIDR_BLOCK_FIELD, STATUS_FIELD, CREATION_TIME_FIELD, NETWORK_INTERFACES_FIELD)); private static final long serialVersionUID = 1L; private final String endpointArn; private final String outpostsId; private final String cidrBlock; private final String status; private final Instant creationTime; private final List networkInterfaces; private Endpoint(BuilderImpl builder) { this.endpointArn = builder.endpointArn; this.outpostsId = builder.outpostsId; this.cidrBlock = builder.cidrBlock; this.status = builder.status; this.creationTime = builder.creationTime; this.networkInterfaces = builder.networkInterfaces; } /** *

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

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

* The ID of the AWS Outpost. *

* * @return The ID of the AWS Outpost. */ public final String outpostsId() { return outpostsId; } /** *

* The VPC CIDR committed by this endpoint. *

* * @return The VPC CIDR committed by this endpoint. */ public final String cidrBlock() { return cidrBlock; } /** *

* The status of the endpoint. *

*

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

* * @return The status of the endpoint. * @see EndpointStatus */ public final EndpointStatus status() { return EndpointStatus.fromValue(status); } /** *

* The status of the endpoint. *

*

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

* * @return The status of the endpoint. * @see EndpointStatus */ public final String statusAsString() { return status; } /** *

* The time the endpoint was created. *

* * @return The time the endpoint was created. */ public final Instant creationTime() { return creationTime; } /** * Returns true if the NetworkInterfaces property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasNetworkInterfaces() { return networkInterfaces != null && !(networkInterfaces instanceof SdkAutoConstructList); } /** *

* The network interface of the endpoint. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasNetworkInterfaces()} to see if a value was sent in this field. *

* * @return The network interface of the endpoint. */ public final List networkInterfaces() { return networkInterfaces; } @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(endpointArn()); hashCode = 31 * hashCode + Objects.hashCode(outpostsId()); hashCode = 31 * hashCode + Objects.hashCode(cidrBlock()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(hasNetworkInterfaces() ? networkInterfaces() : null); 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 Endpoint)) { return false; } Endpoint other = (Endpoint) obj; return Objects.equals(endpointArn(), other.endpointArn()) && Objects.equals(outpostsId(), other.outpostsId()) && Objects.equals(cidrBlock(), other.cidrBlock()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(creationTime(), other.creationTime()) && hasNetworkInterfaces() == other.hasNetworkInterfaces() && Objects.equals(networkInterfaces(), other.networkInterfaces()); } /** * 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("Endpoint").add("EndpointArn", endpointArn()).add("OutpostsId", outpostsId()) .add("CidrBlock", cidrBlock()).add("Status", statusAsString()).add("CreationTime", creationTime()) .add("NetworkInterfaces", hasNetworkInterfaces() ? networkInterfaces() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EndpointArn": return Optional.ofNullable(clazz.cast(endpointArn())); case "OutpostsId": return Optional.ofNullable(clazz.cast(outpostsId())); case "CidrBlock": return Optional.ofNullable(clazz.cast(cidrBlock())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "NetworkInterfaces": return Optional.ofNullable(clazz.cast(networkInterfaces())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Endpoint) 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 endpoint. *

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

* The ID of the AWS Outpost. *

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

* The VPC CIDR committed by this endpoint. *

* * @param cidrBlock * The VPC CIDR committed by this endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cidrBlock(String cidrBlock); /** *

* The status of the endpoint. *

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

* The status of the endpoint. *

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

* The time the endpoint was created. *

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

* The network interface of the endpoint. *

* * @param networkInterfaces * The network interface of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkInterfaces(Collection networkInterfaces); /** *

* The network interface of the endpoint. *

* * @param networkInterfaces * The network interface of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder networkInterfaces(NetworkInterface... networkInterfaces); /** *

* The network interface of the endpoint. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and * its result is passed to {@link #networkInterfaces(List)}. * * @param networkInterfaces * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #networkInterfaces(List) */ Builder networkInterfaces(Consumer... networkInterfaces); } static final class BuilderImpl implements Builder { private String endpointArn; private String outpostsId; private String cidrBlock; private String status; private Instant creationTime; private List networkInterfaces = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(Endpoint model) { endpointArn(model.endpointArn); outpostsId(model.outpostsId); cidrBlock(model.cidrBlock); status(model.status); creationTime(model.creationTime); networkInterfaces(model.networkInterfaces); } public final String getEndpointArn() { return endpointArn; } @Override public final Builder endpointArn(String endpointArn) { this.endpointArn = endpointArn; return this; } public final void setEndpointArn(String endpointArn) { this.endpointArn = endpointArn; } public final String getOutpostsId() { return outpostsId; } @Override public final Builder outpostsId(String outpostsId) { this.outpostsId = outpostsId; return this; } public final void setOutpostsId(String outpostsId) { this.outpostsId = outpostsId; } public final String getCidrBlock() { return cidrBlock; } @Override public final Builder cidrBlock(String cidrBlock) { this.cidrBlock = cidrBlock; return this; } public final void setCidrBlock(String cidrBlock) { this.cidrBlock = cidrBlock; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(EndpointStatus status) { this.status(status == null ? null : status.toString()); return this; } public final void setStatus(String status) { this.status = status; } public final Instant getCreationTime() { return creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } public final List getNetworkInterfaces() { List result = NetworkInterfacesCopier.copyToBuilder(this.networkInterfaces); if (result instanceof SdkAutoConstructList) { return null; } return result; } @Override public final Builder networkInterfaces(Collection networkInterfaces) { this.networkInterfaces = NetworkInterfacesCopier.copy(networkInterfaces); return this; } @Override @SafeVarargs public final Builder networkInterfaces(NetworkInterface... networkInterfaces) { networkInterfaces(Arrays.asList(networkInterfaces)); return this; } @Override @SafeVarargs public final Builder networkInterfaces(Consumer... networkInterfaces) { networkInterfaces(Stream.of(networkInterfaces).map(c -> NetworkInterface.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setNetworkInterfaces(Collection networkInterfaces) { this.networkInterfaces = NetworkInterfacesCopier.copyFromBuilder(networkInterfaces); } @Override public Endpoint build() { return new Endpoint(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy