
software.amazon.awssdk.services.storagegateway.model.FileSystemAssociationInfo 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.storagegateway.model;
import java.io.Serializable;
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;
/**
*
* Describes the object returned by DescribeFileSystemAssociations
that describes a created file system
* association.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class FileSystemAssociationInfo implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField FILE_SYSTEM_ASSOCIATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FileSystemAssociationARN").getter(getter(FileSystemAssociationInfo::fileSystemAssociationARN))
.setter(setter(Builder::fileSystemAssociationARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileSystemAssociationARN").build())
.build();
private static final SdkField LOCATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LocationARN").getter(getter(FileSystemAssociationInfo::locationARN))
.setter(setter(Builder::locationARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocationARN").build()).build();
private static final SdkField FILE_SYSTEM_ASSOCIATION_STATUS_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("FileSystemAssociationStatus")
.getter(getter(FileSystemAssociationInfo::fileSystemAssociationStatus))
.setter(setter(Builder::fileSystemAssociationStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileSystemAssociationStatus")
.build()).build();
private static final SdkField AUDIT_DESTINATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AuditDestinationARN").getter(getter(FileSystemAssociationInfo::auditDestinationARN))
.setter(setter(Builder::auditDestinationARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuditDestinationARN").build())
.build();
private static final SdkField GATEWAY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GatewayARN").getter(getter(FileSystemAssociationInfo::gatewayARN)).setter(setter(Builder::gatewayARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GatewayARN").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(FileSystemAssociationInfo::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField CACHE_ATTRIBUTES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CacheAttributes")
.getter(getter(FileSystemAssociationInfo::cacheAttributes)).setter(setter(Builder::cacheAttributes))
.constructor(CacheAttributes::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheAttributes").build()).build();
private static final SdkField ENDPOINT_NETWORK_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("EndpointNetworkConfiguration")
.getter(getter(FileSystemAssociationInfo::endpointNetworkConfiguration))
.setter(setter(Builder::endpointNetworkConfiguration))
.constructor(EndpointNetworkConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointNetworkConfiguration")
.build()).build();
private static final SdkField> FILE_SYSTEM_ASSOCIATION_STATUS_DETAILS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("FileSystemAssociationStatusDetails")
.getter(getter(FileSystemAssociationInfo::fileSystemAssociationStatusDetails))
.setter(setter(Builder::fileSystemAssociationStatusDetails))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileSystemAssociationStatusDetails")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(FileSystemAssociationStatusDetail::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
FILE_SYSTEM_ASSOCIATION_ARN_FIELD, LOCATION_ARN_FIELD, FILE_SYSTEM_ASSOCIATION_STATUS_FIELD,
AUDIT_DESTINATION_ARN_FIELD, GATEWAY_ARN_FIELD, TAGS_FIELD, CACHE_ATTRIBUTES_FIELD,
ENDPOINT_NETWORK_CONFIGURATION_FIELD, FILE_SYSTEM_ASSOCIATION_STATUS_DETAILS_FIELD));
private static final long serialVersionUID = 1L;
private final String fileSystemAssociationARN;
private final String locationARN;
private final String fileSystemAssociationStatus;
private final String auditDestinationARN;
private final String gatewayARN;
private final List tags;
private final CacheAttributes cacheAttributes;
private final EndpointNetworkConfiguration endpointNetworkConfiguration;
private final List fileSystemAssociationStatusDetails;
private FileSystemAssociationInfo(BuilderImpl builder) {
this.fileSystemAssociationARN = builder.fileSystemAssociationARN;
this.locationARN = builder.locationARN;
this.fileSystemAssociationStatus = builder.fileSystemAssociationStatus;
this.auditDestinationARN = builder.auditDestinationARN;
this.gatewayARN = builder.gatewayARN;
this.tags = builder.tags;
this.cacheAttributes = builder.cacheAttributes;
this.endpointNetworkConfiguration = builder.endpointNetworkConfiguration;
this.fileSystemAssociationStatusDetails = builder.fileSystemAssociationStatusDetails;
}
/**
*
* The Amazon Resource Name (ARN) of the file system association.
*
*
* @return The Amazon Resource Name (ARN) of the file system association.
*/
public final String fileSystemAssociationARN() {
return fileSystemAssociationARN;
}
/**
*
* The ARN of the backend Amazon FSx file system used for storing file data. For information, see FileSystem in the Amazon
* FSx API Reference.
*
*
* @return The ARN of the backend Amazon FSx file system used for storing file data. For information, see FileSystem in the
* Amazon FSx API Reference.
*/
public final String locationARN() {
return locationARN;
}
/**
*
* The status of the file system association. Valid Values: AVAILABLE
| CREATING
|
* DELETING
| FORCE_DELETING
| UPDATING
| ERROR
*
*
* @return The status of the file system association. Valid Values: AVAILABLE
| CREATING
|
* DELETING
| FORCE_DELETING
| UPDATING
| ERROR
*/
public final String fileSystemAssociationStatus() {
return fileSystemAssociationStatus;
}
/**
*
* The Amazon Resource Name (ARN) of the storage used for the audit logs.
*
*
* @return The Amazon Resource Name (ARN) of the storage used for the audit logs.
*/
public final String auditDestinationARN() {
return auditDestinationARN;
}
/**
* Returns the value of the GatewayARN property for this object.
*
* @return The value of the GatewayARN property for this object.
*/
public final String gatewayARN() {
return gatewayARN;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructList);
}
/**
*
* A list of up to 50 tags assigned to the SMB file share, sorted alphabetically by key name. Each tag is a
* key-value pair.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return A list of up to 50 tags assigned to the SMB file share, sorted alphabetically by key name. Each tag is a
* key-value pair.
*/
public final List tags() {
return tags;
}
/**
* Returns the value of the CacheAttributes property for this object.
*
* @return The value of the CacheAttributes property for this object.
*/
public final CacheAttributes cacheAttributes() {
return cacheAttributes;
}
/**
*
* Specifies network configuration information for the gateway associated with the Amazon FSx file system.
*
*
*
* If multiple file systems are associated with this gateway, this parameter's IpAddresses
field is
* required.
*
*
*
* @return Specifies network configuration information for the gateway associated with the Amazon FSx file
* system.
*
* If multiple file systems are associated with this gateway, this parameter's IpAddresses
* field is required.
*
*/
public final EndpointNetworkConfiguration endpointNetworkConfiguration() {
return endpointNetworkConfiguration;
}
/**
* For responses, this returns true if the service returned a value for the FileSystemAssociationStatusDetails
* property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()}
* method on the property). This is useful because the SDK will never return a null collection or map, but you may
* need to differentiate between the service returning nothing (or null) and the service returning an empty
* collection or map. For requests, this returns true if a value for the property was specified in the request
* builder, and false if a value was not specified.
*/
public final boolean hasFileSystemAssociationStatusDetails() {
return fileSystemAssociationStatusDetails != null
&& !(fileSystemAssociationStatusDetails instanceof SdkAutoConstructList);
}
/**
*
* An array containing the FileSystemAssociationStatusDetail data type, which provides detailed information on file
* system association status.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasFileSystemAssociationStatusDetails}
* method.
*
*
* @return An array containing the FileSystemAssociationStatusDetail data type, which provides detailed information
* on file system association status.
*/
public final List fileSystemAssociationStatusDetails() {
return fileSystemAssociationStatusDetails;
}
@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(fileSystemAssociationARN());
hashCode = 31 * hashCode + Objects.hashCode(locationARN());
hashCode = 31 * hashCode + Objects.hashCode(fileSystemAssociationStatus());
hashCode = 31 * hashCode + Objects.hashCode(auditDestinationARN());
hashCode = 31 * hashCode + Objects.hashCode(gatewayARN());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(cacheAttributes());
hashCode = 31 * hashCode + Objects.hashCode(endpointNetworkConfiguration());
hashCode = 31 * hashCode
+ Objects.hashCode(hasFileSystemAssociationStatusDetails() ? fileSystemAssociationStatusDetails() : 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 FileSystemAssociationInfo)) {
return false;
}
FileSystemAssociationInfo other = (FileSystemAssociationInfo) obj;
return Objects.equals(fileSystemAssociationARN(), other.fileSystemAssociationARN())
&& Objects.equals(locationARN(), other.locationARN())
&& Objects.equals(fileSystemAssociationStatus(), other.fileSystemAssociationStatus())
&& Objects.equals(auditDestinationARN(), other.auditDestinationARN())
&& Objects.equals(gatewayARN(), other.gatewayARN()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags()) && Objects.equals(cacheAttributes(), other.cacheAttributes())
&& Objects.equals(endpointNetworkConfiguration(), other.endpointNetworkConfiguration())
&& hasFileSystemAssociationStatusDetails() == other.hasFileSystemAssociationStatusDetails()
&& Objects.equals(fileSystemAssociationStatusDetails(), other.fileSystemAssociationStatusDetails());
}
/**
* 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("FileSystemAssociationInfo")
.add("FileSystemAssociationARN", fileSystemAssociationARN())
.add("LocationARN", locationARN())
.add("FileSystemAssociationStatus", fileSystemAssociationStatus())
.add("AuditDestinationARN", auditDestinationARN())
.add("GatewayARN", gatewayARN())
.add("Tags", hasTags() ? tags() : null)
.add("CacheAttributes", cacheAttributes())
.add("EndpointNetworkConfiguration", endpointNetworkConfiguration())
.add("FileSystemAssociationStatusDetails",
hasFileSystemAssociationStatusDetails() ? fileSystemAssociationStatusDetails() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FileSystemAssociationARN":
return Optional.ofNullable(clazz.cast(fileSystemAssociationARN()));
case "LocationARN":
return Optional.ofNullable(clazz.cast(locationARN()));
case "FileSystemAssociationStatus":
return Optional.ofNullable(clazz.cast(fileSystemAssociationStatus()));
case "AuditDestinationARN":
return Optional.ofNullable(clazz.cast(auditDestinationARN()));
case "GatewayARN":
return Optional.ofNullable(clazz.cast(gatewayARN()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "CacheAttributes":
return Optional.ofNullable(clazz.cast(cacheAttributes()));
case "EndpointNetworkConfiguration":
return Optional.ofNullable(clazz.cast(endpointNetworkConfiguration()));
case "FileSystemAssociationStatusDetails":
return Optional.ofNullable(clazz.cast(fileSystemAssociationStatusDetails()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function